-<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><title>ttyd - Terminal</title><link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA0xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTgyRjc1RjA3MTZEMTFFNjg2M0NCOEY3RjJBMEY3N0EiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTgyRjc1RUY3MTZEMTFFNjg2M0NCOEY3RjJBMEY3N0EiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjU3YmQxNjhjLWI5ZDctMTE3OS1hM2RlLWZmNjQyYTM4NTJmMCIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjU3YmQxNjhjLWI5ZDctMTE3OS1hM2RlLWZmNjQyYTM4NTJmMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhsssMYAAALDSURBVHjaxFa9jxJBFH8zDMdCYrhIAppgIjaG5C5RQ+zO2Gty5gpbY2KsbOyu1MrGGEtj/A9stLPXs6CjJ5GYIF6AE5IDBHZmfG92F4ZzvQAnyyO7O8zX+73f+5gRd3bvvSgffN4/l948YgASFhQ9aWhqM6+pYfrVjD5WH9NK8f7x8ebNnVtvWC6b/RaPxy8zxsxmbB5lIfNsIDMggreezqG1o9GIGj8E45zFNzYgnU4D5xyUUkBglpFAKfgWa5gFY89rNVvgJJMgSBkpjcViIISA4XAI4/EYkBXTdyYQ9LOUU9sw7bmG2lqgPwwAKSV9D/P5/G2csNtoNJ71+32HFjqOszyQkDY9xLbrjkEorSe+wYGc67o72Wz2dSqV+tjr9e4iiAfdbnfL+G4B10wtDV/nBSYAN5O053eivVqtvq1UKr/RDaVCofCyVCo9ogXE0qISppgsJ3GlCzzGkQHcOEgT8n2xWLyfy+XeDwaDK7Va7Xm73X4YUHaaRfMwcbIPdTNBGWBSwkP3Ewdr9Xr9FcbAUwpICkyKAXuTRdkIAxH4QThOEn61W2YSKruAVpeJiUQiYRQjqHImk9nDjDiPijnO+d7pdN5hXOwRuGXdYRggANIdM9sy2tTeGPsuNpvNJwgkRVUMpYPdV5dJURsIZZ9WBEB6aRhKkeeWSzi2j9kxk8vLFqsABFkvlWSYhoqdni6zY2dRfHJfYoErvxBFLb5expVUDFlYCwDpM8CU0pEDoADUGH9YCf8dgKuQSRagXoo/Lg0Da3CBVwm9syBKBv46FfHNIlc+BYFZQHe0yBnQPgN0HFtV8H8VmXko8ABgEOo1uIDZMbCWALRiQAR/gkvpqsU+Rcl4gW9zR6JLCXXQ5XTVAKR/sqIvGODl89BnJfLHcRJNceP6tQ9fDr4+RmRHmAUqoiLEkOnM1vb2pz8CDACUMgcHE3VMqAAAAABJRU5ErkJggg=="/><style>.xterm{font-feature-settings:"liga" 0;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:0}.xterm .xterm-helpers{position:absolute;top:0;z-index:10}.xterm .xterm-helper-textarea{position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-10;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm{cursor:text}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:100;color:transparent}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:.5}.xterm-underline{text-decoration:underline}body,html{height:100%;min-height:100%;margin:0;overflow:hidden}#terminal-container{width:auto;height:100%;margin:0 auto;padding:0;background-color:#2b2b2b}#terminal-container .terminal{padding:5px}</style></head><body><script src="auth_token.js"></script><script type="text/javascript">!function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=66)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0,this._disposables.forEach(function(e){return e.dispose()}),this._disposables.length=0},e.prototype.register=function(e){this._disposables.push(e)},e.prototype.unregister=function(e){var t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)},e}();t.Disposable=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(10),s=i(7);t.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32;var a=3,l=function(){function e(){this.fg=0,this.bg=0}return e.toColorRGB=function(e){return[e>>>16&255,e>>>8&255,255&e]},e.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},e.prototype.clone=function(){var t=new e;return t.fg=this.fg,t.bg=this.bg,t},e.prototype.isInverse=function(){return 67108864&this.fg},e.prototype.isBold=function(){return 134217728&this.fg},e.prototype.isUnderline=function(){return 268435456&this.fg},e.prototype.isBlink=function(){return 536870912&this.fg},e.prototype.isInvisible=function(){return 1073741824&this.fg},e.prototype.isItalic=function(){return 67108864&this.bg},e.prototype.isDim=function(){return 134217728&this.bg},e.prototype.getFgColorMode=function(){return 50331648&this.fg},e.prototype.getBgColorMode=function(){return 50331648&this.bg},e.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},e.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},e.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},e.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},e.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},e.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},e.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},e.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},e}();t.AttributeData=l,t.DEFAULT_ATTR_DATA=new l;var h=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.combinedData="",t}return n(i,e),i.fromCharData=function(e){var t=new i;return t.setFromCharData(e),t},i.prototype.isCombined=function(){return 2097152&this.content},i.prototype.getWidth=function(){return this.content>>22},i.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?o.stringFromCodePoint(2097151&this.content):""},i.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},i.prototype.setFromCharData=function(e){this.fg=e[t.CHAR_DATA_ATTR_INDEX],this.bg=0;var i=!1;if(e[t.CHAR_DATA_CHAR_INDEX].length>2)i=!0;else if(2===e[t.CHAR_DATA_CHAR_INDEX].length){var r=e[t.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){var n=e[t.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(r-55296)+n-56320+65536|e[t.CHAR_DATA_WIDTH_INDEX]<<22:i=!0}else i=!0}else this.content=e[t.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[t.CHAR_DATA_WIDTH_INDEX]<<22;i&&(this.combinedData=e[t.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[t.CHAR_DATA_WIDTH_INDEX]<<22)},i.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},i}(l);t.CellData=h;var c=function(){function e(e,i,r){void 0===r&&(r=!1),this.isWrapped=r,this._combined={},this._data=new Uint32Array(e*a);for(var n=i||h.fromCharData([0,t.NULL_CELL_CHAR,t.NULL_CELL_WIDTH,t.NULL_CELL_CODE]),o=0;o<e;++o)this.setCell(o,n);this.length=e}return e.prototype.get=function(e){var t=this._data[e*a+0],i=2097151&t;return[this._data[e*a+1],2097152&t?this._combined[e]:i?o.stringFromCodePoint(i):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]},e.prototype.set=function(e,i){this._data[e*a+1]=i[t.CHAR_DATA_ATTR_INDEX],i[t.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=i[1],this._data[e*a+0]=2097152|e|i[t.CHAR_DATA_WIDTH_INDEX]<<22):this._data[e*a+0]=i[t.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|i[t.CHAR_DATA_WIDTH_INDEX]<<22},e.prototype.getWidth=function(e){return this._data[e*a+0]>>22},e.prototype.hasWidth=function(e){return 12582912&this._data[e*a+0]},e.prototype.getFg=function(e){return this._data[e*a+1]},e.prototype.getBg=function(e){return this._data[e*a+2]},e.prototype.hasContent=function(e){return 4194303&this._data[e*a+0]},e.prototype.getCodePoint=function(e){var t=this._data[e*a+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},e.prototype.isCombined=function(e){return 2097152&this._data[e*a+0]},e.prototype.getString=function(e){var t=this._data[e*a+0];return 2097152&t?this._combined[e]:2097151&t?o.stringFromCodePoint(2097151&t):""},e.prototype.loadCell=function(e,t){var i=e*a;return t.content=this._data[i+0],t.fg=this._data[i+1],t.bg=this._data[i+2],2097152&t.content&&(t.combinedData=this._combined[e]),t},e.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),this._data[e*a+0]=t.content,this._data[e*a+1]=t.fg,this._data[e*a+2]=t.bg},e.prototype.setCellFromCodePoint=function(e,t,i,r,n){this._data[e*a+0]=t|i<<22,this._data[e*a+1]=r,this._data[e*a+2]=n},e.prototype.addCodepointToCell=function(e,t){var i=this._data[e*a+0];2097152&i?this._combined[e]+=o.stringFromCodePoint(t):(2097151&i?(this._combined[e]=o.stringFromCodePoint(2097151&i)+o.stringFromCodePoint(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[e*a+0]=i)},e.prototype.insertCells=function(e,t,i){if(e%=this.length,t<this.length-e){for(var r=new h,n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(n=0;n<t;++n)this.setCell(e+n,i)}else for(n=e;n<this.length;++n)this.setCell(n,i)},e.prototype.deleteCells=function(e,t,i){if(e%=this.length,t<this.length-e){for(var r=new h,n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(n=this.length-t;n<this.length;++n)this.setCell(n,i)}else for(n=e;n<this.length;++n)this.setCell(n,i)},e.prototype.replaceCells=function(e,t,i){for(;e<t&&e<this.length;)this.setCell(e++,i)},e.prototype.resize=function(e,t){if(e!==this.length){if(e>this.length){var i=new Uint32Array(e*a);this.length&&(e*a<this._data.length?i.set(this._data.subarray(0,e*a)):i.set(this._data)),this._data=i;for(var r=this.length;r<e;++r)this.setCell(r,t)}else if(e){(i=new Uint32Array(e*a)).set(this._data.subarray(0,e*a)),this._data=i;var n=Object.keys(this._combined);for(r=0;r<n.length;r++){var o=parseInt(n[r],10);o>=e&&delete this._combined[o]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={};for(var t=0;t<this.length;++t)this.setCell(t,e)},e.prototype.copyFrom=function(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];this.isWrapped=e.isWrapped},e.prototype.clone=function(){var t=new e(0);for(var i in t._data=new Uint32Array(this._data),t.length=this.length,this._combined)t._combined[i]=this._combined[i];return t.isWrapped=this.isWrapped,t},e.prototype.getTrimmedLength=function(){for(var e=this.length-1;e>=0;--e)if(4194303&this._data[e*a+0])return e+(this._data[e*a+0]>>22);return 0},e.prototype.copyCellsFrom=function(e,t,i,r,n){var o=e._data;if(n)for(var s=r-1;s>=0;s--)for(var l=0;l<a;l++)this._data[(i+s)*a+l]=o[(t+s)*a+l];else for(s=0;s<r;s++)for(l=0;l<a;l++)this._data[(i+s)*a+l]=o[(t+s)*a+l];var h=Object.keys(e._combined);for(l=0;l<h.length;l++){var c=parseInt(h[l],10);c>=t&&(this._combined[c-t+i]=e._combined[c])}},e.prototype.translateToString=function(e,i,r){void 0===e&&(e=!1),void 0===i&&(i=0),void 0===r&&(r=this.length),e&&(r=Math.min(r,this.getTrimmedLength()));for(var n="";i<r;){var s=this._data[i*a+0],l=2097151&s;n+=2097152&s?this._combined[i]:l?o.stringFromCodePoint(l):t.WHITESPACE_CELL_CHAR,i+=s>>22||1}return n},e}();t.BufferLine=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._listeners=[]}return Object.defineProperty(e.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(t){return e._listeners.push(t),{dispose:function(){for(var i=0;i<e._listeners.length;i++)if(e._listeners[i]===t)return void e._listeners.splice(i,1)}}}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){for(var t=[],i=0;i<this._listeners.length;i++)t.push(this._listeners[i]);for(i=0;i<t.length;i++)t[i].call(void 0,e)},e}();t.EventEmitter2=r},function(e,t,i){var r,n;void 0===(n="function"==typeof(r=function(e){"use strict";e.__esModule=!0;var t={},i=Object.prototype.hasOwnProperty,r=function(e){var r=arguments.length<=1||void 0===arguments[1]?t:arguments[1],n=r.cache||{};return function(){for(var t=arguments.length,o=Array(t),s=0;s<t;s++)o[s]=arguments[s];var a=String(o[0]);return!1===r.caseSensitive&&(a=a.toLowerCase()),i.call(n,a)?n[a]:n[a]=e.apply(this,o)}},n=function(e,t){if("function"==typeof t){var i=e;e=t,t=i}var r=t&&t.delay||t||0,n=void 0,o=void 0,s=void 0;return function(){for(var t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];n=i,o=this,s||(s=setTimeout(function(){e.apply(o,n),n=o=s=null},r))}},o=function(e,t,i){var r=i.value;return{configurable:!0,get:function(){var e=r.bind(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e}}},s=h(r),a=h(n),l=h(function(e,t){return e.bind(t)},function(){return o});function h(e,t){var i,r=(t=t||e.decorate||(i=e,function(e){return"function"==typeof e?i(e):function(t,r,n){n.value=i(n.value,e,t,r,n)}}))();return function(){for(var i=arguments.length,n=Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=n.length;return(s<2?t:s>2?r:e).apply(void 0,n)}}e.memoize=s,e.debounce=a,e.bind=l,e.default={memoize:s,debounce:a,bind:l}})?r.apply(t,[t]):r)||(e.exports=n)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=function(e,t,i,r){return e.addEventListener(t,i,r),{dispose:function(){i&&e.removeEventListener(t,i,r)}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"==typeof navigator,n=r?"node":navigator.userAgent,o=r?"node":navigator.platform;function s(e,t){return e.indexOf(t)>=0}t.isFirefox=!!~n.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.isMSIE=!!~n.indexOf("MSIE")||!!~n.indexOf("Trident"),t.isMac=s(["Macintosh","MacIntel","MacPPC","Mac68K"],o),t.isIpad="iPad"===o,t.isIphone="iPhone"===o,t.isMSWindows=s(["Windows","Win16","Win32","WinCE"],o),t.isLinux=o.indexOf("Linux")>=0},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_COLOR=256},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.NUL="\0",e.SOH="\ 1",e.STX="\ 2",e.ETX="\ 3",e.EOT="\ 4",e.ENQ="\ 5",e.ACK="\ 6",e.BEL="\a",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="\ e",e.SI="\ f",e.DLE="\10",e.DC1="\11",e.DC2="\12",e.DC3="\13",e.DC4="\14",e.NAK="\15",e.SYN="\16",e.ETB="\17",e.CAN="\18",e.EM="\19",e.SUB="\1a",e.ESC="\e",e.FS="\1c",e.GS="\1d",e.RS="\1e",e.US="\1f",e.SP=" ",e.DEL="\7f"}(t.C0||(t.C0={})),function(e){e.PAD="\80",e.HOP="\81",e.BPH="\82",e.NBH="\83",e.IND="\84",e.NEL="\85",e.SSA="\86",e.ESA="\87",e.HTS="\88",e.HTJ="\89",e.VTS="\8a",e.PLD="\8b",e.PLU="\8c",e.RI="\8d",e.SS2="\8e",e.SS3="\8f",e.DCS="\90",e.PU1="\91",e.PU2="\92",e.STS="\93",e.CCH="\94",e.MW="\95",e.SPA="\96",e.EPA="\97",e.SOS="\98",e.SGCI="\99",e.SCI="\9a",e.CSI="\9b",e.ST="\9c",e.OSC="\9d",e.PM="\9e",e.APC="\9f"}(t.C1||(t.C1={}))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(7),n=i(4),o=i(17),s=i(1),a=function(){function e(e,t,i,r,n){this._container=e,this._alpha=r,this._colors=n,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){this._container.removeChild(this._canvas),this._charAtlas&&this._charAtlas.dispose()},e.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha}),this._alpha||this.clearAll()},e.prototype.onOptionsChanged=function(e){},e.prototype.onBlur=function(e){},e.prototype.onFocus=function(e){},e.prototype.onCursorMove=function(e){},e.prototype.onGridChanged=function(e,t,i){},e.prototype.onSelectionChanged=function(e,t,i,r){void 0===r&&(r=!1)},e.prototype.setColors=function(e,t){this._refreshCharAtlas(e,t)},e.prototype.setTransparency=function(e,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(e,this._colors),this.onGridChanged(e,0,e.rows-1)}},e.prototype._refreshCharAtlas=function(e,t){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=o.acquireCharAtlas(e,t,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e,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(e,this._colors)},e.prototype.fillCells=function(e,t,i,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight)},e.prototype.fillBottomLineAtCells=function(e,t,i){void 0===i&&(i=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,i*this._scaledCellWidth,window.devicePixelRatio)},e.prototype.fillLeftLineAtCell=function(e,t){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},e.prototype.strokeRectAtCell=function(e,t,i,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,i*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},e.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))},e.prototype.clearCells=function(e,t,i,r){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight))},e.prototype.fillCharTrueColor=function(e,t,i,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline="middle",this._clipRow(e,r),this._ctx.fillText(t.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},e.prototype.drawChars=function(e,t,i,o){var a,l;t.isFgRGB()||t.isBgRGB()?this._drawUncachedChars(e,t,i,o):(t.isInverse()?(a=t.isBgDefault()?n.INVERTED_DEFAULT_COLOR:t.getBgColor(),l=t.isFgDefault()?n.INVERTED_DEFAULT_COLOR:t.getFgColor()):(l=t.isBgDefault()?r.DEFAULT_COLOR:t.getBgColor(),a=t.isFgDefault()?r.DEFAULT_COLOR:t.getFgColor()),a+=e.options.drawBoldTextInBrightColors&&t.isBold()&&a<8&&a!==n.INVERTED_DEFAULT_COLOR?8:0,this._currentGlyphIdentifier.chars=t.getChars()||s.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=t.getCode()||s.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=l,this._currentGlyphIdentifier.fg=a,this._currentGlyphIdentifier.bold=t.isBold()&&e.options.enableBold,this._currentGlyphIdentifier.dim=!!t.isDim(),this._currentGlyphIdentifier.italic=!!t.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,i*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,i,o))},e.prototype._drawUncachedChars=function(e,t,i,r){if(this._ctx.save(),this._ctx.font=this._getFont(e,t.isBold()&&e.options.enableBold,!!t.isItalic()),this._ctx.textBaseline="middle",t.isInverse())t.isBgDefault()?this._ctx.fillStyle=this._colors.background.css:t.isBgRGB()?this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(t.getBgColor()).join(",")+")":this._ctx.fillStyle=this._colors.ansi[t.getBgColor()].css;else if(t.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(t.isFgRGB())this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var o=t.getFgColor();e.options.drawBoldTextInBrightColors&&t.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css}this._clipRow(e,r),t.isDim()&&(this._ctx.globalAlpha=n.DIM_OPACITY),this._ctx.fillText(t.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},e.prototype._clipRow=function(e,t){this._ctx.beginPath(),this._ctx.rect(0,t*this._scaledCellHeight,e.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t,i){return(i?"italic":"")+" "+(t?e.options.fontWeightBold:e.options.fontWeight)+" "+e.options.fontSize*window.devicePixelRatio+"px "+e.options.fontFamily},e}();t.BaseRenderLayer=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.length);for(var r="",n=t;n<i;++n){var o=e[n];o>65535?(o-=65536,r+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r};var r=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r=0,n=0;this._interim&&(56320<=(a=e.charCodeAt(n++))&&a<=57343?t[r++]=1024*(this._interim-55296)+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0);for(var o=n;o<i;++o){var s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=i)return this._interim=s,r;var a;56320<=(a=e.charCodeAt(o))&&a<=57343?t[r++]=1024*(s-55296)+a-56320+65536:(t[r++]=s,t[r++]=a)}else t[r++]=s}return r},e}();t.StringToUtf32=r;var n=function(){function e(){this.interim=new Uint8Array(3)}return e.prototype.clear=function(){this.interim.fill(0)},e.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r,n,o,s,a=0,l=0,h=0;if(this.interim[0]){var c=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var f=0,d=void 0;(d=63&this.interim[++f])&&f<4;)u<<=6,u|=d;for(var _=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,p=_-f;h<p;){if(h>=i)return 0;if(128!=(192&(d=e[h++]))){h--,c=!0;break}this.interim[f++]=d,u<<=6,u|=63&d}c||(2===_?u<128?h--:t[a++]=u:3===_?u<2048||u>=55296&&u<=57343||(t[a++]=u):l<65536||l>1114111||(t[a++]=u)),this.interim.fill(0)}for(var m=i-4,y=h;y<i;){for(;!(!(y<m)||128&(r=e[y])||128&(n=e[y+1])||128&(o=e[y+2])||128&(s=e[y+3]));)t[a++]=r,t[a++]=n,t[a++]=o,t[a++]=s,y+=4;if((r=e[y++])<128)t[a++]=r;else if(192==(224&r)){if(y>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[y++]))){y--;continue}if((l=(31&r)<<6|63&n)<128){y--;continue}t[a++]=l}else if(224==(240&r)){if(y>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[y++]))){y--;continue}if(y>=i)return this.interim[0]=r,this.interim[1]=n,a;if(128!=(192&(o=e[y++]))){y--;continue}if((l=(15&r)<<12|(63&n)<<6|63&o)<2048||l>=55296&&l<=57343)continue;t[a++]=l}else if(240==(248&r)){if(y>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[y++]))){y--;continue}if(y>=i)return this.interim[0]=r,this.interim[1]=n,a;if(128!=(192&(o=e[y++]))){y--;continue}if(y>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,a;if(128!=(192&(s=e[y++]))){y--;continue}if((l=(7&r)<<18|(63&n)<<12|(63&o)<<6|63&s)<65536||l>1114111)continue;t[a++]=l}}return a},e}();t.Utf8ToUtf32=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(7);t.generateConfig=function(e,t,i,r){var n={foreground:r.foreground,background:r.background,cursor:null,cursorAccent:null,selection:null,ansi:r.ansi.slice(0,16)};return{type:i.options.experimentalCharAtlas,devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:i.options.fontFamily,fontSize:i.options.fontSize,fontWeight:i.options.fontWeight,fontWeightBold:i.options.fontWeightBold,allowTransparency:i.options.allowTransparency,colors:n}},t.configEquals=function(e,t){for(var i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.type===t.type&&e.devicePixelRatio===t.devicePixelRatio&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.scaledCharWidth===t.scaledCharWidth&&e.scaledCharHeight===t.scaledCharHeight&&e.colors.foreground===t.colors.foreground&&e.colors.background===t.colors.background},t.is256Color=function(e){return e<r.DEFAULT_COLOR}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blankLine="Blank line",t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(30),n=i(1),o=i(31),s=i(32);t.MAX_BUFFER_SIZE=4294967295;var a=function(){function e(e,t){this._terminal=e,this._hasScrollback=t,this.savedCurAttrData=n.DEFAULT_ATTR_DATA.clone(),this.markers=[],this._nullCell=n.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,n.WHITESPACE_CELL_CHAR,n.WHITESPACE_CELL_WIDTH,n.WHITESPACE_CELL_CODE]),this._cols=this._terminal.cols,this._rows=this._terminal.rows,this.clear()}return e.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg):(this._nullCell.fg=0,this._nullCell.bg=0),this._nullCell},e.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0),this._whitespaceCell},e.prototype.getBlankLine=function(e,t){return new n.BufferLine(this._terminal.cols,this.getNullCell(e),t)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows},enumerable:!0,configurable:!0}),e.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var i=e+this._terminal.options.scrollback;return i>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=n.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,t){var i=this.getNullCell(n.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(var o=0;o<this.lines.length;o++)this.lines.get(o).resize(e,i);var s=0;if(this._rows<t)for(var a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new n.BufferLine(e,i)));else for(a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){var l=this.lines.length-r;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedY=Math.min(this.savedY,t-1),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(o=0;o<this.lines.length;o++)this.lines.get(o).resize(e,i);this._cols=e,this._rows=t},Object.defineProperty(e.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._terminal.options.windowsMode},enumerable:!0,configurable:!0}),e.prototype._reflow=function(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var i=o.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(n.DEFAULT_ATTR_DATA));if(i.length>0){var r=o.reflowLargerCreateNewLayout(this.lines,i);o.reflowLargerApplyNewLayout(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,t,i){for(var r=this.getNullCell(n.DEFAULT_ATTR_DATA),o=i;o-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new n.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--)},e.prototype._reflowSmaller=function(e,t){for(var i=this.getNullCell(n.DEFAULT_ATTR_DATA),r=[],s=0,a=this.lines.length-1;a>=0;a--){var l=this.lines.get(a);if(!(!l||!l.isWrapped&&l.getTrimmedLength()<=e)){for(var h=[l];l.isWrapped&&a>0;)l=this.lines.get(--a),h.unshift(l);var c=this.ybase+this.y;if(!(c>=a&&c<a+h.length)){var u,f=h[h.length-1].getTrimmedLength(),d=o.reflowSmallerGetNewLineLengths(h,this._cols,e),_=d.length-h.length;u=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+_):Math.max(0,this.lines.length-this.lines.maxLength+_);for(var p=[],m=0;m<_;m++){var y=this.getBlankLine(n.DEFAULT_ATTR_DATA,!0);p.push(y)}p.length>0&&(r.push({start:a+h.length+s,newLines:p}),s+=p.length),h.push.apply(h,p);var g=d.length-1,C=d[g];0===C&&(C=d[--g]);for(var v=h.length-_-1,b=f;v>=0;){var w=Math.min(b,C);if(h[g].copyCellsFrom(h[v],b-w,C-w,w,!0),0==(C-=w)&&(C=d[--g]),0==(b-=w)){v--;var S=Math.max(v,0);b=o.getWrappedLineTrimmedLength(h,S,this._cols)}}for(m=0;m<h.length;m++)d[m]<e&&h[m].setCell(d[m],i);for(var E=_-u;E-- >0;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++)}}}if(r.length>0){var L=[],x=[];for(m=0;m<this.lines.length;m++)x.push(this.lines.get(m));var A=this.lines.length,T=A-1,k=0,M=r[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);var R=0;for(m=Math.min(this.lines.maxLength-1,A+s-1);m>=0;m--)if(M&&M.start>T+R){for(var D=M.newLines.length-1;D>=0;D--)this.lines.set(m--,M.newLines[D]);m++,L.push({index:T+1,amount:M.newLines.length}),R+=M.newLines.length,M=r[++k]}else this.lines.set(m,x[T--]);var O=0;for(m=L.length-1;m>=0;m--)L[m].index+=O,this.lines.onInsertEmitter.fire(L[m]),O+=L[m].amount;var H=Math.max(0,A+s-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}},e.prototype.stringIndexToBufferIndex=function(e,t,i){for(void 0===i&&(i=!1);t;){var r=this.lines.get(e);if(!r)return[-1,-1];for(var o=i?r.getTrimmedLength():r.length,s=0;s<o;++s)if(r.get(s)[n.CHAR_DATA_WIDTH_INDEX]&&(t-=r.get(s)[n.CHAR_DATA_CHAR_INDEX].length||1),t<0)return[e,s];e++}return[e,0]},e.prototype.translateBufferLineToString=function(e,t,i,r){void 0===i&&(i=0);var n=this.lines.get(e);return n?n.translateToString(t,i,r):""},e.prototype.getWrappedRangeForLine=function(e){for(var t=e,i=e;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}},e.prototype.setupTabStops=function(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._terminal.options.tabStopWidth)this.tabs[e]=!0},e.prototype.prevStop=function(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,i=new s.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim(function(e){i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(function(e){i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.onDelete(function(e){i.line>=e.index&&i.line<e.index+e.amount&&i.dispose(),i.line>e.index&&(i.line-=e.amount)})),i.register(i.onDispose(function(){return t._removeMarker(i)})),i},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,i,r,n){return new l(this,e,t,i,r,n)},e}();t.Buffer=a;var l=function(){function e(e,t,i,r,n,o){void 0===i&&(i=0),void 0===r&&(r=e.lines.length),void 0===n&&(n=0),void 0===o&&(o=0),this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=n,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return e.prototype.hasNext=function(){return this._current<this._endIndex},e.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 t="",i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(16);t.wcwidth=function(e){var t=[[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]],i=[[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]],n=0|e.control,o=new Uint8Array(65536);r.fill(o,1),o[0]=e.nul,r.fill(o,e.control,1,32),r.fill(o,e.control,127,160),r.fill(o,2,4352,4448),o[9001]=2,o[9002]=2,r.fill(o,2,11904,42192),o[12351]=1,r.fill(o,2,44032,55204),r.fill(o,2,63744,64256),r.fill(o,2,65040,65050),r.fill(o,2,65072,65136),r.fill(o,2,65280,65377),r.fill(o,2,65504,65511);for(var s=0;s<t.length;++s)r.fill(o,0,t[s][0],t[s][1]+1);return function(e){return e<32?0|n:e<127?1:e<65536?o[e]:function(e,t){var i,r=0,n=t.length-1;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(e>t[i=r+n>>1][1])r=i+1;else{if(!(e<t[i][0]))return!0;n=i-1}return!1}(t=e,i)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1;var t}}({nul:0,control:0}),t.getStringCellWidth=function(e){for(var i=0,r=e.length,n=0;n<r;++n){var o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return i+t.wcwidth(o);var s=e.charCodeAt(n);56320<=s&&s<=57343?o=1024*(o-55296)+s-56320+65536:i+=t.wcwidth(s)}i+=t.wcwidth(o)}return i}},function(e,t,i){"use strict";function r(e,t,i,r){if(void 0===i&&(i=0),void 0===r&&(r=e.length),i>=e.length)return e;i=(e.length+i)%e.length,r=r>=e.length?e.length:(e.length+r)%e.length;for(var n=i;n<r;++n)e[n]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.fill=function(e,t,i,n){return e.fill?e.fill(t,i,n):r(e,t,i,n)},t.fillFallback=r,t.concat=function(e,t){var i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(11),n=i(43),o=i(45),s=i(46),a={none:o.default,static:s.default,dynamic:n.default},l=[];t.acquireCharAtlas=function(e,t,i,n){for(var o=r.generateConfig(i,n,e,t),s=0;s<l.length;s++){var h=(c=l[s]).ownedBy.indexOf(e);if(h>=0){if(r.configEquals(c.config,o))return c.atlas;1===c.ownedBy.length?(c.atlas.dispose(),l.splice(s,1)):c.ownedBy.splice(h,1);break}}for(s=0;s<l.length;s++){var c=l[s];if(r.configEquals(c.config,o))return c.ownedBy.push(e),c.atlas}var u={atlas:new a[e.options.experimentalCharAtlas](document,o),config:o,ownedBy:[e]};return l.push(u),u.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<l.length;t++){var i=l[t].ownedBy.indexOf(e);if(-1!==i){1===l[t].ownedBy.length?(l[t].atlas.dispose(),l.splice(t,1)):l[t].ownedBy.splice(i,1);break}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l("#ffffff"),n=l("#000000"),o=l("#ffffff"),s=l("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967159};function l(e){return{css:e,rgba:parseInt(e.slice(1),16)<<8|255}}function h(e){var t=e.toString(16);return t.length<2?"0"+t:t}t.DEFAULT_ANSI_COLORS=function(){for(var e=[l("#2e3436"),l("#cc0000"),l("#4e9a06"),l("#c4a000"),l("#3465a4"),l("#75507b"),l("#06989a"),l("#d3d7cf"),l("#555753"),l("#ef2929"),l("#8ae234"),l("#fce94f"),l("#729fcf"),l("#ad7fa8"),l("#34e2e2"),l("#eeeeec")],t=[0,95,135,175,215,255],i=0;i<216;i++){var r=t[i/36%6|0],n=t[i/6%6|0],o=t[i%6];e.push({css:"#"+h(r)+h(n)+h(o),rgba:(r<<24|n<<16|o<<8|255)>>>0})}for(i=0;i<24;i++){var s=8+10*i,a=h(s);e.push({css:"#"+a+a+a,rgba:(s<<24|s<<16|s<<8|255)>>>0})}return e}();var c=function(){function e(e,i){this.allowTransparency=i;var l=e.createElement("canvas");l.width=1,l.height=1;var h=l.getContext("2d");if(!h)throw new Error("Could not get rendering context");this._ctx=h,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:r,background:n,cursor:o,cursorAccent:s,selection:a,ansi:t.DEFAULT_ANSI_COLORS.slice()}}return e.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,r),this.colors.background=this._parseColor(e.background,n),this.colors.cursor=this._parseColor(e.cursor,o,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,s,!0),this.colors.selection=this._parseColor(e.selection,a,!0),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15])},e.prototype._parseColor=function(e,t,i){if(void 0===i&&(i=this.allowTransparency),void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;return i||255===r[3]?{css:e,rgba:(r[0]<<24|r[1]<<16|r[2]<<8|r[3])>>>0}:(console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t)},e}();t.ColorManager=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(6),n=i(4);function o(e,t){for(var i=!0,r=t.rgba>>>24,n=t.rgba>>>16&255,o=t.rgba>>>8&255,s=0;s<e.data.length;s+=4)e.data[s]===r&&e.data[s+1]===n&&e.data[s+2]===o?e.data[s+3]=0:i=!1;return i}function s(e,t){return e+" "+t.fontSize*t.devicePixelRatio+"px "+t.fontFamily}t.generateStaticCharAtlasTexture=function(e,t,i){var a=i.scaledCharWidth+n.CHAR_ATLAS_CELL_SPACING,l=i.scaledCharHeight+n.CHAR_ATLAS_CELL_SPACING,h=t(255*a,34*l),c=h.getContext("2d",{alpha:i.allowTransparency});c.fillStyle=i.colors.background.css,c.fillRect(0,0,h.width,h.height),c.save(),c.fillStyle=i.colors.foreground.css,c.font=s(i.fontWeight,i),c.textBaseline="middle";for(var u=0;u<256;u++)c.save(),c.beginPath(),c.rect(u*a,0,a,l),c.clip(),c.fillText(String.fromCharCode(u),u*a,l/2),c.restore();for(c.save(),c.font=s(i.fontWeightBold,i),u=0;u<256;u++)c.save(),c.beginPath(),c.rect(u*a,l,a,l),c.clip(),c.fillText(String.fromCharCode(u),u*a,1.5*l),c.restore();c.restore(),c.font=s(i.fontWeight,i);for(var f=0;f<16;f++){var d=(f+2)*l;for(u=0;u<256;u++)c.save(),c.beginPath(),c.rect(u*a,d,a,l),c.clip(),c.fillStyle=i.colors.ansi[f].css,c.fillText(String.fromCharCode(u),u*a,d+l/2),c.restore()}for(c.font=s(i.fontWeightBold,i),f=0;f<16;f++)for(d=(f+2+16)*l,u=0;u<256;u++)c.save(),c.beginPath(),c.rect(u*a,d,a,l),c.clip(),c.fillStyle=i.colors.ansi[f].css,c.fillText(String.fromCharCode(u),u*a,d+l/2),c.restore();if(c.restore(),!("createImageBitmap"in e)||r.isFirefox||r.isSafari)return h;var _=c.getImageData(0,0,h.width,h.height);return o(_,i.colors.background),e.createImageBitmap(_)},t.clearColor=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),s=function(e){function t(t,i,r){var n=e.call(this)||this;return n.content=0,n.combinedData="",n.fg=t.fg,n.bg=t.bg,n.combinedData=i,n._width=r,n}return n(t,e),t.prototype.isCombined=function(){return 2097152},t.prototype.getWidth=function(){return this._width},t.prototype.getChars=function(){return this.combinedData},t.prototype.getCode=function(){return 2097151},t.prototype.setFromCharData=function(e){throw new Error("not implemented")},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(o.AttributeData);t.JoinedCellData=s;var a=function(){function e(e){this._terminal=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new o.CellData}return e.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1},e.prototype.getJoinedCharacters=function(e){if(0===this._characterJoiners.length)return[];var t=this._terminal.buffer.lines.get(e);if(0===t.length)return[];for(var i=[],r=t.translateToString(!0),n=0,s=0,a=0,l=t.getFg(0),h=t.getBg(0),c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==l||this._workCell.bg!==h){if(c-n>1)for(var u=this._getJoinedRanges(r,a,s,t,n),f=0;f<u.length;f++)i.push(u[f]);n=c,a=s,l=this._workCell.fg,h=this._workCell.bg}s+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._terminal.cols-n>1)for(u=this._getJoinedRanges(r,a,s,t,n),f=0;f<u.length;f++)i.push(u[f]);return i},e.prototype._getJoinedRanges=function(t,i,r,n,o){for(var s=t.substring(i,r),a=this._characterJoiners[0].handler(s),l=1;l<this._characterJoiners.length;l++)for(var h=this._characterJoiners[l].handler(s),c=0;c<h.length;c++)e._mergeRanges(a,h[c]);return this._stringRangesToCellRanges(a,n,o),a},e.prototype._stringRangesToCellRanges=function(e,t,i){var r=0,n=!1,s=0,a=e[r];if(a){for(var l=i;l<this._terminal.cols;l++){var h=t.getWidth(l),c=t.getString(l).length||o.WHITESPACE_CELL_CHAR.length;if(0!==h){if(!n&&a[0]<=s&&(a[0]=l,n=!0),a[1]<=s){if(a[1]=l,!(a=e[++r]))break;a[0]<=s?(a[0]=l,n=!0):n=!1}s+=c}}a&&(a[1]=this._terminal.cols)}},e._mergeRanges=function(e,t){for(var i=!1,r=0;r<e.length;r++){var n=e[r];if(i){if(t[1]<=n[0])return e[r-1][1]=t[1],e;if(t[1]<=n[1])return e[r-1][1]=Math.max(t[1],n[1]),e.splice(r,1),i=!1,e;e.splice(r,1),r--}else{if(t[1]<=n[0])return e.splice(r,0,t),e;if(t[1]<=n[1])return n[0]=Math.min(t[0],n[0]),e;t[0]<n[1]&&(n[0]=Math.min(t[0],n[0]),i=!0)}}return i?e[e.length-1][1]=t[1]:e.push(t),e},e}();t.CharacterJoinerRegistry=a},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(5),a=function(e){function t(t){var i=e.call(this)||this;return i._terminal=t,i._zones=[],i._areZonesActive=!1,i._tooltipTimeout=null,i._currentZone=null,i._lastHoverCoords=[null,null],i.register(s.addDisposableDomListener(i._terminal.element,"mousedown",function(e){return i._onMouseDown(e)})),i._mouseMoveListener=function(e){return i._onMouseMove(e)},i._mouseLeaveListener=function(e){return i._onMouseLeave(e)},i._clickListener=function(e){return i._onClick(e)},i}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._deactivate()},t.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},t.prototype.clearAll=function(e,t){if(0!==this._zones.length){t||(e=0,t=this._terminal.rows-1);for(var i=0;i<this._zones.length;i++){var r=this._zones[i];(r.y1>e&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1<e&&r.y2>t+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(i--,1))}0===this._zones.length&&this._deactivate()}},t.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.addEventListener("click",this._clickListener))},t.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.removeEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.removeEventListener("click",this._clickListener))},t.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},t.prototype._onHover=function(e){var t=this,i=this._findZoneEventAt(e);i!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),i&&(this._currentZone=i,i.hoverCallback&&i.hoverCallback(e),this._tooltipTimeout=setTimeout(function(){return t._onTooltip(e)},500)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=null;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._terminal.getSelection().length,this._areZonesActive){var t=this._findZoneEventAt(e);t&&t.willLinkActivate(e)&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e),i=this._terminal.getSelection().length;t&&i===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._findZoneEventAt=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!t)return null;for(var i=t[0],r=t[1],n=0;n<this._zones.length;n++){var o=this._zones[n];if(o.y1===o.y2){if(r===o.y1&&i>=o.x1&&i<o.x2)return o}else if(r===o.y1&&i>=o.x1||r===o.y2&&i<o.x2||r>o.y1&&r<o.y2)return o}return null},t}(o.Disposable);t.MouseZoneManager=a;var l=function(e,t,i,r,n,o,s,a,l){this.x1=e,this.y1=t,this.x2=i,this.y2=r,this.clickCallback=n,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=l};t.MouseZone=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._renderCoordinator=e}return e.getCoordsRelativeToElement=function(e,t){var i=t.getBoundingClientRect();return[e.clientX-i.left,e.clientY-i.top]},e.prototype.getCoords=function(t,i,r,n,o,s){if(!r.width||!r.height)return null;var a=e.getCoordsRelativeToElement(t,i);return a?(a[0]=Math.ceil((a[0]+(s?this._renderCoordinator.dimensions.actualCellWidth/2:0))/this._renderCoordinator.dimensions.actualCellWidth),a[1]=Math.ceil(a[1]/this._renderCoordinator.dimensions.actualCellHeight),a[0]=Math.min(Math.max(a[0],1),n+(s?1:0)),a[1]=Math.min(Math.max(a[1],1),o),a):null},e.prototype.getRawByteCoords=function(e,t,i,r,n){var o=this.getCoords(e,t,i,r,n),s=o[0],a=o[1];return{x:s+=32,y:a+=32}},e}();t.MouseHelper=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._renderCallback=e}return e.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.refresh=function(e,t,i){var r=this;this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return r._innerRefresh()}))},e.prototype._innerRefresh=function(){void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(this._rowStart=Math.max(this._rowStart,0),this._rowEnd=Math.min(this._rowEnd,this._rowCount-1),this._renderCallback(this._rowStart,this._rowEnd),this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0)},e}();t.RenderDebouncer=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}return n(t,e),t.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener&&(t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr())},this._updateDpr()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.clearListener()},t.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},t.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)},t}(i(0).Disposable);t.ScreenDprMonitor=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(28),n=i(13),o=i(63),s=function(){function e(e){this._core=new r.Terminal(e),this._addonManager=new o.AddonManager}return Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return new a(this._core.buffer)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.on=function(e,t){this._core.on(e,t)},e.prototype.off=function(e,t){this._core.off(e,t)},e.prototype.emit=function(e,t){this._core.emit(e,t)},e.prototype.addDisposableListener=function(e,t){return this._core.addDisposableListener(e,t)},e.prototype.resize=function(e,t){this._core.resize(e,t)},e.prototype.writeln=function(e){this._core.writeln(e)},e.prototype.open=function(e){this._core.open(e)},e.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},e.prototype.addCsiHandler=function(e,t){return this._core.addCsiHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this._core.addOscHandler(e,t)},e.prototype.registerLinkMatcher=function(e,t,i){return this._core.registerLinkMatcher(e,t,i)},e.prototype.deregisterLinkMatcher=function(e){this._core.deregisterLinkMatcher(e)},e.prototype.registerCharacterJoiner=function(e){return this._core.registerCharacterJoiner(e)},e.prototype.deregisterCharacterJoiner=function(e){this._core.deregisterCharacterJoiner(e)},e.prototype.addMarker=function(e){return this._core.addMarker(e)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.select=function(e,t,i){this._core.select(e,t,i)},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(e,t){this._core.selectLines(e,t)},e.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},e.prototype.destroy=function(){this._core.destroy()},e.prototype.scrollLines=function(e){this._core.scrollLines(e)},e.prototype.scrollPages=function(e){this._core.scrollPages(e)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(e){this._core.scrollToLine(e)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(e){this._core.write(e)},e.prototype.writeUtf8=function(e){this._core.writeUtf8(e)},e.prototype.getOption=function(e){return this._core.getOption(e)},e.prototype.setOption=function(e,t){this._core.setOption(e,t)},e.prototype.refresh=function(e,t){this._core.refresh(e,t)},e.prototype.reset=function(){this._core.reset()},e.applyAddon=function(t){t.apply(e)},e.prototype.loadAddon=function(e){return this._addonManager.loadAddon(this,e)},Object.defineProperty(e,"strings",{get:function(){return n},enumerable:!0,configurable:!0}),e}();t.Terminal=s;var a=function(){function e(e){this._buffer=e}return Object.defineProperty(e.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!0,configurable:!0}),e.prototype.getLine=function(e){var t=this._buffer.lines.get(e);if(t)return new l(t)},e}(),l=function(){function e(e){this._line=e}return Object.defineProperty(e.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!0,configurable:!0}),e.prototype.getCell=function(e){if(!(e<0||e>=this._line.length))return new h(this._line,e)},e.prototype.translateToString=function(e,t,i){return this._line.translateToString(e,t,i)},e}(),h=function(){function e(e,t){this._line=e,this._x=t}return Object.defineProperty(e.prototype,"char",{get:function(){return this._line.getString(this._x)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._line.getWidth(this._x)},enumerable:!0,configurable:!0}),e}()},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.activate=function(e){this._terminal=e},e.prototype.dispose=function(){},e.prototype.fit=function(){var e=this.proposeDimensions();if(e&&this._terminal){var t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderCoordinator.clear(),this._terminal.resize(e.cols,e.rows))}},e.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element.parentElement){var e=this._terminal._core,t=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(t.getPropertyValue("height")),r=Math.max(0,parseInt(t.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o=i-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),s=r-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-e.viewport.scrollBarWidth;return{cols:Math.floor(s/e._renderCoordinator.dimensions.actualCellWidth),rows:Math.floor(o/e._renderCoordinator.dimensions.actualCellHeight)}}},e}();t.FitAddon=r},function(e,t,i){window,e.exports=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=new RegExp("(?:^|[^\\da-z\\.-]+)((https?:\\/\\/)((([\\da-z\\.-]+)\\.([a-z\\.]{2,6}))|((\\d{1,3}\\.){3}\\d{1,3})|(localhost))(:\\d{1,5})?((\\/[\\/\\w\\.\\-%~:+]*)*([^:\"'\\s]))?(\\?[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?(#[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?)($|[^\\/\\w\\.\\-%]+)");function n(e,t){window.open(t,"_blank")}var o=function(){function e(e,t){void 0===e&&(e=n),void 0===t&&(t={}),this._handler=e,this._options=t,this._options.matchIndex=1}return e.prototype.activate=function(e){this._terminal=e,this._linkMatcherId=this._terminal.registerLinkMatcher(r,this._handler,this._options)},e.prototype.dispose=function(){void 0!==this._linkMatcherId&&void 0!==this._terminal&&this._terminal.deregisterLinkMatcher(this._linkMatcherId)},e}();t.WebLinksAddon=o}])},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(29),s=i(14),a=i(33),l=i(34),h=i(35),c=i(36),u=i(8),f=i(37),d=i(40),_=i(50),p=i(51),m=i(54),y=i(6),g=i(5),C=i(13),v=i(22),b=i(55),w=i(21),S=i(56),E=i(17),L=i(57),x=i(59),A=i(60),T=i(2),k=i(1),M=i(61),R=i(18),D=i(62),O="undefined"!=typeof window?window.document:null,H=["cols","rows"],B={cols:80,rows:24,convertEol:!1,termName:"xterm",cursorBlink:!1,cursorStyle:"block",bellSound:b.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,enableBold:!0,experimentalCharAtlas:"static",fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,scrollback:1e3,screenKeys:!1,screenReaderMode:!1,debug:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,allowTransparency:!1,tabStopWidth:8,theme:void 0,rightClickSelectsWord:y.isMac,rendererType:"canvas",windowsMode:!1},P=function(e){function t(t){void 0===t&&(t={});var i=e.call(this)||this;return i.browser=y,i._blankLine=null,i._onCursorMove=new T.EventEmitter2,i._onData=new T.EventEmitter2,i._onKey=new T.EventEmitter2,i._onLineFeed=new T.EventEmitter2,i._onRender=new T.EventEmitter2,i._onResize=new T.EventEmitter2,i._onScroll=new T.EventEmitter2,i._onSelectionChange=new T.EventEmitter2,i._onTitleChange=new T.EventEmitter2,i.options=A.clone(t),i._setup(),i.onCursorMove(function(){return i.emit("cursormove")}),i.onData(function(e){return i.emit("data",e)}),i.onKey(function(e){return i.emit("key",e.key,e.domEvent)}),i.onLineFeed(function(){return i.emit("linefeed")}),i.onRender(function(e){return i.emit("refresh",e)}),i.onResize(function(e){return i.emit("resize",e)}),i.onSelectionChange(function(){return i.emit("selection")}),i.onScroll(function(e){return i.emit("scroll",e)}),i.onTitleChange(function(e){return i.emit("title",e)}),i}return n(t,e),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0),this._customKeyEventHandler=null,E.removeTerminalFromCache(this),this.handler=function(){},this.write=function(){},this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},t.prototype.destroy=function(){this.dispose()},t.prototype._setup=function(){var e=this;Object.keys(B).forEach(function(t){null!==e.options[t]&&void 0!==e.options[t]||(e.options[t]=B[t])}),this._parent=O?O.body:null,this.cols=Math.max(this.options.cols,2),this.rows=Math.max(this.options.rows,1),this.options.handler&&this.onData(this.options.handler),this.cursorState=0,this.cursorHidden=!1,this._customKeyEventHandler=null,this.applicationKeypad=!1,this.applicationCursor=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!0,this.bracketedPasteMode=!1,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.curAttrData=k.DEFAULT_ATTR_DATA.clone(),this._eraseAttrData=k.DEFAULT_ATTR_DATA.clone(),this.params=[],this.currentParam=0,this.writeBuffer=[],this.writeBufferUtf8=[],this._writeInProgress=!1,this._xoffSentToCatchUp=!1,this._userScrolling=!1,this._inputHandler=new f.InputHandler(this),this._inputHandler.onCursorMove(function(){return e._onCursorMove.fire()}),this._inputHandler.onLineFeed(function(){return e._onLineFeed.fire()}),this._inputHandler.onData(function(t){return e._onData.fire(t)}),this.register(this._inputHandler),this.selectionManager=this.selectionManager||null,this.linkifier=this.linkifier||new _.Linkifier(this),this._mouseZoneManager=this._mouseZoneManager||null,this.soundManager=this.soundManager||new b.SoundManager(this),this.buffers=new o.BufferSet(this),this.selectionManager&&(this.selectionManager.clearSelection(),this.selectionManager.initBuffersListeners()),this.options.windowsMode&&(this._windowsMode=M.applyWindowsMode(this))},Object.defineProperty(t.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),t.prototype.eraseAttrData=function(){return this._eraseAttrData.bg&=-67108864,this._eraseAttrData.bg|=67108863&this.curAttrData.bg,this._eraseAttrData},t.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},Object.defineProperty(t.prototype,"isFocused",{get:function(){return O.activeElement===this.textarea&&O.hasFocus()},enumerable:!0,configurable:!0}),t.prototype.getOption=function(e){if(!(e in B))throw new Error('No option with key "'+e+'"');return this.options[e]},t.prototype.setOption=function(e,t){if(!(e in B))throw new Error('No option with key "'+e+'"');if(-1!==H.indexOf(e)&&console.error('Option "'+e+'" can only be set in the constructor'),this.options[e]!==t){switch(e){case"bellStyle":t||(t="none");break;case"cursorStyle":t||(t="block");break;case"fontWeight":t||(t="normal");break;case"fontWeightBold":t||(t="bold");break;case"lineHeight":if(t<1)return void console.warn(e+" cannot be less than 1, value: "+t);case"rendererType":t||(t="canvas");break;case"tabStopWidth":if(t<1)return void console.warn(e+" cannot be less than 1, value: "+t);break;case"theme":this._setTheme(t);break;case"scrollback":if((t=Math.min(t,s.MAX_BUFFER_SIZE))<0)return void console.warn(e+" cannot be less than 0, value: "+t);if(this.options[e]!==t){var i=this.rows+t;if(this.buffer.lines.length>i){var r=this.buffer.lines.length-i,n=this.buffer.ydisp-r<0;this.buffer.lines.trimStart(r),this.buffer.ybase=Math.max(this.buffer.ybase-r,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-r,0),n&&this.refresh(0,this.rows-1)}}}switch(this.options[e]=t,e){case"fontFamily":case"fontSize":this._renderCoordinator&&(this._renderCoordinator.clear(),this.charMeasure.measure(this.options));break;case"drawBoldTextInBrightColors":case"experimentalCharAtlas":case"enableBold":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":this._renderCoordinator&&(this._renderCoordinator.clear(),this._renderCoordinator.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderCoordinator&&this._renderCoordinator.setRenderer(this._createRenderer());break;case"scrollback":this.buffers.resize(this.cols,this.rows),this.viewport&&this.viewport.syncScrollArea();break;case"screenReaderMode":t?!this._accessibilityManager&&this._renderCoordinator&&(this._accessibilityManager=new S.AccessibilityManager(this,this._renderCoordinator.dimensions)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"windowsMode":t?this._windowsMode||(this._windowsMode=M.applyWindowsMode(this)):this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0)}this._renderCoordinator&&this._renderCoordinator.onOptionsChanged()}},t.prototype._onTextAreaFocus=function(e){this.sendFocus&&this.handler(u.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},t.prototype.blur=function(){return this.textarea.blur()},t.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.sendFocus&&this.handler(u.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},t.prototype._initGlobal=function(){var e=this;this._bindKeys(),this.register(g.addDisposableDomListener(this.element,"copy",function(t){e.hasSelection()&&c.copyHandler(t,e,e.selectionManager)}));var t=function(t){return c.pasteHandler(t,e)};this.register(g.addDisposableDomListener(this.textarea,"paste",t)),this.register(g.addDisposableDomListener(this.element,"paste",t)),y.isFirefox?this.register(g.addDisposableDomListener(this.element,"mousedown",function(t){2===t.button&&c.rightClickHandler(t,e,e.selectionManager,e.options.rightClickSelectsWord)})):this.register(g.addDisposableDomListener(this.element,"contextmenu",function(t){c.rightClickHandler(t,e,e.selectionManager,e.options.rightClickSelectsWord)})),y.isLinux&&this.register(g.addDisposableDomListener(this.element,"auxclick",function(t){1===t.button&&c.moveTextAreaUnderMouseCursor(t,e)}))},t.prototype._bindKeys=function(){var e=this,t=this;this.register(g.addDisposableDomListener(this.element,"keydown",function(e){O.activeElement===this&&t._keyDown(e)},!0)),this.register(g.addDisposableDomListener(this.element,"keypress",function(e){O.activeElement===this&&t._keyPress(e)},!0)),this.register(g.addDisposableDomListener(this.element,"keyup",function(i){(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode})(i)||e.focus(),t._keyUp(i)},!0)),this.register(g.addDisposableDomListener(this.textarea,"keydown",function(t){return e._keyDown(t)},!0)),this.register(g.addDisposableDomListener(this.textarea,"keypress",function(t){return e._keyPress(t)},!0)),this.register(g.addDisposableDomListener(this.textarea,"compositionstart",function(){return e._compositionHelper.compositionstart()})),this.register(g.addDisposableDomListener(this.textarea,"compositionupdate",function(t){return e._compositionHelper.compositionupdate(t)})),this.register(g.addDisposableDomListener(this.textarea,"compositionend",function(){return e._compositionHelper.compositionend()})),this.register(this.onRender(function(){return e._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(t){return e._queueLinkification(t.start,t.end)}))},t.prototype.open=function(e){var t=this;if(this._parent=e||this._parent,!this._parent)throw new Error("Terminal requires a parent element.");this._context=this._parent.ownerDocument.defaultView,this._document=this._parent.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),this._parent.appendChild(this.element);var i=O.createDocumentFragment();this._viewportElement=O.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=O.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=O.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=O.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this._mouseZoneManager=new w.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return t._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=O.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.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(g.addDisposableDomListener(this.textarea,"focus",function(e){return t._onTextAreaFocus(e)})),this.register(g.addDisposableDomListener(this.textarea,"blur",function(){return t._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea),this._compositionView=O.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=new a.CompositionHelper(this.textarea,this._compositionView,this),this._helperContainer.appendChild(this._compositionView),this.charMeasure=new m.CharMeasure(O,this._helperContainer),this.element.appendChild(i),this._theme=this.options.theme,this._colorManager=new R.ColorManager(O,this.options.allowTransparency),this._colorManager.setTheme(this._theme);var r=this._createRenderer();this._renderCoordinator=new D.RenderCoordinator(r,this.rows,this.screenElement),this._renderCoordinator.onRender(function(e){return t._onRender.fire(e)}),this.onResize(function(e){return t._renderCoordinator.resize(e.cols,e.rows)}),this.viewport=new h.Viewport(this,this._viewportElement,this._viewportScrollArea,this.charMeasure,this._renderCoordinator.dimensions),this.viewport.onThemeChange(this._colorManager.colors),this.register(this.viewport),this.register(this.onCursorMove(function(){return t._renderCoordinator.onCursorMove()})),this.register(this.onResize(function(){return t._renderCoordinator.onResize(t.cols,t.rows)})),this.register(this.addDisposableListener("blur",function(){return t._renderCoordinator.onBlur()})),this.register(this.addDisposableListener("focus",function(){return t._renderCoordinator.onFocus()})),this.register(this.charMeasure.onCharSizeChanged(function(){return t._renderCoordinator.onCharSizeChanged()})),this.register(this._renderCoordinator.onDimensionsChange(function(){return t.viewport.syncScrollArea()})),this.selectionManager=new p.SelectionManager(this,this.charMeasure),this.register(this.selectionManager.onSelectionChange(function(){return t._onSelectionChange.fire()})),this.register(g.addDisposableDomListener(this.element,"mousedown",function(e){return t.selectionManager.onMouseDown(e)})),this.register(this.selectionManager.onRedrawRequest(function(e){return t._renderCoordinator.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this.selectionManager.onLinuxMouseSelection(function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()})),this.register(this.onScroll(function(){t.viewport.syncScrollArea(),t.selectionManager.refresh()})),this.register(g.addDisposableDomListener(this._viewportElement,"scroll",function(){return t.selectionManager.refresh()})),this.mouseHelper=new v.MouseHelper(this._renderCoordinator),this.element.classList.toggle("enable-mouse-events",this.mouseEvents),this.mouseEvents?this.selectionManager.disable():this.selectionManager.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new S.AccessibilityManager(this,this._renderCoordinator.dimensions),this._accessibilityManager.register(this._renderCoordinator.onDimensionsChange(function(e){return t._accessibilityManager.setDimensions(e)}))),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},t.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return new d.Renderer(this,this._colorManager.colors);case"dom":return new L.DomRenderer(this,this._colorManager.colors);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},t.prototype._setTheme=function(e){this._theme=e,this._colorManager.setTheme(e),this._renderCoordinator&&this._renderCoordinator.setColors(this._colorManager.colors),this.viewport&&this.viewport.onThemeChange(this._colorManager.colors)},t.prototype.bindMouse=function(){var e=this,t=this.element,i=this,r=32;function n(e){var t,n;if(t=function(e){var t,r,n;switch(e.overrideType||e.type){case"mousedown":t=null!==e.button&&void 0!==e.button?+e.button:null!==e.which&&void 0!==e.which?e.which-1:null,y.isMSIE&&(t=1===t?0:4===t?1:t);break;case"mouseup":t=3;break;case"DOMMouseScroll":t=e.detail<0?64:65;break;case"wheel":t=e.deltaY<0?64:65}return n=(e.shiftKey?4:0)|(e.metaKey?8:0)|(r=e.ctrlKey?16:0),i.vt200Mouse?n&=r:i.normalMouse||(n=0),32+(n<<2)+t}(e),n=i.mouseHelper.getRawByteCoords(e,i.screenElement,i.charMeasure,i.cols,i.rows))switch(s(t,n),e.overrideType||e.type){case"mousedown":r=t;break;case"mouseup":r=32}}function o(e,t){if(i.utfMouse){if(t>2047)return void e.push(2047);e.push(t)}else{if(255===t)return void e.push(0);t>127&&(t=127),e.push(t)}}function s(e,t){if(i._vt300Mouse){e&=3,t.x-=32,t.y-=32;var r=u.C0.ESC+"[24";if(0===e)r+="1";else if(1===e)r+="3";else if(2===e)r+="5";else{if(3===e)return;r+="0"}return r+="~["+t.x+","+t.y+"]\r",void i.handler(r)}if(i._decLocator)return e&=3,t.x-=32,t.y-=32,0===e?e=2:1===e?e=4:2===e?e=6:3===e&&(e=3),void i.handler(u.C0.ESC+"["+e+";"+(3===e?4:0)+";"+t.y+";"+t.x+";"+t.page||"0&w");if(i.urxvtMouse)return t.x-=32,t.y-=32,t.x++,t.y++,void i.handler(u.C0.ESC+"["+e+";"+t.x+";"+t.y+"M");if(i.sgrMouse)return t.x-=32,t.y-=32,void i.handler(u.C0.ESC+"[<"+((3==(3&e)?-4&e:e)-32)+";"+t.x+";"+t.y+(3==(3&e)?"m":"M"));var n=[];o(n,e),o(n,t.x),o(n,t.y),i.handler(u.C0.ESC+"[M"+String.fromCharCode.apply(String,n))}this.register(g.addDisposableDomListener(t,"mousedown",function(t){if(t.preventDefault(),e.focus(),e.mouseEvents&&!e.selectionManager.shouldForceSelection(t)){if(n(t),e.vt200Mouse)return t.overrideType="mouseup",n(t),e.cancel(t);var o;e.normalMouse&&(o=function(t){e.normalMouse&&function(e){var t=r,n=i.mouseHelper.getRawByteCoords(e,i.screenElement,i.charMeasure,i.cols,i.rows);n&&s(t+=32,n)}(t)},e._document.addEventListener("mousemove",o));var a=function(t){return e.normalMouse&&!e.x10Mouse&&n(t),o&&(e._document.removeEventListener("mousemove",o),o=null),e._document.removeEventListener("mouseup",a),e.cancel(t)};return e._document.addEventListener("mouseup",a),e.cancel(t)}})),this.register(g.addDisposableDomListener(t,"wheel",function(t){if(e.mouseEvents)e.x10Mouse||e._vt300Mouse||e._decLocator||(n(t),t.preventDefault());else if(!e.buffer.hasScrollback){var i=e.viewport.getLinesScrolled(t);if(0===i)return;for(var r=u.C0.ESC+(e.applicationCursor?"O":"[")+(t.deltaY<0?"A":"B"),o="",s=0;s<Math.abs(i);s++)o+=r;e.handler(o)}})),this.register(g.addDisposableDomListener(t,"wheel",function(t){if(!e.mouseEvents)return e.viewport.onWheel(t),e.cancel(t)})),this.register(g.addDisposableDomListener(t,"touchstart",function(t){if(!e.mouseEvents)return e.viewport.onTouchStart(t),e.cancel(t)})),this.register(g.addDisposableDomListener(t,"touchmove",function(t){if(!e.mouseEvents)return e.viewport.onTouchMove(t),e.cancel(t)}))},t.prototype.refresh=function(e,t){this._renderCoordinator&&this._renderCoordinator.refreshRows(e,t)},t.prototype._queueLinkification=function(e,t){this.linkifier&&this.linkifier.linkifyRows(e,t)},t.prototype.updateCursorStyle=function(e){this.selectionManager&&this.selectionManager.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},t.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.buffer.y,this.buffer.y))},t.prototype.scroll=function(e){var t;void 0===e&&(e=!1),t=this._blankLine;var i=this.eraseAttrData();t&&t.length===this.cols&&t.getFg(0)===i.fg&&t.getBg(0)===i.bg||(t=this.buffer.getBlankLine(i,e),this._blankLine=t),t.isWrapped=e;var r=this.buffer.ybase+this.buffer.scrollTop,n=this.buffer.ybase+this.buffer.scrollBottom;if(0===this.buffer.scrollTop){var o=this.buffer.lines.isFull;n===this.buffer.lines.length-1?o?this.buffer.lines.recycle().copyFrom(t):this.buffer.lines.push(t.clone()):this.buffer.lines.splice(n+1,0,t.clone()),o?this._userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++)}else{var s=n-r+1;this.buffer.lines.shiftElements(r+1,s-1,-1),this.buffer.lines.set(n,t.clone())}this._userScrolling||(this.buffer.ydisp=this.buffer.ybase),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom),this._onScroll.fire(this.buffer.ydisp)},t.prototype.scrollLines=function(e,t){if(e<0){if(0===this.buffer.ydisp)return;this._userScrolling=!0}else e+this.buffer.ydisp>=this.buffer.ybase&&(this._userScrolling=!1);var i=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),i!==this.buffer.ydisp&&(t||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},t.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},t.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},t.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},t.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)},t.prototype.writeUtf8=function(e){var t=this;this._isDisposed||e&&(this.writeBufferUtf8.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&this.writeBufferUtf8.length>=5&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&this.writeBufferUtf8.length>0&&(this._writeInProgress=!0,setTimeout(function(){t._innerWriteUtf8()})))},t.prototype._innerWriteUtf8=function(e){var t=this;void 0===e&&(e=0),this._isDisposed&&(this.writeBufferUtf8=[]);for(var i=Date.now();this.writeBufferUtf8.length>e;){var r=this.writeBufferUtf8[e];if(e++,this._xoffSentToCatchUp&&this.writeBufferUtf8.length===e&&(this.handler(u.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parseUtf8(r),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),Date.now()-i>=12)break}this.writeBufferUtf8.length>e?(e>50&&(this.writeBufferUtf8=this.writeBufferUtf8.slice(e),e=0),setTimeout(function(){return t._innerWriteUtf8(e)},0)):(this._writeInProgress=!1,this.writeBufferUtf8=[])},t.prototype.write=function(e){var t=this;this._isDisposed||e&&(this.writeBuffer.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&this.writeBuffer.length>=5&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&this.writeBuffer.length>0&&(this._writeInProgress=!0,setTimeout(function(){t._innerWrite()})))},t.prototype._innerWrite=function(e){var t=this;void 0===e&&(e=0),this._isDisposed&&(this.writeBuffer=[]);for(var i=Date.now();this.writeBuffer.length>e;){var r=this.writeBuffer[e];if(e++,this._xoffSentToCatchUp&&this.writeBuffer.length===e&&(this.handler(u.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parse(r),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),Date.now()-i>=12)break}this.writeBuffer.length>e?(e>50&&(this.writeBuffer=this.writeBuffer.slice(e),e=0),setTimeout(function(){return t._innerWrite(e)},0)):(this._writeInProgress=!1,this.writeBuffer=[])},t.prototype.writeln=function(e){this.write(e+"\r\n")},t.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},t.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},t.prototype.registerLinkMatcher=function(e,t,i){var r=this.linkifier.registerLinkMatcher(e,t,i);return this.refresh(0,this.rows-1),r},t.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},t.prototype.registerCharacterJoiner=function(e){var t=this._renderCoordinator.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},t.prototype.deregisterCharacterJoiner=function(e){this._renderCoordinator.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(t.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),t.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},t.prototype.hasSelection=function(){return!!this.selectionManager&&this.selectionManager.hasSelection},t.prototype.select=function(e,t,i){this.selectionManager.setSelection(e,t,i)},t.prototype.getSelection=function(){return this.selectionManager?this.selectionManager.selectionText:""},t.prototype.getSelectionPosition=function(){if(this.selectionManager.hasSelection)return{startColumn:this.selectionManager.selectionStart[0],startRow:this.selectionManager.selectionStart[1],endColumn:this.selectionManager.selectionEnd[0],endRow:this.selectionManager.selectionEnd[1]}},t.prototype.clearSelection=function(){this.selectionManager&&this.selectionManager.clearSelection()},t.prototype.selectAll=function(){this.selectionManager&&this.selectionManager.selectAll()},t.prototype.selectLines=function(e,t){this.selectionManager&&this.selectionManager.selectLines(e,t)},t.prototype._keyDown=function(e){if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=x.evaluateKeyboardEvent(e,this.applicationCursor,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===t.type||2===t.type){var i=this.rows-1;return this.scrollLines(2===t.type?-i:i),this.cancel(e,!0)}return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(this.emit("keydown",e),this._onKey.fire({key:t.key,domEvent:e}),this.showCursor(),this.handler(t.key),this.cancel(e,!0)))},t.prototype._isThirdLevelShift=function(e,t){var i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isMSWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)},t.prototype.setgLevel=function(e){this.glevel=e,this.charset=this.charsets[e]},t.prototype.setgCharset=function(e,t){this.charsets[e]=t,this.glevel===e&&(this.charset=t)},t.prototype._keyUp=function(e){this.updateCursorStyle(e)},t.prototype._keyPress=function(e){var t;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this.emit("keypress",t,e),this._onKey.fire({key:t,domEvent:e}),this.showCursor(),this.handler(t),0))},t.prototype.bell=function(){var e=this;this.emit("bell"),this._soundBell()&&this.soundManager.playBellSound(),this._visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this._visualBellTimer),this._visualBellTimer=window.setTimeout(function(){e.element.classList.remove("visual-bell-active")},200))},t.prototype.log=function(e,t){this.options.debug&&this._context.console&&this._context.console.log&&this._context.console.log(e,t)},t.prototype.error=function(e,t){this.options.debug&&this._context.console&&this._context.console.error&&this._context.console.error(e,t)},t.prototype.resize=function(e,t){isNaN(e)||isNaN(t)||(e!==this.cols||t!==this.rows?(e<2&&(e=2),t<1&&(t=1),this.buffers.resize(e,t),this.cols=e,this.rows=t,this.buffers.setupTabStops(this.cols),this.charMeasure&&this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._onResize.fire({cols:e,rows:t})):!this.charMeasure||this.charMeasure.width&&this.charMeasure.height||this.charMeasure.measure(this.options))},t.prototype.updateRange=function(e){e<this._refreshStart&&(this._refreshStart=e),e>this._refreshEnd&&(this._refreshEnd=e)},t.prototype.maxRange=function(){this._refreshStart=0,this._refreshEnd=this.rows-1},t.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(k.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},t.prototype.is=function(e){return 0===(this.options.termName+"").indexOf(e)},t.prototype.handler=function(e){this.options.disableStdin||(this.selectionManager&&this.selectionManager.hasSelection&&this.selectionManager.clearSelection(),this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),this._onData.fire(e))},t.prototype.handleTitle=function(e){this._onTitleChange.fire(e)},t.prototype.index=function(){this.buffer.y++,this.buffer.y>this.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},t.prototype.reverseIndex=function(){if(this.buffer.y===this.buffer.scrollTop){var e=this.buffer.scrollBottom-this.buffer.scrollTop;this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,e,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttrData())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)}else this.buffer.y--},t.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var e=this._customKeyEventHandler,t=this._inputHandler,i=this.cursorState,r=this.writeBuffer,n=this.writeBufferUtf8,o=this._writeInProgress,s=this._xoffSentToCatchUp,a=this._userScrolling;this._setup(),this._customKeyEventHandler=e,this._inputHandler=t,this.cursorState=i,this.writeBuffer=r,this.writeBufferUtf8=n,this._writeInProgress=o,this._xoffSentToCatchUp=s,this._userScrolling=a,this.refresh(0,this.rows-1),this.viewport&&this.viewport.syncScrollArea()},t.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0},t.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},t.prototype._visualBell=function(){return!1},t.prototype._soundBell=function(){return"sound"===this.options.bellStyle},t}(l.EventEmitter);t.Terminal=P},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(14),n=i(2),o=function(){function e(e){this._terminal=e,this._onBufferActivate=new n.EventEmitter2,this._normal=new r.Buffer(this._terminal,!0),this._normal.fillViewportRows(),this._alt=new r.Buffer(this._terminal,!1),this._activeBuffer=this._normal,this.setupTabStops()}return Object.defineProperty(e.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),e.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}))},e.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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}))},e.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},e.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},e}();t.BufferSet=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(2),n=function(){function e(e){this._maxLength=e,this.onDeleteEmitter=new r.EventEmitter2,this.onInsertEmitter=new r.EventEmitter2,this.onTrimEmitter=new r.EventEmitter2,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(e.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},set:function(e){if(e>this._length)for(var t=this._length;t<e;t++)this._array[t]=void 0;this._length=e},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},e.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},e.prototype.push=function(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},e.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(e.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0}),e.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},e.prototype.splice=function(e,t){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];if(t){for(var n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t}for(n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+i.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<i.length;n++)this._array[this._getCyclicIndex(e+n)]=i[n];if(this._length+i.length>this._maxLength){var o=this._length+i.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=i.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},e.prototype.shiftElements=function(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(var r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));var n=e+t+i-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;r<t;r++)this.set(e+r+i,this.get(e+r))}},e.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},e}();t.CircularList=n},function(e,t,i){"use strict";function r(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();var r=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),n=2===e[t+1].getWidth(0);return r&&n?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.reflowLargerGetLinesToRemove=function(e,t,i,n,o){for(var s=[],a=0;a<e.length-1;a++){var l=a,h=e.get(++l);if(h.isWrapped){for(var c=[e.get(a)];l<e.length&&h.isWrapped;)c.push(h),h=e.get(++l);if(n>=a&&n<l)a+=c.length-1;else{for(var u=0,f=r(c,u,t),d=1,_=0;d<c.length;){var p=r(c,d,t),m=p-_,y=i-f,g=Math.min(m,y);c[u].copyCellsFrom(c[d],_,f,g,!1),(f+=g)===i&&(u++,f=0),(_+=g)===p&&(d++,_=0),0===f&&0!==u&&2===c[u-1].getWidth(i-1)&&(c[u].copyCellsFrom(c[u-1],i-1,f++,1,!1),c[u-1].setCell(i-1,o))}c[u].replaceCells(f,i,o);for(var C=0,v=c.length-1;v>0&&(v>u||0===c[v].getTrimmedLength());v--)C++;C>0&&(s.push(a+c.length-C),s.push(C)),a+=c.length-1}}}return s},t.reflowLargerCreateNewLayout=function(e,t){for(var i=[],r=0,n=t[r],o=0,s=0;s<e.length;s++)if(n===s){var a=t[++r];e.onDeleteEmitter.fire({index:s-o,amount:a}),s+=a-1,o+=a,n=t[++r]}else i.push(s);return{layout:i,countRemoved:o}},t.reflowLargerApplyNewLayout=function(e,t){for(var i=[],r=0;r<t.length;r++)i.push(e.get(t[r]));for(r=0;r<i.length;r++)e.set(r,i[r]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,i){for(var n=[],o=e.map(function(i,n){return r(e,n,t)}).reduce(function(e,t){return e+t}),s=0,a=0,l=0;l<o;){if(o-l<i){n.push(o-l);break}s+=i;var h=r(e,a,t);s>h&&(s-=h,a++);var c=2===e[a].getWidth(s-1);c&&s--;var u=c?i-1:i;n.push(u),l+=u}return n},t.getWrappedLineTrimmedLength=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=function(e){function t(i){var r=e.call(this)||this;return r.line=i,r._id=t._nextId++,r.isDisposed=!1,r._onDispose=new o.EventEmitter2,r}return n(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._onDispose.fire())},t._nextId=1,t}(i(0).Disposable);t.Marker=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,i){this._textarea=e,this._compositionView=t,this._terminal=i,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}return e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),e){var i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(t._isSendingComposition){t._isSendingComposition=!1;var e;e=t._isComposing?t._textarea.value.substring(i.start,i.end):t._textarea.value.substring(i.start),t._terminal.handler(e)}},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._terminal.handler(r)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout(function(){if(!e._isComposing){var i=e._textarea.value.replace(t,"");i.length>0&&e._terminal.handler(i)}},0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._terminal.buffer.isCursorInViewport){var i=Math.ceil(this._terminal.charMeasure.height*this._terminal.options.lineHeight),r=this._terminal.buffer.y*i,n=this._terminal.buffer.x*this._terminal.charMeasure.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._terminal.options.fontFamily,this._compositionView.style.fontSize=this._terminal.options.fontSize+"px";var o=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r+"px",this._textarea.style.width=o.width+"px",this._textarea.style.height=o.height+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(function(){return t.updateCompositionElements(!0)},0)}},e.prototype._clearTextareaPosition=function(){this._textarea.style.left="",this._textarea.style.top=""},e}();t.CompositionHelper=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=e.call(this)||this;return t._events=t._events||{},t}return n(t,e),t.prototype.on=function(e,t){this._events[e]=this._events[e]||[],this._events[e].push(t)},t.prototype.addDisposableListener=function(e,t){var i=this;this.on(e,t);var r=!1;return{dispose:function(){r||(i.off(e,t),r=!0)}}},t.prototype.off=function(e,t){if(this._events[e])for(var i=this._events[e],r=i.length;r--;)if(i[r]===t)return void i.splice(r,1)},t.prototype.removeAllListeners=function(e){this._events[e]&&delete this._events[e]},t.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(this._events[e])for(var r=this._events[e],n=0;n<r.length;n++)r[n].apply(this,t)},t.prototype.emitMayRemoveListeners=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(this._events[e])for(var r=this._events[e],n=r.length,o=0;o<r.length;o++)r[o].apply(this,t),o-=n-r.length,n=r.length},t.prototype.listeners=function(e){return this._events[e]||[]},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._events={}},t}(i(0).Disposable);t.EventEmitter=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(5),a=15,l=function(e){function t(t,i,r,n,o){var l=e.call(this)||this;return l._terminal=t,l._viewportElement=i,l._scrollArea=r,l._charMeasure=n,l._dimensions=o,l.scrollBarWidth=0,l._currentRowHeight=0,l._lastRecordedBufferLength=0,l._lastRecordedViewportHeight=0,l._lastRecordedBufferHeight=0,l._lastScrollTop=0,l._wheelPartialScroll=0,l._refreshAnimationFrame=null,l._ignoreNextScrollEvent=!1,l.scrollBarWidth=l._viewportElement.offsetWidth-l._scrollArea.offsetWidth||a,l.register(s.addDisposableDomListener(l._viewportElement,"scroll",l._onScroll.bind(l))),setTimeout(function(){return l.syncScrollArea()},0),l}return n(t,e),t.prototype.onDimensionsChance=function(e){this._dimensions=e},t.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(){var e=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return e._innerRefresh()}))},t.prototype._innerRefresh=function(){if(this._charMeasure.height>0){this._currentRowHeight=this._dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._terminal.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(){if(this._lastRecordedBufferLength!==this._terminal.buffer.lines.length)return this._lastRecordedBufferLength=this._terminal.buffer.lines.length,void this._refresh();if(this._lastRecordedViewportHeight===this._dimensions.canvasHeight){var e=this._terminal.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===e&&this._lastScrollTop===this._viewportElement.scrollTop&&this._dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh()}else this._refresh()},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._terminal.buffer.ydisp;this._terminal.scrollLines(t,!0)}},t.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);0!==t&&(this._viewportElement.scrollTop+=t,e.preventDefault())},t.prototype._getPixelsScrolled=function(e){if(0===e.deltaY)return 0;var t=e.deltaY;return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._terminal.rows),t},t.prototype.getLinesScrolled=function(e){if(0===e.deltaY)return 0;var t=e.deltaY;return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._terminal.rows),t},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,e.preventDefault())},t}(o.Disposable);t.Viewport=l},function(e,t,i){"use strict";function r(e){return e.replace(/\r?\n/g,"\r")}function n(e,t){return t?"\e[200~"+e+"\e[201~":e}function o(e,t){var i=t.screenElement.getBoundingClientRect(),r=e.clientX-i.left-10,n=e.clientY-i.top-10;t.textarea.style.position="absolute",t.textarea.style.width="20px",t.textarea.style.height="20px",t.textarea.style.left=r+"px",t.textarea.style.top=n+"px",t.textarea.style.zIndex="1000",t.textarea.focus(),setTimeout(function(){t.textarea.style.position=null,t.textarea.style.width=null,t.textarea.style.height=null,t.textarea.style.left=null,t.textarea.style.top=null,t.textarea.style.zIndex=null},200)}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTextForTerminal=r,t.bracketTextForPaste=n,t.copyHandler=function(e,t,i){t.browser.isMSIE?window.clipboardData.setData("Text",i.selectionText):e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()},t.pasteHandler=function(e,t){e.stopPropagation();var i=function(i){i=n(i=r(i),t.bracketedPasteMode),t.handler(i),t.textarea.value="",t.emit("paste",i),t.cancel(e)};t.browser.isMSIE?window.clipboardData&&i(window.clipboardData.getData("Text")):e.clipboardData&&i(e.clipboardData.getData("text/plain"))},t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,i,r){o(e,t),r&&!i.isClickInSelection(e)&&i.selectWordAtCursor(e),t.textarea.value=i.selectionText,t.textarea.select()}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(8),s=i(38),a=i(15),l=i(39),h=i(0),c=i(16),u=i(10),f=i(1),d=i(2),_={"(":0,")":1,"*":2,"+":3,"-":1,".":2},p=function(){function e(e){this._terminal=e,this._data=new Uint32Array(0)}return e.prototype.hook=function(e,t,i){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,i){this._data=c.concat(this._data,e.subarray(t,i))},e.prototype.unhook=function(){var e=u.utf32ToString(this._data);switch(this._data=new Uint32Array(0),e){case'"q':return this._terminal.handler(o.C0.ESC+'P1$r0"q'+o.C0.ESC+"\\");case'"p':return this._terminal.handler(o.C0.ESC+'P1$r61"p'+o.C0.ESC+"\\");case"r":var t=this._terminal.buffer.scrollTop+1+";"+(this._terminal.buffer.scrollBottom+1)+"r";return this._terminal.handler(o.C0.ESC+"P1$r"+t+o.C0.ESC+"\\");case"m":return this._terminal.handler(o.C0.ESC+"P1$r0m"+o.C0.ESC+"\\");case" q":var i={block:2,underline:4,bar:6}[this._terminal.getOption("cursorStyle")];return i-=this._terminal.getOption("cursorBlink"),this._terminal.handler(o.C0.ESC+"P1$r"+i+" q"+o.C0.ESC+"\\");default:this._terminal.error("Unknown DCS $q %s",e),this._terminal.handler(o.C0.ESC+"P0$r"+o.C0.ESC+"\\")}},e}(),m=function(e){function t(t,i){void 0===i&&(i=new l.EscapeSequenceParser);var r=e.call(this)||this;r._terminal=t,r._parser=i,r._parseBuffer=new Uint32Array(4096),r._stringDecoder=new u.StringToUtf32,r._utf8Decoder=new u.Utf8ToUtf32,r._workCell=new f.CellData,r._onCursorMove=new d.EventEmitter2,r._onData=new d.EventEmitter2,r._onLineFeed=new d.EventEmitter2,r._onScroll=new d.EventEmitter2,r.register(r._parser),r._parser.setCsiHandlerFallback(function(e,t,i){r._terminal.error("Unknown CSI code: ",{collect:e,params:t,flag:String.fromCharCode(i)})}),r._parser.setEscHandlerFallback(function(e,t){r._terminal.error("Unknown ESC code: ",{collect:e,flag:String.fromCharCode(t)})}),r._parser.setExecuteHandlerFallback(function(e){r._terminal.error("Unknown EXECUTE code: ",{code:e})}),r._parser.setOscHandlerFallback(function(e,t){r._terminal.error("Unknown OSC code: ",{identifier:e,data:t})}),r._parser.setPrintHandler(function(e,t,i){return r.print(e,t,i)}),r._parser.setCsiHandler("@",function(e,t){return r.insertChars(e)}),r._parser.setCsiHandler("A",function(e,t){return r.cursorUp(e)}),r._parser.setCsiHandler("B",function(e,t){return r.cursorDown(e)}),r._parser.setCsiHandler("C",function(e,t){return r.cursorForward(e)}),r._parser.setCsiHandler("D",function(e,t){return r.cursorBackward(e)}),r._parser.setCsiHandler("E",function(e,t){return r.cursorNextLine(e)}),r._parser.setCsiHandler("F",function(e,t){return r.cursorPrecedingLine(e)}),r._parser.setCsiHandler("G",function(e,t){return r.cursorCharAbsolute(e)}),r._parser.setCsiHandler("H",function(e,t){return r.cursorPosition(e)}),r._parser.setCsiHandler("I",function(e,t){return r.cursorForwardTab(e)}),r._parser.setCsiHandler("J",function(e,t){return r.eraseInDisplay(e)}),r._parser.setCsiHandler("K",function(e,t){return r.eraseInLine(e)}),r._parser.setCsiHandler("L",function(e,t){return r.insertLines(e)}),r._parser.setCsiHandler("M",function(e,t){return r.deleteLines(e)}),r._parser.setCsiHandler("P",function(e,t){return r.deleteChars(e)}),r._parser.setCsiHandler("S",function(e,t){return r.scrollUp(e)}),r._parser.setCsiHandler("T",function(e,t){return r.scrollDown(e,t)}),r._parser.setCsiHandler("X",function(e,t){return r.eraseChars(e)}),r._parser.setCsiHandler("Z",function(e,t){return r.cursorBackwardTab(e)}),r._parser.setCsiHandler("`",function(e,t){return r.charPosAbsolute(e)}),r._parser.setCsiHandler("a",function(e,t){return r.hPositionRelative(e)}),r._parser.setCsiHandler("b",function(e,t){return r.repeatPrecedingCharacter(e)}),r._parser.setCsiHandler("c",function(e,t){return r.sendDeviceAttributes(e,t)}),r._parser.setCsiHandler("d",function(e,t){return r.linePosAbsolute(e)}),r._parser.setCsiHandler("e",function(e,t){return r.vPositionRelative(e)}),r._parser.setCsiHandler("f",function(e,t){return r.hVPosition(e)}),r._parser.setCsiHandler("g",function(e,t){return r.tabClear(e)}),r._parser.setCsiHandler("h",function(e,t){return r.setMode(e,t)}),r._parser.setCsiHandler("l",function(e,t){return r.resetMode(e,t)}),r._parser.setCsiHandler("m",function(e,t){return r.charAttributes(e)}),r._parser.setCsiHandler("n",function(e,t){return r.deviceStatus(e,t)}),r._parser.setCsiHandler("p",function(e,t){return r.softReset(e,t)}),r._parser.setCsiHandler("q",function(e,t){return r.setCursorStyle(e,t)}),r._parser.setCsiHandler("r",function(e,t){return r.setScrollRegion(e,t)}),r._parser.setCsiHandler("s",function(e,t){return r.saveCursor(e)}),r._parser.setCsiHandler("u",function(e,t){return r.restoreCursor(e)}),r._parser.setExecuteHandler(o.C0.BEL,function(){return r.bell()}),r._parser.setExecuteHandler(o.C0.LF,function(){return r.lineFeed()}),r._parser.setExecuteHandler(o.C0.VT,function(){return r.lineFeed()}),r._parser.setExecuteHandler(o.C0.FF,function(){return r.lineFeed()}),r._parser.setExecuteHandler(o.C0.CR,function(){return r.carriageReturn()}),r._parser.setExecuteHandler(o.C0.BS,function(){return r.backspace()}),r._parser.setExecuteHandler(o.C0.HT,function(){return r.tab()}),r._parser.setExecuteHandler(o.C0.SO,function(){return r.shiftOut()}),r._parser.setExecuteHandler(o.C0.SI,function(){return r.shiftIn()}),r._parser.setExecuteHandler(o.C1.IND,function(){return r.index()}),r._parser.setExecuteHandler(o.C1.NEL,function(){return r.nextLine()}),r._parser.setExecuteHandler(o.C1.HTS,function(){return r.tabSet()}),r._parser.setOscHandler(0,function(e){return r.setTitle(e)}),r._parser.setOscHandler(2,function(e){return r.setTitle(e)}),r._parser.setEscHandler("7",function(){return r.saveCursor([])}),r._parser.setEscHandler("8",function(){return r.restoreCursor([])}),r._parser.setEscHandler("D",function(){return r.index()}),r._parser.setEscHandler("E",function(){return r.nextLine()}),r._parser.setEscHandler("H",function(){return r.tabSet()}),r._parser.setEscHandler("M",function(){return r.reverseIndex()}),r._parser.setEscHandler("=",function(){return r.keypadApplicationMode()}),r._parser.setEscHandler(">",function(){return r.keypadNumericMode()}),r._parser.setEscHandler("c",function(){return r.reset()}),r._parser.setEscHandler("n",function(){return r.setgLevel(2)}),r._parser.setEscHandler("o",function(){return r.setgLevel(3)}),r._parser.setEscHandler("|",function(){return r.setgLevel(3)}),r._parser.setEscHandler("}",function(){return r.setgLevel(2)}),r._parser.setEscHandler("~",function(){return r.setgLevel(1)}),r._parser.setEscHandler("%@",function(){return r.selectDefaultCharset()}),r._parser.setEscHandler("%G",function(){return r.selectDefaultCharset()});var n=function(e){a._parser.setEscHandler("("+e,function(){return r.selectCharset("("+e)}),a._parser.setEscHandler(")"+e,function(){return r.selectCharset(")"+e)}),a._parser.setEscHandler("*"+e,function(){return r.selectCharset("*"+e)}),a._parser.setEscHandler("+"+e,function(){return r.selectCharset("+"+e)}),a._parser.setEscHandler("-"+e,function(){return r.selectCharset("-"+e)}),a._parser.setEscHandler("."+e,function(){return r.selectCharset("."+e)}),a._parser.setEscHandler("/"+e,function(){return r.selectCharset("/"+e)})},a=this;for(var h in s.CHARSETS)n(h);return r._parser.setErrorHandler(function(e){return r._terminal.error("Parsing error: ",e),e}),r._parser.setDcsHandler("$q",new p(r._terminal)),r}return n(t,e),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._terminal=null},t.prototype.parse=function(e){if(this._terminal){var t=this._terminal.buffer,i=t.x,r=t.y;this._terminal.debug&&this._terminal.log("data: "+e),this._parseBuffer.length<e.length&&(this._parseBuffer=new Uint32Array(e.length)),this._parser.parse(this._parseBuffer,this._stringDecoder.decode(e,this._parseBuffer)),(t=this._terminal.buffer).x===i&&t.y===r||this._onCursorMove.fire()}},t.prototype.parseUtf8=function(e){if(this._terminal){var t=this._terminal.buffer,i=t.x,r=t.y;this._terminal.debug&&this._terminal.log("data: "+e),this._parseBuffer.length<e.length&&(this._parseBuffer=new Uint32Array(e.length)),this._parser.parse(this._parseBuffer,this._utf8Decoder.decode(e,this._parseBuffer)),(t=this._terminal.buffer).x===i&&t.y===r||this._terminal.emit("cursormove")}},t.prototype.print=function(e,t,i){var r,n,o=this._terminal.buffer,s=this._terminal.charset,l=this._terminal.options.screenReaderMode,h=this._terminal.cols,c=this._terminal.wraparoundMode,d=this._terminal.insertMode,_=this._terminal.curAttrData,p=o.lines.get(o.y+o.ybase);this._terminal.updateRange(o.y);for(var m=t;m<i;++m){if(r=e[m],n=a.wcwidth(r),r<127&&s){var y=s[String.fromCharCode(r)];y&&(r=y.charCodeAt(0))}if(l&&this._terminal.emit("a11y.char",u.stringFromCodePoint(r)),n||!o.x){if(o.x+n-1>=h)if(c)o.x=0,o.y++,o.y>o.scrollBottom?(o.y--,this._terminal.scroll(!0)):o.lines.get(o.y).isWrapped=!0,p=o.lines.get(o.y+o.ybase);else if(2===n)continue;if(d&&(p.insertCells(o.x,n,o.getNullCell(_)),2===p.getWidth(h-1)&&p.setCellFromCodePoint(h-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,_.fg,_.bg)),p.setCellFromCodePoint(o.x++,r,n,_.fg,_.bg),n>0)for(;--n;)p.setCellFromCodePoint(o.x++,0,0,_.fg,_.bg)}else p.getWidth(o.x-1)?p.addCodepointToCell(o.x-1,r):p.addCodepointToCell(o.x-2,r)}this._terminal.updateRange(o.y)},t.prototype.addCsiHandler=function(e,t){return this._parser.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,t)},t.prototype.bell=function(){this._terminal.bell()},t.prototype.lineFeed=function(){var e=this._terminal.buffer;this._terminal.options.convertEol&&(e.x=0),e.y++,e.y>e.scrollBottom&&(e.y--,this._terminal.scroll()),e.x>=this._terminal.cols&&e.x--,this._onLineFeed.fire()},t.prototype.carriageReturn=function(){this._terminal.buffer.x=0},t.prototype.backspace=function(){this._terminal.buffer.x>0&&this._terminal.buffer.x--},t.prototype.tab=function(){var e=this._terminal.buffer.x;this._terminal.buffer.x=this._terminal.buffer.nextStop(),this._terminal.options.screenReaderMode&&this._terminal.emit("a11y.tab",this._terminal.buffer.x-e)},t.prototype.shiftOut=function(){this._terminal.setgLevel(1)},t.prototype.shiftIn=function(){this._terminal.setgLevel(0)},t.prototype.insertChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).insertCells(this._terminal.buffer.x,e[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.cursorUp=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0)},t.prototype.cursorDown=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},t.prototype.cursorForward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.cursorBackward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=t,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},t.prototype.cursorNextLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},t.prototype.cursorPrecedingLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},t.prototype.cursorCharAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1},t.prototype.cursorPosition=function(e){var t,i=e[0]-1;t=e.length>=2?e[1]-1:0,i<0?i=0:i>=this._terminal.rows&&(i=this._terminal.rows-1),t<0?t=0:t>=this._terminal.cols&&(t=this._terminal.cols-1),this._terminal.buffer.x=t,this._terminal.buffer.y=i},t.prototype.cursorForwardTab=function(e){for(var t=e[0]||1;t--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},t.prototype._eraseInBufferLine=function(e,t,i,r){void 0===r&&(r=!1);var n=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+e);n.replaceCells(t,i,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),r&&(n.isWrapped=!1)},t.prototype._resetBufferLine=function(e){this._eraseInBufferLine(e,0,this._terminal.cols,!0)},t.prototype.eraseInDisplay=function(e){var t;switch(e[0]){case 0:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);t<this._terminal.rows;t++)this._resetBufferLine(t);this._terminal.updateRange(t);break;case 1:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t,0,this._terminal.buffer.x+1,!0),this._terminal.buffer.x+1>=this._terminal.cols&&(this._terminal.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 2:for(t=this._terminal.rows,this._terminal.updateRange(t-1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 3:var i=this._terminal.buffer.lines.length-this._terminal.rows;i>0&&(this._terminal.buffer.lines.trimStart(i),this._terminal.buffer.ybase=Math.max(this._terminal.buffer.ybase-i,0),this._terminal.buffer.ydisp=Math.max(this._terminal.buffer.ydisp-i,0),this._onScroll.fire(0))}},t.prototype.eraseInLine=function(e){switch(e[0]){case 0:this._eraseInBufferLine(this._terminal.buffer.y,this._terminal.buffer.x,this._terminal.cols);break;case 1:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.buffer.x+1);break;case 2:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.cols)}this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.insertLines=function(e){var t=e[0];t<1&&(t=1);for(var i=this._terminal.buffer,r=i.y+i.ybase,n=this._terminal.rows-1-i.scrollBottom,o=this._terminal.rows-1+i.ybase-n+1;t--;)i.lines.splice(o-1,1),i.lines.splice(r,0,i.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(i.y),this._terminal.updateRange(i.scrollBottom)},t.prototype.deleteLines=function(e){var t=e[0];t<1&&(t=1);var i,r=this._terminal.buffer,n=r.y+r.ybase;for(i=this._terminal.rows-1-r.scrollBottom,i=this._terminal.rows-1+r.ybase-i;t--;)r.lines.splice(n,1),r.lines.splice(i,0,r.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(r.y),this._terminal.updateRange(r.scrollBottom)},t.prototype.deleteChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).deleteCells(this._terminal.buffer.x,e[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.scrollUp=function(e){for(var t=e[0]||1,i=this._terminal.buffer;t--;)i.lines.splice(i.ybase+i.scrollTop,1),i.lines.splice(i.ybase+i.scrollBottom,0,i.getBlankLine(f.DEFAULT_ATTR_DATA));this._terminal.updateRange(i.scrollTop),this._terminal.updateRange(i.scrollBottom)},t.prototype.scrollDown=function(e,t){if(e.length<2&&!t){for(var i=e[0]||1,r=this._terminal.buffer;i--;)r.lines.splice(r.ybase+r.scrollBottom,1),r.lines.splice(r.ybase+r.scrollTop,0,r.getBlankLine(f.DEFAULT_ATTR_DATA));this._terminal.updateRange(r.scrollTop),this._terminal.updateRange(r.scrollBottom)}},t.prototype.eraseChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).replaceCells(this._terminal.buffer.x,this._terminal.buffer.x+(e[0]||1),this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()))},t.prototype.cursorBackwardTab=function(e){for(var t=e[0]||1,i=this._terminal.buffer;t--;)i.x=i.prevStop()},t.prototype.charPosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.hPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.repeatPrecedingCharacter=function(e){var t=this._terminal.buffer,i=t.lines.get(t.ybase+t.y);i.loadCell(t.x-1,this._workCell),i.replaceCells(t.x,t.x+(e[0]||1),void 0!==this._workCell.content?this._workCell:t.getNullCell(f.DEFAULT_ATTR_DATA))},t.prototype.sendDeviceAttributes=function(e,t){e[0]>0||(t?">"===t&&(this._terminal.is("xterm")?this._terminal.handler(o.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(o.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(e[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(o.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(o.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(o.C0.ESC+"[?6c"))},t.prototype.linePosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y=t-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},t.prototype.vPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},t.prototype.hVPosition=function(e){e[0]<1&&(e[0]=1),e[1]<1&&(e[1]=1),this._terminal.buffer.y=e[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=e[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.tabClear=function(e){var t=e[0];t<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===t&&(this._terminal.buffer.tabs={})},t.prototype.setMode=function(e,t){if(e.length>1)for(var i=0;i<e.length;i++)this.setMode([e[i]]);else if(t){if("?"===t)switch(e[0]){case 1:this._terminal.applicationCursor=!0;break;case 2:this._terminal.setgCharset(0,s.DEFAULT_CHARSET),this._terminal.setgCharset(1,s.DEFAULT_CHARSET),this._terminal.setgCharset(2,s.DEFAULT_CHARSET),this._terminal.setgCharset(3,s.DEFAULT_CHARSET);break;case 3:this._terminal.savedCols=this._terminal.cols,this._terminal.resize(132,this._terminal.rows);break;case 6:this._terminal.originMode=!0;break;case 7:this._terminal.wraparoundMode=!0;break;case 12:break;case 66:this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=9===e[0],this._terminal.vt200Mouse=1e3===e[0],this._terminal.normalMouse=e[0]>1e3,this._terminal.mouseEvents=!0,this._terminal.element&&this._terminal.element.classList.add("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.disable(),this._terminal.log("Binding to mouse events.");break;case 1004:this._terminal.sendFocus=!0;break;case 1005:this._terminal.utfMouse=!0;break;case 1006:this._terminal.sgrMouse=!0;break;case 1015:this._terminal.urxvtMouse=!0;break;case 25:this._terminal.cursorHidden=!1;break;case 1048:this.saveCursor(e);break;case 1049:this.saveCursor(e);case 47:case 1047:this._terminal.buffers.activateAltBuffer(this._terminal.eraseAttrData()),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}}else switch(e[0]){case 4:this._terminal.insertMode=!0}},t.prototype.resetMode=function(e,t){if(e.length>1)for(var i=0;i<e.length;i++)this.resetMode([e[i]]);else if(t){if("?"===t)switch(e[0]){case 1:this._terminal.applicationCursor=!1;break;case 3:132===this._terminal.cols&&this._terminal.savedCols&&this._terminal.resize(this._terminal.savedCols,this._terminal.rows),delete this._terminal.savedCols;break;case 6:this._terminal.originMode=!1;break;case 7:this._terminal.wraparoundMode=!1;break;case 12:break;case 66:this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=!1,this._terminal.vt200Mouse=!1,this._terminal.normalMouse=!1,this._terminal.mouseEvents=!1,this._terminal.element&&this._terminal.element.classList.remove("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.enable();break;case 1004:this._terminal.sendFocus=!1;break;case 1005:this._terminal.utfMouse=!1;break;case 1006:this._terminal.sgrMouse=!1;break;case 1015:this._terminal.urxvtMouse=!1;break;case 25:this._terminal.cursorHidden=!0;break;case 1048:this.restoreCursor(e);break;case 1049:case 47:case 1047:this._terminal.buffers.activateNormalBuffer(),1049===e[0]&&this.restoreCursor(e),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}}else switch(e[0]){case 4:this._terminal.insertMode=!1}},t.prototype.charAttributes=function(e){if(1===e.length&&0===e[0])return this._terminal.curAttrData.fg=f.DEFAULT_ATTR_DATA.fg,void(this._terminal.curAttrData.bg=f.DEFAULT_ATTR_DATA.bg);for(var t,i=e.length,r=this._terminal.curAttrData,n=0;n<i;n++)(t=e[n])>=30&&t<=37?(r.fg&=-50331904,r.fg|=16777216|t-30):t>=40&&t<=47?(r.bg&=-50331904,r.bg|=16777216|t-40):t>=90&&t<=97?(r.fg&=-50331904,r.fg|=16777224|t-90):t>=100&&t<=107?(r.bg&=-50331904,r.bg|=16777224|t-100):0===t?(r.fg=f.DEFAULT_ATTR_DATA.fg,r.bg=f.DEFAULT_ATTR_DATA.bg):1===t?r.fg|=134217728:3===t?r.bg|=67108864:4===t?r.fg|=268435456:5===t?r.fg|=536870912:7===t?r.fg|=67108864:8===t?r.fg|=1073741824:2===t?r.bg|=134217728:22===t?(r.fg&=-134217729,r.bg&=-134217729):23===t?r.bg&=-67108865:24===t?r.fg&=-268435457:25===t?r.fg&=-536870913:27===t?r.fg&=-67108865:28===t?r.fg&=-1073741825:39===t?(r.fg&=-67108864,r.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):49===t?(r.bg&=-67108864,r.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):38===t?2===e[n+1]?(n+=2,r.fg|=50331648,r.fg&=-16777216,r.fg|=f.AttributeData.fromColorRGB([e[n],e[n+1],e[n+2]]),n+=2):5===e[n+1]&&(t=255&e[n+=2],r.fg&=-50331904,r.fg|=33554432|t):48===t?2===e[n+1]?(n+=2,r.bg|=50331648,r.bg&=-16777216,r.bg|=f.AttributeData.fromColorRGB([e[n],e[n+1],e[n+2]]),n+=2):5===e[n+1]&&(t=255&e[n+=2],r.bg&=-50331904,r.bg|=33554432|t):100===t?(r.fg&=-67108864,r.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._terminal.error("Unknown SGR attribute: %d.",t)},t.prototype.deviceStatus=function(e,t){if(t){if("?"===t)switch(e[0]){case 6:i=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1,this._onData.fire(o.C0.ESC+"[?"+i+";"+r+"R")}}else switch(e[0]){case 5:this._onData.fire(o.C0.ESC+"[0n");break;case 6:var i=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1;this._onData.fire(o.C0.ESC+"["+i+";"+r+"R")}},t.prototype.softReset=function(e,t){"!"===t&&(this._terminal.cursorHidden=!1,this._terminal.insertMode=!1,this._terminal.originMode=!1,this._terminal.wraparoundMode=!0,this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.applicationCursor=!1,this._terminal.buffer.scrollTop=0,this._terminal.buffer.scrollBottom=this._terminal.rows-1,this._terminal.curAttrData=f.DEFAULT_ATTR_DATA,this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null])},t.prototype.setCursorStyle=function(e,t){if(" "===t){var i=e[0]<1?1:e[0];switch(i){case 1:case 2:this._terminal.setOption("cursorStyle","block");break;case 3:case 4:this._terminal.setOption("cursorStyle","underline");break;case 5:case 6:this._terminal.setOption("cursorStyle","bar")}var r=i%2==1;this._terminal.setOption("cursorBlink",r)}},t.prototype.setScrollRegion=function(e,t){t||(this._terminal.buffer.scrollTop=(e[0]||1)-1,this._terminal.buffer.scrollBottom=(e[1]&&e[1]<=this._terminal.rows?e[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)},t.prototype.saveCursor=function(e){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y,this._terminal.buffer.savedCurAttrData.fg=this._terminal.curAttrData.fg,this._terminal.buffer.savedCurAttrData.bg=this._terminal.curAttrData.bg},t.prototype.restoreCursor=function(e){this._terminal.buffer.x=this._terminal.buffer.savedX||0,this._terminal.buffer.y=this._terminal.buffer.savedY||0,this._terminal.curAttrData.fg=this._terminal.buffer.savedCurAttrData.fg,this._terminal.curAttrData.bg=this._terminal.buffer.savedCurAttrData.bg},t.prototype.setTitle=function(e){this._terminal.handleTitle(e)},t.prototype.nextLine=function(){this._terminal.buffer.x=0,this.index()},t.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},t.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},t.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0),this._terminal.setgCharset(0,s.DEFAULT_CHARSET)},t.prototype.selectCharset=function(e){2===e.length?"/"!==e[0]&&this._terminal.setgCharset(_[e[0]],s.CHARSETS[e[1]]||s.DEFAULT_CHARSET):this.selectDefaultCharset()},t.prototype.index=function(){this._terminal.index()},t.prototype.tabSet=function(){this._terminal.tabSet()},t.prototype.reverseIndex=function(){this._terminal.reverseIndex()},t.prototype.reset=function(){this._parser.reset(),this._terminal.reset()},t.prototype.setgLevel=function(e){this._terminal.setgLevel(e)},t}(h.Disposable);t.InputHandler=m},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"\t",c:"\f",d:"\r",e:"\n",f:"°",g:"±",h:"",i:"\v",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=null,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(10);function a(e,t){for(var i=t-e,r=new Array(i);i--;)r[i]=--t;return r}var l=function(){function e(e){this.table="undefined"==typeof Uint8Array?new Array(e):new Uint8Array(e)}return e.prototype.add=function(e,t,i,r){this.table[t<<8|e]=(0|i)<<4|(void 0===r?t:r)},e.prototype.addMany=function(e,t,i,r){for(var n=0;n<e.length;n++)this.add(e[n],t,i,r)},e}();t.TransitionTable=l;var h=a(32,127),c=a(0,24);c.push(25),c.push.apply(c,a(28,32)),t.VT500_TRANSITION_TABLE=function(){var e,t=new l(4095),i=a(0,14);for(e in i)for(var r=0;r<=160;++r)t.add(r,e,1,0);for(e in t.addMany(h,0,2,0),i)t.addMany([24,26,153,154],e,3,0),t.addMany(a(128,144),e,3,0),t.addMany(a(144,152),e,3,0),t.add(156,e,0,0),t.add(27,e,11,1),t.add(157,e,4,8),t.addMany([152,158,159],e,0,7),t.add(155,e,11,3),t.add(144,e,11,9);return t.addMany(c,0,3,0),t.addMany(c,1,3,1),t.add(127,1,0,1),t.addMany(c,8,0,8),t.addMany(c,3,3,3),t.add(127,3,0,3),t.addMany(c,4,3,4),t.add(127,4,0,4),t.addMany(c,6,3,6),t.addMany(c,5,3,5),t.add(127,5,0,5),t.addMany(c,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(h,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(a(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(h,7,0,7),t.addMany(c,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(a(64,127),3,7,0),t.addMany(a(48,58),3,8,4),t.add(59,3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(a(48,58),4,8,4),t.add(59,4,8,4),t.addMany(a(64,127),4,7,0),t.addMany([58,60,61,62,63],4,0,6),t.addMany(a(32,64),6,0,6),t.add(127,6,0,6),t.addMany(a(64,127),6,0,0),t.add(58,3,0,6),t.addMany(a(32,48),3,9,5),t.addMany(a(32,48),5,9,5),t.addMany(a(48,64),5,0,6),t.addMany(a(64,127),5,7,0),t.addMany(a(32,48),4,9,5),t.addMany(a(32,48),1,9,2),t.addMany(a(32,48),2,9,2),t.addMany(a(48,127),2,10,0),t.addMany(a(48,80),1,10,0),t.addMany(a(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(a(96,127),1,10,0),t.add(80,1,11,9),t.addMany(c,9,0,9),t.add(127,9,0,9),t.addMany(a(28,32),9,0,9),t.addMany(a(32,48),9,9,12),t.add(58,9,0,11),t.addMany(a(48,58),9,8,10),t.add(59,9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(c,11,0,11),t.addMany(a(32,128),11,0,11),t.addMany(a(28,32),11,0,11),t.addMany(c,10,0,10),t.add(127,10,0,10),t.addMany(a(28,32),10,0,10),t.addMany(a(48,58),10,8,10),t.add(59,10,8,10),t.addMany([58,60,61,62,63],10,0,11),t.addMany(a(32,48),10,9,12),t.addMany(c,12,0,12),t.add(127,12,0,12),t.addMany(a(28,32),12,0,12),t.addMany(a(32,48),12,9,12),t.addMany(a(48,64),12,0,11),t.addMany(a(64,127),12,12,13),t.addMany(a(64,127),10,12,13),t.addMany(a(64,127),9,12,13),t.addMany(c,13,13,13),t.addMany(h,13,13,13),t.add(127,13,0,13),t.addMany([27,156],13,14,0),t.add(160,8,5,8),t}();var u=function(){function e(){}return e.prototype.hook=function(e,t,i){},e.prototype.put=function(e,t,i){},e.prototype.unhook=function(){},e}(),f=function(e){function i(i){void 0===i&&(i=t.VT500_TRANSITION_TABLE);var r=e.call(this)||this;return r.TRANSITIONS=i,r.initialState=0,r.currentState=r.initialState,r._osc="",r._params=[0],r._collect="",r._printHandlerFb=function(e,t,i){},r._executeHandlerFb=function(e){},r._csiHandlerFb=function(e,t,i){},r._escHandlerFb=function(e,t){},r._oscHandlerFb=function(e,t){},r._dcsHandlerFb=new u,r._errorHandlerFb=function(e){return e},r._printHandler=r._printHandlerFb,r._executeHandlers=Object.create(null),r._csiHandlers=Object.create(null),r._escHandlers=Object.create(null),r._oscHandlers=Object.create(null),r._dcsHandlers=Object.create(null),r._activeDcsHandler=null,r._errorHandler=r._errorHandlerFb,r.setEscHandler("\\",function(){}),r}return n(i,e),i.prototype.dispose=function(){this._printHandlerFb=null,this._executeHandlerFb=null,this._csiHandlerFb=null,this._escHandlerFb=null,this._oscHandlerFb=null,this._dcsHandlerFb=null,this._errorHandlerFb=null,this._printHandler=null,this._executeHandlers=null,this._escHandlers=null,this._csiHandlers=null,this._oscHandlers=null,this._dcsHandlers=null,this._activeDcsHandler=null,this._errorHandler=null},i.prototype.setPrintHandler=function(e){this._printHandler=e},i.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},i.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},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,t){var i=e.charCodeAt(0);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);var r=this._csiHandlers[i];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},i.prototype.setCsiHandler=function(e,t){this._csiHandlers[e.charCodeAt(0)]=[t]},i.prototype.clearCsiHandler=function(e){this._csiHandlers[e.charCodeAt(0)]&&delete this._csiHandlers[e.charCodeAt(0)]},i.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},i.prototype.setEscHandler=function(e,t){this._escHandlers[e]=t},i.prototype.clearEscHandler=function(e){this._escHandlers[e]&&delete this._escHandlers[e]},i.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},i.prototype.addOscHandler=function(e,t){void 0===this._oscHandlers[e]&&(this._oscHandlers[e]=[]);var i=this._oscHandlers[e];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},i.prototype.setOscHandler=function(e,t){this._oscHandlers[e]=[t]},i.prototype.clearOscHandler=function(e){this._oscHandlers[e]&&delete this._oscHandlers[e]},i.prototype.setOscHandlerFallback=function(e){this._oscHandlerFb=e},i.prototype.setDcsHandler=function(e,t){this._dcsHandlers[e]=t},i.prototype.clearDcsHandler=function(e){this._dcsHandlers[e]&&delete this._dcsHandlers[e]},i.prototype.setDcsHandlerFallback=function(e){this._dcsHandlerFb=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._osc="",this._params=[0],this._collect="",this._activeDcsHandler=null},i.prototype.parse=function(e,t){for(var i=0,r=0,n=!1,o=this.currentState,a=-1,l=-1,h=this._osc,c=this._collect,u=this._params,f=this.TRANSITIONS.table,d=this._activeDcsHandler,_=null,p=0;p<t;++p)if(i=e[p],0===o&&i>31&&i<128){a=~a?a:p;do{p++}while(p<t&&e[p]>31&&e[p]<128);p--}else if(4===o&&i>47&&i<57)u[u.length-1]=10*u[u.length-1]+i-48;else{switch((r=f[o<<8|(i<160?i:160)])>>4){case 2:a=~a?a:p;break;case 3:~a&&(this._printHandler(e,a,p),a=-1),(_=this._executeHandlers[i])?_():this._executeHandlerFb(i);break;case 0:~a?(this._printHandler(e,a,p),a=-1):~l&&(d.put(e,l,p),l=-1);break;case 1:if(i>159)switch(o){case 0:a=~a?a:p;break;case 6:r|=6;break;case 11:r|=11;break;case 13:l=~l?l:p,r|=13;break;default:n=!0}else n=!0;if(n){if(this._errorHandler({position:p,code:i,currentState:o,print:a,dcs:l,osc:h,collect:c,params:u,abort:!1}).abort)return;n=!1}break;case 7:for(var m=this._csiHandlers[i],y=m?m.length-1:-1;y>=0&&!1===m[y](u,c);y--);y<0&&this._csiHandlerFb(c,u,i);break;case 8:59===i?u.push(0):u[u.length-1]=10*u[u.length-1]+i-48;break;case 9:c+=String.fromCharCode(i);break;case 10:(_=this._escHandlers[c+String.fromCharCode(i)])?_(c,i):this._escHandlerFb(c,i);break;case 11:~a&&(this._printHandler(e,a,p),a=-1),h="",u=[0],c="",l=-1;break;case 12:(d=this._dcsHandlers[c+String.fromCharCode(i)])||(d=this._dcsHandlerFb),d.hook(c,u,i);break;case 13:l=~l?l:p;break;case 14:d&&(~l&&d.put(e,l,p),d.unhook(),d=null),27===i&&(r|=1),h="",u=[0],c="",l=-1;break;case 4:~a&&(this._printHandler(e,a,p),a=-1),h="";break;case 5:for(var g=p+1;;g++)if(g>=t||(i=e[g])<32||i>127&&i<=159){h+=s.utf32ToString(e,p,g),p=g-1;break}break;case 6:if(h&&24!==i&&26!==i){var C=h.indexOf(";");if(-1===C)this._oscHandlerFb(-1,h);else{for(var v=parseInt(h.substring(0,C)),b=h.substring(C+1),w=this._oscHandlers[v],S=w?w.length-1:-1;S>=0&&!1===w[S](b);S--);S<0&&this._oscHandlerFb(v,b)}}27===i&&(r|=1),h="",u=[0],c="",l=-1}o=15&r}0===o&&~a?this._printHandler(e,a,t):13===o&&~l&&d&&d.put(e,l,t),this._osc=h,this._collect=c,this._params=u,this._activeDcsHandler=d,this.currentState=o},i}(o.Disposable);t.EscapeSequenceParser=f},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(41),s=i(47),a=i(48),l=i(49),h=i(20),c=function(e){function t(t,i){var r=e.call(this)||this;r._terminal=t,r._colors=i;var n=r._terminal.options.allowTransparency;return r._characterJoinerRegistry=new h.CharacterJoinerRegistry(t),r._renderLayers=[new o.TextRenderLayer(r._terminal.screenElement,0,r._colors,r._characterJoinerRegistry,n),new s.SelectionRenderLayer(r._terminal.screenElement,1,r._colors),new l.LinkRenderLayer(r._terminal.screenElement,2,r._colors,r._terminal),new a.CursorRenderLayer(r._terminal.screenElement,3,r._colors)],r.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},r._devicePixelRatio=window.devicePixelRatio,r._updateDimensions(),r.onOptionsChanged(),r}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._renderLayers.forEach(function(e){return e.dispose()})},t.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._terminal.cols,this._terminal.rows))},t.prototype.setColors=function(e){var t=this;this._colors=e,this._renderLayers.forEach(function(e){e.setColors(t._terminal,t._colors),e.reset(t._terminal)})},t.prototype.onResize=function(e,t){var i=this;this._updateDimensions(),this._renderLayers.forEach(function(e){return e.resize(i._terminal,i.dimensions)}),this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.onCharSizeChanged=function(){this.onResize(this._terminal.cols,this._terminal.rows)},t.prototype.onBlur=function(){var e=this;this._runOperation(function(t){return t.onBlur(e._terminal)})},t.prototype.onFocus=function(){var e=this;this._runOperation(function(t){return t.onFocus(e._terminal)})},t.prototype.onSelectionChanged=function(e,t,i){var r=this;void 0===i&&(i=!1),this._runOperation(function(n){return n.onSelectionChanged(r._terminal,e,t,i)})},t.prototype.onCursorMove=function(){var e=this;this._runOperation(function(t){return t.onCursorMove(e._terminal)})},t.prototype.onOptionsChanged=function(){var e=this;this._runOperation(function(t){return t.onOptionsChanged(e._terminal)})},t.prototype.clear=function(){var e=this;this._runOperation(function(t){return t.reset(e._terminal)})},t.prototype._runOperation=function(e){this._renderLayers.forEach(function(t){return e(t)})},t.prototype.renderRows=function(e,t){var i=this;this._renderLayers.forEach(function(r){return r.onGridChanged(i._terminal,e,t)})},t.prototype._updateDimensions=function(){this._terminal.charMeasure.width&&this._terminal.charMeasure.height&&(this.dimensions.scaledCharWidth=Math.floor(this._terminal.charMeasure.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.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._terminal.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols)},t.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},t}(i(0).Disposable);t.Renderer=c},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),s=i(9),a=i(1),l=i(20),h=function(e){function t(t,i,r,n,s){var l=e.call(this,t,"text",i,s,r)||this;return l._characterOverlapCache={},l._workCell=new a.CellData,l._state=new o.GridCache,l._characterJoinerRegistry=n,l}return n(t,e),t.prototype.resize=function(t,i){e.prototype.resize.call(this,t,i);var r=this._getFont(t,!1,!1);this._characterWidth===i.scaledCharWidth&&this._characterFont===r||(this._characterWidth=i.scaledCharWidth,this._characterFont=r,this._characterOverlapCache={}),this._state.clear(),this._state.resize(t.cols,t.rows)},t.prototype.reset=function(e){this._state.clear(),this.clearAll()},t.prototype._forEachCell=function(e,t,i,r,n){for(var o=t;o<=i;o++)for(var s=o+e.buffer.ydisp,h=e.buffer.lines.get(s),c=r?r.getJoinedCharacters(s):[],u=0;u<e.cols;u++){h.loadCell(u,this._workCell);var f=this._workCell,d=!1,_=u;if(0!==f.getWidth()){if(c.length>0&&u===c[0][0]){d=!0;var p=c.shift();f=new l.JoinedCellData(this._workCell,h.translateToString(!0,p[0],p[1]),p[1]-p[0]),_=p[1]-1}!d&&this._isOverlapping(f)&&_<h.length-1&&h.getCodePoint(_+1)===a.NULL_CELL_CODE&&(f.content&=-12582913,f.content|=2<<22),n(f,u,o),u=_}}},t.prototype._drawBackground=function(e,t,i){var r=this,n=this._ctx,o=e.cols,s=0,l=0,h=null;n.save(),this._forEachCell(e,t,i,null,function(e,t,i){var c=null;e.isInverse()?c=e.isFgDefault()?r._colors.foreground.css:e.isFgRGB()?"rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":r._colors.ansi[e.getFgColor()].css:e.isBgRGB()?c="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":e.isBgPalette()&&(c=r._colors.ansi[e.getBgColor()].css),null===h&&(s=t,l=i),i!==l?(n.fillStyle=h,r.fillCells(s,l,o-s,1),s=t,l=i):h!==c&&(n.fillStyle=h,r.fillCells(s,l,t-s,1),s=t,l=i),h=c}),null!==h&&(n.fillStyle=h,this.fillCells(s,l,o-s,1)),n.restore()},t.prototype._drawForeground=function(e,t,i){var r=this;this._forEachCell(e,t,i,this._characterJoinerRegistry,function(t,i,n){if(!t.isInvisible()&&(r.drawChars(e,t,i,n),t.isUnderline())){if(r._ctx.save(),t.isInverse())t.isBgDefault()?r._ctx.fillStyle=r._colors.background.css:t.isBgRGB()?r._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(t.getBgColor()).join(",")+")":r._ctx.fillStyle=r._colors.ansi[t.getBgColor()].css;else if(t.isFgDefault())r._ctx.fillStyle=r._colors.foreground.css;else if(t.isFgRGB())r._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var o=t.getFgColor();e.options.drawBoldTextInBrightColors&&t.isBold()&&o<8&&(o+=8),r._ctx.fillStyle=r._colors.ansi[o].css}r.fillBottomLineAtCells(i,n,t.getWidth()),r._ctx.restore()}})},t.prototype.onGridChanged=function(e,t,i){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this.clearCells(0,t,e.cols,i-t+1),this._drawBackground(e,t,i),this._drawForeground(e,t,i))},t.prototype.onOptionsChanged=function(e){this.setTransparency(e,e.options.allowTransparency)},t.prototype._isOverlapping=function(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;var t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i,i},t}(s.BaseRenderLayer);t.TextRenderLayer=h},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var i=0;i<e;i++){this.cache.length<=i&&this.cache.push([]);for(var r=this.cache[i].length;r<t;r++)this.cache[i].push(null);this.cache[i].length=t}this.cache.length=e},e.prototype.clear=function(){for(var e=0;e<this.cache.length;e++)for(var t=0;t<this.cache[e].length;t++)this.cache[e][t]=null},e}();t.GridCache=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(4),s=i(12),a=i(18),l=i(19),h=i(44),c=i(6),u=1024,f=1024,d={css:"rgba(0, 0, 0, 0)",rgba:0};function _(e){return e.code<<21|e.bg<<12|e.fg<<3|(e.bold?0:4)+(e.dim?0:2)+(e.italic?0:1)}t.getGlyphCacheKey=_;var p=function(e){function t(t,i){var r=e.call(this)||this;r._config=i,r._drawToCacheCount=0,r._glyphsWaitingOnBitmap=[],r._bitmapCommitTimeout=null,r._bitmap=null,r._cacheCanvas=t.createElement("canvas"),r._cacheCanvas.width=u,r._cacheCanvas.height=f,r._cacheCtx=r._cacheCanvas.getContext("2d",{alpha:!0});var n=t.createElement("canvas");n.width=r._config.scaledCharWidth,n.height=r._config.scaledCharHeight,r._tmpCtx=n.getContext("2d",{alpha:r._config.allowTransparency}),r._width=Math.floor(u/r._config.scaledCharWidth),r._height=Math.floor(f/r._config.scaledCharHeight);var o=r._width*r._height;return r._cacheMap=new h.default(o),r._cacheMap.prealloc(o),r}return n(t,e),t.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},t.prototype.beginFrame=function(){this._drawToCacheCount=0},t.prototype.draw=function(e,t,i,r){if(32===t.code)return!0;if(!this._canCache(t))return!1;var n=_(t),o=this._cacheMap.get(n);if(null!=o)return this._drawFromCache(e,o,i,r),!0;if(this._drawToCacheCount<100){var s;s=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var a=this._drawToCache(t,s);return this._cacheMap.set(n,a),this._drawFromCache(e,a,i,r),!0}return!1},t.prototype._canCache=function(e){return e.code<256},t.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},t.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},t.prototype._drawFromCache=function(e,t,i,r){if(!t.isEmpty){var n=this._toCoordinateX(t.index),o=this._toCoordinateY(t.index);e.drawImage(t.inBitmap?this._bitmap:this._cacheCanvas,n,o,this._config.scaledCharWidth,this._config.scaledCharHeight,i,r,this._config.scaledCharWidth,this._config.scaledCharHeight)}},t.prototype._getColorFromAnsiIndex=function(e){return e<this._config.colors.ansi.length?this._config.colors.ansi[e]:a.DEFAULT_ANSI_COLORS[e]},t.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?d:e.bg===o.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},t.prototype._getForegroundColor=function(e){return e.fg===o.INVERTED_DEFAULT_COLOR?this._config.colors.background:e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},t.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var i=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=i.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var r=e.bold?this._config.fontWeightBold:this._config.fontWeight,n=e.italic?"italic":"";this._tmpCtx.font=n+" "+r+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(e).css,e.dim&&(this._tmpCtx.globalAlpha=o.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var s=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),a=!1;this._config.allowTransparency||(a=l.clearColor(s,i));var h=this._toCoordinateX(t),c=this._toCoordinateY(t);this._cacheCtx.putImageData(s,h,c);var u={index:t,isEmpty:a,inBitmap:!1};return this._addGlyphToBitmap(u),u},t.prototype._addGlyphToBitmap=function(e){var t=this;"createImageBitmap"in window&&!c.isFirefox&&!c.isSafari&&(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout(function(){return t._generateBitmap()},100)))},t.prototype._generateBitmap=function(){var e=this,t=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(i){e._bitmap=i;for(var r=0;r<t.length;r++)t[r].inBitmap=!0}),this._bitmapCommitTimeout=null},t}(s.default);t.default=p},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.capacity=e,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return e.prototype._unlinkNode=function(e){var t=e.prev,i=e.next;e===this._head&&(this._head=i),e===this._tail&&(this._tail=t),null!==t&&(t.next=i),null!==i&&(i.prev=t)},e.prototype._appendNode=function(e){var t=this._tail;null!==t&&(t.next=e),e.prev=t,e.next=null,this._tail=e,null===this._head&&(this._head=e)},e.prototype.prealloc=function(e){for(var t=this._nodePool,i=0;i<e;i++)t.push({prev:null,next:null,key:null,value:null})},e.prototype.get=function(e){var t=this._map[e];return void 0!==t?(this._unlinkNode(t),this._appendNode(t),t.value):null},e.prototype.peekValue=function(e){var t=this._map[e];return void 0!==t?t.value:null},e.prototype.peek=function(){var e=this._head;return null===e?null:e.value},e.prototype.set=function(e,t){var i=this._map[e];if(void 0!==i)i=this._map[e],this._unlinkNode(i),i.value=t;else if(this.size>=this.capacity)i=this._head,this._unlinkNode(i),delete this._map[i.key],i.key=e,i.value=t,this._map[e]=i;else{var r=this._nodePool;r.length>0?((i=r.pop()).key=e,i.value=t):i={prev:null,next:null,key:e,value:t},this._map[e]=i,this.size++}this._appendNode(i)},e}();t.default=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,i){return e.call(this)||this}return n(t,e),t.prototype.draw=function(e,t,i,r){return!1},t}(i(12).default);t.default=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(4),s=i(19),a=i(12),l=i(11),h=i(7),c=function(e){function t(t,i){var r=e.call(this)||this;return r._document=t,r._config=i,r._canvasFactory=function(e,t){var i=r._document.createElement("canvas");return i.width=e,i.height=t,i},r}return n(t,e),t.prototype._doWarmUp=function(){var e=this,t=s.generateStaticCharAtlasTexture(window,this._canvasFactory,this._config);t instanceof HTMLCanvasElement?this._texture=t:t.then(function(t){e._texture=t})},t.prototype._isCached=function(e,t){var i=e.code<256,r=e.fg<16,n=e.fg===h.DEFAULT_COLOR,o=e.bg===h.DEFAULT_COLOR;return i&&(r||n)&&o&&!e.italic},t.prototype.draw=function(e,t,i,r){if(null===this._texture||void 0===this._texture)return!1;var n=0;if(l.is256Color(t.fg)?n=2+t.fg+(t.bold?16:0):t.fg===h.DEFAULT_COLOR&&t.bold&&(n=1),!this._isCached(t,n))return!1;e.save();var s=this._config.scaledCharWidth+o.CHAR_ATLAS_CELL_SPACING,a=this._config.scaledCharHeight+o.CHAR_ATLAS_CELL_SPACING;return t.dim&&(e.globalAlpha=o.DIM_OPACITY),e.drawImage(this._texture,t.code*s,n*a,s,this._config.scaledCharHeight,i,r,s,this._config.scaledCharHeight),e.restore(),!0},t}(a.default);t.default=c},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,i,r){var n=e.call(this,t,"selection",i,!0,r)||this;return n._clearState(),n}return n(t,e),t.prototype._clearState=function(){this._state={start:null,end:null,columnSelectMode:null,ydisp:null}},t.prototype.resize=function(t,i){e.prototype.resize.call(this,t,i),this._clearState()},t.prototype.reset=function(e){this._state.start&&this._state.end&&(this._clearState(),this.clearAll())},t.prototype.onSelectionChanged=function(e,t,i,r){if(this._didStateChange(t,i,r,e.buffer.ydisp))if(this.clearAll(),t&&i){var n=t[1]-e.buffer.ydisp,o=i[1]-e.buffer.ydisp,s=Math.max(n,0),a=Math.min(o,e.rows-1);if(!(s>=e.rows||a<0)){if(this._ctx.fillStyle=this._colors.selection.css,r){var l=t[0],h=i[0]-l,c=a-s+1;this.fillCells(l,s,h,c)}else{l=n===s?t[0]:0;var u=s===a?i[0]:e.cols;this.fillCells(l,s,u-l,1);var f=Math.max(a-s-1,0);if(this.fillCells(0,s+1,e.cols,f),s!==a){var d=o===a?i[0]:e.cols;this.fillCells(0,a,d,1)}}this._state.start=[t[0],t[1]],this._state.end=[i[0],i[1]],this._state.columnSelectMode=r,this._state.ydisp=e.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,i,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||r!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},t}(i(9).BaseRenderLayer);t.SelectionRenderLayer=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(9),s=i(1),a=function(e){function t(t,i,r){var n=e.call(this,t,"cursor",i,!0,r)||this;return n._cell=new s.CellData,n._state={x:null,y:null,isFocused:null,style:null,width:null},n._cursorRenderers={bar:n._renderBarCursor.bind(n),block:n._renderBlockCursor.bind(n),underline:n._renderUnderlineCursor.bind(n)},n}return n(t,e),t.prototype.resize=function(t,i){e.prototype.resize.call(this,t,i),this._state={x:null,y:null,isFocused:null,style:null,width:null}},t.prototype.reset=function(e){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(e))},t.prototype.onBlur=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),e.refresh(e.buffer.y,e.buffer.y)},t.prototype.onFocus=function(e){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(e):e.refresh(e.buffer.y,e.buffer.y)},t.prototype.onOptionsChanged=function(e){var t=this;e.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new l(e,function(){t._render(e,!0)})):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),e.refresh(e.buffer.y,e.buffer.y))},t.prototype.onCursorMove=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype.onGridChanged=function(e,t,i){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(e,!1):this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype._render=function(e,t){if(e.cursorState&&!e.cursorHidden){var i=e.buffer.ybase+e.buffer.y,r=i-e.buffer.ydisp;if(r<0||r>=e.rows)this._clearCursor();else if(e.buffer.lines.get(i).loadCell(e.buffer.x,this._cell),void 0!==this._cell.content){if(!e.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(e,e.buffer.x,r,this._cell),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,void(this._state.width=this._cell.getWidth());if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===e.buffer.x&&this._state.y===r&&this._state.isFocused===e.isFocused&&this._state.style===e.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.options.cursorStyle||"block"](e,e.buffer.x,r,this._cell),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},t.prototype._clearCursor=function(){this._state&&(this.clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:null,y:null,isFocused:null,style:null,width:null})},t.prototype._renderBarCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(t,i),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(t,i,r.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(e,r,t,i),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(t,i),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,i,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(t,i,r.getWidth(),1),this._ctx.restore()},t}(o.BaseRenderLayer);t.CursorRenderLayer=a;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e.isFocused&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=null),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)},e.prototype.restartBlinkAnimation=function(e){var t=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=null,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null}),t._blinkInterval=setInterval(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=null,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})},600)},e)},e.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=null),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)},e.prototype.resume=function(e){this._animationTimeRestarted=null,this._restartInterval(),this.restartBlinkAnimation(e)},e}()},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(9),s=i(4),a=i(11),l=function(e){function t(t,i,r,n){var o=e.call(this,t,"link",i,!0,r)||this;return o._state=null,n.linkifier.onLinkHover(function(e){return o._onLinkHover(e)}),n.linkifier.onLinkLeave(function(e){return o._onLinkLeave(e)}),o}return n(t,e),t.prototype.resize=function(t,i){e.prototype.resize.call(this,t,i),this._state=null},t.prototype.reset=function(e){this._clearCurrentLink()},t.prototype._clearCurrentLink=function(){if(this._state){this.clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;e>0&&this.clearCells(0,this._state.y1+1,this._state.cols,e),this.clearCells(0,this._state.y2,this._state.x2,1),this._state=null}},t.prototype._onLinkHover=function(e){if(e.fg===s.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:a.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this.fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this.fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t<e.y2;t++)this.fillBottomLineAtCells(0,t,e.cols);this.fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e},t.prototype._onLinkLeave=function(e){this._clearCurrentLink()},t}(o.BaseRenderLayer);t.LinkRenderLayer=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(21),n=i(15),o=i(2),s=function(){function e(e){this._terminal=e,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onLinkHover=new o.EventEmitter2,this._onLinkLeave=new o.EventEmitter2,this._onLinkTooltip=new o.EventEmitter2,this._rowsToLinkify={start:null,end:null}}return Object.defineProperty(e.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),e.prototype.attachToDom=function(e){this._mouseZoneManager=e},e.prototype.linkifyRows=function(t,i){var r=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=i):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,i)),this._mouseZoneManager.clearAll(t,i),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return r._linkifyRows()},e.TIME_BEFORE_LINKIFY))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var t=this._terminal.buffer,i=t.ydisp+this._rowsToLinkify.start;if(!(i>=t.lines.length)){for(var r=t.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,n=Math.ceil(e.OVERSCAN_CHAR_LIMIT/this._terminal.cols),o=this._terminal.buffer.iterator(!1,i,r,n,n);o.hasNext();)for(var s=o.next(),a=0;a<this._linkMatchers.length;a++)this._doLinkifyRow(s.range.first,s.content,this._linkMatchers[a]);this._rowsToLinkify.start=null,this._rowsToLinkify.end=null}},e.prototype.registerLinkMatcher=function(e,t,i){if(void 0===i&&(i={}),!t)throw new Error("handler must be defined");var r={id:this._nextLinkMatcherId++,regex:e,handler:t,matchIndex:i.matchIndex,validationCallback:i.validationCallback,hoverTooltipCallback:i.tooltipCallback,hoverLeaveCallback:i.leaveCallback,willLinkActivate:i.willLinkActivate,priority:i.priority||0};return this._addLinkMatcherToList(r),r.id},e.prototype._addLinkMatcherToList=function(e){if(0!==this._linkMatchers.length){for(var t=this._linkMatchers.length-1;t>=0;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},e.prototype.deregisterLinkMatcher=function(e){for(var t=0;t<this._linkMatchers.length;t++)if(this._linkMatchers[t].id===e)return this._linkMatchers.splice(t,1),!0;return!1},e.prototype._doLinkifyRow=function(e,t,i){for(var r,n=this,o=new RegExp(i.regex.source,i.regex.flags+"g"),s=-1,a=function(){var a=r["number"!=typeof i.matchIndex?0:i.matchIndex];if(!a){if(l._terminal.debug)throw console.log({match:r,matcher:i}),new Error("match found without corresponding matchIndex");return"break"}if(s=t.indexOf(a,s+1),o.lastIndex=s+a.length,s<0)return"break";var h=l._terminal.buffer.stringIndexToBufferIndex(e,s);if(h[0]<0)return"break";var c,u=l._terminal.buffer.lines.get(h[0]).getFg(h[1]);u&&(c=u>>9&511),i.validationCallback?i.validationCallback(a,function(e){n._rowsTimeoutId||e&&n._addLink(h[1],h[0]-n._terminal.buffer.ydisp,a,i,c)}):l._addLink(h[1],h[0]-l._terminal.buffer.ydisp,a,i,c)},l=this;null!==(r=o.exec(t))&&"break"!==a(););},e.prototype._addLink=function(e,t,i,o,s){var a=this,l=n.getStringCellWidth(i),h=e%this._terminal.cols,c=t+Math.floor(e/this._terminal.cols),u=(h+l)%this._terminal.cols,f=c+Math.floor((h+l)/this._terminal.cols);0===u&&(u=this._terminal.cols,f--),this._mouseZoneManager.add(new r.MouseZone(h+1,c+1,u+1,f+1,function(e){if(o.handler)return o.handler(e,i);window.open(i,"_blank")},function(){a._onLinkHover.fire(a._createLinkHoverEvent(h,c,u,f,s)),a._terminal.element.classList.add("xterm-cursor-pointer")},function(e){a._onLinkTooltip.fire(a._createLinkHoverEvent(h,c,u,f,s)),o.hoverTooltipCallback&&o.hoverTooltipCallback(e,i)},function(){a._onLinkLeave.fire(a._createLinkHoverEvent(h,c,u,f,s)),a._terminal.element.classList.remove("xterm-cursor-pointer"),o.hoverLeaveCallback&&o.hoverLeaveCallback()},function(e){return!o.willLinkActivate||o.willLinkActivate(e,i)}))},e.prototype._createLinkHoverEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._terminal.cols,fg:n}},e.TIME_BEFORE_LINKIFY=200,e.OVERSCAN_CHAR_LIMIT=2e3,e}();t.Linkifier=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(22),n=i(6),o=i(52),s=i(53),a=i(1),l=i(2),h=String.fromCharCode(160),c=new RegExp(h,"g"),u=function(){function e(e,t){this._terminal=e,this._charMeasure=t,this._enabled=!0,this._workCell=new a.CellData,this._onLinuxMouseSelection=new l.EventEmitter2,this._onRedrawRequest=new l.EventEmitter2,this._onSelectionChange=new l.EventEmitter2,this._initListeners(),this.enable(),this._model=new o.SelectionModel(e),this._activeSelectionMode=0}return Object.defineProperty(e.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onRedrawRequest",{get:function(){return this._onRedrawRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._removeMouseDownListeners()},Object.defineProperty(e.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),e.prototype._initListeners=function(){var e=this;this._mouseMoveListener=function(t){return e._onMouseMove(t)},this._mouseUpListener=function(t){return e._onMouseUp(t)},this.initBuffersListeners()},e.prototype.initBuffersListeners=function(){var e=this;this._trimListener=this._terminal.buffer.lines.onTrim(function(t){return e._onTrim(t)}),this._terminal.buffers.onBufferActivate(function(t){return e._onBufferActivate(t)})},e.prototype.disable=function(){this.clearSelection(),this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},Object.defineProperty(e.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var i=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var r=e[1];r<=t[1];r++){var o=this._buffer.translateBufferLineToString(r,!0,e[0],t[0]);i.push(o)}}else{var s=e[1]===t[1]?t[0]:void 0;for(i.push(this._buffer.translateBufferLineToString(e[1],!0,e[0],s)),r=e[1]+1;r<=t[1]-1;r++){var a=this._buffer.lines.get(r);o=this._buffer.translateBufferLineToString(r,!0),a.isWrapped?i[i.length-1]+=o:i.push(o)}e[1]!==t[1]&&(a=this._buffer.lines.get(t[1]),o=this._buffer.translateBufferLineToString(t[1],!0,0,t[0]),a.isWrapped?i[i.length-1]+=o:i.push(o))}return i.map(function(e){return e.replace(c," ")}).join(n.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),e.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},e.prototype.refresh=function(e){var t=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return t._refresh()})),n.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},e.prototype._refresh=function(){this._refreshAnimationFrame=null,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},e.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!i||!r)&&this._areCoordsInSelection(t,i,r)},e.prototype._areCoordsInSelection=function(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]},e.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},e.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},e.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._terminal.cols,t],this.refresh(),this._onSelectionChange.fire()},e.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},e.prototype._getMouseBufferCoords=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return t?(t[0]--,t[1]--,t[1]+=this._terminal.buffer.ydisp,t):null},e.prototype._getMouseEventScrollAmount=function(e){var t=r.MouseHelper.getCoordsRelativeToElement(e,this._terminal.screenElement)[1],i=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},e.prototype.shouldForceSelection=function(e){return n.isMac?e.altKey&&this._terminal.options.macOptionClickForcesSelection:e.shiftKey},e.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},e.prototype._addMouseDownListeners=function(){var e=this;this._terminal.element.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.addEventListener("mouseup",this._mouseUpListener),this._dragScrollIntervalTimer=setInterval(function(){return e._dragScroll()},50)},e.prototype._removeMouseDownListeners=function(){this._terminal.element.ownerDocument&&(this._terminal.element.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=null},e.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},e.prototype._onSingleClick=function(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart){this._model.selectionEnd=null;var t=this._buffer.lines.get(this._model.selectionStart[1]);t&&(t.length>=this._model.selectionStart[0]||0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++)}},e.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},e.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},e.prototype.shouldColumnSelect=function(e){return e.altKey&&!(n.isMac&&this._terminal.options.macOptionClickForcesSelection)},e.prototype._onMouseMove=function(e){e.stopImmediatePropagation();var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._terminal.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._terminal.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0)),this._model.selectionEnd[1]<this._buffer.lines.length&&0===this._buffer.lines.get(this._model.selectionEnd[1]).hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++,t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)):this.refresh(!0)},e.prototype._dragScroll=function(){this._dragScrollAmount&&(this._terminal.scrollLines(this._dragScrollAmount,!1),this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._terminal.cols),this._model.selectionEnd[1]=Math.min(this._terminal.buffer.ydisp+this._terminal.rows,this._terminal.buffer.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=this._terminal.buffer.ydisp),this.refresh())},e.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500?new s.AltClickHandler(e,this._terminal).move():this.hasSelection&&this._onSelectionChange.fire()},e.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener&&this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(function(e){return t._onTrim(e)})},e.prototype._convertViewportColToCharacterIndex=function(e,t){for(var i=t[0],r=0;t[0]>=r;r++){var n=e.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:n>1&&t[0]!==r&&(i+=n-1)}return i},e.prototype.setSelection=function(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh()},e.prototype._getWordAt=function(e,t,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),e[0]>=this._terminal.cols)return null;var n=this._buffer.lines.get(e[1]);if(!n)return null;var o=this._buffer.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(n,e),a=s,l=e[0]-s,h=0,c=0,u=0,f=0;if(" "===o.charAt(s)){for(;s>0&&" "===o.charAt(s-1);)s--;for(;a<o.length&&" "===o.charAt(a+1);)a++}else{var d=e[0],_=e[0];0===n.getWidth(d)&&(h++,d--),2===n.getWidth(_)&&(c++,_++);var p=n.getString(_).length;for(p>1&&(f+=p-1,a+=p-1);d>0&&s>0&&!this._isCharWordSeparator(n.loadCell(d-1,this._workCell));){n.loadCell(d-1,this._workCell);var m=this._workCell.getChars().length;0===this._workCell.getWidth()?(h++,d--):m>1&&(u+=m-1,s-=m-1),s--,d--}for(;_<n.length&&a+1<o.length&&!this._isCharWordSeparator(n.loadCell(_+1,this._workCell));){n.loadCell(_+1,this._workCell);var y=this._workCell.getChars().length;2===this._workCell.getWidth()?(c++,_++):y>1&&(f+=y-1,a+=y-1),a++,_++}}a++;var g=s+l-h+u,C=Math.min(this._terminal.cols,a-s+h+c-u-f);if(!t&&""===o.slice(s,a).trim())return null;if(i&&0===g&&32!==n.getCodePoint(0)){var v=this._buffer.lines.get(e[1]-1);if(v&&n.isWrapped&&32!==v.getCodePoint(this._terminal.cols-1)){var b=this._getWordAt([this._terminal.cols-1,e[1]-1],!1,!0,!1);if(b){var w=this._terminal.cols-b.start;g-=w,C+=w}}}if(r&&g+C===this._terminal.cols&&32!==n.getCodePoint(this._terminal.cols-1)){var S=this._buffer.lines.get(e[1]+1);if(S&&S.isWrapped&&32!==S.getCodePoint(0)){var E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(C+=E.length)}}return{start:g,length:C}},e.prototype._selectWordAt=function(e,t){var i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._terminal.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}},e.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var i=e[1];t.start<0;)t.start+=this._terminal.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._terminal.cols;)t.length-=this._terminal.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}},e.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&" ()[]{}'\"".indexOf(e.getChars())>=0},e.prototype._selectLineAt=function(e){var t=this._buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._terminal.cols,t.last],this._model.selectionStartLength=0},e}();t.SelectionManager=u},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._terminal=e,this.clearSelection()}return e.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._terminal.cols,this._terminal.buffer.ybase+this._terminal.rows-1];if(!this.selectionStart)return null;if(!this.selectionEnd||this.areSelectionValuesReversed()){var e=this.selectionStart[0]+this.selectionStartLength;return e>this._terminal.cols?[e%this._terminal.cols,this.selectionStart[1]+Math.floor(e/this._terminal.cols)]:[e,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd},enumerable:!0,configurable:!0}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();t.SelectionModel=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(8),n=function(){function e(e,t){var i;this._mouseEvent=e,this._terminal=t,this._lines=this._terminal.buffer.lines,this._startCol=this._terminal.buffer.x,this._startRow=this._terminal.buffer.y;var r=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows,!1);r&&(i=r.map(function(e){return e-1}),this._endCol=i[0],this._endRow=i[1])}return e.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())},e.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},e.prototype._resetStartingRow=function(){return 0===this._moveToRequestedRow().length?"":o(this._bufferLine(this._startCol,this._startRow,this._startCol,this._startRow-this._wrappedRowsForRow(this._startRow),!1).length,this._sequence("D"))},e.prototype._moveToRequestedRow=function(){var e=this._startRow-this._wrappedRowsForRow(this._startRow),t=this._endRow-this._wrappedRowsForRow(this._endRow);return o(Math.abs(e-t)-this._wrappedRowsCount(),this._sequence(this._verticalDirection()))},e.prototype._moveToRequestedCol=function(){var e;e=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow;var t=this._endRow,i=this._horizontalDirection();return o(this._bufferLine(this._startCol,e,this._endCol,t,"C"===i).length,this._sequence(i))},e.prototype._moveHorizontallyOnly=function(){var e=this._horizontalDirection();return o(Math.abs(this._startCol-this._endCol),this._sequence(e))},e.prototype._wrappedRowsCount=function(){for(var e=0,t=this._startRow-this._wrappedRowsForRow(this._startRow),i=this._endRow-this._wrappedRowsForRow(this._endRow),r=0;r<Math.abs(t-i);r++){var n="A"===this._verticalDirection()?-1:1;this._lines.get(t+n*r).isWrapped&&e++}return e},e.prototype._wrappedRowsForRow=function(e){for(var t=0,i=this._lines.get(e).isWrapped;i&&e>=0&&e<this._terminal.rows;)t++,e--,i=this._lines.get(e).isWrapped;return t},e.prototype._horizontalDirection=function(){var e;return e=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow,this._startCol<this._endCol&&e<=this._endRow||this._startCol>=this._endCol&&e<this._endRow?"C":"D"},e.prototype._verticalDirection=function(){return this._startRow>this._endRow?"A":"B"},e.prototype._bufferLine=function(e,t,i,r,n){for(var o=e,s=t,a="";o!==i||s!==r;)o+=n?1:-1,n&&o>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!n&&o<0&&(a+=this._terminal.buffer.translateBufferLineToString(s,!1,0,e+1),e=o=this._terminal.cols-1,s--);return a+this._terminal.buffer.translateBufferLineToString(s,!1,e,o)},e.prototype._sequence=function(e){var t=this._terminal.applicationCursor?"O":"[";return r.C0.ESC+t+e},e}();function o(e,t){e=Math.floor(e);for(var i="",r=0;r<e;r++)i+=t;return i}t.AltClickHandler=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(2),n=function(){function e(e,t){this._onCharSizeChanged=new r.EventEmitter2,this._document=e,this._parentElement=t,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 Object.defineProperty(e.prototype,"onCharSizeChanged",{get:function(){return this._onCharSizeChanged.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.measure=function(e){this._measureElement.style.fontFamily=e.fontFamily,this._measureElement.style.fontSize=e.fontSize+"px";var t=this._measureElement.getBoundingClientRect();if(0!==t.width&&0!==t.height){var i=Math.ceil(t.height);this._width===t.width&&this._height===i||(this._width=t.width,this._height=i,this._onCharSizeChanged.fire())}},e}();t.CharMeasure=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BELL_SOUND="data:audio/wav;base64,UklGRigBAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQQBAADpAFgCwAMlBZoG/wdmCcoKRAypDQ8PbRDBEQQTOxRtFYcWlBePGIUZXhoiG88bcBz7HHIdzh0WHlMeZx51HmkeUx4WHs8dah0AHXwc3hs9G4saxRnyGBIYGBcQFv8U4RPAEoYRQBACD70NWwwHC6gJOwjWBloF7gOBAhABkf8b/qv8R/ve+Xf4Ife79W/0JfPZ8Z/wde9N7ijtE+wU6xvqM+lb6H7nw+YX5mrlxuQz5Mzje+Ma49fioeKD4nXiYeJy4pHitOL04j/jn+MN5IPkFOWs5U3mDefM55/ogOl36m7rdOyE7abuyu8D8Unyj/Pg9D/2qfcb+Yn6/vuK/Qj/lAAlAg==";var r=function(){function e(e){this._terminal=e}return Object.defineProperty(e,"audioContext",{get:function(){if(!e._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;e._audioContext=new t}return e._audioContext},enumerable:!0,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var i=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),function(e){i.buffer=e,i.connect(t.destination),i.start(0)})}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),i=t.length,r=new Uint8Array(i),n=0;n<i;n++)r[n]=t.charCodeAt(n);return r.buffer},e.prototype._removeMimeType=function(e){return e.split(",")[1]},e}();t.SoundManager=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(13),s=i(6),a=i(23),l=i(5),h=i(0),c=i(24),u=function(e){function t(t,i){var r=e.call(this)||this;r._terminal=t,r._dimensions=i,r._liveRegionLineCount=0,r._charsToConsume=[],r._charsToAnnounce="",r._accessibilityTreeRoot=document.createElement("div"),r._accessibilityTreeRoot.classList.add("xterm-accessibility"),r._rowContainer=document.createElement("div"),r._rowContainer.classList.add("xterm-accessibility-tree"),r._rowElements=[];for(var n=0;n<r._terminal.rows;n++)r._rowElements[n]=r._createAccessibilityTreeNode(),r._rowContainer.appendChild(r._rowElements[n]);return r._topBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,0)},r._bottomBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,1)},r._rowElements[0].addEventListener("focus",r._topBoundaryFocusListener),r._rowElements[r._rowElements.length-1].addEventListener("focus",r._bottomBoundaryFocusListener),r._refreshRowsDimensions(),r._accessibilityTreeRoot.appendChild(r._rowContainer),r._renderRowsDebouncer=new a.RenderDebouncer(r._renderRows.bind(r)),r._refreshRows(),r._liveRegion=document.createElement("div"),r._liveRegion.classList.add("live-region"),r._liveRegion.setAttribute("aria-live","assertive"),r._accessibilityTreeRoot.appendChild(r._liveRegion),r._terminal.element.insertAdjacentElement("afterbegin",r._accessibilityTreeRoot),r.register(r._renderRowsDebouncer),r.register(r._terminal.onResize(function(e){return r._onResize(e.rows)})),r.register(r._terminal.onRender(function(e){return r._refreshRows(e.start,e.end)})),r.register(r._terminal.onScroll(function(){return r._refreshRows()})),r.register(r._terminal.addDisposableListener("a11y.char",function(e){return r._onChar(e)})),r.register(r._terminal.onLineFeed(function(){return r._onChar("\n")})),r.register(r._terminal.addDisposableListener("a11y.tab",function(e){return r._onTab(e)})),r.register(r._terminal.onKey(function(e){return r._onKey(e.key)})),r.register(r._terminal.addDisposableListener("blur",function(){return r._clearLiveRegion()})),r._screenDprMonitor=new c.ScreenDprMonitor,r.register(r._screenDprMonitor),r._screenDprMonitor.setListener(function(){return r._refreshRowsDimensions()}),r.register(l.addDisposableDomListener(window,"resize",function(){return r._refreshRowsDimensions()})),r}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._terminal.element.removeChild(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(e,t){var i=e.target,r=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===r){var n,o;if(0===t?(n=i,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(n=this._rowElements.shift(),o=i,this._rowContainer.removeChild(n)),n.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){var s=this._createAccessibilityTreeNode();this._rowElements.unshift(s),this._rowContainer.insertAdjacentElement("afterbegin",s)}else s=this._createAccessibilityTreeNode(),this._rowElements.push(s),this._rowContainer.appendChild(s);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}},t.prototype._onResize=function(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},t.prototype._onTab=function(e){for(var t=0;t<e;t++)this._onChar(" ")},t.prototype._onChar=function(e){var t=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=o.tooMuchOutput)),s.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)},0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,s.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)},t.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},t.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){for(var i=this._terminal.buffer,r=i.lines.length.toString(),n=e;n<=t;n++){var s=i.translateBufferLineToString(i.ydisp+n,!0),a=(i.ydisp+n+1).toString(),l=this._rowElements[n];l&&(l.textContent=0===s.length?o.blankLine:s,l.setAttribute("aria-posinset",a),l.setAttribute("aria-setsize",r))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}},t.prototype.setDimensions=function(e){this._dimensions=e,this._refreshRowsDimensions()},t.prototype._refreshRowDimensions=function(e){e.style.height=this._dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(h.Disposable);t.AccessibilityManager=u},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(58),s=i(4),a=i(0),l="xterm-dom-renderer-owner-",h="xterm-rows",c="xterm-selection",u=1,f=function(e){function t(t,i){var r=e.call(this)||this;return r._terminal=t,r._colors=i,r._terminalClass=u++,r._rowElements=[],r._rowContainer=document.createElement("div"),r._rowContainer.classList.add(h),r._rowContainer.style.lineHeight="normal",r._rowContainer.setAttribute("aria-hidden","true"),r._refreshRowElements(r._terminal.cols,r._terminal.rows),r._selectionContainer=document.createElement("div"),r._selectionContainer.classList.add(c),r._selectionContainer.setAttribute("aria-hidden","true"),r.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},r._updateDimensions(),r._injectCss(),r._rowFactory=new o.DomRendererRowFactory(t.options,document),r._terminal.element.classList.add(l+r._terminalClass),r._terminal.screenElement.appendChild(r._rowContainer),r._terminal.screenElement.appendChild(r._selectionContainer),r._terminal.linkifier.onLinkHover(function(e){return r._onLinkHover(e)}),r._terminal.linkifier.onLinkLeave(function(e){return r._onLinkLeave(e)}),r}return n(t,e),t.prototype.dispose=function(){this._terminal.element.classList.remove(l+this._terminalClass),this._terminal.screenElement.removeChild(this._rowContainer),this._terminal.screenElement.removeChild(this._selectionContainer),this._terminal.screenElement.removeChild(this._themeStyleElement),this._terminal.screenElement.removeChild(this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.prototype._updateDimensions=function(){var e=this;this.dimensions.scaledCharWidth=this._terminal.charMeasure.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._terminal.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._terminal.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._terminal.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this._rowElements.forEach(function(t){t.style.width=e.dimensions.canvasWidth+"px",t.style.height=e.dimensions.actualCellHeight+"px",t.style.lineHeight=e.dimensions.actualCellHeight+"px",t.style.overflow="hidden"}),this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._dimensionsStyleElement));var t=this._terminalSelector+" ."+h+" span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=t,this._selectionContainer.style.height=this._terminal._viewportElement.style.height,this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.setColors=function(e){this._colors=e,this._injectCss()},t.prototype._injectCss=function(){var e=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._themeStyleElement));var t=this._terminalSelector+" ."+h+" { color: "+this._colors.foreground.css+"; background-color: "+this._colors.background.css+"; font-family: "+this._terminal.options.fontFamily+"; font-size: "+this._terminal.options.fontSize+"px;}";t+=this._terminalSelector+" span:not(."+o.BOLD_CLASS+") { font-weight: "+this._terminal.options.fontWeight+";}"+this._terminalSelector+" span."+o.BOLD_CLASS+" { font-weight: "+this._terminal.options.fontWeightBold+";}"+this._terminalSelector+" span."+o.ITALIC_CLASS+" { font-style: italic;}",t+="@keyframes blink { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; }}",t+=this._terminalSelector+" ."+h+":not(.xterm-focus) ."+o.CURSOR_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" ."+h+".xterm-focus ."+o.CURSOR_CLASS+"."+o.CURSOR_BLINK_CLASS+" { animation: blink 1s step-end infinite;}"+this._terminalSelector+" ."+h+".xterm-focus ."+o.CURSOR_CLASS+"."+o.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" ."+h+".xterm-focus ."+o.CURSOR_CLASS+"."+o.CURSOR_STYLE_BAR_CLASS+" { box-shadow: 1px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" ."+h+".xterm-focus ."+o.CURSOR_CLASS+"."+o.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",t+=this._terminalSelector+" ."+c+" { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" ."+c+" div { position: absolute; background-color: "+this._colors.selection.css+";}",this._colors.ansi.forEach(function(i,r){t+=e._terminalSelector+" .xterm-fg-"+r+" { color: "+i.css+"; }"+e._terminalSelector+" .xterm-bg-"+r+" { background-color: "+i.css+"; }"}),t+=this._terminalSelector+" .xterm-fg-"+s.INVERTED_DEFAULT_COLOR+" { color: "+this._colors.background.css+"; }"+this._terminalSelector+" .xterm-bg-"+s.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=t},t.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},t.prototype._refreshRowElements=function(e,t){for(var i=this._rowElements.length;i<=t;i++){var r=document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())},t.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},t.prototype.onCharSizeChanged=function(){this._updateDimensions()},t.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},t.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},t.prototype.onSelectionChanged=function(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var r=e[1]-this._terminal.buffer.ydisp,n=t[1]-this._terminal.buffer.ydisp,o=Math.max(r,0),s=Math.min(n,this._terminal.rows-1);if(!(o>=this._terminal.rows||s<0)){var a=document.createDocumentFragment();if(i)a.appendChild(this._createSelectionElement(o,e[0],t[0],s-o+1));else{var l=r===o?e[0]:0,h=o===s?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(o,l,h));var c=s-o-1;if(a.appendChild(this._createSelectionElement(o+1,0,this._terminal.cols,c)),o!==s){var u=n===s?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},t.prototype._createSelectionElement=function(e,t,i,r){void 0===r&&(r=1);var n=document.createElement("div");return n.style.height=r*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(i-t)+"px",n},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss(),this._terminal.refresh(0,this._terminal.rows-1)},t.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},t.prototype.renderRows=function(e,t){for(var i=this._terminal,r=i.buffer.ybase+i.buffer.y,n=this._terminal.buffer.x,o=this._terminal.options.cursorBlink,s=e;s<=t;s++){var a=this._rowElements[s];a.innerHTML="";var l=s+i.buffer.ydisp,h=i.buffer.lines.get(l),c=i.options.cursorStyle;a.appendChild(this._rowFactory.createRow(h,l===r,c,n,o,this.dimensions.actualCellWidth,i.cols))}},Object.defineProperty(t.prototype,"_terminalSelector",{get:function(){return"."+l+this._terminalClass},enumerable:!0,configurable:!0}),t.prototype.registerCharacterJoiner=function(e){return-1},t.prototype.deregisterCharacterJoiner=function(e){return!1},t.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},t.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},t.prototype._setCellUnderline=function(e,t,i,r,n,o){for(;e!==t||i!==r;){var s=this._rowElements[i];if(!s)return;var a=s.children[e];a&&(a.style.textDecoration=o?"underline":"none"),++e>=n&&(e=0,i++)}},t}(a.Disposable);t.DomRenderer=f},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(4),n=i(1);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var o=function(){function e(e,t){this._terminalOptions=e,this._document=t,this._workCell=new n.CellData}return e.prototype.createRow=function(e,i,o,s,a,l,h){for(var c=this._document.createDocumentFragment(),u=0,f=Math.min(e.length,h)-1;f>=0;f--)if(e.loadCell(f,this._workCell).getCode()!==n.NULL_CELL_CODE||i&&f===s){u=f+1;break}for(f=0;f<u;f++){e.loadCell(f,this._workCell);var d=this._workCell.getWidth();if(0!==d){var _=this._document.createElement("span");if(d>1&&(_.style.width=l*d+"px"),i&&f===s)switch(_.classList.add(t.CURSOR_CLASS),a&&_.classList.add(t.CURSOR_BLINK_CLASS),o){case"bar":_.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":_.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:_.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&this._terminalOptions.enableBold&&_.classList.add(t.BOLD_CLASS),this._workCell.isItalic()&&_.classList.add(t.ITALIC_CLASS),this._workCell.isDim()&&_.classList.add(t.DIM_CLASS),this._workCell.isUnderline()&&_.classList.add(t.UNDERLINE_CLASS),_.textContent=this._workCell.getChars()||n.WHITESPACE_CELL_CHAR;var p=this._workCell.isInverse();if(this._workCell.isFgRGB()){var m=_.getAttribute("style")||"";m+=(p?"background-":"")+"color:rgb("+n.AttributeData.toColorRGB(this._workCell.getFgColor()).join(",")+");",_.setAttribute("style",m)}else if(this._workCell.isFgPalette()){var y=this._workCell.getFgColor();this._workCell.isBold()&&y<8&&!p&&this._terminalOptions.enableBold&&this._terminalOptions.drawBoldTextInBrightColors&&(y+=8),_.classList.add("xterm-"+(p?"b":"f")+"g-"+y)}else p&&_.classList.add("xterm-bg-"+r.INVERTED_DEFAULT_COLOR);this._workCell.isBgRGB()?(m=_.getAttribute("style")||"",m+=(p?"":"background-")+"color:rgb("+n.AttributeData.toColorRGB(this._workCell.getBgColor()).join(",")+");",_.setAttribute("style",m)):this._workCell.isBgPalette()?_.classList.add("xterm-"+(p?"f":"b")+"g-"+this._workCell.getBgColor()):p&&_.classList.add("xterm-fg-"+r.INVERTED_DEFAULT_COLOR),c.appendChild(_)}}return c},e}();t.DomRendererRowFactory=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(8),n={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:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,o){var s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?s.key=t?r.C0.ESC+"OA":r.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?s.key=t?r.C0.ESC+"OD":r.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?s.key=t?r.C0.ESC+"OC":r.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(s.key=t?r.C0.ESC+"OB":r.C0.ESC+"[B");break;case 8:if(e.shiftKey){s.key=r.C0.BS;break}if(e.altKey){s.key=r.C0.ESC+r.C0.DEL;break}s.key=r.C0.DEL;break;case 9:if(e.shiftKey){s.key=r.C0.ESC+"[Z";break}s.key=r.C0.HT,s.cancel=!0;break;case 13:s.key=r.C0.CR,s.cancel=!0;break;case 27:s.key=r.C0.ESC,s.cancel=!0;break;case 37:a?(s.key=r.C0.ESC+"[1;"+(a+1)+"D",s.key===r.C0.ESC+"[1;3D"&&(s.key=i?r.C0.ESC+"b":r.C0.ESC+"[1;5D")):s.key=t?r.C0.ESC+"OD":r.C0.ESC+"[D";break;case 39:a?(s.key=r.C0.ESC+"[1;"+(a+1)+"C",s.key===r.C0.ESC+"[1;3C"&&(s.key=i?r.C0.ESC+"f":r.C0.ESC+"[1;5C")):s.key=t?r.C0.ESC+"OC":r.C0.ESC+"[C";break;case 38:a?(s.key=r.C0.ESC+"[1;"+(a+1)+"A",s.key===r.C0.ESC+"[1;3A"&&(s.key=r.C0.ESC+"[1;5A")):s.key=t?r.C0.ESC+"OA":r.C0.ESC+"[A";break;case 40:a?(s.key=r.C0.ESC+"[1;"+(a+1)+"B",s.key===r.C0.ESC+"[1;3B"&&(s.key=r.C0.ESC+"[1;5B")):s.key=t?r.C0.ESC+"OB":r.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(s.key=r.C0.ESC+"[2~");break;case 46:s.key=a?r.C0.ESC+"[3;"+(a+1)+"~":r.C0.ESC+"[3~";break;case 36:s.key=a?r.C0.ESC+"[1;"+(a+1)+"H":t?r.C0.ESC+"OH":r.C0.ESC+"[H";break;case 35:s.key=a?r.C0.ESC+"[1;"+(a+1)+"F":t?r.C0.ESC+"OF":r.C0.ESC+"[F";break;case 33:e.shiftKey?s.type=2:s.key=r.C0.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:s.key=r.C0.ESC+"[6~";break;case 112:s.key=a?r.C0.ESC+"[1;"+(a+1)+"P":r.C0.ESC+"OP";break;case 113:s.key=a?r.C0.ESC+"[1;"+(a+1)+"Q":r.C0.ESC+"OQ";break;case 114:s.key=a?r.C0.ESC+"[1;"+(a+1)+"R":r.C0.ESC+"OR";break;case 115:s.key=a?r.C0.ESC+"[1;"+(a+1)+"S":r.C0.ESC+"OS";break;case 116:s.key=a?r.C0.ESC+"[15;"+(a+1)+"~":r.C0.ESC+"[15~";break;case 117:s.key=a?r.C0.ESC+"[17;"+(a+1)+"~":r.C0.ESC+"[17~";break;case 118:s.key=a?r.C0.ESC+"[18;"+(a+1)+"~":r.C0.ESC+"[18~";break;case 119:s.key=a?r.C0.ESC+"[19;"+(a+1)+"~":r.C0.ESC+"[19~";break;case 120:s.key=a?r.C0.ESC+"[20;"+(a+1)+"~":r.C0.ESC+"[20~";break;case 121:s.key=a?r.C0.ESC+"[21;"+(a+1)+"~":r.C0.ESC+"[21~";break;case 122:s.key=a?r.C0.ESC+"[23;"+(a+1)+"~":r.C0.ESC+"[23~";break;case 123:s.key=a?r.C0.ESC+"[24;"+(a+1)+"~":r.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!o||!e.altKey||e.metaKey)i&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?s.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(s.key=r.C0.US);else{var l=n[e.keyCode],h=l&&l[e.shiftKey?1:0];if(h)s.key=r.C0.ESC+h;else if(e.keyCode>=65&&e.keyCode<=90){var c=e.ctrlKey?e.keyCode-64:e.keyCode+32;s.key=r.C0.ESC+String.fromCharCode(c)}}else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=String.fromCharCode(0):e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=String.fromCharCode(127):219===e.keyCode?s.key=String.fromCharCode(27):220===e.keyCode?s.key=String.fromCharCode(28):221===e.keyCode&&(s.key=String.fromCharCode(29))}return s}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=function e(t,i){if(void 0===i&&(i=5),"object"!=typeof t)return t;if(null===t)return null;var r=Array.isArray(t)?[]:{};for(var n in t)r[n]=i<=1?t[n]:e(t[n],i-1);return r}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(1);t.applyWindowsMode=function(e){return e.onLineFeed(function(){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1).get(e.cols-1);t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE&&(e.buffer.lines.get(e.buffer.ybase+e.buffer.y).isWrapped=!0)})}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),s=i(2),a=i(0),l=i(24),h=i(5),c=function(e){function t(t,i,r){var n=e.call(this)||this;if(n._renderer=t,n._rowCount=i,n._isPaused=!1,n._needsFullRefresh=!1,n._canvasWidth=0,n._canvasHeight=0,n._onDimensionsChange=new s.EventEmitter2,n._onRender=new s.EventEmitter2,n._onRefreshRequest=new s.EventEmitter2,n._renderDebouncer=new o.RenderDebouncer(function(e,t){return n._renderRows(e,t)}),n.register(n._renderDebouncer),n._screenDprMonitor=new l.ScreenDprMonitor,n._screenDprMonitor.setListener(function(){return n._renderer.onDevicePixelRatioChange()}),n.register(n._screenDprMonitor),n.register(h.addDisposableDomListener(window,"resize",function(){return n._renderer.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var a=new IntersectionObserver(function(e){return n._onIntersectionChange(e[e.length-1])},{threshold:0});a.observe(r),n.register({dispose:function(){return a.disconnect()}})}return n}return n(t,e),Object.defineProperty(t.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!0,configurable:!0}),t.prototype._onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},t.prototype.refreshRows=function(e,t){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(e,t,this._rowCount)},t.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._onRender.fire({start:e,end:t})},t.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},t.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this._fireOnCanvasResize()},t.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},t.prototype.setRenderer=function(e){this._renderer.dispose(),this._renderer=e},t.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount)},t.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},t.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange()},t.prototype.onResize=function(e,t){this._renderer.onResize(e,t),this._fullRefresh()},t.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},t.prototype.onBlur=function(){this._renderer.onBlur()},t.prototype.onFocus=function(){this._renderer.onFocus()},t.prototype.onSelectionChanged=function(e,t,i){this._renderer.onSelectionChanged(e,t,i)},t.prototype.onCursorMove=function(){this._renderer.onCursorMove()},t.prototype.onOptionsChanged=function(){this._renderer.onOptionsChanged()},t.prototype.clear=function(){this._renderer.clear()},t.prototype.registerCharacterJoiner=function(e){return this._renderer.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._renderer.deregisterCharacterJoiner(e)},t}(a.Disposable);t.RenderCoordinator=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._addons=[]}return e.prototype.dispose=function(){for(var e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()},e.prototype.loadAddon=function(e,t){var i=this,r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=function(){return i._wrappedAddonDispose(r)},t.activate(e)},e.prototype._wrappedAddonDispose=function(e){if(!e.isDisposed){for(var t=-1,i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},e}();t.AddonManager=r},function(e,t,i){},function(e,t,i){},function(e,t,i){"use strict";i.r(t);var r=function(){},n={},o=[],s=[];function a(e,t){var i,a,l,h,c=s;for(h=arguments.length;h-- >2;)o.push(arguments[h]);for(t&&null!=t.children&&(o.length||o.push(t.children),delete t.children);o.length;)if((a=o.pop())&&void 0!==a.pop)for(h=a.length;h--;)o.push(a[h]);else"boolean"==typeof a&&(a=null),(l="function"!=typeof e)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(l=!1)),l&&i?c[c.length-1]+=a:c===s?c=[a]:c.push(a),i=l;var u=new r;return u.nodeName=e,u.children=c,u.attributes=null==t?void 0:t,u.key=null==t?void 0:t.key,void 0!==n.vnode&&n.vnode(u),u}function l(e,t){for(var i in t)e[i]=t[i];return e}function h(e,t){null!=e&&("function"==typeof e?e(t):e.current=t)}var c="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,u=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function d(e){!e._dirty&&(e._dirty=!0)&&1==f.push(e)&&(n.debounceRendering||c)(_)}function _(){for(var e;e=f.pop();)e._dirty&&O(e)}function p(e,t,i){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&m(e,t.nodeName):i||e._componentConstructor===t.nodeName}function m(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function y(e){var t=l({},e.attributes);t.children=e.children;var i=e.nodeName.defaultProps;if(void 0!==i)for(var r in i)void 0===t[r]&&(t[r]=i[r]);return t}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function C(e,t,i,r,n){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)h(i,null),h(r,e);else if("class"!==t||n)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof i||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof i)for(var o in i)o in r||(e.style[o]="");for(var o in r)e.style[o]="number"==typeof r[o]&&!1===u.test(o)?r[o]+"px":r[o]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?i||e.addEventListener(t,v,s):e.removeEventListener(t,v,s),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!n&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var a=n&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function v(e){return this._listeners[e.type](n.event&&n.event(e)||e)}var b=[],w=0,S=!1,E=!1;function L(){for(var e;e=b.shift();)n.afterMount&&n.afterMount(e),e.componentDidMount&&e.componentDidMount()}function x(e,t,i,r,n,o){w++||(S=null!=n&&void 0!==n.ownerSVGElement,E=null!=e&&!("__preactattr_"in e));var s=function e(t,i,r,n,o){var s=t,a=S;if(null!=i&&"boolean"!=typeof i||(i=""),"string"==typeof i||"number"==typeof i)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||o)?t.nodeValue!=i&&(t.nodeValue=i):(s=document.createTextNode(i),t&&(t.parentNode&&t.parentNode.replaceChild(s,t),A(t,!0))),s.__preactattr_=!0,s;var l,h,c=i.nodeName;if("function"==typeof c)return function(e,t,i,r){for(var n=e&&e._component,o=n,s=e,a=n&&e._componentConstructor===t.nodeName,l=a,h=y(t);n&&!l&&(n=n._parentComponent);)l=n.constructor===t.nodeName;return n&&l&&(!r||n._component)?(D(n,h,3,i,r),e=n.base):(o&&!a&&(H(o),e=s=null),n=M(t.nodeName,h,i),e&&!n.nextBase&&(n.nextBase=e,s=null),D(n,h,1,i,r),e=n.base,s&&e!==s&&(s._component=null,A(s,!1))),e}(t,i,r,n);if(S="svg"===c||"foreignObject"!==c&&S,c=String(c),(!t||!m(t,c))&&(l=c,(h=S?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l)).normalizedNodeName=l,s=h,t)){for(;t.firstChild;)s.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(s,t),A(t,!0)}var u=s.firstChild,f=s.__preactattr_,d=i.children;if(null==f){f=s.__preactattr_={};for(var _=s.attributes,v=_.length;v--;)f[_[v].name]=_[v].value}return!E&&d&&1===d.length&&"string"==typeof d[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=d[0]&&(u.nodeValue=d[0]):(d&&d.length||null!=u)&&function(t,i,r,n,o){var s,a,l,h,c,u=t.childNodes,f=[],d={},_=0,m=0,y=u.length,C=0,v=i?i.length:0;if(0!==y)for(var b=0;b<y;b++){var w=u[b],S=w.__preactattr_,E=v&&S?w._component?w._component.__key:S.key:null;null!=E?(_++,d[E]=w):(S||(void 0!==w.splitText?!o||w.nodeValue.trim():o))&&(f[C++]=w)}if(0!==v)for(var b=0;b<v;b++){h=i[b],c=null;var E=h.key;if(null!=E)_&&void 0!==d[E]&&(c=d[E],d[E]=void 0,_--);else if(m<C)for(s=m;s<C;s++)if(void 0!==f[s]&&p(a=f[s],h,o)){c=a,f[s]=void 0,s===C-1&&C--,s===m&&m++;break}c=e(c,h,r,n),l=u[b],c&&c!==t&&c!==l&&(null==l?t.appendChild(c):c===l.nextSibling?g(l):t.insertBefore(c,l))}if(_)for(var b in d)void 0!==d[b]&&A(d[b],!1);for(;m<=C;)void 0!==(c=f[C--])&&A(c,!1)}(s,d,r,n,E||null!=f.dangerouslySetInnerHTML),function(e,t,i){var r;for(r in i)t&&null!=t[r]||null==i[r]||C(e,r,i[r],i[r]=void 0,S);for(r in t)"children"===r||"innerHTML"===r||r in i&&t[r]===("value"===r||"checked"===r?e[r]:i[r])||C(e,r,i[r],i[r]=t[r],S)}(s,i.attributes,f),S=a,s}(e,t,i,r,o);return n&&s.parentNode!==n&&n.appendChild(s),--w||(E=!1,o||L()),s}function A(e,t){var i=e._component;i?H(i):(null!=e.__preactattr_&&h(e.__preactattr_.ref,null),!1!==t&&null!=e.__preactattr_||g(e),T(e))}function T(e){for(e=e.lastChild;e;){var t=e.previousSibling;A(e,!0),e=t}}var k=[];function M(e,t,i){var r,n=k.length;for(e.prototype&&e.prototype.render?(r=new e(t,i),B.call(r,t,i)):((r=new B(t,i)).constructor=e,r.render=R);n--;)if(k[n].constructor===e)return r.nextBase=k[n].nextBase,k.splice(n,1),r;return r}function R(e,t,i){return this.constructor(e,i)}function D(e,t,i,r,o){e._disable||(e._disable=!0,e.__ref=t.ref,e.__key=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||o?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r)),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&e.base?d(e):O(e,1,o)),h(e.__ref,e))}function O(e,t,i,r){if(!e._disable){var o,s,a,h=e.props,c=e.state,u=e.context,f=e.prevProps||h,d=e.prevState||c,_=e.prevContext||u,p=e.base,m=e.nextBase,g=p||m,C=e._component,v=!1,S=_;if(e.constructor.getDerivedStateFromProps&&(c=l(l({},c),e.constructor.getDerivedStateFromProps(h,c)),e.state=c),p&&(e.props=f,e.state=d,e.context=_,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(h,c,u)?v=!0:e.componentWillUpdate&&e.componentWillUpdate(h,c,u),e.props=h,e.state=c,e.context=u),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!v){o=e.render(h,c,u),e.getChildContext&&(u=l(l({},u),e.getChildContext())),p&&e.getSnapshotBeforeUpdate&&(S=e.getSnapshotBeforeUpdate(f,d));var E,T,k=o&&o.nodeName;if("function"==typeof k){var R=y(o);(s=C)&&s.constructor===k&&R.key==s.__key?D(s,R,1,u,!1):(E=s,e._component=s=M(k,R,u),s.nextBase=s.nextBase||m,s._parentComponent=e,D(s,R,0,u,!1),O(s,1,i,!0)),T=s.base}else a=g,(E=C)&&(a=e._component=null),(g||1===t)&&(a&&(a._component=null),T=x(a,o,u,i||!p,g&&g.parentNode,!0));if(g&&T!==g&&s!==C){var B=g.parentNode;B&&T!==B&&(B.replaceChild(T,g),E||(g._component=null,A(g,!1)))}if(E&&H(E),e.base=T,T&&!r){for(var P=e,F=e;F=F._parentComponent;)(P=F).base=T;T._component=P,T._componentConstructor=P.constructor}}for(!p||i?b.push(e):v||(e.componentDidUpdate&&e.componentDidUpdate(f,d,S),n.afterUpdate&&n.afterUpdate(e));e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);w||r||L()}}function H(e){n.beforeUnmount&&n.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var i=e._component;i?H(i):t&&(null!=t.__preactattr_&&h(t.__preactattr_.ref,null),e.nextBase=t,g(t),k.push(e),T(t)),h(e.__ref,null)}function B(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{},this._renderCallbacks=[]}l(B.prototype,{setState:function(e,t){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this._renderCallbacks.push(t),d(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),O(this,2)},render:function(){}});var P,F=i(3),I=i(25),W=i(26),U=i(27),j=function(){function e(){this.overlayNode=document.createElement("div"),this.overlayNode.style.cssText="border-radius: 15px;\nfont-size: xx-large;\nopacity: 0.75;\npadding: 0.2em 0.5em 0.2em 0.5em;\nposition: absolute;\n-webkit-user-select: none;\n-webkit-transition: opacity 180ms ease-in;\n-moz-user-select: none;\n-moz-transition: opacity 180ms ease-in;",this.overlayNode.addEventListener("mousedown",function(e){e.preventDefault(),e.stopPropagation()},!0)}return e.prototype.activate=function(e){this.terminal=e},e.prototype.dispose=function(){},e.prototype.showOverlay=function(e,t){var i=this.terminal,r=this.overlayNode;r.style.color="#101010",r.style.backgroundColor="#f0f0f0",r.textContent=e,r.style.opacity="0.75",r.parentNode||i.element.appendChild(r);var n=i.element.getBoundingClientRect(),o=r.getBoundingClientRect();if(r.style.top=(n.height-o.height)/2+"px",r.style.left=(n.width-o.width)/2+"px",this.overlayTimeout&&clearTimeout(this.overlayTimeout),null!==t){var s=this;s.overlayTimeout=setTimeout(function(){r.style.opacity="0",s.overlayTimeout=setTimeout(function(){r.parentNode&&r.parentNode.removeChild(r),s.overlayTimeout=null,r.style.opacity="0.75"},200)},t||1500)}},e}(),N=(i(64),P=function(e,t){return(P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),z=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},K=function(e){function t(t){var i=e.call(this,t)||this;return i.textEncoder=new TextEncoder,i.textDecoder=new TextDecoder,i.fitAddon=new W.FitAddon,i.overlayAddon=new j,i}return N(t,e),t.prototype.componentDidMount=function(){this.openTerminal()},t.prototype.componentWillUnmount=function(){this.socket.close(),this.terminal.dispose(),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("beforeunload",this.onWindowUnload)},t.prototype.render=function(e){var t=this;return a("div",{id:e.id,ref:function(e){return t.container=e}})},t.prototype.onWindowResize=function(){var e=this.fitAddon;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){return e.fit()},250)},t.prototype.onWindowUnload=function(e){var t="Close terminal? this will also terminate the command.";return e.returnValue=t,t},t.prototype.openTerminal=function(){var e=this;this.terminal&&this.terminal.dispose(),this.socket=new WebSocket(this.props.url,["tty"]),this.terminal=new I.Terminal(this.props.options);var t=this,i=t.socket,r=t.terminal,n=t.container,o=t.fitAddon,s=t.overlayAddon;window.term=r,i.binaryType="arraybuffer",i.onopen=this.onSocketOpen,i.onmessage=this.onSocketData,i.onclose=this.onSocketClose,r.loadAddon(o),r.loadAddon(s),r.loadAddon(new U.WebLinksAddon),r.onTitleChange(function(t){t&&""!==t&&(document.title=t+" | "+e.title)}),r.onData(this.onTerminalData),r.onResize(this.onTerminalResize),document.queryCommandSupported&&document.queryCommandSupported("copy")&&r.onSelectionChange(function(){s.showOverlay("✂",200),document.execCommand("copy")}),r.open(n),r.focus(),window.addEventListener("resize",this.onWindowResize),window.addEventListener("beforeunload",this.onWindowUnload)},t.prototype.onSocketOpen=function(){console.log("[ttyd] Websocket connection opened");var e=this.socket,t=this.textEncoder,i=this.fitAddon;e.send(t.encode(JSON.stringify({AuthToken:""}))),i.fit()},t.prototype.onSocketClose=function(e){console.log("[ttyd] websocket connection closed with code: "+e.code);var t=this.overlayAddon,i=this.openTerminal,r=this.autoReconnect;t.showOverlay("Connection Closed",null),window.removeEventListener("beforeunload",this.onWindowUnload),1008===e.code&&window.location.reload(),1e3!==e.code&&r>0&&setTimeout(i,1e3*r)},t.prototype.onSocketData=function(e){var t=this.terminal,i=this.textDecoder,r=new Uint8Array(e.data),n=String.fromCharCode(r[0]),o=r.slice(1);switch(n){case"0":t.writeUtf8(o);break;case"1":this.title=i.decode(o.buffer),document.title=this.title;break;case"2":var s=JSON.parse(i.decode(o.buffer));Object.keys(s).forEach(function(e){console.log("[ttyd] setting "+e+": "+s[e]),t.setOption(e,s[e])});break;case"3":this.autoReconnect=parseInt(i.decode(o.buffer)),console.log("[ttyd] enabling reconnect: "+this.autoReconnect+" seconds");break;default:console.warn("[ttyd] unknown command: "+n)}},t.prototype.onTerminalResize=function(e){var t=this.overlayAddon,i=this.socket,r=this.textEncoder;if(i.readyState===WebSocket.OPEN){var n=JSON.stringify({columns:e.cols,rows:e.rows});i.send(r.encode("1"+n))}setTimeout(function(){t.showOverlay(e.cols+"x"+e.rows)},500)},t.prototype.onTerminalData=function(e){var t=this.socket,i=this.textEncoder;t.readyState===WebSocket.OPEN&&t.send(i.encode("0"+e))},z([F.bind],t.prototype,"onWindowResize",null),z([F.bind],t.prototype,"openTerminal",null),z([F.bind],t.prototype,"onSocketOpen",null),z([F.bind],t.prototype,"onSocketClose",null),z([F.bind],t.prototype,"onSocketData",null),z([F.bind],t.prototype,"onTerminalResize",null),z([F.bind],t.prototype,"onTerminalData",null),t}(B),V=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),G="https:"===window.location.protocol?"wss://":"ws://",q=window.location.pathname.endsWith("/")?"ws":"/ws",J=[G,window.location.host,window.location.pathname,q,window.location.search].join(""),Y={fontSize:13,fontFamily:"Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace",theme:{foreground:"#d2d2d2",background:"#2b2b2b",cursor:"#adadad",black:"#000000",red:"#d81e00",green:"#5ea702",yellow:"#cfae00",blue:"#427ab3",magenta:"#89658e",cyan:"#00a7aa",white:"#dbded8",brightBlack:"#686a66",brightRed:"#f54235",brightGreen:"#99e343",brightYellow:"#fdeb61",brightBlue:"#84b0d8",brightMagenta:"#bc94b7",brightCyan:"#37e6e8",brightWhite:"#f1f1f0"}},Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return V(t,e),t.prototype.render=function(){return a(K,{id:"terminal-container",url:J,options:Y})},t}(B);i(65),function(e,t,i){x(i,e,{},!1,t,!1)}(a(Z,null),document.body)}]);</script></body></html>
\ No newline at end of file
+<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><title>ttyd - Terminal</title><link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA0xpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTgyRjc1RjA3MTZEMTFFNjg2M0NCOEY3RjJBMEY3N0EiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTgyRjc1RUY3MTZEMTFFNjg2M0NCOEY3RjJBMEY3N0EiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjU3YmQxNjhjLWI5ZDctMTE3OS1hM2RlLWZmNjQyYTM4NTJmMCIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjU3YmQxNjhjLWI5ZDctMTE3OS1hM2RlLWZmNjQyYTM4NTJmMCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PhsssMYAAALDSURBVHjaxFa9jxJBFH8zDMdCYrhIAppgIjaG5C5RQ+zO2Gty5gpbY2KsbOyu1MrGGEtj/A9stLPXs6CjJ5GYIF6AE5IDBHZmfG92F4ZzvQAnyyO7O8zX+73f+5gRd3bvvSgffN4/l948YgASFhQ9aWhqM6+pYfrVjD5WH9NK8f7x8ebNnVtvWC6b/RaPxy8zxsxmbB5lIfNsIDMggreezqG1o9GIGj8E45zFNzYgnU4D5xyUUkBglpFAKfgWa5gFY89rNVvgJJMgSBkpjcViIISA4XAI4/EYkBXTdyYQ9LOUU9sw7bmG2lqgPwwAKSV9D/P5/G2csNtoNJ71+32HFjqOszyQkDY9xLbrjkEorSe+wYGc67o72Wz2dSqV+tjr9e4iiAfdbnfL+G4B10wtDV/nBSYAN5O053eivVqtvq1UKr/RDaVCofCyVCo9ogXE0qISppgsJ3GlCzzGkQHcOEgT8n2xWLyfy+XeDwaDK7Va7Xm73X4YUHaaRfMwcbIPdTNBGWBSwkP3Ewdr9Xr9FcbAUwpICkyKAXuTRdkIAxH4QThOEn61W2YSKruAVpeJiUQiYRQjqHImk9nDjDiPijnO+d7pdN5hXOwRuGXdYRggANIdM9sy2tTeGPsuNpvNJwgkRVUMpYPdV5dJURsIZZ9WBEB6aRhKkeeWSzi2j9kxk8vLFqsABFkvlWSYhoqdni6zY2dRfHJfYoErvxBFLb5expVUDFlYCwDpM8CU0pEDoADUGH9YCf8dgKuQSRagXoo/Lg0Da3CBVwm9syBKBv46FfHNIlc+BYFZQHe0yBnQPgN0HFtV8H8VmXko8ABgEOo1uIDZMbCWALRiQAR/gkvpqsU+Rcl4gW9zR6JLCXXQ5XTVAKR/sqIvGODl89BnJfLHcRJNceP6tQ9fDr4+RmRHmAUqoiLEkOnM1vb2pz8CDACUMgcHE3VMqAAAAABJRU5ErkJggg=="/><style>.xterm{font-feature-settings:"liga" 0;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:0}.xterm .xterm-helpers{position:absolute;top:0;z-index:10}.xterm .xterm-helper-textarea{position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-10;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm{cursor:text}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:100;color:transparent}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:.5}.xterm-underline{text-decoration:underline}body,html{height:100%;min-height:100%;margin:0;overflow:hidden}#terminal-container{width:auto;height:100%;margin:0 auto;padding:0;background-color:#2b2b2b}#terminal-container .terminal{padding:5px}</style></head><body><script src="auth_token.js"></script><script type="text/javascript">!function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=66)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0,this._disposables.forEach(function(e){return e.dispose()}),this._disposables.length=0},e.prototype.register=function(e){this._disposables.push(e)},e.prototype.unregister=function(e){var t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)},e}();t.Disposable=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(10),s=i(7);t.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32;var a=3,l=function(){function e(){this.fg=0,this.bg=0}return e.toColorRGB=function(e){return[e>>>16&255,e>>>8&255,255&e]},e.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},e.prototype.clone=function(){var t=new e;return t.fg=this.fg,t.bg=this.bg,t},e.prototype.isInverse=function(){return 67108864&this.fg},e.prototype.isBold=function(){return 134217728&this.fg},e.prototype.isUnderline=function(){return 268435456&this.fg},e.prototype.isBlink=function(){return 536870912&this.fg},e.prototype.isInvisible=function(){return 1073741824&this.fg},e.prototype.isItalic=function(){return 67108864&this.bg},e.prototype.isDim=function(){return 134217728&this.bg},e.prototype.getFgColorMode=function(){return 50331648&this.fg},e.prototype.getBgColorMode=function(){return 50331648&this.bg},e.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},e.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},e.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},e.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},e.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},e.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},e.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},e.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},e}();t.AttributeData=l,t.DEFAULT_ATTR_DATA=new l;var h=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.combinedData="",t}return n(i,e),i.fromCharData=function(e){var t=new i;return t.setFromCharData(e),t},i.prototype.isCombined=function(){return 2097152&this.content},i.prototype.getWidth=function(){return this.content>>22},i.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?o.stringFromCodePoint(2097151&this.content):""},i.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},i.prototype.setFromCharData=function(e){this.fg=e[t.CHAR_DATA_ATTR_INDEX],this.bg=0;var i=!1;if(e[t.CHAR_DATA_CHAR_INDEX].length>2)i=!0;else if(2===e[t.CHAR_DATA_CHAR_INDEX].length){var r=e[t.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){var n=e[t.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=n&&n<=57343?this.content=1024*(r-55296)+n-56320+65536|e[t.CHAR_DATA_WIDTH_INDEX]<<22:i=!0}else i=!0}else this.content=e[t.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[t.CHAR_DATA_WIDTH_INDEX]<<22;i&&(this.combinedData=e[t.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[t.CHAR_DATA_WIDTH_INDEX]<<22)},i.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},i}(l);t.CellData=h;var c=function(){function e(e,i,r){void 0===r&&(r=!1),this.isWrapped=r,this._combined={},this._data=new Uint32Array(e*a);for(var n=i||h.fromCharData([0,t.NULL_CELL_CHAR,t.NULL_CELL_WIDTH,t.NULL_CELL_CODE]),o=0;o<e;++o)this.setCell(o,n);this.length=e}return e.prototype.get=function(e){var t=this._data[e*a+0],i=2097151&t;return[this._data[e*a+1],2097152&t?this._combined[e]:i?o.stringFromCodePoint(i):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]},e.prototype.set=function(e,i){this._data[e*a+1]=i[t.CHAR_DATA_ATTR_INDEX],i[t.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=i[1],this._data[e*a+0]=2097152|e|i[t.CHAR_DATA_WIDTH_INDEX]<<22):this._data[e*a+0]=i[t.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|i[t.CHAR_DATA_WIDTH_INDEX]<<22},e.prototype.getWidth=function(e){return this._data[e*a+0]>>22},e.prototype.hasWidth=function(e){return 12582912&this._data[e*a+0]},e.prototype.getFg=function(e){return this._data[e*a+1]},e.prototype.getBg=function(e){return this._data[e*a+2]},e.prototype.hasContent=function(e){return 4194303&this._data[e*a+0]},e.prototype.getCodePoint=function(e){var t=this._data[e*a+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},e.prototype.isCombined=function(e){return 2097152&this._data[e*a+0]},e.prototype.getString=function(e){var t=this._data[e*a+0];return 2097152&t?this._combined[e]:2097151&t?o.stringFromCodePoint(2097151&t):""},e.prototype.loadCell=function(e,t){var i=e*a;return t.content=this._data[i+0],t.fg=this._data[i+1],t.bg=this._data[i+2],2097152&t.content&&(t.combinedData=this._combined[e]),t},e.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),this._data[e*a+0]=t.content,this._data[e*a+1]=t.fg,this._data[e*a+2]=t.bg},e.prototype.setCellFromCodePoint=function(e,t,i,r,n){this._data[e*a+0]=t|i<<22,this._data[e*a+1]=r,this._data[e*a+2]=n},e.prototype.addCodepointToCell=function(e,t){var i=this._data[e*a+0];2097152&i?this._combined[e]+=o.stringFromCodePoint(t):(2097151&i?(this._combined[e]=o.stringFromCodePoint(2097151&i)+o.stringFromCodePoint(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[e*a+0]=i)},e.prototype.insertCells=function(e,t,i){if(e%=this.length,t<this.length-e){for(var r=new h,n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(n=0;n<t;++n)this.setCell(e+n,i)}else for(n=e;n<this.length;++n)this.setCell(n,i)},e.prototype.deleteCells=function(e,t,i){if(e%=this.length,t<this.length-e){for(var r=new h,n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(n=this.length-t;n<this.length;++n)this.setCell(n,i)}else for(n=e;n<this.length;++n)this.setCell(n,i)},e.prototype.replaceCells=function(e,t,i){for(;e<t&&e<this.length;)this.setCell(e++,i)},e.prototype.resize=function(e,t){if(e!==this.length){if(e>this.length){var i=new Uint32Array(e*a);this.length&&(e*a<this._data.length?i.set(this._data.subarray(0,e*a)):i.set(this._data)),this._data=i;for(var r=this.length;r<e;++r)this.setCell(r,t)}else if(e){(i=new Uint32Array(e*a)).set(this._data.subarray(0,e*a)),this._data=i;var n=Object.keys(this._combined);for(r=0;r<n.length;r++){var o=parseInt(n[r],10);o>=e&&delete this._combined[o]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={};for(var t=0;t<this.length;++t)this.setCell(t,e)},e.prototype.copyFrom=function(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];this.isWrapped=e.isWrapped},e.prototype.clone=function(){var t=new e(0);for(var i in t._data=new Uint32Array(this._data),t.length=this.length,this._combined)t._combined[i]=this._combined[i];return t.isWrapped=this.isWrapped,t},e.prototype.getTrimmedLength=function(){for(var e=this.length-1;e>=0;--e)if(4194303&this._data[e*a+0])return e+(this._data[e*a+0]>>22);return 0},e.prototype.copyCellsFrom=function(e,t,i,r,n){var o=e._data;if(n)for(var s=r-1;s>=0;s--)for(var l=0;l<a;l++)this._data[(i+s)*a+l]=o[(t+s)*a+l];else for(s=0;s<r;s++)for(l=0;l<a;l++)this._data[(i+s)*a+l]=o[(t+s)*a+l];var h=Object.keys(e._combined);for(l=0;l<h.length;l++){var c=parseInt(h[l],10);c>=t&&(this._combined[c-t+i]=e._combined[c])}},e.prototype.translateToString=function(e,i,r){void 0===e&&(e=!1),void 0===i&&(i=0),void 0===r&&(r=this.length),e&&(r=Math.min(r,this.getTrimmedLength()));for(var n="";i<r;){var s=this._data[i*a+0],l=2097151&s;n+=2097152&s?this._combined[i]:l?o.stringFromCodePoint(l):t.WHITESPACE_CELL_CHAR,i+=s>>22||1}return n},e}();t.BufferLine=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._listeners=[]}return Object.defineProperty(e.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(t){return e._listeners.push(t),{dispose:function(){for(var i=0;i<e._listeners.length;i++)if(e._listeners[i]===t)return void e._listeners.splice(i,1)}}}),this._event},enumerable:!0,configurable:!0}),e.prototype.fire=function(e){for(var t=[],i=0;i<this._listeners.length;i++)t.push(this._listeners[i]);for(i=0;i<t.length;i++)t[i].call(void 0,e)},e}();t.EventEmitter2=r},function(e,t,i){var r,n;void 0===(n="function"==typeof(r=function(e){"use strict";e.__esModule=!0;var t={},i=Object.prototype.hasOwnProperty,r=function(e){var r=arguments.length<=1||void 0===arguments[1]?t:arguments[1],n=r.cache||{};return function(){for(var t=arguments.length,o=Array(t),s=0;s<t;s++)o[s]=arguments[s];var a=String(o[0]);return!1===r.caseSensitive&&(a=a.toLowerCase()),i.call(n,a)?n[a]:n[a]=e.apply(this,o)}},n=function(e,t){if("function"==typeof t){var i=e;e=t,t=i}var r=t&&t.delay||t||0,n=void 0,o=void 0,s=void 0;return function(){for(var t=arguments.length,i=Array(t),a=0;a<t;a++)i[a]=arguments[a];n=i,o=this,s||(s=setTimeout(function(){e.apply(o,n),n=o=s=null},r))}},o=function(e,t,i){var r=i.value;return{configurable:!0,get:function(){var e=r.bind(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e}}},s=h(r),a=h(n),l=h(function(e,t){return e.bind(t)},function(){return o});function h(e,t){var i,r=(t=t||e.decorate||(i=e,function(e){return"function"==typeof e?i(e):function(t,r,n){n.value=i(n.value,e,t,r,n)}}))();return function(){for(var i=arguments.length,n=Array(i),o=0;o<i;o++)n[o]=arguments[o];var s=n.length;return(s<2?t:s>2?r:e).apply(void 0,n)}}e.memoize=s,e.debounce=a,e.bind=l,e.default={memoize:s,debounce:a,bind:l}})?r.apply(t,[t]):r)||(e.exports=n)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=function(e,t,i,r){return e.addEventListener(t,i,r),{dispose:function(){i&&e.removeEventListener(t,i,r)}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"==typeof navigator,n=r?"node":navigator.userAgent,o=r?"node":navigator.platform;function s(e,t){return e.indexOf(t)>=0}t.isFirefox=!!~n.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.isMSIE=!!~n.indexOf("MSIE")||!!~n.indexOf("Trident"),t.isMac=s(["Macintosh","MacIntel","MacPPC","Mac68K"],o),t.isIpad="iPad"===o,t.isIphone="iPhone"===o,t.isMSWindows=s(["Windows","Win16","Win32","WinCE"],o),t.isLinux=o.indexOf("Linux")>=0},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_COLOR=256},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.NUL="\0",e.SOH="\ 1",e.STX="\ 2",e.ETX="\ 3",e.EOT="\ 4",e.ENQ="\ 5",e.ACK="\ 6",e.BEL="\a",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="\ e",e.SI="\ f",e.DLE="\10",e.DC1="\11",e.DC2="\12",e.DC3="\13",e.DC4="\14",e.NAK="\15",e.SYN="\16",e.ETB="\17",e.CAN="\18",e.EM="\19",e.SUB="\1a",e.ESC="\e",e.FS="\1c",e.GS="\1d",e.RS="\1e",e.US="\1f",e.SP=" ",e.DEL="\7f"}(t.C0||(t.C0={})),function(e){e.PAD="\80",e.HOP="\81",e.BPH="\82",e.NBH="\83",e.IND="\84",e.NEL="\85",e.SSA="\86",e.ESA="\87",e.HTS="\88",e.HTJ="\89",e.VTS="\8a",e.PLD="\8b",e.PLU="\8c",e.RI="\8d",e.SS2="\8e",e.SS3="\8f",e.DCS="\90",e.PU1="\91",e.PU2="\92",e.STS="\93",e.CCH="\94",e.MW="\95",e.SPA="\96",e.EPA="\97",e.SOS="\98",e.SGCI="\99",e.SCI="\9a",e.CSI="\9b",e.ST="\9c",e.OSC="\9d",e.PM="\9e",e.APC="\9f"}(t.C1||(t.C1={}))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(7),n=i(4),o=i(17),s=i(1),a=function(){function e(e,t,i,r,n){this._container=e,this._alpha=r,this._colors=n,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){this._container.removeChild(this._canvas),this._charAtlas&&this._charAtlas.dispose()},e.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha}),this._alpha||this.clearAll()},e.prototype.onOptionsChanged=function(e){},e.prototype.onBlur=function(e){},e.prototype.onFocus=function(e){},e.prototype.onCursorMove=function(e){},e.prototype.onGridChanged=function(e,t,i){},e.prototype.onSelectionChanged=function(e,t,i,r){void 0===r&&(r=!1)},e.prototype.setColors=function(e,t){this._refreshCharAtlas(e,t)},e.prototype.setTransparency=function(e,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(e,this._colors),this.onGridChanged(e,0,e.rows-1)}},e.prototype._refreshCharAtlas=function(e,t){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=o.acquireCharAtlas(e,t,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e,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(e,this._colors)},e.prototype.fillCells=function(e,t,i,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight)},e.prototype.fillBottomLineAtCells=function(e,t,i){void 0===i&&(i=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,i*this._scaledCellWidth,window.devicePixelRatio)},e.prototype.fillLeftLineAtCell=function(e,t){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},e.prototype.strokeRectAtCell=function(e,t,i,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,i*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},e.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))},e.prototype.clearCells=function(e,t,i,r){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight))},e.prototype.fillCharTrueColor=function(e,t,i,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline="middle",this._clipRow(e,r),this._ctx.fillText(t.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},e.prototype.drawChars=function(e,t,i,o){var a,l;t.isFgRGB()||t.isBgRGB()?this._drawUncachedChars(e,t,i,o):(t.isInverse()?(a=t.isBgDefault()?n.INVERTED_DEFAULT_COLOR:t.getBgColor(),l=t.isFgDefault()?n.INVERTED_DEFAULT_COLOR:t.getFgColor()):(l=t.isBgDefault()?r.DEFAULT_COLOR:t.getBgColor(),a=t.isFgDefault()?r.DEFAULT_COLOR:t.getFgColor()),a+=e.options.drawBoldTextInBrightColors&&t.isBold()&&a<8&&a!==n.INVERTED_DEFAULT_COLOR?8:0,this._currentGlyphIdentifier.chars=t.getChars()||s.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=t.getCode()||s.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=l,this._currentGlyphIdentifier.fg=a,this._currentGlyphIdentifier.bold=t.isBold()&&e.options.enableBold,this._currentGlyphIdentifier.dim=!!t.isDim(),this._currentGlyphIdentifier.italic=!!t.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,i*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,i,o))},e.prototype._drawUncachedChars=function(e,t,i,r){if(this._ctx.save(),this._ctx.font=this._getFont(e,t.isBold()&&e.options.enableBold,!!t.isItalic()),this._ctx.textBaseline="middle",t.isInverse())t.isBgDefault()?this._ctx.fillStyle=this._colors.background.css:t.isBgRGB()?this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(t.getBgColor()).join(",")+")":this._ctx.fillStyle=this._colors.ansi[t.getBgColor()].css;else if(t.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(t.isFgRGB())this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var o=t.getFgColor();e.options.drawBoldTextInBrightColors&&t.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css}this._clipRow(e,r),t.isDim()&&(this._ctx.globalAlpha=n.DIM_OPACITY),this._ctx.fillText(t.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},e.prototype._clipRow=function(e,t){this._ctx.beginPath(),this._ctx.rect(0,t*this._scaledCellHeight,e.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t,i){return(i?"italic":"")+" "+(t?e.options.fontWeightBold:e.options.fontWeight)+" "+e.options.fontSize*window.devicePixelRatio+"px "+e.options.fontFamily},e}();t.BaseRenderLayer=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.length);for(var r="",n=t;n<i;++n){var o=e[n];o>65535?(o-=65536,r+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r};var r=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r=0,n=0;this._interim&&(56320<=(a=e.charCodeAt(n++))&&a<=57343?t[r++]=1024*(this._interim-55296)+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0);for(var o=n;o<i;++o){var s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=i)return this._interim=s,r;var a;56320<=(a=e.charCodeAt(o))&&a<=57343?t[r++]=1024*(s-55296)+a-56320+65536:(t[r++]=s,t[r++]=a)}else t[r++]=s}return r},e}();t.StringToUtf32=r;var n=function(){function e(){this.interim=new Uint8Array(3)}return e.prototype.clear=function(){this.interim.fill(0)},e.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r,n,o,s,a=0,l=0,h=0;if(this.interim[0]){var c=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var f=0,d=void 0;(d=63&this.interim[++f])&&f<4;)u<<=6,u|=d;for(var _=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,p=_-f;h<p;){if(h>=i)return 0;if(128!=(192&(d=e[h++]))){h--,c=!0;break}this.interim[f++]=d,u<<=6,u|=63&d}c||(2===_?u<128?h--:t[a++]=u:3===_?u<2048||u>=55296&&u<=57343||(t[a++]=u):l<65536||l>1114111||(t[a++]=u)),this.interim.fill(0)}for(var m=i-4,y=h;y<i;){for(;!(!(y<m)||128&(r=e[y])||128&(n=e[y+1])||128&(o=e[y+2])||128&(s=e[y+3]));)t[a++]=r,t[a++]=n,t[a++]=o,t[a++]=s,y+=4;if((r=e[y++])<128)t[a++]=r;else if(192==(224&r)){if(y>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[y++]))){y--;continue}if((l=(31&r)<<6|63&n)<128){y--;continue}t[a++]=l}else if(224==(240&r)){if(y>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[y++]))){y--;continue}if(y>=i)return this.interim[0]=r,this.interim[1]=n,a;if(128!=(192&(o=e[y++]))){y--;continue}if((l=(15&r)<<12|(63&n)<<6|63&o)<2048||l>=55296&&l<=57343)continue;t[a++]=l}else if(240==(248&r)){if(y>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[y++]))){y--;continue}if(y>=i)return this.interim[0]=r,this.interim[1]=n,a;if(128!=(192&(o=e[y++]))){y--;continue}if(y>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,a;if(128!=(192&(s=e[y++]))){y--;continue}if((l=(7&r)<<18|(63&n)<<12|(63&o)<<6|63&s)<65536||l>1114111)continue;t[a++]=l}}return a},e}();t.Utf8ToUtf32=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(7);t.generateConfig=function(e,t,i,r){var n={foreground:r.foreground,background:r.background,cursor:null,cursorAccent:null,selection:null,ansi:r.ansi.slice(0,16)};return{type:i.options.experimentalCharAtlas,devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:i.options.fontFamily,fontSize:i.options.fontSize,fontWeight:i.options.fontWeight,fontWeightBold:i.options.fontWeightBold,allowTransparency:i.options.allowTransparency,colors:n}},t.configEquals=function(e,t){for(var i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.type===t.type&&e.devicePixelRatio===t.devicePixelRatio&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.scaledCharWidth===t.scaledCharWidth&&e.scaledCharHeight===t.scaledCharHeight&&e.colors.foreground===t.colors.foreground&&e.colors.background===t.colors.background},t.is256Color=function(e){return e<r.DEFAULT_COLOR}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blankLine="Blank line",t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(30),n=i(1),o=i(31),s=i(32);t.MAX_BUFFER_SIZE=4294967295;var a=function(){function e(e,t){this._terminal=e,this._hasScrollback=t,this.savedCurAttrData=n.DEFAULT_ATTR_DATA.clone(),this.markers=[],this._nullCell=n.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,n.WHITESPACE_CELL_CHAR,n.WHITESPACE_CELL_WIDTH,n.WHITESPACE_CELL_CODE]),this._cols=this._terminal.cols,this._rows=this._terminal.rows,this.clear()}return e.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg):(this._nullCell.fg=0,this._nullCell.bg=0),this._nullCell},e.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0),this._whitespaceCell},e.prototype.getBlankLine=function(e,t){return new n.BufferLine(this._terminal.cols,this.getNullCell(e),t)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows},enumerable:!0,configurable:!0}),e.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var i=e+this._terminal.options.scrollback;return i>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=n.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,t){var i=this.getNullCell(n.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(var o=0;o<this.lines.length;o++)this.lines.get(o).resize(e,i);var s=0;if(this._rows<t)for(var a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this.ybase>0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new n.BufferLine(e,i)));else for(a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){var l=this.lines.length-r;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedY=Math.min(this.savedY,t-1),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(o=0;o<this.lines.length;o++)this.lines.get(o).resize(e,i);this._cols=e,this._rows=t},Object.defineProperty(e.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._terminal.options.windowsMode},enumerable:!0,configurable:!0}),e.prototype._reflow=function(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var i=o.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(n.DEFAULT_ATTR_DATA));if(i.length>0){var r=o.reflowLargerCreateNewLayout(this.lines,i);o.reflowLargerApplyNewLayout(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,t,i){for(var r=this.getNullCell(n.DEFAULT_ATTR_DATA),o=i;o-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new n.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--)},e.prototype._reflowSmaller=function(e,t){for(var i=this.getNullCell(n.DEFAULT_ATTR_DATA),r=[],s=0,a=this.lines.length-1;a>=0;a--){var l=this.lines.get(a);if(!(!l||!l.isWrapped&&l.getTrimmedLength()<=e)){for(var h=[l];l.isWrapped&&a>0;)l=this.lines.get(--a),h.unshift(l);var c=this.ybase+this.y;if(!(c>=a&&c<a+h.length)){var u,f=h[h.length-1].getTrimmedLength(),d=o.reflowSmallerGetNewLineLengths(h,this._cols,e),_=d.length-h.length;u=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+_):Math.max(0,this.lines.length-this.lines.maxLength+_);for(var p=[],m=0;m<_;m++){var y=this.getBlankLine(n.DEFAULT_ATTR_DATA,!0);p.push(y)}p.length>0&&(r.push({start:a+h.length+s,newLines:p}),s+=p.length),h.push.apply(h,p);var g=d.length-1,C=d[g];0===C&&(C=d[--g]);for(var v=h.length-_-1,b=f;v>=0;){var w=Math.min(b,C);if(h[g].copyCellsFrom(h[v],b-w,C-w,w,!0),0==(C-=w)&&(C=d[--g]),0==(b-=w)){v--;var S=Math.max(v,0);b=o.getWrappedLineTrimmedLength(h,S,this._cols)}}for(m=0;m<h.length;m++)d[m]<e&&h[m].setCell(d[m],i);for(var E=_-u;E-- >0;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++)}}}if(r.length>0){var L=[],x=[];for(m=0;m<this.lines.length;m++)x.push(this.lines.get(m));var A=this.lines.length,T=A-1,k=0,M=r[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);var R=0;for(m=Math.min(this.lines.maxLength-1,A+s-1);m>=0;m--)if(M&&M.start>T+R){for(var D=M.newLines.length-1;D>=0;D--)this.lines.set(m--,M.newLines[D]);m++,L.push({index:T+1,amount:M.newLines.length}),R+=M.newLines.length,M=r[++k]}else this.lines.set(m,x[T--]);var O=0;for(m=L.length-1;m>=0;m--)L[m].index+=O,this.lines.onInsertEmitter.fire(L[m]),O+=L[m].amount;var H=Math.max(0,A+s-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}},e.prototype.stringIndexToBufferIndex=function(e,t,i){for(void 0===i&&(i=!1);t;){var r=this.lines.get(e);if(!r)return[-1,-1];for(var o=i?r.getTrimmedLength():r.length,s=0;s<o;++s)if(r.get(s)[n.CHAR_DATA_WIDTH_INDEX]&&(t-=r.get(s)[n.CHAR_DATA_CHAR_INDEX].length||1),t<0)return[e,s];e++}return[e,0]},e.prototype.translateBufferLineToString=function(e,t,i,r){void 0===i&&(i=0);var n=this.lines.get(e);return n?n.translateToString(t,i,r):""},e.prototype.getWrappedRangeForLine=function(e){for(var t=e,i=e;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}},e.prototype.setupTabStops=function(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._terminal.options.tabStopWidth)this.tabs[e]=!0},e.prototype.prevStop=function(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,i=new s.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim(function(e){i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(function(e){i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.onDelete(function(e){i.line>=e.index&&i.line<e.index+e.amount&&i.dispose(),i.line>e.index&&(i.line-=e.amount)})),i.register(i.onDispose(function(){return t._removeMarker(i)})),i},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,i,r,n){return new l(this,e,t,i,r,n)},e}();t.Buffer=a;var l=function(){function e(e,t,i,r,n,o){void 0===i&&(i=0),void 0===r&&(r=e.lines.length),void 0===n&&(n=0),void 0===o&&(o=0),this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=n,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return e.prototype.hasNext=function(){return this._current<this._endIndex},e.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 t="",i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(16);t.wcwidth=function(e){var t=[[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]],i=[[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]],n=0|e.control,o=new Uint8Array(65536);r.fill(o,1),o[0]=e.nul,r.fill(o,e.control,1,32),r.fill(o,e.control,127,160),r.fill(o,2,4352,4448),o[9001]=2,o[9002]=2,r.fill(o,2,11904,42192),o[12351]=1,r.fill(o,2,44032,55204),r.fill(o,2,63744,64256),r.fill(o,2,65040,65050),r.fill(o,2,65072,65136),r.fill(o,2,65280,65377),r.fill(o,2,65504,65511);for(var s=0;s<t.length;++s)r.fill(o,0,t[s][0],t[s][1]+1);return function(e){return e<32?0|n:e<127?1:e<65536?o[e]:function(e,t){var i,r=0,n=t.length-1;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(e>t[i=r+n>>1][1])r=i+1;else{if(!(e<t[i][0]))return!0;n=i-1}return!1}(t=e,i)?0:t>=131072&&t<=196605||t>=196608&&t<=262141?2:1;var t}}({nul:0,control:0}),t.getStringCellWidth=function(e){for(var i=0,r=e.length,n=0;n<r;++n){var o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return i+t.wcwidth(o);var s=e.charCodeAt(n);56320<=s&&s<=57343?o=1024*(o-55296)+s-56320+65536:i+=t.wcwidth(s)}i+=t.wcwidth(o)}return i}},function(e,t,i){"use strict";function r(e,t,i,r){if(void 0===i&&(i=0),void 0===r&&(r=e.length),i>=e.length)return e;i=(e.length+i)%e.length,r=r>=e.length?e.length:(e.length+r)%e.length;for(var n=i;n<r;++n)e[n]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.fill=function(e,t,i,n){return e.fill?e.fill(t,i,n):r(e,t,i,n)},t.fillFallback=r,t.concat=function(e,t){var i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(11),n=i(43),o=i(45),s=i(46),a={none:o.default,static:s.default,dynamic:n.default},l=[];t.acquireCharAtlas=function(e,t,i,n){for(var o=r.generateConfig(i,n,e,t),s=0;s<l.length;s++){var h=(c=l[s]).ownedBy.indexOf(e);if(h>=0){if(r.configEquals(c.config,o))return c.atlas;1===c.ownedBy.length?(c.atlas.dispose(),l.splice(s,1)):c.ownedBy.splice(h,1);break}}for(s=0;s<l.length;s++){var c=l[s];if(r.configEquals(c.config,o))return c.ownedBy.push(e),c.atlas}var u={atlas:new a[e.options.experimentalCharAtlas](document,o),config:o,ownedBy:[e]};return l.push(u),u.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<l.length;t++){var i=l[t].ownedBy.indexOf(e);if(-1!==i){1===l[t].ownedBy.length?(l[t].atlas.dispose(),l.splice(t,1)):l[t].ownedBy.splice(i,1);break}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l("#ffffff"),n=l("#000000"),o=l("#ffffff"),s=l("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967159};function l(e){return{css:e,rgba:parseInt(e.slice(1),16)<<8|255}}function h(e){var t=e.toString(16);return t.length<2?"0"+t:t}t.DEFAULT_ANSI_COLORS=function(){for(var e=[l("#2e3436"),l("#cc0000"),l("#4e9a06"),l("#c4a000"),l("#3465a4"),l("#75507b"),l("#06989a"),l("#d3d7cf"),l("#555753"),l("#ef2929"),l("#8ae234"),l("#fce94f"),l("#729fcf"),l("#ad7fa8"),l("#34e2e2"),l("#eeeeec")],t=[0,95,135,175,215,255],i=0;i<216;i++){var r=t[i/36%6|0],n=t[i/6%6|0],o=t[i%6];e.push({css:"#"+h(r)+h(n)+h(o),rgba:(r<<24|n<<16|o<<8|255)>>>0})}for(i=0;i<24;i++){var s=8+10*i,a=h(s);e.push({css:"#"+a+a+a,rgba:(s<<24|s<<16|s<<8|255)>>>0})}return e}();var c=function(){function e(e,i){this.allowTransparency=i;var l=e.createElement("canvas");l.width=1,l.height=1;var h=l.getContext("2d");if(!h)throw new Error("Could not get rendering context");this._ctx=h,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:r,background:n,cursor:o,cursorAccent:s,selection:a,ansi:t.DEFAULT_ANSI_COLORS.slice()}}return e.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,r),this.colors.background=this._parseColor(e.background,n),this.colors.cursor=this._parseColor(e.cursor,o,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,s,!0),this.colors.selection=this._parseColor(e.selection,a,!0),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15])},e.prototype._parseColor=function(e,t,i){if(void 0===i&&(i=this.allowTransparency),void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;return i||255===r[3]?{css:e,rgba:(r[0]<<24|r[1]<<16|r[2]<<8|r[3])>>>0}:(console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t)},e}();t.ColorManager=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(6),n=i(4);function o(e,t){for(var i=!0,r=t.rgba>>>24,n=t.rgba>>>16&255,o=t.rgba>>>8&255,s=0;s<e.data.length;s+=4)e.data[s]===r&&e.data[s+1]===n&&e.data[s+2]===o?e.data[s+3]=0:i=!1;return i}function s(e,t){return e+" "+t.fontSize*t.devicePixelRatio+"px "+t.fontFamily}t.generateStaticCharAtlasTexture=function(e,t,i){var a=i.scaledCharWidth+n.CHAR_ATLAS_CELL_SPACING,l=i.scaledCharHeight+n.CHAR_ATLAS_CELL_SPACING,h=t(255*a,34*l),c=h.getContext("2d",{alpha:i.allowTransparency});c.fillStyle=i.colors.background.css,c.fillRect(0,0,h.width,h.height),c.save(),c.fillStyle=i.colors.foreground.css,c.font=s(i.fontWeight,i),c.textBaseline="middle";for(var u=0;u<256;u++)c.save(),c.beginPath(),c.rect(u*a,0,a,l),c.clip(),c.fillText(String.fromCharCode(u),u*a,l/2),c.restore();for(c.save(),c.font=s(i.fontWeightBold,i),u=0;u<256;u++)c.save(),c.beginPath(),c.rect(u*a,l,a,l),c.clip(),c.fillText(String.fromCharCode(u),u*a,1.5*l),c.restore();c.restore(),c.font=s(i.fontWeight,i);for(var f=0;f<16;f++){var d=(f+2)*l;for(u=0;u<256;u++)c.save(),c.beginPath(),c.rect(u*a,d,a,l),c.clip(),c.fillStyle=i.colors.ansi[f].css,c.fillText(String.fromCharCode(u),u*a,d+l/2),c.restore()}for(c.font=s(i.fontWeightBold,i),f=0;f<16;f++)for(d=(f+2+16)*l,u=0;u<256;u++)c.save(),c.beginPath(),c.rect(u*a,d,a,l),c.clip(),c.fillStyle=i.colors.ansi[f].css,c.fillText(String.fromCharCode(u),u*a,d+l/2),c.restore();if(c.restore(),!("createImageBitmap"in e)||r.isFirefox||r.isSafari)return h;var _=c.getImageData(0,0,h.width,h.height);return o(_,i.colors.background),e.createImageBitmap(_)},t.clearColor=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),s=function(e){function t(t,i,r){var n=e.call(this)||this;return n.content=0,n.combinedData="",n.fg=t.fg,n.bg=t.bg,n.combinedData=i,n._width=r,n}return n(t,e),t.prototype.isCombined=function(){return 2097152},t.prototype.getWidth=function(){return this._width},t.prototype.getChars=function(){return this.combinedData},t.prototype.getCode=function(){return 2097151},t.prototype.setFromCharData=function(e){throw new Error("not implemented")},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(o.AttributeData);t.JoinedCellData=s;var a=function(){function e(e){this._terminal=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new o.CellData}return e.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1},e.prototype.getJoinedCharacters=function(e){if(0===this._characterJoiners.length)return[];var t=this._terminal.buffer.lines.get(e);if(0===t.length)return[];for(var i=[],r=t.translateToString(!0),n=0,s=0,a=0,l=t.getFg(0),h=t.getBg(0),c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==l||this._workCell.bg!==h){if(c-n>1)for(var u=this._getJoinedRanges(r,a,s,t,n),f=0;f<u.length;f++)i.push(u[f]);n=c,a=s,l=this._workCell.fg,h=this._workCell.bg}s+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._terminal.cols-n>1)for(u=this._getJoinedRanges(r,a,s,t,n),f=0;f<u.length;f++)i.push(u[f]);return i},e.prototype._getJoinedRanges=function(t,i,r,n,o){for(var s=t.substring(i,r),a=this._characterJoiners[0].handler(s),l=1;l<this._characterJoiners.length;l++)for(var h=this._characterJoiners[l].handler(s),c=0;c<h.length;c++)e._mergeRanges(a,h[c]);return this._stringRangesToCellRanges(a,n,o),a},e.prototype._stringRangesToCellRanges=function(e,t,i){var r=0,n=!1,s=0,a=e[r];if(a){for(var l=i;l<this._terminal.cols;l++){var h=t.getWidth(l),c=t.getString(l).length||o.WHITESPACE_CELL_CHAR.length;if(0!==h){if(!n&&a[0]<=s&&(a[0]=l,n=!0),a[1]<=s){if(a[1]=l,!(a=e[++r]))break;a[0]<=s?(a[0]=l,n=!0):n=!1}s+=c}}a&&(a[1]=this._terminal.cols)}},e._mergeRanges=function(e,t){for(var i=!1,r=0;r<e.length;r++){var n=e[r];if(i){if(t[1]<=n[0])return e[r-1][1]=t[1],e;if(t[1]<=n[1])return e[r-1][1]=Math.max(t[1],n[1]),e.splice(r,1),i=!1,e;e.splice(r,1),r--}else{if(t[1]<=n[0])return e.splice(r,0,t),e;if(t[1]<=n[1])return n[0]=Math.min(t[0],n[0]),e;t[0]<n[1]&&(n[0]=Math.min(t[0],n[0]),i=!0)}}return i?e[e.length-1][1]=t[1]:e.push(t),e},e}();t.CharacterJoinerRegistry=a},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(5),a=function(e){function t(t){var i=e.call(this)||this;return i._terminal=t,i._zones=[],i._areZonesActive=!1,i._tooltipTimeout=null,i._currentZone=null,i._lastHoverCoords=[null,null],i.register(s.addDisposableDomListener(i._terminal.element,"mousedown",function(e){return i._onMouseDown(e)})),i._mouseMoveListener=function(e){return i._onMouseMove(e)},i._mouseLeaveListener=function(e){return i._onMouseLeave(e)},i._clickListener=function(e){return i._onClick(e)},i}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._deactivate()},t.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},t.prototype.clearAll=function(e,t){if(0!==this._zones.length){t||(e=0,t=this._terminal.rows-1);for(var i=0;i<this._zones.length;i++){var r=this._zones[i];(r.y1>e&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1<e&&r.y2>t+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(i--,1))}0===this._zones.length&&this._deactivate()}},t.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.addEventListener("click",this._clickListener))},t.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.removeEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.removeEventListener("click",this._clickListener))},t.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},t.prototype._onHover=function(e){var t=this,i=this._findZoneEventAt(e);i!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),i&&(this._currentZone=i,i.hoverCallback&&i.hoverCallback(e),this._tooltipTimeout=setTimeout(function(){return t._onTooltip(e)},500)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=null;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._terminal.getSelection().length,this._areZonesActive){var t=this._findZoneEventAt(e);t&&t.willLinkActivate(e)&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e),i=this._terminal.getSelection().length;t&&i===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._findZoneEventAt=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!t)return null;for(var i=t[0],r=t[1],n=0;n<this._zones.length;n++){var o=this._zones[n];if(o.y1===o.y2){if(r===o.y1&&i>=o.x1&&i<o.x2)return o}else if(r===o.y1&&i>=o.x1||r===o.y2&&i<o.x2||r>o.y1&&r<o.y2)return o}return null},t}(o.Disposable);t.MouseZoneManager=a;var l=function(e,t,i,r,n,o,s,a,l){this.x1=e,this.y1=t,this.x2=i,this.y2=r,this.clickCallback=n,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=l};t.MouseZone=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._renderCoordinator=e}return e.getCoordsRelativeToElement=function(e,t){var i=t.getBoundingClientRect();return[e.clientX-i.left,e.clientY-i.top]},e.prototype.getCoords=function(t,i,r,n,o,s){if(!r.width||!r.height)return null;var a=e.getCoordsRelativeToElement(t,i);return a?(a[0]=Math.ceil((a[0]+(s?this._renderCoordinator.dimensions.actualCellWidth/2:0))/this._renderCoordinator.dimensions.actualCellWidth),a[1]=Math.ceil(a[1]/this._renderCoordinator.dimensions.actualCellHeight),a[0]=Math.min(Math.max(a[0],1),n+(s?1:0)),a[1]=Math.min(Math.max(a[1],1),o),a):null},e.prototype.getRawByteCoords=function(e,t,i,r,n){var o=this.getCoords(e,t,i,r,n),s=o[0],a=o[1];return{x:s+=32,y:a+=32}},e}();t.MouseHelper=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._renderCallback=e}return e.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.refresh=function(e,t,i){var r=this;this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return r._innerRefresh()}))},e.prototype._innerRefresh=function(){void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(this._rowStart=Math.max(this._rowStart,0),this._rowEnd=Math.min(this._rowEnd,this._rowCount-1),this._renderCallback(this._rowStart,this._rowEnd),this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0)},e}();t.RenderDebouncer=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}return n(t,e),t.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener&&(t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr())},this._updateDpr()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.clearListener()},t.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},t.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)},t}(i(0).Disposable);t.ScreenDprMonitor=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(28),n=i(13),o=i(63),s=function(){function e(e){this._core=new r.Terminal(e),this._addonManager=new o.AddonManager}return Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return new a(this._core.buffer)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.on=function(e,t){this._core.on(e,t)},e.prototype.off=function(e,t){this._core.off(e,t)},e.prototype.emit=function(e,t){this._core.emit(e,t)},e.prototype.addDisposableListener=function(e,t){return this._core.addDisposableListener(e,t)},e.prototype.resize=function(e,t){this._core.resize(e,t)},e.prototype.writeln=function(e){this._core.writeln(e)},e.prototype.open=function(e){this._core.open(e)},e.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},e.prototype.addCsiHandler=function(e,t){return this._core.addCsiHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this._core.addOscHandler(e,t)},e.prototype.registerLinkMatcher=function(e,t,i){return this._core.registerLinkMatcher(e,t,i)},e.prototype.deregisterLinkMatcher=function(e){this._core.deregisterLinkMatcher(e)},e.prototype.registerCharacterJoiner=function(e){return this._core.registerCharacterJoiner(e)},e.prototype.deregisterCharacterJoiner=function(e){this._core.deregisterCharacterJoiner(e)},e.prototype.addMarker=function(e){return this._core.addMarker(e)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.select=function(e,t,i){this._core.select(e,t,i)},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(e,t){this._core.selectLines(e,t)},e.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},e.prototype.destroy=function(){this._core.destroy()},e.prototype.scrollLines=function(e){this._core.scrollLines(e)},e.prototype.scrollPages=function(e){this._core.scrollPages(e)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(e){this._core.scrollToLine(e)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(e){this._core.write(e)},e.prototype.writeUtf8=function(e){this._core.writeUtf8(e)},e.prototype.getOption=function(e){return this._core.getOption(e)},e.prototype.setOption=function(e,t){this._core.setOption(e,t)},e.prototype.refresh=function(e,t){this._core.refresh(e,t)},e.prototype.reset=function(){this._core.reset()},e.applyAddon=function(t){t.apply(e)},e.prototype.loadAddon=function(e){return this._addonManager.loadAddon(this,e)},Object.defineProperty(e,"strings",{get:function(){return n},enumerable:!0,configurable:!0}),e}();t.Terminal=s;var a=function(){function e(e){this._buffer=e}return Object.defineProperty(e.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!0,configurable:!0}),e.prototype.getLine=function(e){var t=this._buffer.lines.get(e);if(t)return new l(t)},e}(),l=function(){function e(e){this._line=e}return Object.defineProperty(e.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!0,configurable:!0}),e.prototype.getCell=function(e){if(!(e<0||e>=this._line.length))return new h(this._line,e)},e.prototype.translateToString=function(e,t,i){return this._line.translateToString(e,t,i)},e}(),h=function(){function e(e,t){this._line=e,this._x=t}return Object.defineProperty(e.prototype,"char",{get:function(){return this._line.getString(this._x)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._line.getWidth(this._x)},enumerable:!0,configurable:!0}),e}()},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.prototype.activate=function(e){this._terminal=e},e.prototype.dispose=function(){},e.prototype.fit=function(){var e=this.proposeDimensions();if(e&&this._terminal){var t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderCoordinator.clear(),this._terminal.resize(e.cols,e.rows))}},e.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element.parentElement){var e=this._terminal._core,t=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(t.getPropertyValue("height")),r=Math.max(0,parseInt(t.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o=i-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),s=r-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-e.viewport.scrollBarWidth;return{cols:Math.floor(s/e._renderCoordinator.dimensions.actualCellWidth),rows:Math.floor(o/e._renderCoordinator.dimensions.actualCellHeight)}}},e}();t.FitAddon=r},function(e,t,i){window,e.exports=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=new RegExp("(?:^|[^\\da-z\\.-]+)((https?:\\/\\/)((([\\da-z\\.-]+)\\.([a-z\\.]{2,6}))|((\\d{1,3}\\.){3}\\d{1,3})|(localhost))(:\\d{1,5})?((\\/[\\/\\w\\.\\-%~:+]*)*([^:\"'\\s]))?(\\?[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?(#[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?)($|[^\\/\\w\\.\\-%]+)");function n(e,t){window.open(t,"_blank")}var o=function(){function e(e,t){void 0===e&&(e=n),void 0===t&&(t={}),this._handler=e,this._options=t,this._options.matchIndex=1}return e.prototype.activate=function(e){this._terminal=e,this._linkMatcherId=this._terminal.registerLinkMatcher(r,this._handler,this._options)},e.prototype.dispose=function(){void 0!==this._linkMatcherId&&void 0!==this._terminal&&this._terminal.deregisterLinkMatcher(this._linkMatcherId)},e}();t.WebLinksAddon=o}])},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(29),s=i(14),a=i(33),l=i(34),h=i(35),c=i(36),u=i(8),f=i(37),d=i(40),_=i(50),p=i(51),m=i(54),y=i(6),g=i(5),C=i(13),v=i(22),b=i(55),w=i(21),S=i(56),E=i(17),L=i(57),x=i(59),A=i(60),T=i(2),k=i(1),M=i(61),R=i(18),D=i(62),O="undefined"!=typeof window?window.document:null,H=["cols","rows"],B={cols:80,rows:24,convertEol:!1,termName:"xterm",cursorBlink:!1,cursorStyle:"block",bellSound:b.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,enableBold:!0,experimentalCharAtlas:"static",fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,scrollback:1e3,screenKeys:!1,screenReaderMode:!1,debug:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,allowTransparency:!1,tabStopWidth:8,theme:void 0,rightClickSelectsWord:y.isMac,rendererType:"canvas",windowsMode:!1},P=function(e){function t(t){void 0===t&&(t={});var i=e.call(this)||this;return i.browser=y,i._blankLine=null,i._onCursorMove=new T.EventEmitter2,i._onData=new T.EventEmitter2,i._onKey=new T.EventEmitter2,i._onLineFeed=new T.EventEmitter2,i._onRender=new T.EventEmitter2,i._onResize=new T.EventEmitter2,i._onScroll=new T.EventEmitter2,i._onSelectionChange=new T.EventEmitter2,i._onTitleChange=new T.EventEmitter2,i.options=A.clone(t),i._setup(),i.onCursorMove(function(){return i.emit("cursormove")}),i.onData(function(e){return i.emit("data",e)}),i.onKey(function(e){return i.emit("key",e.key,e.domEvent)}),i.onLineFeed(function(){return i.emit("linefeed")}),i.onRender(function(e){return i.emit("refresh",e)}),i.onResize(function(e){return i.emit("resize",e)}),i.onSelectionChange(function(){return i.emit("selection")}),i.onScroll(function(e){return i.emit("scroll",e)}),i.onTitleChange(function(e){return i.emit("title",e)}),i}return n(t,e),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0),this._customKeyEventHandler=null,E.removeTerminalFromCache(this),this.handler=function(){},this.write=function(){},this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},t.prototype.destroy=function(){this.dispose()},t.prototype._setup=function(){var e=this;Object.keys(B).forEach(function(t){null!==e.options[t]&&void 0!==e.options[t]||(e.options[t]=B[t])}),this._parent=O?O.body:null,this.cols=Math.max(this.options.cols,2),this.rows=Math.max(this.options.rows,1),this.options.handler&&this.onData(this.options.handler),this.cursorState=0,this.cursorHidden=!1,this._customKeyEventHandler=null,this.applicationKeypad=!1,this.applicationCursor=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!0,this.bracketedPasteMode=!1,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.curAttrData=k.DEFAULT_ATTR_DATA.clone(),this._eraseAttrData=k.DEFAULT_ATTR_DATA.clone(),this.params=[],this.currentParam=0,this.writeBuffer=[],this.writeBufferUtf8=[],this._writeInProgress=!1,this._xoffSentToCatchUp=!1,this._userScrolling=!1,this._inputHandler=new f.InputHandler(this),this._inputHandler.onCursorMove(function(){return e._onCursorMove.fire()}),this._inputHandler.onLineFeed(function(){return e._onLineFeed.fire()}),this._inputHandler.onData(function(t){return e._onData.fire(t)}),this.register(this._inputHandler),this.selectionManager=this.selectionManager||null,this.linkifier=this.linkifier||new _.Linkifier(this),this._mouseZoneManager=this._mouseZoneManager||null,this.soundManager=this.soundManager||new b.SoundManager(this),this.buffers=new o.BufferSet(this),this.selectionManager&&(this.selectionManager.clearSelection(),this.selectionManager.initBuffersListeners()),this.options.windowsMode&&(this._windowsMode=M.applyWindowsMode(this))},Object.defineProperty(t.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),t.prototype.eraseAttrData=function(){return this._eraseAttrData.bg&=-67108864,this._eraseAttrData.bg|=67108863&this.curAttrData.bg,this._eraseAttrData},t.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},Object.defineProperty(t.prototype,"isFocused",{get:function(){return O.activeElement===this.textarea&&O.hasFocus()},enumerable:!0,configurable:!0}),t.prototype.getOption=function(e){if(!(e in B))throw new Error('No option with key "'+e+'"');return this.options[e]},t.prototype.setOption=function(e,t){if(!(e in B))throw new Error('No option with key "'+e+'"');if(-1!==H.indexOf(e)&&console.error('Option "'+e+'" can only be set in the constructor'),this.options[e]!==t){switch(e){case"bellStyle":t||(t="none");break;case"cursorStyle":t||(t="block");break;case"fontWeight":t||(t="normal");break;case"fontWeightBold":t||(t="bold");break;case"lineHeight":if(t<1)return void console.warn(e+" cannot be less than 1, value: "+t);case"rendererType":t||(t="canvas");break;case"tabStopWidth":if(t<1)return void console.warn(e+" cannot be less than 1, value: "+t);break;case"theme":this._setTheme(t);break;case"scrollback":if((t=Math.min(t,s.MAX_BUFFER_SIZE))<0)return void console.warn(e+" cannot be less than 0, value: "+t);if(this.options[e]!==t){var i=this.rows+t;if(this.buffer.lines.length>i){var r=this.buffer.lines.length-i,n=this.buffer.ydisp-r<0;this.buffer.lines.trimStart(r),this.buffer.ybase=Math.max(this.buffer.ybase-r,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-r,0),n&&this.refresh(0,this.rows-1)}}}switch(this.options[e]=t,e){case"fontFamily":case"fontSize":this._renderCoordinator&&(this._renderCoordinator.clear(),this.charMeasure.measure(this.options));break;case"drawBoldTextInBrightColors":case"experimentalCharAtlas":case"enableBold":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":this._renderCoordinator&&(this._renderCoordinator.clear(),this._renderCoordinator.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderCoordinator&&this._renderCoordinator.setRenderer(this._createRenderer());break;case"scrollback":this.buffers.resize(this.cols,this.rows),this.viewport&&this.viewport.syncScrollArea();break;case"screenReaderMode":t?!this._accessibilityManager&&this._renderCoordinator&&(this._accessibilityManager=new S.AccessibilityManager(this,this._renderCoordinator.dimensions)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"windowsMode":t?this._windowsMode||(this._windowsMode=M.applyWindowsMode(this)):this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0)}this._renderCoordinator&&this._renderCoordinator.onOptionsChanged()}},t.prototype._onTextAreaFocus=function(e){this.sendFocus&&this.handler(u.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},t.prototype.blur=function(){return this.textarea.blur()},t.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.sendFocus&&this.handler(u.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},t.prototype._initGlobal=function(){var e=this;this._bindKeys(),this.register(g.addDisposableDomListener(this.element,"copy",function(t){e.hasSelection()&&c.copyHandler(t,e,e.selectionManager)}));var t=function(t){return c.pasteHandler(t,e)};this.register(g.addDisposableDomListener(this.textarea,"paste",t)),this.register(g.addDisposableDomListener(this.element,"paste",t)),y.isFirefox?this.register(g.addDisposableDomListener(this.element,"mousedown",function(t){2===t.button&&c.rightClickHandler(t,e,e.selectionManager,e.options.rightClickSelectsWord)})):this.register(g.addDisposableDomListener(this.element,"contextmenu",function(t){c.rightClickHandler(t,e,e.selectionManager,e.options.rightClickSelectsWord)})),y.isLinux&&this.register(g.addDisposableDomListener(this.element,"auxclick",function(t){1===t.button&&c.moveTextAreaUnderMouseCursor(t,e)}))},t.prototype._bindKeys=function(){var e=this,t=this;this.register(g.addDisposableDomListener(this.element,"keydown",function(e){O.activeElement===this&&t._keyDown(e)},!0)),this.register(g.addDisposableDomListener(this.element,"keypress",function(e){O.activeElement===this&&t._keyPress(e)},!0)),this.register(g.addDisposableDomListener(this.element,"keyup",function(i){(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode})(i)||e.focus(),t._keyUp(i)},!0)),this.register(g.addDisposableDomListener(this.textarea,"keydown",function(t){return e._keyDown(t)},!0)),this.register(g.addDisposableDomListener(this.textarea,"keypress",function(t){return e._keyPress(t)},!0)),this.register(g.addDisposableDomListener(this.textarea,"compositionstart",function(){return e._compositionHelper.compositionstart()})),this.register(g.addDisposableDomListener(this.textarea,"compositionupdate",function(t){return e._compositionHelper.compositionupdate(t)})),this.register(g.addDisposableDomListener(this.textarea,"compositionend",function(){return e._compositionHelper.compositionend()})),this.register(this.onRender(function(){return e._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(t){return e._queueLinkification(t.start,t.end)}))},t.prototype.open=function(e){var t=this;if(this._parent=e||this._parent,!this._parent)throw new Error("Terminal requires a parent element.");this._context=this._parent.ownerDocument.defaultView,this._document=this._parent.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),this._parent.appendChild(this.element);var i=O.createDocumentFragment();this._viewportElement=O.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=O.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=O.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=O.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this._mouseZoneManager=new w.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return t._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=O.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.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(g.addDisposableDomListener(this.textarea,"focus",function(e){return t._onTextAreaFocus(e)})),this.register(g.addDisposableDomListener(this.textarea,"blur",function(){return t._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea),this._compositionView=O.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=new a.CompositionHelper(this.textarea,this._compositionView,this),this._helperContainer.appendChild(this._compositionView),this.charMeasure=new m.CharMeasure(O,this._helperContainer),this.element.appendChild(i),this._theme=this.options.theme,this._colorManager=new R.ColorManager(O,this.options.allowTransparency),this._colorManager.setTheme(this._theme);var r=this._createRenderer();this._renderCoordinator=new D.RenderCoordinator(r,this.rows,this.screenElement),this._renderCoordinator.onRender(function(e){return t._onRender.fire(e)}),this.onResize(function(e){return t._renderCoordinator.resize(e.cols,e.rows)}),this.viewport=new h.Viewport(this,this._viewportElement,this._viewportScrollArea,this.charMeasure,this._renderCoordinator.dimensions),this.viewport.onThemeChange(this._colorManager.colors),this.register(this.viewport),this.register(this.onCursorMove(function(){return t._renderCoordinator.onCursorMove()})),this.register(this.onResize(function(){return t._renderCoordinator.onResize(t.cols,t.rows)})),this.register(this.addDisposableListener("blur",function(){return t._renderCoordinator.onBlur()})),this.register(this.addDisposableListener("focus",function(){return t._renderCoordinator.onFocus()})),this.register(this.charMeasure.onCharSizeChanged(function(){return t._renderCoordinator.onCharSizeChanged()})),this.register(this._renderCoordinator.onDimensionsChange(function(){return t.viewport.syncScrollArea()})),this.selectionManager=new p.SelectionManager(this,this.charMeasure),this.register(this.selectionManager.onSelectionChange(function(){return t._onSelectionChange.fire()})),this.register(g.addDisposableDomListener(this.element,"mousedown",function(e){return t.selectionManager.onMouseDown(e)})),this.register(this.selectionManager.onRedrawRequest(function(e){return t._renderCoordinator.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this.selectionManager.onLinuxMouseSelection(function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()})),this.register(this.onScroll(function(){t.viewport.syncScrollArea(),t.selectionManager.refresh()})),this.register(g.addDisposableDomListener(this._viewportElement,"scroll",function(){return t.selectionManager.refresh()})),this.mouseHelper=new v.MouseHelper(this._renderCoordinator),this.element.classList.toggle("enable-mouse-events",this.mouseEvents),this.mouseEvents?this.selectionManager.disable():this.selectionManager.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new S.AccessibilityManager(this,this._renderCoordinator.dimensions),this._accessibilityManager.register(this._renderCoordinator.onDimensionsChange(function(e){return t._accessibilityManager.setDimensions(e)}))),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},t.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return new d.Renderer(this,this._colorManager.colors);case"dom":return new L.DomRenderer(this,this._colorManager.colors);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},t.prototype._setTheme=function(e){this._theme=e,this._colorManager.setTheme(e),this._renderCoordinator&&this._renderCoordinator.setColors(this._colorManager.colors),this.viewport&&this.viewport.onThemeChange(this._colorManager.colors)},t.prototype.bindMouse=function(){var e=this,t=this.element,i=this,r=32;function n(e){var t,n;if(t=function(e){var t,r,n;switch(e.overrideType||e.type){case"mousedown":t=null!==e.button&&void 0!==e.button?+e.button:null!==e.which&&void 0!==e.which?e.which-1:null,y.isMSIE&&(t=1===t?0:4===t?1:t);break;case"mouseup":t=3;break;case"DOMMouseScroll":t=e.detail<0?64:65;break;case"wheel":t=e.deltaY<0?64:65}return n=(e.shiftKey?4:0)|(e.metaKey?8:0)|(r=e.ctrlKey?16:0),i.vt200Mouse?n&=r:i.normalMouse||(n=0),32+(n<<2)+t}(e),n=i.mouseHelper.getRawByteCoords(e,i.screenElement,i.charMeasure,i.cols,i.rows))switch(s(t,n),e.overrideType||e.type){case"mousedown":r=t;break;case"mouseup":r=32}}function o(e,t){if(i.utfMouse){if(t>2047)return void e.push(2047);e.push(t)}else{if(255===t)return void e.push(0);t>127&&(t=127),e.push(t)}}function s(e,t){if(i._vt300Mouse){e&=3,t.x-=32,t.y-=32;var r=u.C0.ESC+"[24";if(0===e)r+="1";else if(1===e)r+="3";else if(2===e)r+="5";else{if(3===e)return;r+="0"}return r+="~["+t.x+","+t.y+"]\r",void i.handler(r)}if(i._decLocator)return e&=3,t.x-=32,t.y-=32,0===e?e=2:1===e?e=4:2===e?e=6:3===e&&(e=3),void i.handler(u.C0.ESC+"["+e+";"+(3===e?4:0)+";"+t.y+";"+t.x+";"+t.page||"0&w");if(i.urxvtMouse)return t.x-=32,t.y-=32,t.x++,t.y++,void i.handler(u.C0.ESC+"["+e+";"+t.x+";"+t.y+"M");if(i.sgrMouse)return t.x-=32,t.y-=32,void i.handler(u.C0.ESC+"[<"+((3==(3&e)?-4&e:e)-32)+";"+t.x+";"+t.y+(3==(3&e)?"m":"M"));var n=[];o(n,e),o(n,t.x),o(n,t.y),i.handler(u.C0.ESC+"[M"+String.fromCharCode.apply(String,n))}this.register(g.addDisposableDomListener(t,"mousedown",function(t){if(t.preventDefault(),e.focus(),e.mouseEvents&&!e.selectionManager.shouldForceSelection(t)){if(n(t),e.vt200Mouse)return t.overrideType="mouseup",n(t),e.cancel(t);var o;e.normalMouse&&(o=function(t){e.normalMouse&&function(e){var t=r,n=i.mouseHelper.getRawByteCoords(e,i.screenElement,i.charMeasure,i.cols,i.rows);n&&s(t+=32,n)}(t)},e._document.addEventListener("mousemove",o));var a=function(t){return e.normalMouse&&!e.x10Mouse&&n(t),o&&(e._document.removeEventListener("mousemove",o),o=null),e._document.removeEventListener("mouseup",a),e.cancel(t)};return e._document.addEventListener("mouseup",a),e.cancel(t)}})),this.register(g.addDisposableDomListener(t,"wheel",function(t){if(e.mouseEvents)e.x10Mouse||e._vt300Mouse||e._decLocator||(n(t),t.preventDefault());else if(!e.buffer.hasScrollback){var i=e.viewport.getLinesScrolled(t);if(0===i)return;for(var r=u.C0.ESC+(e.applicationCursor?"O":"[")+(t.deltaY<0?"A":"B"),o="",s=0;s<Math.abs(i);s++)o+=r;e.handler(o)}})),this.register(g.addDisposableDomListener(t,"wheel",function(t){if(!e.mouseEvents)return e.viewport.onWheel(t),e.cancel(t)})),this.register(g.addDisposableDomListener(t,"touchstart",function(t){if(!e.mouseEvents)return e.viewport.onTouchStart(t),e.cancel(t)})),this.register(g.addDisposableDomListener(t,"touchmove",function(t){if(!e.mouseEvents)return e.viewport.onTouchMove(t),e.cancel(t)}))},t.prototype.refresh=function(e,t){this._renderCoordinator&&this._renderCoordinator.refreshRows(e,t)},t.prototype._queueLinkification=function(e,t){this.linkifier&&this.linkifier.linkifyRows(e,t)},t.prototype.updateCursorStyle=function(e){this.selectionManager&&this.selectionManager.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},t.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.buffer.y,this.buffer.y))},t.prototype.scroll=function(e){var t;void 0===e&&(e=!1),t=this._blankLine;var i=this.eraseAttrData();t&&t.length===this.cols&&t.getFg(0)===i.fg&&t.getBg(0)===i.bg||(t=this.buffer.getBlankLine(i,e),this._blankLine=t),t.isWrapped=e;var r=this.buffer.ybase+this.buffer.scrollTop,n=this.buffer.ybase+this.buffer.scrollBottom;if(0===this.buffer.scrollTop){var o=this.buffer.lines.isFull;n===this.buffer.lines.length-1?o?this.buffer.lines.recycle().copyFrom(t):this.buffer.lines.push(t.clone()):this.buffer.lines.splice(n+1,0,t.clone()),o?this._userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++)}else{var s=n-r+1;this.buffer.lines.shiftElements(r+1,s-1,-1),this.buffer.lines.set(n,t.clone())}this._userScrolling||(this.buffer.ydisp=this.buffer.ybase),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom),this._onScroll.fire(this.buffer.ydisp)},t.prototype.scrollLines=function(e,t){if(e<0){if(0===this.buffer.ydisp)return;this._userScrolling=!0}else e+this.buffer.ydisp>=this.buffer.ybase&&(this._userScrolling=!1);var i=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),i!==this.buffer.ydisp&&(t||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},t.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},t.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},t.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},t.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)},t.prototype.writeUtf8=function(e){var t=this;this._isDisposed||e&&(this.writeBufferUtf8.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&this.writeBufferUtf8.length>=5&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&this.writeBufferUtf8.length>0&&(this._writeInProgress=!0,setTimeout(function(){t._innerWriteUtf8()})))},t.prototype._innerWriteUtf8=function(e){var t=this;void 0===e&&(e=0),this._isDisposed&&(this.writeBufferUtf8=[]);for(var i=Date.now();this.writeBufferUtf8.length>e;){var r=this.writeBufferUtf8[e];if(e++,this._xoffSentToCatchUp&&this.writeBufferUtf8.length===e&&(this.handler(u.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parseUtf8(r),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),Date.now()-i>=12)break}this.writeBufferUtf8.length>e?(e>50&&(this.writeBufferUtf8=this.writeBufferUtf8.slice(e),e=0),setTimeout(function(){return t._innerWriteUtf8(e)},0)):(this._writeInProgress=!1,this.writeBufferUtf8=[])},t.prototype.write=function(e){var t=this;this._isDisposed||e&&(this.writeBuffer.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&this.writeBuffer.length>=5&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&this.writeBuffer.length>0&&(this._writeInProgress=!0,setTimeout(function(){t._innerWrite()})))},t.prototype._innerWrite=function(e){var t=this;void 0===e&&(e=0),this._isDisposed&&(this.writeBuffer=[]);for(var i=Date.now();this.writeBuffer.length>e;){var r=this.writeBuffer[e];if(e++,this._xoffSentToCatchUp&&this.writeBuffer.length===e&&(this.handler(u.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parse(r),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),Date.now()-i>=12)break}this.writeBuffer.length>e?(e>50&&(this.writeBuffer=this.writeBuffer.slice(e),e=0),setTimeout(function(){return t._innerWrite(e)},0)):(this._writeInProgress=!1,this.writeBuffer=[])},t.prototype.writeln=function(e){this.write(e+"\r\n")},t.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},t.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},t.prototype.registerLinkMatcher=function(e,t,i){var r=this.linkifier.registerLinkMatcher(e,t,i);return this.refresh(0,this.rows-1),r},t.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},t.prototype.registerCharacterJoiner=function(e){var t=this._renderCoordinator.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},t.prototype.deregisterCharacterJoiner=function(e){this._renderCoordinator.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(t.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),t.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},t.prototype.hasSelection=function(){return!!this.selectionManager&&this.selectionManager.hasSelection},t.prototype.select=function(e,t,i){this.selectionManager.setSelection(e,t,i)},t.prototype.getSelection=function(){return this.selectionManager?this.selectionManager.selectionText:""},t.prototype.getSelectionPosition=function(){if(this.selectionManager.hasSelection)return{startColumn:this.selectionManager.selectionStart[0],startRow:this.selectionManager.selectionStart[1],endColumn:this.selectionManager.selectionEnd[0],endRow:this.selectionManager.selectionEnd[1]}},t.prototype.clearSelection=function(){this.selectionManager&&this.selectionManager.clearSelection()},t.prototype.selectAll=function(){this.selectionManager&&this.selectionManager.selectAll()},t.prototype.selectLines=function(e,t){this.selectionManager&&this.selectionManager.selectLines(e,t)},t.prototype._keyDown=function(e){if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=x.evaluateKeyboardEvent(e,this.applicationCursor,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===t.type||2===t.type){var i=this.rows-1;return this.scrollLines(2===t.type?-i:i),this.cancel(e,!0)}return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(this.emit("keydown",e),this._onKey.fire({key:t.key,domEvent:e}),this.showCursor(),this.handler(t.key),this.cancel(e,!0)))},t.prototype._isThirdLevelShift=function(e,t){var i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isMSWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)},t.prototype.setgLevel=function(e){this.glevel=e,this.charset=this.charsets[e]},t.prototype.setgCharset=function(e,t){this.charsets[e]=t,this.glevel===e&&(this.charset=t)},t.prototype._keyUp=function(e){this.updateCursorStyle(e)},t.prototype._keyPress=function(e){var t;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this.emit("keypress",t,e),this._onKey.fire({key:t,domEvent:e}),this.showCursor(),this.handler(t),0))},t.prototype.bell=function(){var e=this;this.emit("bell"),this._soundBell()&&this.soundManager.playBellSound(),this._visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this._visualBellTimer),this._visualBellTimer=window.setTimeout(function(){e.element.classList.remove("visual-bell-active")},200))},t.prototype.log=function(e,t){this.options.debug&&this._context.console&&this._context.console.log&&this._context.console.log(e,t)},t.prototype.error=function(e,t){this.options.debug&&this._context.console&&this._context.console.error&&this._context.console.error(e,t)},t.prototype.resize=function(e,t){isNaN(e)||isNaN(t)||(e!==this.cols||t!==this.rows?(e<2&&(e=2),t<1&&(t=1),this.buffers.resize(e,t),this.cols=e,this.rows=t,this.buffers.setupTabStops(this.cols),this.charMeasure&&this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._onResize.fire({cols:e,rows:t})):!this.charMeasure||this.charMeasure.width&&this.charMeasure.height||this.charMeasure.measure(this.options))},t.prototype.updateRange=function(e){e<this._refreshStart&&(this._refreshStart=e),e>this._refreshEnd&&(this._refreshEnd=e)},t.prototype.maxRange=function(){this._refreshStart=0,this._refreshEnd=this.rows-1},t.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(k.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},t.prototype.is=function(e){return 0===(this.options.termName+"").indexOf(e)},t.prototype.handler=function(e){this.options.disableStdin||(this.selectionManager&&this.selectionManager.hasSelection&&this.selectionManager.clearSelection(),this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),this._onData.fire(e))},t.prototype.handleTitle=function(e){this._onTitleChange.fire(e)},t.prototype.index=function(){this.buffer.y++,this.buffer.y>this.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},t.prototype.reverseIndex=function(){if(this.buffer.y===this.buffer.scrollTop){var e=this.buffer.scrollBottom-this.buffer.scrollTop;this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,e,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttrData())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)}else this.buffer.y--},t.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var e=this._customKeyEventHandler,t=this._inputHandler,i=this.cursorState,r=this.writeBuffer,n=this.writeBufferUtf8,o=this._writeInProgress,s=this._xoffSentToCatchUp,a=this._userScrolling;this._setup(),this._customKeyEventHandler=e,this._inputHandler=t,this.cursorState=i,this.writeBuffer=r,this.writeBufferUtf8=n,this._writeInProgress=o,this._xoffSentToCatchUp=s,this._userScrolling=a,this.refresh(0,this.rows-1),this.viewport&&this.viewport.syncScrollArea()},t.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0},t.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},t.prototype._visualBell=function(){return!1},t.prototype._soundBell=function(){return"sound"===this.options.bellStyle},t}(l.EventEmitter);t.Terminal=P},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(14),n=i(2),o=function(){function e(e){this._terminal=e,this._onBufferActivate=new n.EventEmitter2,this._normal=new r.Buffer(this._terminal,!0),this._normal.fillViewportRows(),this._alt=new r.Buffer(this._terminal,!1),this._activeBuffer=this._normal,this.setupTabStops()}return Object.defineProperty(e.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),e.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}))},e.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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}))},e.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},e.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},e}();t.BufferSet=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(2),n=function(){function e(e){this._maxLength=e,this.onDeleteEmitter=new r.EventEmitter2,this.onInsertEmitter=new r.EventEmitter2,this.onTrimEmitter=new r.EventEmitter2,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(e.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},set:function(e){if(e>this._length)for(var t=this._length;t<e;t++)this._array[t]=void 0;this._length=e},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},e.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},e.prototype.push=function(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},e.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(e.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0}),e.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},e.prototype.splice=function(e,t){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];if(t){for(var n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t}for(n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+i.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<i.length;n++)this._array[this._getCyclicIndex(e+n)]=i[n];if(this._length+i.length>this._maxLength){var o=this._length+i.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=i.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},e.prototype.shiftElements=function(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(var r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));var n=e+t+i-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;r<t;r++)this.set(e+r+i,this.get(e+r))}},e.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},e}();t.CircularList=n},function(e,t,i){"use strict";function r(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();var r=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),n=2===e[t+1].getWidth(0);return r&&n?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.reflowLargerGetLinesToRemove=function(e,t,i,n,o){for(var s=[],a=0;a<e.length-1;a++){var l=a,h=e.get(++l);if(h.isWrapped){for(var c=[e.get(a)];l<e.length&&h.isWrapped;)c.push(h),h=e.get(++l);if(n>=a&&n<l)a+=c.length-1;else{for(var u=0,f=r(c,u,t),d=1,_=0;d<c.length;){var p=r(c,d,t),m=p-_,y=i-f,g=Math.min(m,y);c[u].copyCellsFrom(c[d],_,f,g,!1),(f+=g)===i&&(u++,f=0),(_+=g)===p&&(d++,_=0),0===f&&0!==u&&2===c[u-1].getWidth(i-1)&&(c[u].copyCellsFrom(c[u-1],i-1,f++,1,!1),c[u-1].setCell(i-1,o))}c[u].replaceCells(f,i,o);for(var C=0,v=c.length-1;v>0&&(v>u||0===c[v].getTrimmedLength());v--)C++;C>0&&(s.push(a+c.length-C),s.push(C)),a+=c.length-1}}}return s},t.reflowLargerCreateNewLayout=function(e,t){for(var i=[],r=0,n=t[r],o=0,s=0;s<e.length;s++)if(n===s){var a=t[++r];e.onDeleteEmitter.fire({index:s-o,amount:a}),s+=a-1,o+=a,n=t[++r]}else i.push(s);return{layout:i,countRemoved:o}},t.reflowLargerApplyNewLayout=function(e,t){for(var i=[],r=0;r<t.length;r++)i.push(e.get(t[r]));for(r=0;r<i.length;r++)e.set(r,i[r]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,i){for(var n=[],o=e.map(function(i,n){return r(e,n,t)}).reduce(function(e,t){return e+t}),s=0,a=0,l=0;l<o;){if(o-l<i){n.push(o-l);break}s+=i;var h=r(e,a,t);s>h&&(s-=h,a++);var c=2===e[a].getWidth(s-1);c&&s--;var u=c?i-1:i;n.push(u),l+=u}return n},t.getWrappedLineTrimmedLength=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(2),s=function(e){function t(i){var r=e.call(this)||this;return r.line=i,r._id=t._nextId++,r.isDisposed=!1,r._onDispose=new o.EventEmitter2,r}return n(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._onDispose.fire())},t._nextId=1,t}(i(0).Disposable);t.Marker=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,i){this._textarea=e,this._compositionView=t,this._terminal=i,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}return e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),e){var i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(t._isSendingComposition){t._isSendingComposition=!1;var e;e=t._isComposing?t._textarea.value.substring(i.start,i.end):t._textarea.value.substring(i.start),t._terminal.handler(e)}},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._terminal.handler(r)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout(function(){if(!e._isComposing){var i=e._textarea.value.replace(t,"");i.length>0&&e._terminal.handler(i)}},0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._terminal.buffer.isCursorInViewport){var i=Math.ceil(this._terminal.charMeasure.height*this._terminal.options.lineHeight),r=this._terminal.buffer.y*i,n=this._terminal.buffer.x*this._terminal.charMeasure.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._terminal.options.fontFamily,this._compositionView.style.fontSize=this._terminal.options.fontSize+"px";var o=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r+"px",this._textarea.style.width=o.width+"px",this._textarea.style.height=o.height+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(function(){return t.updateCompositionElements(!0)},0)}},e.prototype._clearTextareaPosition=function(){this._textarea.style.left="",this._textarea.style.top=""},e}();t.CompositionHelper=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){var t=e.call(this)||this;return t._events=t._events||{},t}return n(t,e),t.prototype.on=function(e,t){this._events[e]=this._events[e]||[],this._events[e].push(t)},t.prototype.addDisposableListener=function(e,t){var i=this;this.on(e,t);var r=!1;return{dispose:function(){r||(i.off(e,t),r=!0)}}},t.prototype.off=function(e,t){if(this._events[e])for(var i=this._events[e],r=i.length;r--;)if(i[r]===t)return void i.splice(r,1)},t.prototype.removeAllListeners=function(e){this._events[e]&&delete this._events[e]},t.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(this._events[e])for(var r=this._events[e],n=0;n<r.length;n++)r[n].apply(this,t)},t.prototype.emitMayRemoveListeners=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(this._events[e])for(var r=this._events[e],n=r.length,o=0;o<r.length;o++)r[o].apply(this,t),o-=n-r.length,n=r.length},t.prototype.listeners=function(e){return this._events[e]||[]},t.prototype.dispose=function(){e.prototype.dispose.call(this),this._events={}},t}(i(0).Disposable);t.EventEmitter=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(5),a=15,l=function(e){function t(t,i,r,n,o){var l=e.call(this)||this;return l._terminal=t,l._viewportElement=i,l._scrollArea=r,l._charMeasure=n,l._dimensions=o,l.scrollBarWidth=0,l._currentRowHeight=0,l._lastRecordedBufferLength=0,l._lastRecordedViewportHeight=0,l._lastRecordedBufferHeight=0,l._lastScrollTop=0,l._wheelPartialScroll=0,l._refreshAnimationFrame=null,l._ignoreNextScrollEvent=!1,l.scrollBarWidth=l._viewportElement.offsetWidth-l._scrollArea.offsetWidth||a,l.register(s.addDisposableDomListener(l._viewportElement,"scroll",l._onScroll.bind(l))),setTimeout(function(){return l.syncScrollArea()},0),l}return n(t,e),t.prototype.onDimensionsChance=function(e){this._dimensions=e},t.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(){var e=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return e._innerRefresh()}))},t.prototype._innerRefresh=function(){if(this._charMeasure.height>0){this._currentRowHeight=this._dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._terminal.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(){if(this._lastRecordedBufferLength!==this._terminal.buffer.lines.length)return this._lastRecordedBufferLength=this._terminal.buffer.lines.length,void this._refresh();if(this._lastRecordedViewportHeight===this._dimensions.canvasHeight){var e=this._terminal.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===e&&this._lastScrollTop===this._viewportElement.scrollTop&&this._dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh()}else this._refresh()},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._terminal.buffer.ydisp;this._terminal.scrollLines(t,!0)}},t.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);0!==t&&(this._viewportElement.scrollTop+=t,e.preventDefault())},t.prototype._getPixelsScrolled=function(e){if(0===e.deltaY)return 0;var t=e.deltaY;return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._terminal.rows),t},t.prototype.getLinesScrolled=function(e){if(0===e.deltaY)return 0;var t=e.deltaY;return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._terminal.rows),t},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,e.preventDefault())},t}(o.Disposable);t.Viewport=l},function(e,t,i){"use strict";function r(e){return e.replace(/\r?\n/g,"\r")}function n(e,t){return t?"\e[200~"+e+"\e[201~":e}function o(e,t){var i=t.screenElement.getBoundingClientRect(),r=e.clientX-i.left-10,n=e.clientY-i.top-10;t.textarea.style.position="absolute",t.textarea.style.width="20px",t.textarea.style.height="20px",t.textarea.style.left=r+"px",t.textarea.style.top=n+"px",t.textarea.style.zIndex="1000",t.textarea.focus(),setTimeout(function(){t.textarea.style.position=null,t.textarea.style.width=null,t.textarea.style.height=null,t.textarea.style.left=null,t.textarea.style.top=null,t.textarea.style.zIndex=null},200)}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTextForTerminal=r,t.bracketTextForPaste=n,t.copyHandler=function(e,t,i){t.browser.isMSIE?window.clipboardData.setData("Text",i.selectionText):e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()},t.pasteHandler=function(e,t){e.stopPropagation();var i=function(i){i=n(i=r(i),t.bracketedPasteMode),t.handler(i),t.textarea.value="",t.emit("paste",i),t.cancel(e)};t.browser.isMSIE?window.clipboardData&&i(window.clipboardData.getData("Text")):e.clipboardData&&i(e.clipboardData.getData("text/plain"))},t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,i,r){o(e,t),r&&!i.isClickInSelection(e)&&i.selectWordAtCursor(e),t.textarea.value=i.selectionText,t.textarea.select()}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(8),s=i(38),a=i(15),l=i(39),h=i(0),c=i(16),u=i(10),f=i(1),d=i(2),_={"(":0,")":1,"*":2,"+":3,"-":1,".":2},p=function(){function e(e){this._terminal=e,this._data=new Uint32Array(0)}return e.prototype.hook=function(e,t,i){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,i){this._data=c.concat(this._data,e.subarray(t,i))},e.prototype.unhook=function(){var e=u.utf32ToString(this._data);switch(this._data=new Uint32Array(0),e){case'"q':return this._terminal.handler(o.C0.ESC+'P1$r0"q'+o.C0.ESC+"\\");case'"p':return this._terminal.handler(o.C0.ESC+'P1$r61"p'+o.C0.ESC+"\\");case"r":var t=this._terminal.buffer.scrollTop+1+";"+(this._terminal.buffer.scrollBottom+1)+"r";return this._terminal.handler(o.C0.ESC+"P1$r"+t+o.C0.ESC+"\\");case"m":return this._terminal.handler(o.C0.ESC+"P1$r0m"+o.C0.ESC+"\\");case" q":var i={block:2,underline:4,bar:6}[this._terminal.getOption("cursorStyle")];return i-=this._terminal.getOption("cursorBlink"),this._terminal.handler(o.C0.ESC+"P1$r"+i+" q"+o.C0.ESC+"\\");default:this._terminal.error("Unknown DCS $q %s",e),this._terminal.handler(o.C0.ESC+"P0$r"+o.C0.ESC+"\\")}},e}(),m=function(e){function t(t,i){void 0===i&&(i=new l.EscapeSequenceParser);var r=e.call(this)||this;r._terminal=t,r._parser=i,r._parseBuffer=new Uint32Array(4096),r._stringDecoder=new u.StringToUtf32,r._utf8Decoder=new u.Utf8ToUtf32,r._workCell=new f.CellData,r._onCursorMove=new d.EventEmitter2,r._onData=new d.EventEmitter2,r._onLineFeed=new d.EventEmitter2,r._onScroll=new d.EventEmitter2,r.register(r._parser),r._parser.setCsiHandlerFallback(function(e,t,i){r._terminal.error("Unknown CSI code: ",{collect:e,params:t,flag:String.fromCharCode(i)})}),r._parser.setEscHandlerFallback(function(e,t){r._terminal.error("Unknown ESC code: ",{collect:e,flag:String.fromCharCode(t)})}),r._parser.setExecuteHandlerFallback(function(e){r._terminal.error("Unknown EXECUTE code: ",{code:e})}),r._parser.setOscHandlerFallback(function(e,t){r._terminal.error("Unknown OSC code: ",{identifier:e,data:t})}),r._parser.setPrintHandler(function(e,t,i){return r.print(e,t,i)}),r._parser.setCsiHandler("@",function(e,t){return r.insertChars(e)}),r._parser.setCsiHandler("A",function(e,t){return r.cursorUp(e)}),r._parser.setCsiHandler("B",function(e,t){return r.cursorDown(e)}),r._parser.setCsiHandler("C",function(e,t){return r.cursorForward(e)}),r._parser.setCsiHandler("D",function(e,t){return r.cursorBackward(e)}),r._parser.setCsiHandler("E",function(e,t){return r.cursorNextLine(e)}),r._parser.setCsiHandler("F",function(e,t){return r.cursorPrecedingLine(e)}),r._parser.setCsiHandler("G",function(e,t){return r.cursorCharAbsolute(e)}),r._parser.setCsiHandler("H",function(e,t){return r.cursorPosition(e)}),r._parser.setCsiHandler("I",function(e,t){return r.cursorForwardTab(e)}),r._parser.setCsiHandler("J",function(e,t){return r.eraseInDisplay(e)}),r._parser.setCsiHandler("K",function(e,t){return r.eraseInLine(e)}),r._parser.setCsiHandler("L",function(e,t){return r.insertLines(e)}),r._parser.setCsiHandler("M",function(e,t){return r.deleteLines(e)}),r._parser.setCsiHandler("P",function(e,t){return r.deleteChars(e)}),r._parser.setCsiHandler("S",function(e,t){return r.scrollUp(e)}),r._parser.setCsiHandler("T",function(e,t){return r.scrollDown(e,t)}),r._parser.setCsiHandler("X",function(e,t){return r.eraseChars(e)}),r._parser.setCsiHandler("Z",function(e,t){return r.cursorBackwardTab(e)}),r._parser.setCsiHandler("`",function(e,t){return r.charPosAbsolute(e)}),r._parser.setCsiHandler("a",function(e,t){return r.hPositionRelative(e)}),r._parser.setCsiHandler("b",function(e,t){return r.repeatPrecedingCharacter(e)}),r._parser.setCsiHandler("c",function(e,t){return r.sendDeviceAttributes(e,t)}),r._parser.setCsiHandler("d",function(e,t){return r.linePosAbsolute(e)}),r._parser.setCsiHandler("e",function(e,t){return r.vPositionRelative(e)}),r._parser.setCsiHandler("f",function(e,t){return r.hVPosition(e)}),r._parser.setCsiHandler("g",function(e,t){return r.tabClear(e)}),r._parser.setCsiHandler("h",function(e,t){return r.setMode(e,t)}),r._parser.setCsiHandler("l",function(e,t){return r.resetMode(e,t)}),r._parser.setCsiHandler("m",function(e,t){return r.charAttributes(e)}),r._parser.setCsiHandler("n",function(e,t){return r.deviceStatus(e,t)}),r._parser.setCsiHandler("p",function(e,t){return r.softReset(e,t)}),r._parser.setCsiHandler("q",function(e,t){return r.setCursorStyle(e,t)}),r._parser.setCsiHandler("r",function(e,t){return r.setScrollRegion(e,t)}),r._parser.setCsiHandler("s",function(e,t){return r.saveCursor(e)}),r._parser.setCsiHandler("u",function(e,t){return r.restoreCursor(e)}),r._parser.setExecuteHandler(o.C0.BEL,function(){return r.bell()}),r._parser.setExecuteHandler(o.C0.LF,function(){return r.lineFeed()}),r._parser.setExecuteHandler(o.C0.VT,function(){return r.lineFeed()}),r._parser.setExecuteHandler(o.C0.FF,function(){return r.lineFeed()}),r._parser.setExecuteHandler(o.C0.CR,function(){return r.carriageReturn()}),r._parser.setExecuteHandler(o.C0.BS,function(){return r.backspace()}),r._parser.setExecuteHandler(o.C0.HT,function(){return r.tab()}),r._parser.setExecuteHandler(o.C0.SO,function(){return r.shiftOut()}),r._parser.setExecuteHandler(o.C0.SI,function(){return r.shiftIn()}),r._parser.setExecuteHandler(o.C1.IND,function(){return r.index()}),r._parser.setExecuteHandler(o.C1.NEL,function(){return r.nextLine()}),r._parser.setExecuteHandler(o.C1.HTS,function(){return r.tabSet()}),r._parser.setOscHandler(0,function(e){return r.setTitle(e)}),r._parser.setOscHandler(2,function(e){return r.setTitle(e)}),r._parser.setEscHandler("7",function(){return r.saveCursor([])}),r._parser.setEscHandler("8",function(){return r.restoreCursor([])}),r._parser.setEscHandler("D",function(){return r.index()}),r._parser.setEscHandler("E",function(){return r.nextLine()}),r._parser.setEscHandler("H",function(){return r.tabSet()}),r._parser.setEscHandler("M",function(){return r.reverseIndex()}),r._parser.setEscHandler("=",function(){return r.keypadApplicationMode()}),r._parser.setEscHandler(">",function(){return r.keypadNumericMode()}),r._parser.setEscHandler("c",function(){return r.reset()}),r._parser.setEscHandler("n",function(){return r.setgLevel(2)}),r._parser.setEscHandler("o",function(){return r.setgLevel(3)}),r._parser.setEscHandler("|",function(){return r.setgLevel(3)}),r._parser.setEscHandler("}",function(){return r.setgLevel(2)}),r._parser.setEscHandler("~",function(){return r.setgLevel(1)}),r._parser.setEscHandler("%@",function(){return r.selectDefaultCharset()}),r._parser.setEscHandler("%G",function(){return r.selectDefaultCharset()});var n=function(e){a._parser.setEscHandler("("+e,function(){return r.selectCharset("("+e)}),a._parser.setEscHandler(")"+e,function(){return r.selectCharset(")"+e)}),a._parser.setEscHandler("*"+e,function(){return r.selectCharset("*"+e)}),a._parser.setEscHandler("+"+e,function(){return r.selectCharset("+"+e)}),a._parser.setEscHandler("-"+e,function(){return r.selectCharset("-"+e)}),a._parser.setEscHandler("."+e,function(){return r.selectCharset("."+e)}),a._parser.setEscHandler("/"+e,function(){return r.selectCharset("/"+e)})},a=this;for(var h in s.CHARSETS)n(h);return r._parser.setErrorHandler(function(e){return r._terminal.error("Parsing error: ",e),e}),r._parser.setDcsHandler("$q",new p(r._terminal)),r}return n(t,e),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._terminal=null},t.prototype.parse=function(e){if(this._terminal){var t=this._terminal.buffer,i=t.x,r=t.y;this._terminal.debug&&this._terminal.log("data: "+e),this._parseBuffer.length<e.length&&(this._parseBuffer=new Uint32Array(e.length)),this._parser.parse(this._parseBuffer,this._stringDecoder.decode(e,this._parseBuffer)),(t=this._terminal.buffer).x===i&&t.y===r||this._onCursorMove.fire()}},t.prototype.parseUtf8=function(e){if(this._terminal){var t=this._terminal.buffer,i=t.x,r=t.y;this._terminal.debug&&this._terminal.log("data: "+e),this._parseBuffer.length<e.length&&(this._parseBuffer=new Uint32Array(e.length)),this._parser.parse(this._parseBuffer,this._utf8Decoder.decode(e,this._parseBuffer)),(t=this._terminal.buffer).x===i&&t.y===r||this._terminal.emit("cursormove")}},t.prototype.print=function(e,t,i){var r,n,o=this._terminal.buffer,s=this._terminal.charset,l=this._terminal.options.screenReaderMode,h=this._terminal.cols,c=this._terminal.wraparoundMode,d=this._terminal.insertMode,_=this._terminal.curAttrData,p=o.lines.get(o.y+o.ybase);this._terminal.updateRange(o.y);for(var m=t;m<i;++m){if(r=e[m],n=a.wcwidth(r),r<127&&s){var y=s[String.fromCharCode(r)];y&&(r=y.charCodeAt(0))}if(l&&this._terminal.emit("a11y.char",u.stringFromCodePoint(r)),n||!o.x){if(o.x+n-1>=h)if(c)o.x=0,o.y++,o.y>o.scrollBottom?(o.y--,this._terminal.scroll(!0)):o.lines.get(o.y).isWrapped=!0,p=o.lines.get(o.y+o.ybase);else if(2===n)continue;if(d&&(p.insertCells(o.x,n,o.getNullCell(_)),2===p.getWidth(h-1)&&p.setCellFromCodePoint(h-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,_.fg,_.bg)),p.setCellFromCodePoint(o.x++,r,n,_.fg,_.bg),n>0)for(;--n;)p.setCellFromCodePoint(o.x++,0,0,_.fg,_.bg)}else p.getWidth(o.x-1)?p.addCodepointToCell(o.x-1,r):p.addCodepointToCell(o.x-2,r)}this._terminal.updateRange(o.y)},t.prototype.addCsiHandler=function(e,t){return this._parser.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,t)},t.prototype.bell=function(){this._terminal.bell()},t.prototype.lineFeed=function(){var e=this._terminal.buffer;this._terminal.options.convertEol&&(e.x=0),e.y++,e.y>e.scrollBottom&&(e.y--,this._terminal.scroll()),e.x>=this._terminal.cols&&e.x--,this._onLineFeed.fire()},t.prototype.carriageReturn=function(){this._terminal.buffer.x=0},t.prototype.backspace=function(){this._terminal.buffer.x>0&&this._terminal.buffer.x--},t.prototype.tab=function(){var e=this._terminal.buffer.x;this._terminal.buffer.x=this._terminal.buffer.nextStop(),this._terminal.options.screenReaderMode&&this._terminal.emit("a11y.tab",this._terminal.buffer.x-e)},t.prototype.shiftOut=function(){this._terminal.setgLevel(1)},t.prototype.shiftIn=function(){this._terminal.setgLevel(0)},t.prototype.insertChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).insertCells(this._terminal.buffer.x,e[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.cursorUp=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0)},t.prototype.cursorDown=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},t.prototype.cursorForward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.cursorBackward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=t,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},t.prototype.cursorNextLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},t.prototype.cursorPrecedingLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},t.prototype.cursorCharAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1},t.prototype.cursorPosition=function(e){var t,i=e[0]-1;t=e.length>=2?e[1]-1:0,i<0?i=0:i>=this._terminal.rows&&(i=this._terminal.rows-1),t<0?t=0:t>=this._terminal.cols&&(t=this._terminal.cols-1),this._terminal.buffer.x=t,this._terminal.buffer.y=i},t.prototype.cursorForwardTab=function(e){for(var t=e[0]||1;t--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},t.prototype._eraseInBufferLine=function(e,t,i,r){void 0===r&&(r=!1);var n=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+e);n.replaceCells(t,i,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),r&&(n.isWrapped=!1)},t.prototype._resetBufferLine=function(e){this._eraseInBufferLine(e,0,this._terminal.cols,!0)},t.prototype.eraseInDisplay=function(e){var t;switch(e[0]){case 0:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);t<this._terminal.rows;t++)this._resetBufferLine(t);this._terminal.updateRange(t);break;case 1:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t,0,this._terminal.buffer.x+1,!0),this._terminal.buffer.x+1>=this._terminal.cols&&(this._terminal.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 2:for(t=this._terminal.rows,this._terminal.updateRange(t-1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 3:var i=this._terminal.buffer.lines.length-this._terminal.rows;i>0&&(this._terminal.buffer.lines.trimStart(i),this._terminal.buffer.ybase=Math.max(this._terminal.buffer.ybase-i,0),this._terminal.buffer.ydisp=Math.max(this._terminal.buffer.ydisp-i,0),this._onScroll.fire(0))}},t.prototype.eraseInLine=function(e){switch(e[0]){case 0:this._eraseInBufferLine(this._terminal.buffer.y,this._terminal.buffer.x,this._terminal.cols);break;case 1:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.buffer.x+1);break;case 2:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.cols)}this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.insertLines=function(e){var t=e[0];t<1&&(t=1);for(var i=this._terminal.buffer,r=i.y+i.ybase,n=this._terminal.rows-1-i.scrollBottom,o=this._terminal.rows-1+i.ybase-n+1;t--;)i.lines.splice(o-1,1),i.lines.splice(r,0,i.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(i.y),this._terminal.updateRange(i.scrollBottom)},t.prototype.deleteLines=function(e){var t=e[0];t<1&&(t=1);var i,r=this._terminal.buffer,n=r.y+r.ybase;for(i=this._terminal.rows-1-r.scrollBottom,i=this._terminal.rows-1+r.ybase-i;t--;)r.lines.splice(n,1),r.lines.splice(i,0,r.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(r.y),this._terminal.updateRange(r.scrollBottom)},t.prototype.deleteChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).deleteCells(this._terminal.buffer.x,e[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.scrollUp=function(e){for(var t=e[0]||1,i=this._terminal.buffer;t--;)i.lines.splice(i.ybase+i.scrollTop,1),i.lines.splice(i.ybase+i.scrollBottom,0,i.getBlankLine(f.DEFAULT_ATTR_DATA));this._terminal.updateRange(i.scrollTop),this._terminal.updateRange(i.scrollBottom)},t.prototype.scrollDown=function(e,t){if(e.length<2&&!t){for(var i=e[0]||1,r=this._terminal.buffer;i--;)r.lines.splice(r.ybase+r.scrollBottom,1),r.lines.splice(r.ybase+r.scrollTop,0,r.getBlankLine(f.DEFAULT_ATTR_DATA));this._terminal.updateRange(r.scrollTop),this._terminal.updateRange(r.scrollBottom)}},t.prototype.eraseChars=function(e){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).replaceCells(this._terminal.buffer.x,this._terminal.buffer.x+(e[0]||1),this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()))},t.prototype.cursorBackwardTab=function(e){for(var t=e[0]||1,i=this._terminal.buffer;t--;)i.x=i.prevStop()},t.prototype.charPosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.hPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.repeatPrecedingCharacter=function(e){var t=this._terminal.buffer,i=t.lines.get(t.ybase+t.y);i.loadCell(t.x-1,this._workCell),i.replaceCells(t.x,t.x+(e[0]||1),void 0!==this._workCell.content?this._workCell:t.getNullCell(f.DEFAULT_ATTR_DATA))},t.prototype.sendDeviceAttributes=function(e,t){e[0]>0||(t?">"===t&&(this._terminal.is("xterm")?this._terminal.handler(o.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(o.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(e[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(o.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(o.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(o.C0.ESC+"[?6c"))},t.prototype.linePosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y=t-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},t.prototype.vPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},t.prototype.hVPosition=function(e){e[0]<1&&(e[0]=1),e[1]<1&&(e[1]=1),this._terminal.buffer.y=e[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=e[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.prototype.tabClear=function(e){var t=e[0];t<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===t&&(this._terminal.buffer.tabs={})},t.prototype.setMode=function(e,t){if(e.length>1)for(var i=0;i<e.length;i++)this.setMode([e[i]]);else if(t){if("?"===t)switch(e[0]){case 1:this._terminal.applicationCursor=!0;break;case 2:this._terminal.setgCharset(0,s.DEFAULT_CHARSET),this._terminal.setgCharset(1,s.DEFAULT_CHARSET),this._terminal.setgCharset(2,s.DEFAULT_CHARSET),this._terminal.setgCharset(3,s.DEFAULT_CHARSET);break;case 3:this._terminal.savedCols=this._terminal.cols,this._terminal.resize(132,this._terminal.rows);break;case 6:this._terminal.originMode=!0;break;case 7:this._terminal.wraparoundMode=!0;break;case 12:break;case 66:this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=9===e[0],this._terminal.vt200Mouse=1e3===e[0],this._terminal.normalMouse=e[0]>1e3,this._terminal.mouseEvents=!0,this._terminal.element&&this._terminal.element.classList.add("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.disable(),this._terminal.log("Binding to mouse events.");break;case 1004:this._terminal.sendFocus=!0;break;case 1005:this._terminal.utfMouse=!0;break;case 1006:this._terminal.sgrMouse=!0;break;case 1015:this._terminal.urxvtMouse=!0;break;case 25:this._terminal.cursorHidden=!1;break;case 1048:this.saveCursor(e);break;case 1049:this.saveCursor(e);case 47:case 1047:this._terminal.buffers.activateAltBuffer(this._terminal.eraseAttrData()),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}}else switch(e[0]){case 4:this._terminal.insertMode=!0}},t.prototype.resetMode=function(e,t){if(e.length>1)for(var i=0;i<e.length;i++)this.resetMode([e[i]]);else if(t){if("?"===t)switch(e[0]){case 1:this._terminal.applicationCursor=!1;break;case 3:132===this._terminal.cols&&this._terminal.savedCols&&this._terminal.resize(this._terminal.savedCols,this._terminal.rows),delete this._terminal.savedCols;break;case 6:this._terminal.originMode=!1;break;case 7:this._terminal.wraparoundMode=!1;break;case 12:break;case 66:this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=!1,this._terminal.vt200Mouse=!1,this._terminal.normalMouse=!1,this._terminal.mouseEvents=!1,this._terminal.element&&this._terminal.element.classList.remove("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.enable();break;case 1004:this._terminal.sendFocus=!1;break;case 1005:this._terminal.utfMouse=!1;break;case 1006:this._terminal.sgrMouse=!1;break;case 1015:this._terminal.urxvtMouse=!1;break;case 25:this._terminal.cursorHidden=!0;break;case 1048:this.restoreCursor(e);break;case 1049:case 47:case 1047:this._terminal.buffers.activateNormalBuffer(),1049===e[0]&&this.restoreCursor(e),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}}else switch(e[0]){case 4:this._terminal.insertMode=!1}},t.prototype.charAttributes=function(e){if(1===e.length&&0===e[0])return this._terminal.curAttrData.fg=f.DEFAULT_ATTR_DATA.fg,void(this._terminal.curAttrData.bg=f.DEFAULT_ATTR_DATA.bg);for(var t,i=e.length,r=this._terminal.curAttrData,n=0;n<i;n++)(t=e[n])>=30&&t<=37?(r.fg&=-50331904,r.fg|=16777216|t-30):t>=40&&t<=47?(r.bg&=-50331904,r.bg|=16777216|t-40):t>=90&&t<=97?(r.fg&=-50331904,r.fg|=16777224|t-90):t>=100&&t<=107?(r.bg&=-50331904,r.bg|=16777224|t-100):0===t?(r.fg=f.DEFAULT_ATTR_DATA.fg,r.bg=f.DEFAULT_ATTR_DATA.bg):1===t?r.fg|=134217728:3===t?r.bg|=67108864:4===t?r.fg|=268435456:5===t?r.fg|=536870912:7===t?r.fg|=67108864:8===t?r.fg|=1073741824:2===t?r.bg|=134217728:22===t?(r.fg&=-134217729,r.bg&=-134217729):23===t?r.bg&=-67108865:24===t?r.fg&=-268435457:25===t?r.fg&=-536870913:27===t?r.fg&=-67108865:28===t?r.fg&=-1073741825:39===t?(r.fg&=-67108864,r.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):49===t?(r.bg&=-67108864,r.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):38===t?2===e[n+1]?(n+=2,r.fg|=50331648,r.fg&=-16777216,r.fg|=f.AttributeData.fromColorRGB([e[n],e[n+1],e[n+2]]),n+=2):5===e[n+1]&&(t=255&e[n+=2],r.fg&=-50331904,r.fg|=33554432|t):48===t?2===e[n+1]?(n+=2,r.bg|=50331648,r.bg&=-16777216,r.bg|=f.AttributeData.fromColorRGB([e[n],e[n+1],e[n+2]]),n+=2):5===e[n+1]&&(t=255&e[n+=2],r.bg&=-50331904,r.bg|=33554432|t):100===t?(r.fg&=-67108864,r.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._terminal.error("Unknown SGR attribute: %d.",t)},t.prototype.deviceStatus=function(e,t){if(t){if("?"===t)switch(e[0]){case 6:i=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1,this._onData.fire(o.C0.ESC+"[?"+i+";"+r+"R")}}else switch(e[0]){case 5:this._onData.fire(o.C0.ESC+"[0n");break;case 6:var i=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1;this._onData.fire(o.C0.ESC+"["+i+";"+r+"R")}},t.prototype.softReset=function(e,t){"!"===t&&(this._terminal.cursorHidden=!1,this._terminal.insertMode=!1,this._terminal.originMode=!1,this._terminal.wraparoundMode=!0,this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.applicationCursor=!1,this._terminal.buffer.scrollTop=0,this._terminal.buffer.scrollBottom=this._terminal.rows-1,this._terminal.curAttrData=f.DEFAULT_ATTR_DATA,this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null])},t.prototype.setCursorStyle=function(e,t){if(" "===t){var i=e[0]<1?1:e[0];switch(i){case 1:case 2:this._terminal.setOption("cursorStyle","block");break;case 3:case 4:this._terminal.setOption("cursorStyle","underline");break;case 5:case 6:this._terminal.setOption("cursorStyle","bar")}var r=i%2==1;this._terminal.setOption("cursorBlink",r)}},t.prototype.setScrollRegion=function(e,t){t||(this._terminal.buffer.scrollTop=(e[0]||1)-1,this._terminal.buffer.scrollBottom=(e[1]&&e[1]<=this._terminal.rows?e[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)},t.prototype.saveCursor=function(e){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y,this._terminal.buffer.savedCurAttrData.fg=this._terminal.curAttrData.fg,this._terminal.buffer.savedCurAttrData.bg=this._terminal.curAttrData.bg},t.prototype.restoreCursor=function(e){this._terminal.buffer.x=this._terminal.buffer.savedX||0,this._terminal.buffer.y=this._terminal.buffer.savedY||0,this._terminal.curAttrData.fg=this._terminal.buffer.savedCurAttrData.fg,this._terminal.curAttrData.bg=this._terminal.buffer.savedCurAttrData.bg},t.prototype.setTitle=function(e){this._terminal.handleTitle(e)},t.prototype.nextLine=function(){this._terminal.buffer.x=0,this.index()},t.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},t.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},t.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0),this._terminal.setgCharset(0,s.DEFAULT_CHARSET)},t.prototype.selectCharset=function(e){2===e.length?"/"!==e[0]&&this._terminal.setgCharset(_[e[0]],s.CHARSETS[e[1]]||s.DEFAULT_CHARSET):this.selectDefaultCharset()},t.prototype.index=function(){this._terminal.index()},t.prototype.tabSet=function(){this._terminal.tabSet()},t.prototype.reverseIndex=function(){this._terminal.reverseIndex()},t.prototype.reset=function(){this._parser.reset(),this._terminal.reset()},t.prototype.setgLevel=function(e){this._terminal.setgLevel(e)},t}(h.Disposable);t.InputHandler=m},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"\t",c:"\f",d:"\r",e:"\n",f:"°",g:"±",h:"",i:"\v",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=null,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(10);function a(e,t){for(var i=t-e,r=new Array(i);i--;)r[i]=--t;return r}var l=function(){function e(e){this.table="undefined"==typeof Uint8Array?new Array(e):new Uint8Array(e)}return e.prototype.add=function(e,t,i,r){this.table[t<<8|e]=(0|i)<<4|(void 0===r?t:r)},e.prototype.addMany=function(e,t,i,r){for(var n=0;n<e.length;n++)this.add(e[n],t,i,r)},e}();t.TransitionTable=l;var h=a(32,127),c=a(0,24);c.push(25),c.push.apply(c,a(28,32)),t.VT500_TRANSITION_TABLE=function(){var e,t=new l(4095),i=a(0,14);for(e in i)for(var r=0;r<=160;++r)t.add(r,e,1,0);for(e in t.addMany(h,0,2,0),i)t.addMany([24,26,153,154],e,3,0),t.addMany(a(128,144),e,3,0),t.addMany(a(144,152),e,3,0),t.add(156,e,0,0),t.add(27,e,11,1),t.add(157,e,4,8),t.addMany([152,158,159],e,0,7),t.add(155,e,11,3),t.add(144,e,11,9);return t.addMany(c,0,3,0),t.addMany(c,1,3,1),t.add(127,1,0,1),t.addMany(c,8,0,8),t.addMany(c,3,3,3),t.add(127,3,0,3),t.addMany(c,4,3,4),t.add(127,4,0,4),t.addMany(c,6,3,6),t.addMany(c,5,3,5),t.add(127,5,0,5),t.addMany(c,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(h,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(a(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(h,7,0,7),t.addMany(c,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(a(64,127),3,7,0),t.addMany(a(48,58),3,8,4),t.add(59,3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(a(48,58),4,8,4),t.add(59,4,8,4),t.addMany(a(64,127),4,7,0),t.addMany([58,60,61,62,63],4,0,6),t.addMany(a(32,64),6,0,6),t.add(127,6,0,6),t.addMany(a(64,127),6,0,0),t.add(58,3,0,6),t.addMany(a(32,48),3,9,5),t.addMany(a(32,48),5,9,5),t.addMany(a(48,64),5,0,6),t.addMany(a(64,127),5,7,0),t.addMany(a(32,48),4,9,5),t.addMany(a(32,48),1,9,2),t.addMany(a(32,48),2,9,2),t.addMany(a(48,127),2,10,0),t.addMany(a(48,80),1,10,0),t.addMany(a(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(a(96,127),1,10,0),t.add(80,1,11,9),t.addMany(c,9,0,9),t.add(127,9,0,9),t.addMany(a(28,32),9,0,9),t.addMany(a(32,48),9,9,12),t.add(58,9,0,11),t.addMany(a(48,58),9,8,10),t.add(59,9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(c,11,0,11),t.addMany(a(32,128),11,0,11),t.addMany(a(28,32),11,0,11),t.addMany(c,10,0,10),t.add(127,10,0,10),t.addMany(a(28,32),10,0,10),t.addMany(a(48,58),10,8,10),t.add(59,10,8,10),t.addMany([58,60,61,62,63],10,0,11),t.addMany(a(32,48),10,9,12),t.addMany(c,12,0,12),t.add(127,12,0,12),t.addMany(a(28,32),12,0,12),t.addMany(a(32,48),12,9,12),t.addMany(a(48,64),12,0,11),t.addMany(a(64,127),12,12,13),t.addMany(a(64,127),10,12,13),t.addMany(a(64,127),9,12,13),t.addMany(c,13,13,13),t.addMany(h,13,13,13),t.add(127,13,0,13),t.addMany([27,156],13,14,0),t.add(160,8,5,8),t}();var u=function(){function e(){}return e.prototype.hook=function(e,t,i){},e.prototype.put=function(e,t,i){},e.prototype.unhook=function(){},e}(),f=function(e){function i(i){void 0===i&&(i=t.VT500_TRANSITION_TABLE);var r=e.call(this)||this;return r.TRANSITIONS=i,r.initialState=0,r.currentState=r.initialState,r._osc="",r._params=[0],r._collect="",r._printHandlerFb=function(e,t,i){},r._executeHandlerFb=function(e){},r._csiHandlerFb=function(e,t,i){},r._escHandlerFb=function(e,t){},r._oscHandlerFb=function(e,t){},r._dcsHandlerFb=new u,r._errorHandlerFb=function(e){return e},r._printHandler=r._printHandlerFb,r._executeHandlers=Object.create(null),r._csiHandlers=Object.create(null),r._escHandlers=Object.create(null),r._oscHandlers=Object.create(null),r._dcsHandlers=Object.create(null),r._activeDcsHandler=null,r._errorHandler=r._errorHandlerFb,r.setEscHandler("\\",function(){}),r}return n(i,e),i.prototype.dispose=function(){this._printHandlerFb=null,this._executeHandlerFb=null,this._csiHandlerFb=null,this._escHandlerFb=null,this._oscHandlerFb=null,this._dcsHandlerFb=null,this._errorHandlerFb=null,this._printHandler=null,this._executeHandlers=null,this._escHandlers=null,this._csiHandlers=null,this._oscHandlers=null,this._dcsHandlers=null,this._activeDcsHandler=null,this._errorHandler=null},i.prototype.setPrintHandler=function(e){this._printHandler=e},i.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},i.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},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,t){var i=e.charCodeAt(0);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);var r=this._csiHandlers[i];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},i.prototype.setCsiHandler=function(e,t){this._csiHandlers[e.charCodeAt(0)]=[t]},i.prototype.clearCsiHandler=function(e){this._csiHandlers[e.charCodeAt(0)]&&delete this._csiHandlers[e.charCodeAt(0)]},i.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},i.prototype.setEscHandler=function(e,t){this._escHandlers[e]=t},i.prototype.clearEscHandler=function(e){this._escHandlers[e]&&delete this._escHandlers[e]},i.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},i.prototype.addOscHandler=function(e,t){void 0===this._oscHandlers[e]&&(this._oscHandlers[e]=[]);var i=this._oscHandlers[e];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},i.prototype.setOscHandler=function(e,t){this._oscHandlers[e]=[t]},i.prototype.clearOscHandler=function(e){this._oscHandlers[e]&&delete this._oscHandlers[e]},i.prototype.setOscHandlerFallback=function(e){this._oscHandlerFb=e},i.prototype.setDcsHandler=function(e,t){this._dcsHandlers[e]=t},i.prototype.clearDcsHandler=function(e){this._dcsHandlers[e]&&delete this._dcsHandlers[e]},i.prototype.setDcsHandlerFallback=function(e){this._dcsHandlerFb=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._osc="",this._params=[0],this._collect="",this._activeDcsHandler=null},i.prototype.parse=function(e,t){for(var i=0,r=0,n=!1,o=this.currentState,a=-1,l=-1,h=this._osc,c=this._collect,u=this._params,f=this.TRANSITIONS.table,d=this._activeDcsHandler,_=null,p=0;p<t;++p)if(i=e[p],0===o&&i>31&&i<128){a=~a?a:p;do{p++}while(p<t&&e[p]>31&&e[p]<128);p--}else if(4===o&&i>47&&i<57)u[u.length-1]=10*u[u.length-1]+i-48;else{switch((r=f[o<<8|(i<160?i:160)])>>4){case 2:a=~a?a:p;break;case 3:~a&&(this._printHandler(e,a,p),a=-1),(_=this._executeHandlers[i])?_():this._executeHandlerFb(i);break;case 0:~a?(this._printHandler(e,a,p),a=-1):~l&&(d.put(e,l,p),l=-1);break;case 1:if(i>159)switch(o){case 0:a=~a?a:p;break;case 6:r|=6;break;case 11:r|=11;break;case 13:l=~l?l:p,r|=13;break;default:n=!0}else n=!0;if(n){if(this._errorHandler({position:p,code:i,currentState:o,print:a,dcs:l,osc:h,collect:c,params:u,abort:!1}).abort)return;n=!1}break;case 7:for(var m=this._csiHandlers[i],y=m?m.length-1:-1;y>=0&&!1===m[y](u,c);y--);y<0&&this._csiHandlerFb(c,u,i);break;case 8:59===i?u.push(0):u[u.length-1]=10*u[u.length-1]+i-48;break;case 9:c+=String.fromCharCode(i);break;case 10:(_=this._escHandlers[c+String.fromCharCode(i)])?_(c,i):this._escHandlerFb(c,i);break;case 11:~a&&(this._printHandler(e,a,p),a=-1),h="",u=[0],c="",l=-1;break;case 12:(d=this._dcsHandlers[c+String.fromCharCode(i)])||(d=this._dcsHandlerFb),d.hook(c,u,i);break;case 13:l=~l?l:p;break;case 14:d&&(~l&&d.put(e,l,p),d.unhook(),d=null),27===i&&(r|=1),h="",u=[0],c="",l=-1;break;case 4:~a&&(this._printHandler(e,a,p),a=-1),h="";break;case 5:for(var g=p+1;;g++)if(g>=t||(i=e[g])<32||i>127&&i<=159){h+=s.utf32ToString(e,p,g),p=g-1;break}break;case 6:if(h&&24!==i&&26!==i){var C=h.indexOf(";");if(-1===C)this._oscHandlerFb(-1,h);else{for(var v=parseInt(h.substring(0,C)),b=h.substring(C+1),w=this._oscHandlers[v],S=w?w.length-1:-1;S>=0&&!1===w[S](b);S--);S<0&&this._oscHandlerFb(v,b)}}27===i&&(r|=1),h="",u=[0],c="",l=-1}o=15&r}0===o&&~a?this._printHandler(e,a,t):13===o&&~l&&d&&d.put(e,l,t),this._osc=h,this._collect=c,this._params=u,this._activeDcsHandler=d,this.currentState=o},i}(o.Disposable);t.EscapeSequenceParser=f},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(41),s=i(47),a=i(48),l=i(49),h=i(20),c=function(e){function t(t,i){var r=e.call(this)||this;r._terminal=t,r._colors=i;var n=r._terminal.options.allowTransparency;return r._characterJoinerRegistry=new h.CharacterJoinerRegistry(t),r._renderLayers=[new o.TextRenderLayer(r._terminal.screenElement,0,r._colors,r._characterJoinerRegistry,n),new s.SelectionRenderLayer(r._terminal.screenElement,1,r._colors),new l.LinkRenderLayer(r._terminal.screenElement,2,r._colors,r._terminal),new a.CursorRenderLayer(r._terminal.screenElement,3,r._colors)],r.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},r._devicePixelRatio=window.devicePixelRatio,r._updateDimensions(),r.onOptionsChanged(),r}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._renderLayers.forEach(function(e){return e.dispose()})},t.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._terminal.cols,this._terminal.rows))},t.prototype.setColors=function(e){var t=this;this._colors=e,this._renderLayers.forEach(function(e){e.setColors(t._terminal,t._colors),e.reset(t._terminal)})},t.prototype.onResize=function(e,t){var i=this;this._updateDimensions(),this._renderLayers.forEach(function(e){return e.resize(i._terminal,i.dimensions)}),this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.onCharSizeChanged=function(){this.onResize(this._terminal.cols,this._terminal.rows)},t.prototype.onBlur=function(){var e=this;this._runOperation(function(t){return t.onBlur(e._terminal)})},t.prototype.onFocus=function(){var e=this;this._runOperation(function(t){return t.onFocus(e._terminal)})},t.prototype.onSelectionChanged=function(e,t,i){var r=this;void 0===i&&(i=!1),this._runOperation(function(n){return n.onSelectionChanged(r._terminal,e,t,i)})},t.prototype.onCursorMove=function(){var e=this;this._runOperation(function(t){return t.onCursorMove(e._terminal)})},t.prototype.onOptionsChanged=function(){var e=this;this._runOperation(function(t){return t.onOptionsChanged(e._terminal)})},t.prototype.clear=function(){var e=this;this._runOperation(function(t){return t.reset(e._terminal)})},t.prototype._runOperation=function(e){this._renderLayers.forEach(function(t){return e(t)})},t.prototype.renderRows=function(e,t){var i=this;this._renderLayers.forEach(function(r){return r.onGridChanged(i._terminal,e,t)})},t.prototype._updateDimensions=function(){this._terminal.charMeasure.width&&this._terminal.charMeasure.height&&(this.dimensions.scaledCharWidth=Math.floor(this._terminal.charMeasure.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.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._terminal.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols)},t.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},t}(i(0).Disposable);t.Renderer=c},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(42),s=i(9),a=i(1),l=i(20),h=function(e){function t(t,i,r,n,s){var l=e.call(this,t,"text",i,s,r)||this;return l._characterOverlapCache={},l._workCell=new a.CellData,l._state=new o.GridCache,l._characterJoinerRegistry=n,l}return n(t,e),t.prototype.resize=function(t,i){e.prototype.resize.call(this,t,i);var r=this._getFont(t,!1,!1);this._characterWidth===i.scaledCharWidth&&this._characterFont===r||(this._characterWidth=i.scaledCharWidth,this._characterFont=r,this._characterOverlapCache={}),this._state.clear(),this._state.resize(t.cols,t.rows)},t.prototype.reset=function(e){this._state.clear(),this.clearAll()},t.prototype._forEachCell=function(e,t,i,r,n){for(var o=t;o<=i;o++)for(var s=o+e.buffer.ydisp,h=e.buffer.lines.get(s),c=r?r.getJoinedCharacters(s):[],u=0;u<e.cols;u++){h.loadCell(u,this._workCell);var f=this._workCell,d=!1,_=u;if(0!==f.getWidth()){if(c.length>0&&u===c[0][0]){d=!0;var p=c.shift();f=new l.JoinedCellData(this._workCell,h.translateToString(!0,p[0],p[1]),p[1]-p[0]),_=p[1]-1}!d&&this._isOverlapping(f)&&_<h.length-1&&h.getCodePoint(_+1)===a.NULL_CELL_CODE&&(f.content&=-12582913,f.content|=2<<22),n(f,u,o),u=_}}},t.prototype._drawBackground=function(e,t,i){var r=this,n=this._ctx,o=e.cols,s=0,l=0,h=null;n.save(),this._forEachCell(e,t,i,null,function(e,t,i){var c=null;e.isInverse()?c=e.isFgDefault()?r._colors.foreground.css:e.isFgRGB()?"rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":r._colors.ansi[e.getFgColor()].css:e.isBgRGB()?c="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":e.isBgPalette()&&(c=r._colors.ansi[e.getBgColor()].css),null===h&&(s=t,l=i),i!==l?(n.fillStyle=h,r.fillCells(s,l,o-s,1),s=t,l=i):h!==c&&(n.fillStyle=h,r.fillCells(s,l,t-s,1),s=t,l=i),h=c}),null!==h&&(n.fillStyle=h,this.fillCells(s,l,o-s,1)),n.restore()},t.prototype._drawForeground=function(e,t,i){var r=this;this._forEachCell(e,t,i,this._characterJoinerRegistry,function(t,i,n){if(!t.isInvisible()&&(r.drawChars(e,t,i,n),t.isUnderline())){if(r._ctx.save(),t.isInverse())t.isBgDefault()?r._ctx.fillStyle=r._colors.background.css:t.isBgRGB()?r._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(t.getBgColor()).join(",")+")":r._ctx.fillStyle=r._colors.ansi[t.getBgColor()].css;else if(t.isFgDefault())r._ctx.fillStyle=r._colors.foreground.css;else if(t.isFgRGB())r._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var o=t.getFgColor();e.options.drawBoldTextInBrightColors&&t.isBold()&&o<8&&(o+=8),r._ctx.fillStyle=r._colors.ansi[o].css}r.fillBottomLineAtCells(i,n,t.getWidth()),r._ctx.restore()}})},t.prototype.onGridChanged=function(e,t,i){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this.clearCells(0,t,e.cols,i-t+1),this._drawBackground(e,t,i),this._drawForeground(e,t,i))},t.prototype.onOptionsChanged=function(e){this.setTransparency(e,e.options.allowTransparency)},t.prototype._isOverlapping=function(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;var t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i,i},t}(s.BaseRenderLayer);t.TextRenderLayer=h},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var i=0;i<e;i++){this.cache.length<=i&&this.cache.push([]);for(var r=this.cache[i].length;r<t;r++)this.cache[i].push(null);this.cache[i].length=t}this.cache.length=e},e.prototype.clear=function(){for(var e=0;e<this.cache.length;e++)for(var t=0;t<this.cache[e].length;t++)this.cache[e][t]=null},e}();t.GridCache=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(4),s=i(12),a=i(18),l=i(19),h=i(44),c=i(6),u=1024,f=1024,d={css:"rgba(0, 0, 0, 0)",rgba:0};function _(e){return e.code<<21|e.bg<<12|e.fg<<3|(e.bold?0:4)+(e.dim?0:2)+(e.italic?0:1)}t.getGlyphCacheKey=_;var p=function(e){function t(t,i){var r=e.call(this)||this;r._config=i,r._drawToCacheCount=0,r._glyphsWaitingOnBitmap=[],r._bitmapCommitTimeout=null,r._bitmap=null,r._cacheCanvas=t.createElement("canvas"),r._cacheCanvas.width=u,r._cacheCanvas.height=f,r._cacheCtx=r._cacheCanvas.getContext("2d",{alpha:!0});var n=t.createElement("canvas");n.width=r._config.scaledCharWidth,n.height=r._config.scaledCharHeight,r._tmpCtx=n.getContext("2d",{alpha:r._config.allowTransparency}),r._width=Math.floor(u/r._config.scaledCharWidth),r._height=Math.floor(f/r._config.scaledCharHeight);var o=r._width*r._height;return r._cacheMap=new h.default(o),r._cacheMap.prealloc(o),r}return n(t,e),t.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},t.prototype.beginFrame=function(){this._drawToCacheCount=0},t.prototype.draw=function(e,t,i,r){if(32===t.code)return!0;if(!this._canCache(t))return!1;var n=_(t),o=this._cacheMap.get(n);if(null!=o)return this._drawFromCache(e,o,i,r),!0;if(this._drawToCacheCount<100){var s;s=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var a=this._drawToCache(t,s);return this._cacheMap.set(n,a),this._drawFromCache(e,a,i,r),!0}return!1},t.prototype._canCache=function(e){return e.code<256},t.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},t.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},t.prototype._drawFromCache=function(e,t,i,r){if(!t.isEmpty){var n=this._toCoordinateX(t.index),o=this._toCoordinateY(t.index);e.drawImage(t.inBitmap?this._bitmap:this._cacheCanvas,n,o,this._config.scaledCharWidth,this._config.scaledCharHeight,i,r,this._config.scaledCharWidth,this._config.scaledCharHeight)}},t.prototype._getColorFromAnsiIndex=function(e){return e<this._config.colors.ansi.length?this._config.colors.ansi[e]:a.DEFAULT_ANSI_COLORS[e]},t.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?d:e.bg===o.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},t.prototype._getForegroundColor=function(e){return e.fg===o.INVERTED_DEFAULT_COLOR?this._config.colors.background:e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},t.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var i=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=i.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var r=e.bold?this._config.fontWeightBold:this._config.fontWeight,n=e.italic?"italic":"";this._tmpCtx.font=n+" "+r+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(e).css,e.dim&&(this._tmpCtx.globalAlpha=o.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var s=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),a=!1;this._config.allowTransparency||(a=l.clearColor(s,i));var h=this._toCoordinateX(t),c=this._toCoordinateY(t);this._cacheCtx.putImageData(s,h,c);var u={index:t,isEmpty:a,inBitmap:!1};return this._addGlyphToBitmap(u),u},t.prototype._addGlyphToBitmap=function(e){var t=this;"createImageBitmap"in window&&!c.isFirefox&&!c.isSafari&&(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout(function(){return t._generateBitmap()},100)))},t.prototype._generateBitmap=function(){var e=this,t=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(i){e._bitmap=i;for(var r=0;r<t.length;r++)t[r].inBitmap=!0}),this._bitmapCommitTimeout=null},t}(s.default);t.default=p},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.capacity=e,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return e.prototype._unlinkNode=function(e){var t=e.prev,i=e.next;e===this._head&&(this._head=i),e===this._tail&&(this._tail=t),null!==t&&(t.next=i),null!==i&&(i.prev=t)},e.prototype._appendNode=function(e){var t=this._tail;null!==t&&(t.next=e),e.prev=t,e.next=null,this._tail=e,null===this._head&&(this._head=e)},e.prototype.prealloc=function(e){for(var t=this._nodePool,i=0;i<e;i++)t.push({prev:null,next:null,key:null,value:null})},e.prototype.get=function(e){var t=this._map[e];return void 0!==t?(this._unlinkNode(t),this._appendNode(t),t.value):null},e.prototype.peekValue=function(e){var t=this._map[e];return void 0!==t?t.value:null},e.prototype.peek=function(){var e=this._head;return null===e?null:e.value},e.prototype.set=function(e,t){var i=this._map[e];if(void 0!==i)i=this._map[e],this._unlinkNode(i),i.value=t;else if(this.size>=this.capacity)i=this._head,this._unlinkNode(i),delete this._map[i.key],i.key=e,i.value=t,this._map[e]=i;else{var r=this._nodePool;r.length>0?((i=r.pop()).key=e,i.value=t):i={prev:null,next:null,key:e,value:t},this._map[e]=i,this.size++}this._appendNode(i)},e}();t.default=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,i){return e.call(this)||this}return n(t,e),t.prototype.draw=function(e,t,i,r){return!1},t}(i(12).default);t.default=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(4),s=i(19),a=i(12),l=i(11),h=i(7),c=function(e){function t(t,i){var r=e.call(this)||this;return r._document=t,r._config=i,r._canvasFactory=function(e,t){var i=r._document.createElement("canvas");return i.width=e,i.height=t,i},r}return n(t,e),t.prototype._doWarmUp=function(){var e=this,t=s.generateStaticCharAtlasTexture(window,this._canvasFactory,this._config);t instanceof HTMLCanvasElement?this._texture=t:t.then(function(t){e._texture=t})},t.prototype._isCached=function(e,t){var i=e.code<256,r=e.fg<16,n=e.fg===h.DEFAULT_COLOR,o=e.bg===h.DEFAULT_COLOR;return i&&(r||n)&&o&&!e.italic},t.prototype.draw=function(e,t,i,r){if(null===this._texture||void 0===this._texture)return!1;var n=0;if(l.is256Color(t.fg)?n=2+t.fg+(t.bold?16:0):t.fg===h.DEFAULT_COLOR&&t.bold&&(n=1),!this._isCached(t,n))return!1;e.save();var s=this._config.scaledCharWidth+o.CHAR_ATLAS_CELL_SPACING,a=this._config.scaledCharHeight+o.CHAR_ATLAS_CELL_SPACING;return t.dim&&(e.globalAlpha=o.DIM_OPACITY),e.drawImage(this._texture,t.code*s,n*a,s,this._config.scaledCharHeight,i,r,s,this._config.scaledCharHeight),e.restore(),!0},t}(a.default);t.default=c},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,i,r){var n=e.call(this,t,"selection",i,!0,r)||this;return n._clearState(),n}return n(t,e),t.prototype._clearState=function(){this._state={start:null,end:null,columnSelectMode:null,ydisp:null}},t.prototype.resize=function(t,i){e.prototype.resize.call(this,t,i),this._clearState()},t.prototype.reset=function(e){this._state.start&&this._state.end&&(this._clearState(),this.clearAll())},t.prototype.onSelectionChanged=function(e,t,i,r){if(this._didStateChange(t,i,r,e.buffer.ydisp))if(this.clearAll(),t&&i){var n=t[1]-e.buffer.ydisp,o=i[1]-e.buffer.ydisp,s=Math.max(n,0),a=Math.min(o,e.rows-1);if(!(s>=e.rows||a<0)){if(this._ctx.fillStyle=this._colors.selection.css,r){var l=t[0],h=i[0]-l,c=a-s+1;this.fillCells(l,s,h,c)}else{l=n===s?t[0]:0;var u=s===a?i[0]:e.cols;this.fillCells(l,s,u-l,1);var f=Math.max(a-s-1,0);if(this.fillCells(0,s+1,e.cols,f),s!==a){var d=o===a?i[0]:e.cols;this.fillCells(0,a,d,1)}}this._state.start=[t[0],t[1]],this._state.end=[i[0],i[1]],this._state.columnSelectMode=r,this._state.ydisp=e.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,i,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||r!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},t}(i(9).BaseRenderLayer);t.SelectionRenderLayer=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(9),s=i(1),a=function(e){function t(t,i,r){var n=e.call(this,t,"cursor",i,!0,r)||this;return n._cell=new s.CellData,n._state={x:null,y:null,isFocused:null,style:null,width:null},n._cursorRenderers={bar:n._renderBarCursor.bind(n),block:n._renderBlockCursor.bind(n),underline:n._renderUnderlineCursor.bind(n)},n}return n(t,e),t.prototype.resize=function(t,i){e.prototype.resize.call(this,t,i),this._state={x:null,y:null,isFocused:null,style:null,width:null}},t.prototype.reset=function(e){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(e))},t.prototype.onBlur=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),e.refresh(e.buffer.y,e.buffer.y)},t.prototype.onFocus=function(e){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(e):e.refresh(e.buffer.y,e.buffer.y)},t.prototype.onOptionsChanged=function(e){var t=this;e.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new l(e,function(){t._render(e,!0)})):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),e.refresh(e.buffer.y,e.buffer.y))},t.prototype.onCursorMove=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype.onGridChanged=function(e,t,i){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(e,!1):this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype._render=function(e,t){if(e.cursorState&&!e.cursorHidden){var i=e.buffer.ybase+e.buffer.y,r=i-e.buffer.ydisp;if(r<0||r>=e.rows)this._clearCursor();else if(e.buffer.lines.get(i).loadCell(e.buffer.x,this._cell),void 0!==this._cell.content){if(!e.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(e,e.buffer.x,r,this._cell),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,void(this._state.width=this._cell.getWidth());if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===e.buffer.x&&this._state.y===r&&this._state.isFocused===e.isFocused&&this._state.style===e.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.options.cursorStyle||"block"](e,e.buffer.x,r,this._cell),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},t.prototype._clearCursor=function(){this._state&&(this.clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:null,y:null,isFocused:null,style:null,width:null})},t.prototype._renderBarCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(t,i),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(t,i,r.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(e,r,t,i),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(t,i),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,i,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(t,i,r.getWidth(),1),this._ctx.restore()},t}(o.BaseRenderLayer);t.CursorRenderLayer=a;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e.isFocused&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=null),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)},e.prototype.restartBlinkAnimation=function(e){var t=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=null,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null}),t._blinkInterval=setInterval(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=null,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})},600)},e)},e.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=null),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)},e.prototype.resume=function(e){this._animationTimeRestarted=null,this._restartInterval(),this.restartBlinkAnimation(e)},e}()},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(9),s=i(4),a=i(11),l=function(e){function t(t,i,r,n){var o=e.call(this,t,"link",i,!0,r)||this;return o._state=null,n.linkifier.onLinkHover(function(e){return o._onLinkHover(e)}),n.linkifier.onLinkLeave(function(e){return o._onLinkLeave(e)}),o}return n(t,e),t.prototype.resize=function(t,i){e.prototype.resize.call(this,t,i),this._state=null},t.prototype.reset=function(e){this._clearCurrentLink()},t.prototype._clearCurrentLink=function(){if(this._state){this.clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;e>0&&this.clearCells(0,this._state.y1+1,this._state.cols,e),this.clearCells(0,this._state.y2,this._state.x2,1),this._state=null}},t.prototype._onLinkHover=function(e){if(e.fg===s.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:a.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this.fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this.fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t<e.y2;t++)this.fillBottomLineAtCells(0,t,e.cols);this.fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e},t.prototype._onLinkLeave=function(e){this._clearCurrentLink()},t}(o.BaseRenderLayer);t.LinkRenderLayer=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(21),n=i(15),o=i(2),s=function(){function e(e){this._terminal=e,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onLinkHover=new o.EventEmitter2,this._onLinkLeave=new o.EventEmitter2,this._onLinkTooltip=new o.EventEmitter2,this._rowsToLinkify={start:null,end:null}}return Object.defineProperty(e.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),e.prototype.attachToDom=function(e){this._mouseZoneManager=e},e.prototype.linkifyRows=function(t,i){var r=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=i):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,i)),this._mouseZoneManager.clearAll(t,i),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return r._linkifyRows()},e.TIME_BEFORE_LINKIFY))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var t=this._terminal.buffer,i=t.ydisp+this._rowsToLinkify.start;if(!(i>=t.lines.length)){for(var r=t.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,n=Math.ceil(e.OVERSCAN_CHAR_LIMIT/this._terminal.cols),o=this._terminal.buffer.iterator(!1,i,r,n,n);o.hasNext();)for(var s=o.next(),a=0;a<this._linkMatchers.length;a++)this._doLinkifyRow(s.range.first,s.content,this._linkMatchers[a]);this._rowsToLinkify.start=null,this._rowsToLinkify.end=null}},e.prototype.registerLinkMatcher=function(e,t,i){if(void 0===i&&(i={}),!t)throw new Error("handler must be defined");var r={id:this._nextLinkMatcherId++,regex:e,handler:t,matchIndex:i.matchIndex,validationCallback:i.validationCallback,hoverTooltipCallback:i.tooltipCallback,hoverLeaveCallback:i.leaveCallback,willLinkActivate:i.willLinkActivate,priority:i.priority||0};return this._addLinkMatcherToList(r),r.id},e.prototype._addLinkMatcherToList=function(e){if(0!==this._linkMatchers.length){for(var t=this._linkMatchers.length-1;t>=0;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},e.prototype.deregisterLinkMatcher=function(e){for(var t=0;t<this._linkMatchers.length;t++)if(this._linkMatchers[t].id===e)return this._linkMatchers.splice(t,1),!0;return!1},e.prototype._doLinkifyRow=function(e,t,i){for(var r,n=this,o=new RegExp(i.regex.source,i.regex.flags+"g"),s=-1,a=function(){var a=r["number"!=typeof i.matchIndex?0:i.matchIndex];if(!a){if(l._terminal.debug)throw console.log({match:r,matcher:i}),new Error("match found without corresponding matchIndex");return"break"}if(s=t.indexOf(a,s+1),o.lastIndex=s+a.length,s<0)return"break";var h=l._terminal.buffer.stringIndexToBufferIndex(e,s);if(h[0]<0)return"break";var c,u=l._terminal.buffer.lines.get(h[0]).getFg(h[1]);u&&(c=u>>9&511),i.validationCallback?i.validationCallback(a,function(e){n._rowsTimeoutId||e&&n._addLink(h[1],h[0]-n._terminal.buffer.ydisp,a,i,c)}):l._addLink(h[1],h[0]-l._terminal.buffer.ydisp,a,i,c)},l=this;null!==(r=o.exec(t))&&"break"!==a(););},e.prototype._addLink=function(e,t,i,o,s){var a=this,l=n.getStringCellWidth(i),h=e%this._terminal.cols,c=t+Math.floor(e/this._terminal.cols),u=(h+l)%this._terminal.cols,f=c+Math.floor((h+l)/this._terminal.cols);0===u&&(u=this._terminal.cols,f--),this._mouseZoneManager.add(new r.MouseZone(h+1,c+1,u+1,f+1,function(e){if(o.handler)return o.handler(e,i);window.open(i,"_blank")},function(){a._onLinkHover.fire(a._createLinkHoverEvent(h,c,u,f,s)),a._terminal.element.classList.add("xterm-cursor-pointer")},function(e){a._onLinkTooltip.fire(a._createLinkHoverEvent(h,c,u,f,s)),o.hoverTooltipCallback&&o.hoverTooltipCallback(e,i)},function(){a._onLinkLeave.fire(a._createLinkHoverEvent(h,c,u,f,s)),a._terminal.element.classList.remove("xterm-cursor-pointer"),o.hoverLeaveCallback&&o.hoverLeaveCallback()},function(e){return!o.willLinkActivate||o.willLinkActivate(e,i)}))},e.prototype._createLinkHoverEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._terminal.cols,fg:n}},e.TIME_BEFORE_LINKIFY=200,e.OVERSCAN_CHAR_LIMIT=2e3,e}();t.Linkifier=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(22),n=i(6),o=i(52),s=i(53),a=i(1),l=i(2),h=String.fromCharCode(160),c=new RegExp(h,"g"),u=function(){function e(e,t){this._terminal=e,this._charMeasure=t,this._enabled=!0,this._workCell=new a.CellData,this._onLinuxMouseSelection=new l.EventEmitter2,this._onRedrawRequest=new l.EventEmitter2,this._onSelectionChange=new l.EventEmitter2,this._initListeners(),this.enable(),this._model=new o.SelectionModel(e),this._activeSelectionMode=0}return Object.defineProperty(e.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onRedrawRequest",{get:function(){return this._onRedrawRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._removeMouseDownListeners()},Object.defineProperty(e.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),e.prototype._initListeners=function(){var e=this;this._mouseMoveListener=function(t){return e._onMouseMove(t)},this._mouseUpListener=function(t){return e._onMouseUp(t)},this.initBuffersListeners()},e.prototype.initBuffersListeners=function(){var e=this;this._trimListener=this._terminal.buffer.lines.onTrim(function(t){return e._onTrim(t)}),this._terminal.buffers.onBufferActivate(function(t){return e._onBufferActivate(t)})},e.prototype.disable=function(){this.clearSelection(),this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},Object.defineProperty(e.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var i=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var r=e[1];r<=t[1];r++){var o=this._buffer.translateBufferLineToString(r,!0,e[0],t[0]);i.push(o)}}else{var s=e[1]===t[1]?t[0]:void 0;for(i.push(this._buffer.translateBufferLineToString(e[1],!0,e[0],s)),r=e[1]+1;r<=t[1]-1;r++){var a=this._buffer.lines.get(r);o=this._buffer.translateBufferLineToString(r,!0),a.isWrapped?i[i.length-1]+=o:i.push(o)}e[1]!==t[1]&&(a=this._buffer.lines.get(t[1]),o=this._buffer.translateBufferLineToString(t[1],!0,0,t[0]),a.isWrapped?i[i.length-1]+=o:i.push(o))}return i.map(function(e){return e.replace(c," ")}).join(n.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),e.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},e.prototype.refresh=function(e){var t=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return t._refresh()})),n.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},e.prototype._refresh=function(){this._refreshAnimationFrame=null,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},e.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!i||!r)&&this._areCoordsInSelection(t,i,r)},e.prototype._areCoordsInSelection=function(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]},e.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},e.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},e.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._terminal.cols,t],this.refresh(),this._onSelectionChange.fire()},e.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},e.prototype._getMouseBufferCoords=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return t?(t[0]--,t[1]--,t[1]+=this._terminal.buffer.ydisp,t):null},e.prototype._getMouseEventScrollAmount=function(e){var t=r.MouseHelper.getCoordsRelativeToElement(e,this._terminal.screenElement)[1],i=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},e.prototype.shouldForceSelection=function(e){return n.isMac?e.altKey&&this._terminal.options.macOptionClickForcesSelection:e.shiftKey},e.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},e.prototype._addMouseDownListeners=function(){var e=this;this._terminal.element.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.addEventListener("mouseup",this._mouseUpListener),this._dragScrollIntervalTimer=setInterval(function(){return e._dragScroll()},50)},e.prototype._removeMouseDownListeners=function(){this._terminal.element.ownerDocument&&(this._terminal.element.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=null},e.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},e.prototype._onSingleClick=function(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart){this._model.selectionEnd=null;var t=this._buffer.lines.get(this._model.selectionStart[1]);t&&(t.length>=this._model.selectionStart[0]||0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++)}},e.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},e.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},e.prototype.shouldColumnSelect=function(e){return e.altKey&&!(n.isMac&&this._terminal.options.macOptionClickForcesSelection)},e.prototype._onMouseMove=function(e){e.stopImmediatePropagation();var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._terminal.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._terminal.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0)),this._model.selectionEnd[1]<this._buffer.lines.length&&0===this._buffer.lines.get(this._model.selectionEnd[1]).hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++,t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)):this.refresh(!0)},e.prototype._dragScroll=function(){this._dragScrollAmount&&(this._terminal.scrollLines(this._dragScrollAmount,!1),this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._terminal.cols),this._model.selectionEnd[1]=Math.min(this._terminal.buffer.ydisp+this._terminal.rows,this._terminal.buffer.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=this._terminal.buffer.ydisp),this.refresh())},e.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500?new s.AltClickHandler(e,this._terminal).move():this.hasSelection&&this._onSelectionChange.fire()},e.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener&&this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(function(e){return t._onTrim(e)})},e.prototype._convertViewportColToCharacterIndex=function(e,t){for(var i=t[0],r=0;t[0]>=r;r++){var n=e.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:n>1&&t[0]!==r&&(i+=n-1)}return i},e.prototype.setSelection=function(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh()},e.prototype._getWordAt=function(e,t,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),e[0]>=this._terminal.cols)return null;var n=this._buffer.lines.get(e[1]);if(!n)return null;var o=this._buffer.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(n,e),a=s,l=e[0]-s,h=0,c=0,u=0,f=0;if(" "===o.charAt(s)){for(;s>0&&" "===o.charAt(s-1);)s--;for(;a<o.length&&" "===o.charAt(a+1);)a++}else{var d=e[0],_=e[0];0===n.getWidth(d)&&(h++,d--),2===n.getWidth(_)&&(c++,_++);var p=n.getString(_).length;for(p>1&&(f+=p-1,a+=p-1);d>0&&s>0&&!this._isCharWordSeparator(n.loadCell(d-1,this._workCell));){n.loadCell(d-1,this._workCell);var m=this._workCell.getChars().length;0===this._workCell.getWidth()?(h++,d--):m>1&&(u+=m-1,s-=m-1),s--,d--}for(;_<n.length&&a+1<o.length&&!this._isCharWordSeparator(n.loadCell(_+1,this._workCell));){n.loadCell(_+1,this._workCell);var y=this._workCell.getChars().length;2===this._workCell.getWidth()?(c++,_++):y>1&&(f+=y-1,a+=y-1),a++,_++}}a++;var g=s+l-h+u,C=Math.min(this._terminal.cols,a-s+h+c-u-f);if(!t&&""===o.slice(s,a).trim())return null;if(i&&0===g&&32!==n.getCodePoint(0)){var v=this._buffer.lines.get(e[1]-1);if(v&&n.isWrapped&&32!==v.getCodePoint(this._terminal.cols-1)){var b=this._getWordAt([this._terminal.cols-1,e[1]-1],!1,!0,!1);if(b){var w=this._terminal.cols-b.start;g-=w,C+=w}}}if(r&&g+C===this._terminal.cols&&32!==n.getCodePoint(this._terminal.cols-1)){var S=this._buffer.lines.get(e[1]+1);if(S&&S.isWrapped&&32!==S.getCodePoint(0)){var E=this._getWordAt([0,e[1]+1],!1,!1,!0);E&&(C+=E.length)}}return{start:g,length:C}},e.prototype._selectWordAt=function(e,t){var i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._terminal.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}},e.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var i=e[1];t.start<0;)t.start+=this._terminal.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._terminal.cols;)t.length-=this._terminal.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}},e.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&" ()[]{}'\"".indexOf(e.getChars())>=0},e.prototype._selectLineAt=function(e){var t=this._buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._terminal.cols,t.last],this._model.selectionStartLength=0},e}();t.SelectionManager=u},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this._terminal=e,this.clearSelection()}return e.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._terminal.cols,this._terminal.buffer.ybase+this._terminal.rows-1];if(!this.selectionStart)return null;if(!this.selectionEnd||this.areSelectionValuesReversed()){var e=this.selectionStart[0]+this.selectionStartLength;return e>this._terminal.cols?[e%this._terminal.cols,this.selectionStart[1]+Math.floor(e/this._terminal.cols)]:[e,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd},enumerable:!0,configurable:!0}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();t.SelectionModel=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(8),n=function(){function e(e,t){var i;this._mouseEvent=e,this._terminal=t,this._lines=this._terminal.buffer.lines,this._startCol=this._terminal.buffer.x,this._startRow=this._terminal.buffer.y;var r=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows,!1);r&&(i=r.map(function(e){return e-1}),this._endCol=i[0],this._endRow=i[1])}return e.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())},e.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},e.prototype._resetStartingRow=function(){return 0===this._moveToRequestedRow().length?"":o(this._bufferLine(this._startCol,this._startRow,this._startCol,this._startRow-this._wrappedRowsForRow(this._startRow),!1).length,this._sequence("D"))},e.prototype._moveToRequestedRow=function(){var e=this._startRow-this._wrappedRowsForRow(this._startRow),t=this._endRow-this._wrappedRowsForRow(this._endRow);return o(Math.abs(e-t)-this._wrappedRowsCount(),this._sequence(this._verticalDirection()))},e.prototype._moveToRequestedCol=function(){var e;e=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow;var t=this._endRow,i=this._horizontalDirection();return o(this._bufferLine(this._startCol,e,this._endCol,t,"C"===i).length,this._sequence(i))},e.prototype._moveHorizontallyOnly=function(){var e=this._horizontalDirection();return o(Math.abs(this._startCol-this._endCol),this._sequence(e))},e.prototype._wrappedRowsCount=function(){for(var e=0,t=this._startRow-this._wrappedRowsForRow(this._startRow),i=this._endRow-this._wrappedRowsForRow(this._endRow),r=0;r<Math.abs(t-i);r++){var n="A"===this._verticalDirection()?-1:1;this._lines.get(t+n*r).isWrapped&&e++}return e},e.prototype._wrappedRowsForRow=function(e){for(var t=0,i=this._lines.get(e).isWrapped;i&&e>=0&&e<this._terminal.rows;)t++,e--,i=this._lines.get(e).isWrapped;return t},e.prototype._horizontalDirection=function(){var e;return e=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow,this._startCol<this._endCol&&e<=this._endRow||this._startCol>=this._endCol&&e<this._endRow?"C":"D"},e.prototype._verticalDirection=function(){return this._startRow>this._endRow?"A":"B"},e.prototype._bufferLine=function(e,t,i,r,n){for(var o=e,s=t,a="";o!==i||s!==r;)o+=n?1:-1,n&&o>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!n&&o<0&&(a+=this._terminal.buffer.translateBufferLineToString(s,!1,0,e+1),e=o=this._terminal.cols-1,s--);return a+this._terminal.buffer.translateBufferLineToString(s,!1,e,o)},e.prototype._sequence=function(e){var t=this._terminal.applicationCursor?"O":"[";return r.C0.ESC+t+e},e}();function o(e,t){e=Math.floor(e);for(var i="",r=0;r<e;r++)i+=t;return i}t.AltClickHandler=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(2),n=function(){function e(e,t){this._onCharSizeChanged=new r.EventEmitter2,this._document=e,this._parentElement=t,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 Object.defineProperty(e.prototype,"onCharSizeChanged",{get:function(){return this._onCharSizeChanged.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.measure=function(e){this._measureElement.style.fontFamily=e.fontFamily,this._measureElement.style.fontSize=e.fontSize+"px";var t=this._measureElement.getBoundingClientRect();if(0!==t.width&&0!==t.height){var i=Math.ceil(t.height);this._width===t.width&&this._height===i||(this._width=t.width,this._height=i,this._onCharSizeChanged.fire())}},e}();t.CharMeasure=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BELL_SOUND="data:audio/wav;base64,UklGRigBAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQQBAADpAFgCwAMlBZoG/wdmCcoKRAypDQ8PbRDBEQQTOxRtFYcWlBePGIUZXhoiG88bcBz7HHIdzh0WHlMeZx51HmkeUx4WHs8dah0AHXwc3hs9G4saxRnyGBIYGBcQFv8U4RPAEoYRQBACD70NWwwHC6gJOwjWBloF7gOBAhABkf8b/qv8R/ve+Xf4Ife79W/0JfPZ8Z/wde9N7ijtE+wU6xvqM+lb6H7nw+YX5mrlxuQz5Mzje+Ma49fioeKD4nXiYeJy4pHitOL04j/jn+MN5IPkFOWs5U3mDefM55/ogOl36m7rdOyE7abuyu8D8Unyj/Pg9D/2qfcb+Yn6/vuK/Qj/lAAlAg==";var r=function(){function e(e){this._terminal=e}return Object.defineProperty(e,"audioContext",{get:function(){if(!e._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;e._audioContext=new t}return e._audioContext},enumerable:!0,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var i=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),function(e){i.buffer=e,i.connect(t.destination),i.start(0)})}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),i=t.length,r=new Uint8Array(i),n=0;n<i;n++)r[n]=t.charCodeAt(n);return r.buffer},e.prototype._removeMimeType=function(e){return e.split(",")[1]},e}();t.SoundManager=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(13),s=i(6),a=i(23),l=i(5),h=i(0),c=i(24),u=function(e){function t(t,i){var r=e.call(this)||this;r._terminal=t,r._dimensions=i,r._liveRegionLineCount=0,r._charsToConsume=[],r._charsToAnnounce="",r._accessibilityTreeRoot=document.createElement("div"),r._accessibilityTreeRoot.classList.add("xterm-accessibility"),r._rowContainer=document.createElement("div"),r._rowContainer.classList.add("xterm-accessibility-tree"),r._rowElements=[];for(var n=0;n<r._terminal.rows;n++)r._rowElements[n]=r._createAccessibilityTreeNode(),r._rowContainer.appendChild(r._rowElements[n]);return r._topBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,0)},r._bottomBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,1)},r._rowElements[0].addEventListener("focus",r._topBoundaryFocusListener),r._rowElements[r._rowElements.length-1].addEventListener("focus",r._bottomBoundaryFocusListener),r._refreshRowsDimensions(),r._accessibilityTreeRoot.appendChild(r._rowContainer),r._renderRowsDebouncer=new a.RenderDebouncer(r._renderRows.bind(r)),r._refreshRows(),r._liveRegion=document.createElement("div"),r._liveRegion.classList.add("live-region"),r._liveRegion.setAttribute("aria-live","assertive"),r._accessibilityTreeRoot.appendChild(r._liveRegion),r._terminal.element.insertAdjacentElement("afterbegin",r._accessibilityTreeRoot),r.register(r._renderRowsDebouncer),r.register(r._terminal.onResize(function(e){return r._onResize(e.rows)})),r.register(r._terminal.onRender(function(e){return r._refreshRows(e.start,e.end)})),r.register(r._terminal.onScroll(function(){return r._refreshRows()})),r.register(r._terminal.addDisposableListener("a11y.char",function(e){return r._onChar(e)})),r.register(r._terminal.onLineFeed(function(){return r._onChar("\n")})),r.register(r._terminal.addDisposableListener("a11y.tab",function(e){return r._onTab(e)})),r.register(r._terminal.onKey(function(e){return r._onKey(e.key)})),r.register(r._terminal.addDisposableListener("blur",function(){return r._clearLiveRegion()})),r._screenDprMonitor=new c.ScreenDprMonitor,r.register(r._screenDprMonitor),r._screenDprMonitor.setListener(function(){return r._refreshRowsDimensions()}),r.register(l.addDisposableDomListener(window,"resize",function(){return r._refreshRowsDimensions()})),r}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._terminal.element.removeChild(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(e,t){var i=e.target,r=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===r){var n,o;if(0===t?(n=i,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(n=this._rowElements.shift(),o=i,this._rowContainer.removeChild(n)),n.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){var s=this._createAccessibilityTreeNode();this._rowElements.unshift(s),this._rowContainer.insertAdjacentElement("afterbegin",s)}else s=this._createAccessibilityTreeNode(),this._rowElements.push(s),this._rowContainer.appendChild(s);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}},t.prototype._onResize=function(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},t.prototype._onTab=function(e){for(var t=0;t<e;t++)this._onChar(" ")},t.prototype._onChar=function(e){var t=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=o.tooMuchOutput)),s.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)},0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,s.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)},t.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},t.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){for(var i=this._terminal.buffer,r=i.lines.length.toString(),n=e;n<=t;n++){var s=i.translateBufferLineToString(i.ydisp+n,!0),a=(i.ydisp+n+1).toString(),l=this._rowElements[n];l&&(l.textContent=0===s.length?o.blankLine:s,l.setAttribute("aria-posinset",a),l.setAttribute("aria-setsize",r))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}},t.prototype.setDimensions=function(e){this._dimensions=e,this._refreshRowsDimensions()},t.prototype._refreshRowDimensions=function(e){e.style.height=this._dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(h.Disposable);t.AccessibilityManager=u},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(58),s=i(4),a=i(0),l="xterm-dom-renderer-owner-",h="xterm-rows",c="xterm-selection",u=1,f=function(e){function t(t,i){var r=e.call(this)||this;return r._terminal=t,r._colors=i,r._terminalClass=u++,r._rowElements=[],r._rowContainer=document.createElement("div"),r._rowContainer.classList.add(h),r._rowContainer.style.lineHeight="normal",r._rowContainer.setAttribute("aria-hidden","true"),r._refreshRowElements(r._terminal.cols,r._terminal.rows),r._selectionContainer=document.createElement("div"),r._selectionContainer.classList.add(c),r._selectionContainer.setAttribute("aria-hidden","true"),r.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},r._updateDimensions(),r._injectCss(),r._rowFactory=new o.DomRendererRowFactory(t.options,document),r._terminal.element.classList.add(l+r._terminalClass),r._terminal.screenElement.appendChild(r._rowContainer),r._terminal.screenElement.appendChild(r._selectionContainer),r._terminal.linkifier.onLinkHover(function(e){return r._onLinkHover(e)}),r._terminal.linkifier.onLinkLeave(function(e){return r._onLinkLeave(e)}),r}return n(t,e),t.prototype.dispose=function(){this._terminal.element.classList.remove(l+this._terminalClass),this._terminal.screenElement.removeChild(this._rowContainer),this._terminal.screenElement.removeChild(this._selectionContainer),this._terminal.screenElement.removeChild(this._themeStyleElement),this._terminal.screenElement.removeChild(this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.prototype._updateDimensions=function(){var e=this;this.dimensions.scaledCharWidth=this._terminal.charMeasure.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._terminal.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._terminal.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._terminal.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this._rowElements.forEach(function(t){t.style.width=e.dimensions.canvasWidth+"px",t.style.height=e.dimensions.actualCellHeight+"px",t.style.lineHeight=e.dimensions.actualCellHeight+"px",t.style.overflow="hidden"}),this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._dimensionsStyleElement));var t=this._terminalSelector+" ."+h+" span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=t,this._selectionContainer.style.height=this._terminal._viewportElement.style.height,this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.setColors=function(e){this._colors=e,this._injectCss()},t.prototype._injectCss=function(){var e=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._themeStyleElement));var t=this._terminalSelector+" ."+h+" { color: "+this._colors.foreground.css+"; background-color: "+this._colors.background.css+"; font-family: "+this._terminal.options.fontFamily+"; font-size: "+this._terminal.options.fontSize+"px;}";t+=this._terminalSelector+" span:not(."+o.BOLD_CLASS+") { font-weight: "+this._terminal.options.fontWeight+";}"+this._terminalSelector+" span."+o.BOLD_CLASS+" { font-weight: "+this._terminal.options.fontWeightBold+";}"+this._terminalSelector+" span."+o.ITALIC_CLASS+" { font-style: italic;}",t+="@keyframes blink { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; }}",t+=this._terminalSelector+" ."+h+":not(.xterm-focus) ."+o.CURSOR_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" ."+h+".xterm-focus ."+o.CURSOR_CLASS+"."+o.CURSOR_BLINK_CLASS+" { animation: blink 1s step-end infinite;}"+this._terminalSelector+" ."+h+".xterm-focus ."+o.CURSOR_CLASS+"."+o.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" ."+h+".xterm-focus ."+o.CURSOR_CLASS+"."+o.CURSOR_STYLE_BAR_CLASS+" { box-shadow: 1px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" ."+h+".xterm-focus ."+o.CURSOR_CLASS+"."+o.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",t+=this._terminalSelector+" ."+c+" { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" ."+c+" div { position: absolute; background-color: "+this._colors.selection.css+";}",this._colors.ansi.forEach(function(i,r){t+=e._terminalSelector+" .xterm-fg-"+r+" { color: "+i.css+"; }"+e._terminalSelector+" .xterm-bg-"+r+" { background-color: "+i.css+"; }"}),t+=this._terminalSelector+" .xterm-fg-"+s.INVERTED_DEFAULT_COLOR+" { color: "+this._colors.background.css+"; }"+this._terminalSelector+" .xterm-bg-"+s.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=t},t.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},t.prototype._refreshRowElements=function(e,t){for(var i=this._rowElements.length;i<=t;i++){var r=document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())},t.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},t.prototype.onCharSizeChanged=function(){this._updateDimensions()},t.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},t.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},t.prototype.onSelectionChanged=function(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var r=e[1]-this._terminal.buffer.ydisp,n=t[1]-this._terminal.buffer.ydisp,o=Math.max(r,0),s=Math.min(n,this._terminal.rows-1);if(!(o>=this._terminal.rows||s<0)){var a=document.createDocumentFragment();if(i)a.appendChild(this._createSelectionElement(o,e[0],t[0],s-o+1));else{var l=r===o?e[0]:0,h=o===s?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(o,l,h));var c=s-o-1;if(a.appendChild(this._createSelectionElement(o+1,0,this._terminal.cols,c)),o!==s){var u=n===s?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},t.prototype._createSelectionElement=function(e,t,i,r){void 0===r&&(r=1);var n=document.createElement("div");return n.style.height=r*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(i-t)+"px",n},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss(),this._terminal.refresh(0,this._terminal.rows-1)},t.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},t.prototype.renderRows=function(e,t){for(var i=this._terminal,r=i.buffer.ybase+i.buffer.y,n=this._terminal.buffer.x,o=this._terminal.options.cursorBlink,s=e;s<=t;s++){var a=this._rowElements[s];a.innerHTML="";var l=s+i.buffer.ydisp,h=i.buffer.lines.get(l),c=i.options.cursorStyle;a.appendChild(this._rowFactory.createRow(h,l===r,c,n,o,this.dimensions.actualCellWidth,i.cols))}},Object.defineProperty(t.prototype,"_terminalSelector",{get:function(){return"."+l+this._terminalClass},enumerable:!0,configurable:!0}),t.prototype.registerCharacterJoiner=function(e){return-1},t.prototype.deregisterCharacterJoiner=function(e){return!1},t.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},t.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},t.prototype._setCellUnderline=function(e,t,i,r,n,o){for(;e!==t||i!==r;){var s=this._rowElements[i];if(!s)return;var a=s.children[e];a&&(a.style.textDecoration=o?"underline":"none"),++e>=n&&(e=0,i++)}},t}(a.Disposable);t.DomRenderer=f},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(4),n=i(1);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var o=function(){function e(e,t){this._terminalOptions=e,this._document=t,this._workCell=new n.CellData}return e.prototype.createRow=function(e,i,o,s,a,l,h){for(var c=this._document.createDocumentFragment(),u=0,f=Math.min(e.length,h)-1;f>=0;f--)if(e.loadCell(f,this._workCell).getCode()!==n.NULL_CELL_CODE||i&&f===s){u=f+1;break}for(f=0;f<u;f++){e.loadCell(f,this._workCell);var d=this._workCell.getWidth();if(0!==d){var _=this._document.createElement("span");if(d>1&&(_.style.width=l*d+"px"),i&&f===s)switch(_.classList.add(t.CURSOR_CLASS),a&&_.classList.add(t.CURSOR_BLINK_CLASS),o){case"bar":_.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":_.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:_.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&this._terminalOptions.enableBold&&_.classList.add(t.BOLD_CLASS),this._workCell.isItalic()&&_.classList.add(t.ITALIC_CLASS),this._workCell.isDim()&&_.classList.add(t.DIM_CLASS),this._workCell.isUnderline()&&_.classList.add(t.UNDERLINE_CLASS),_.textContent=this._workCell.getChars()||n.WHITESPACE_CELL_CHAR;var p=this._workCell.isInverse();if(this._workCell.isFgRGB()){var m=_.getAttribute("style")||"";m+=(p?"background-":"")+"color:rgb("+n.AttributeData.toColorRGB(this._workCell.getFgColor()).join(",")+");",_.setAttribute("style",m)}else if(this._workCell.isFgPalette()){var y=this._workCell.getFgColor();this._workCell.isBold()&&y<8&&!p&&this._terminalOptions.enableBold&&this._terminalOptions.drawBoldTextInBrightColors&&(y+=8),_.classList.add("xterm-"+(p?"b":"f")+"g-"+y)}else p&&_.classList.add("xterm-bg-"+r.INVERTED_DEFAULT_COLOR);this._workCell.isBgRGB()?(m=_.getAttribute("style")||"",m+=(p?"":"background-")+"color:rgb("+n.AttributeData.toColorRGB(this._workCell.getBgColor()).join(",")+");",_.setAttribute("style",m)):this._workCell.isBgPalette()?_.classList.add("xterm-"+(p?"f":"b")+"g-"+this._workCell.getBgColor()):p&&_.classList.add("xterm-fg-"+r.INVERTED_DEFAULT_COLOR),c.appendChild(_)}}return c},e}();t.DomRendererRowFactory=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(8),n={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:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,o){var s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?s.key=t?r.C0.ESC+"OA":r.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?s.key=t?r.C0.ESC+"OD":r.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?s.key=t?r.C0.ESC+"OC":r.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(s.key=t?r.C0.ESC+"OB":r.C0.ESC+"[B");break;case 8:if(e.shiftKey){s.key=r.C0.BS;break}if(e.altKey){s.key=r.C0.ESC+r.C0.DEL;break}s.key=r.C0.DEL;break;case 9:if(e.shiftKey){s.key=r.C0.ESC+"[Z";break}s.key=r.C0.HT,s.cancel=!0;break;case 13:s.key=r.C0.CR,s.cancel=!0;break;case 27:s.key=r.C0.ESC,s.cancel=!0;break;case 37:a?(s.key=r.C0.ESC+"[1;"+(a+1)+"D",s.key===r.C0.ESC+"[1;3D"&&(s.key=i?r.C0.ESC+"b":r.C0.ESC+"[1;5D")):s.key=t?r.C0.ESC+"OD":r.C0.ESC+"[D";break;case 39:a?(s.key=r.C0.ESC+"[1;"+(a+1)+"C",s.key===r.C0.ESC+"[1;3C"&&(s.key=i?r.C0.ESC+"f":r.C0.ESC+"[1;5C")):s.key=t?r.C0.ESC+"OC":r.C0.ESC+"[C";break;case 38:a?(s.key=r.C0.ESC+"[1;"+(a+1)+"A",s.key===r.C0.ESC+"[1;3A"&&(s.key=r.C0.ESC+"[1;5A")):s.key=t?r.C0.ESC+"OA":r.C0.ESC+"[A";break;case 40:a?(s.key=r.C0.ESC+"[1;"+(a+1)+"B",s.key===r.C0.ESC+"[1;3B"&&(s.key=r.C0.ESC+"[1;5B")):s.key=t?r.C0.ESC+"OB":r.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(s.key=r.C0.ESC+"[2~");break;case 46:s.key=a?r.C0.ESC+"[3;"+(a+1)+"~":r.C0.ESC+"[3~";break;case 36:s.key=a?r.C0.ESC+"[1;"+(a+1)+"H":t?r.C0.ESC+"OH":r.C0.ESC+"[H";break;case 35:s.key=a?r.C0.ESC+"[1;"+(a+1)+"F":t?r.C0.ESC+"OF":r.C0.ESC+"[F";break;case 33:e.shiftKey?s.type=2:s.key=r.C0.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:s.key=r.C0.ESC+"[6~";break;case 112:s.key=a?r.C0.ESC+"[1;"+(a+1)+"P":r.C0.ESC+"OP";break;case 113:s.key=a?r.C0.ESC+"[1;"+(a+1)+"Q":r.C0.ESC+"OQ";break;case 114:s.key=a?r.C0.ESC+"[1;"+(a+1)+"R":r.C0.ESC+"OR";break;case 115:s.key=a?r.C0.ESC+"[1;"+(a+1)+"S":r.C0.ESC+"OS";break;case 116:s.key=a?r.C0.ESC+"[15;"+(a+1)+"~":r.C0.ESC+"[15~";break;case 117:s.key=a?r.C0.ESC+"[17;"+(a+1)+"~":r.C0.ESC+"[17~";break;case 118:s.key=a?r.C0.ESC+"[18;"+(a+1)+"~":r.C0.ESC+"[18~";break;case 119:s.key=a?r.C0.ESC+"[19;"+(a+1)+"~":r.C0.ESC+"[19~";break;case 120:s.key=a?r.C0.ESC+"[20;"+(a+1)+"~":r.C0.ESC+"[20~";break;case 121:s.key=a?r.C0.ESC+"[21;"+(a+1)+"~":r.C0.ESC+"[21~";break;case 122:s.key=a?r.C0.ESC+"[23;"+(a+1)+"~":r.C0.ESC+"[23~";break;case 123:s.key=a?r.C0.ESC+"[24;"+(a+1)+"~":r.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!o||!e.altKey||e.metaKey)i&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?s.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(s.key=r.C0.US);else{var l=n[e.keyCode],h=l&&l[e.shiftKey?1:0];if(h)s.key=r.C0.ESC+h;else if(e.keyCode>=65&&e.keyCode<=90){var c=e.ctrlKey?e.keyCode-64:e.keyCode+32;s.key=r.C0.ESC+String.fromCharCode(c)}}else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=String.fromCharCode(0):e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=String.fromCharCode(127):219===e.keyCode?s.key=String.fromCharCode(27):220===e.keyCode?s.key=String.fromCharCode(28):221===e.keyCode&&(s.key=String.fromCharCode(29))}return s}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=function e(t,i){if(void 0===i&&(i=5),"object"!=typeof t)return t;if(null===t)return null;var r=Array.isArray(t)?[]:{};for(var n in t)r[n]=i<=1?t[n]:e(t[n],i-1);return r}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(1);t.applyWindowsMode=function(e){return e.onLineFeed(function(){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1).get(e.cols-1);t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE&&(e.buffer.lines.get(e.buffer.ybase+e.buffer.y).isWrapped=!0)})}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),s=i(2),a=i(0),l=i(24),h=i(5),c=function(e){function t(t,i,r){var n=e.call(this)||this;if(n._renderer=t,n._rowCount=i,n._isPaused=!1,n._needsFullRefresh=!1,n._canvasWidth=0,n._canvasHeight=0,n._onDimensionsChange=new s.EventEmitter2,n._onRender=new s.EventEmitter2,n._onRefreshRequest=new s.EventEmitter2,n._renderDebouncer=new o.RenderDebouncer(function(e,t){return n._renderRows(e,t)}),n.register(n._renderDebouncer),n._screenDprMonitor=new l.ScreenDprMonitor,n._screenDprMonitor.setListener(function(){return n._renderer.onDevicePixelRatioChange()}),n.register(n._screenDprMonitor),n.register(h.addDisposableDomListener(window,"resize",function(){return n._renderer.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var a=new IntersectionObserver(function(e){return n._onIntersectionChange(e[e.length-1])},{threshold:0});a.observe(r),n.register({dispose:function(){return a.disconnect()}})}return n}return n(t,e),Object.defineProperty(t.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!0,configurable:!0}),t.prototype._onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},t.prototype.refreshRows=function(e,t){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(e,t,this._rowCount)},t.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._onRender.fire({start:e,end:t})},t.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},t.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this._fireOnCanvasResize()},t.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},t.prototype.setRenderer=function(e){this._renderer.dispose(),this._renderer=e},t.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount)},t.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},t.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange()},t.prototype.onResize=function(e,t){this._renderer.onResize(e,t),this._fullRefresh()},t.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},t.prototype.onBlur=function(){this._renderer.onBlur()},t.prototype.onFocus=function(){this._renderer.onFocus()},t.prototype.onSelectionChanged=function(e,t,i){this._renderer.onSelectionChanged(e,t,i)},t.prototype.onCursorMove=function(){this._renderer.onCursorMove()},t.prototype.onOptionsChanged=function(){this._renderer.onOptionsChanged()},t.prototype.clear=function(){this._renderer.clear()},t.prototype.registerCharacterJoiner=function(e){return this._renderer.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._renderer.deregisterCharacterJoiner(e)},t}(a.Disposable);t.RenderCoordinator=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this._addons=[]}return e.prototype.dispose=function(){for(var e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()},e.prototype.loadAddon=function(e,t){var i=this,r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=function(){return i._wrappedAddonDispose(r)},t.activate(e)},e.prototype._wrappedAddonDispose=function(e){if(!e.isDisposed){for(var t=-1,i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},e}();t.AddonManager=r},function(e,t,i){},function(e,t,i){},function(e,t,i){"use strict";i.r(t);var r=function(){},n={},o=[],s=[];function a(e,t){var i,a,l,h,c=s;for(h=arguments.length;h-- >2;)o.push(arguments[h]);for(t&&null!=t.children&&(o.length||o.push(t.children),delete t.children);o.length;)if((a=o.pop())&&void 0!==a.pop)for(h=a.length;h--;)o.push(a[h]);else"boolean"==typeof a&&(a=null),(l="function"!=typeof e)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(l=!1)),l&&i?c[c.length-1]+=a:c===s?c=[a]:c.push(a),i=l;var u=new r;return u.nodeName=e,u.children=c,u.attributes=null==t?void 0:t,u.key=null==t?void 0:t.key,void 0!==n.vnode&&n.vnode(u),u}function l(e,t){for(var i in t)e[i]=t[i];return e}function h(e,t){null!=e&&("function"==typeof e?e(t):e.current=t)}var c="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,u=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,f=[];function d(e){!e._dirty&&(e._dirty=!0)&&1==f.push(e)&&(n.debounceRendering||c)(_)}function _(){for(var e;e=f.pop();)e._dirty&&O(e)}function p(e,t,i){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&m(e,t.nodeName):i||e._componentConstructor===t.nodeName}function m(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function y(e){var t=l({},e.attributes);t.children=e.children;var i=e.nodeName.defaultProps;if(void 0!==i)for(var r in i)void 0===t[r]&&(t[r]=i[r]);return t}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function C(e,t,i,r,n){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)h(i,null),h(r,e);else if("class"!==t||n)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof i||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof i)for(var o in i)o in r||(e.style[o]="");for(var o in r)e.style[o]="number"==typeof r[o]&&!1===u.test(o)?r[o]+"px":r[o]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?i||e.addEventListener(t,v,s):e.removeEventListener(t,v,s),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!n&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var a=n&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function v(e){return this._listeners[e.type](n.event&&n.event(e)||e)}var b=[],w=0,S=!1,E=!1;function L(){for(var e;e=b.shift();)n.afterMount&&n.afterMount(e),e.componentDidMount&&e.componentDidMount()}function x(e,t,i,r,n,o){w++||(S=null!=n&&void 0!==n.ownerSVGElement,E=null!=e&&!("__preactattr_"in e));var s=function e(t,i,r,n,o){var s=t,a=S;if(null!=i&&"boolean"!=typeof i||(i=""),"string"==typeof i||"number"==typeof i)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||o)?t.nodeValue!=i&&(t.nodeValue=i):(s=document.createTextNode(i),t&&(t.parentNode&&t.parentNode.replaceChild(s,t),A(t,!0))),s.__preactattr_=!0,s;var l,h,c=i.nodeName;if("function"==typeof c)return function(e,t,i,r){for(var n=e&&e._component,o=n,s=e,a=n&&e._componentConstructor===t.nodeName,l=a,h=y(t);n&&!l&&(n=n._parentComponent);)l=n.constructor===t.nodeName;return n&&l&&(!r||n._component)?(D(n,h,3,i,r),e=n.base):(o&&!a&&(H(o),e=s=null),n=M(t.nodeName,h,i),e&&!n.nextBase&&(n.nextBase=e,s=null),D(n,h,1,i,r),e=n.base,s&&e!==s&&(s._component=null,A(s,!1))),e}(t,i,r,n);if(S="svg"===c||"foreignObject"!==c&&S,c=String(c),(!t||!m(t,c))&&(l=c,(h=S?document.createElementNS("http://www.w3.org/2000/svg",l):document.createElement(l)).normalizedNodeName=l,s=h,t)){for(;t.firstChild;)s.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(s,t),A(t,!0)}var u=s.firstChild,f=s.__preactattr_,d=i.children;if(null==f){f=s.__preactattr_={};for(var _=s.attributes,v=_.length;v--;)f[_[v].name]=_[v].value}return!E&&d&&1===d.length&&"string"==typeof d[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=d[0]&&(u.nodeValue=d[0]):(d&&d.length||null!=u)&&function(t,i,r,n,o){var s,a,l,h,c,u=t.childNodes,f=[],d={},_=0,m=0,y=u.length,C=0,v=i?i.length:0;if(0!==y)for(var b=0;b<y;b++){var w=u[b],S=w.__preactattr_,E=v&&S?w._component?w._component.__key:S.key:null;null!=E?(_++,d[E]=w):(S||(void 0!==w.splitText?!o||w.nodeValue.trim():o))&&(f[C++]=w)}if(0!==v)for(var b=0;b<v;b++){h=i[b],c=null;var E=h.key;if(null!=E)_&&void 0!==d[E]&&(c=d[E],d[E]=void 0,_--);else if(m<C)for(s=m;s<C;s++)if(void 0!==f[s]&&p(a=f[s],h,o)){c=a,f[s]=void 0,s===C-1&&C--,s===m&&m++;break}c=e(c,h,r,n),l=u[b],c&&c!==t&&c!==l&&(null==l?t.appendChild(c):c===l.nextSibling?g(l):t.insertBefore(c,l))}if(_)for(var b in d)void 0!==d[b]&&A(d[b],!1);for(;m<=C;)void 0!==(c=f[C--])&&A(c,!1)}(s,d,r,n,E||null!=f.dangerouslySetInnerHTML),function(e,t,i){var r;for(r in i)t&&null!=t[r]||null==i[r]||C(e,r,i[r],i[r]=void 0,S);for(r in t)"children"===r||"innerHTML"===r||r in i&&t[r]===("value"===r||"checked"===r?e[r]:i[r])||C(e,r,i[r],i[r]=t[r],S)}(s,i.attributes,f),S=a,s}(e,t,i,r,o);return n&&s.parentNode!==n&&n.appendChild(s),--w||(E=!1,o||L()),s}function A(e,t){var i=e._component;i?H(i):(null!=e.__preactattr_&&h(e.__preactattr_.ref,null),!1!==t&&null!=e.__preactattr_||g(e),T(e))}function T(e){for(e=e.lastChild;e;){var t=e.previousSibling;A(e,!0),e=t}}var k=[];function M(e,t,i){var r,n=k.length;for(e.prototype&&e.prototype.render?(r=new e(t,i),B.call(r,t,i)):((r=new B(t,i)).constructor=e,r.render=R);n--;)if(k[n].constructor===e)return r.nextBase=k[n].nextBase,k.splice(n,1),r;return r}function R(e,t,i){return this.constructor(e,i)}function D(e,t,i,r,o){e._disable||(e._disable=!0,e.__ref=t.ref,e.__key=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||o?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r)),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&e.base?d(e):O(e,1,o)),h(e.__ref,e))}function O(e,t,i,r){if(!e._disable){var o,s,a,h=e.props,c=e.state,u=e.context,f=e.prevProps||h,d=e.prevState||c,_=e.prevContext||u,p=e.base,m=e.nextBase,g=p||m,C=e._component,v=!1,S=_;if(e.constructor.getDerivedStateFromProps&&(c=l(l({},c),e.constructor.getDerivedStateFromProps(h,c)),e.state=c),p&&(e.props=f,e.state=d,e.context=_,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(h,c,u)?v=!0:e.componentWillUpdate&&e.componentWillUpdate(h,c,u),e.props=h,e.state=c,e.context=u),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!v){o=e.render(h,c,u),e.getChildContext&&(u=l(l({},u),e.getChildContext())),p&&e.getSnapshotBeforeUpdate&&(S=e.getSnapshotBeforeUpdate(f,d));var E,T,k=o&&o.nodeName;if("function"==typeof k){var R=y(o);(s=C)&&s.constructor===k&&R.key==s.__key?D(s,R,1,u,!1):(E=s,e._component=s=M(k,R,u),s.nextBase=s.nextBase||m,s._parentComponent=e,D(s,R,0,u,!1),O(s,1,i,!0)),T=s.base}else a=g,(E=C)&&(a=e._component=null),(g||1===t)&&(a&&(a._component=null),T=x(a,o,u,i||!p,g&&g.parentNode,!0));if(g&&T!==g&&s!==C){var B=g.parentNode;B&&T!==B&&(B.replaceChild(T,g),E||(g._component=null,A(g,!1)))}if(E&&H(E),e.base=T,T&&!r){for(var P=e,F=e;F=F._parentComponent;)(P=F).base=T;T._component=P,T._componentConstructor=P.constructor}}for(!p||i?b.push(e):v||(e.componentDidUpdate&&e.componentDidUpdate(f,d,S),n.afterUpdate&&n.afterUpdate(e));e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);w||r||L()}}function H(e){n.beforeUnmount&&n.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var i=e._component;i?H(i):t&&(null!=t.__preactattr_&&h(t.__preactattr_.ref,null),e.nextBase=t,g(t),k.push(e),T(t)),h(e.__ref,null)}function B(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{},this._renderCallbacks=[]}l(B.prototype,{setState:function(e,t){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this._renderCallbacks.push(t),d(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),O(this,2)},render:function(){}});var P,F=i(3),I=i(25),W=i(26),U=i(27),j=function(){function e(){this.overlayNode=document.createElement("div"),this.overlayNode.style.cssText="border-radius: 15px;\nfont-size: xx-large;\nopacity: 0.75;\npadding: 0.2em 0.5em 0.2em 0.5em;\nposition: absolute;\n-webkit-user-select: none;\n-webkit-transition: opacity 180ms ease-in;\n-moz-user-select: none;\n-moz-transition: opacity 180ms ease-in;",this.overlayNode.addEventListener("mousedown",function(e){e.preventDefault(),e.stopPropagation()},!0)}return e.prototype.activate=function(e){this.terminal=e},e.prototype.dispose=function(){},e.prototype.showOverlay=function(e,t){var i=this.terminal,r=this.overlayNode;r.style.color="#101010",r.style.backgroundColor="#f0f0f0",r.textContent=e,r.style.opacity="0.75",r.parentNode||i.element.appendChild(r);var n=i.element.getBoundingClientRect(),o=r.getBoundingClientRect();if(r.style.top=(n.height-o.height)/2+"px",r.style.left=(n.width-o.width)/2+"px",this.overlayTimeout&&clearTimeout(this.overlayTimeout),null!==t){var s=this;s.overlayTimeout=setTimeout(function(){r.style.opacity="0",s.overlayTimeout=setTimeout(function(){r.parentNode&&r.parentNode.removeChild(r),s.overlayTimeout=null,r.style.opacity="0.75"},200)},t||1500)}},e}(),N=(i(64),P=function(e,t){return(P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),z=function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,i,s):n(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s},K=function(e){function t(t){var i=e.call(this,t)||this;return i.textEncoder=new TextEncoder,i.textDecoder=new TextDecoder,i.fitAddon=new W.FitAddon,i.overlayAddon=new j,i}return N(t,e),t.prototype.componentDidMount=function(){this.openTerminal()},t.prototype.componentWillUnmount=function(){this.socket.close(),this.terminal.dispose(),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("beforeunload",this.onWindowUnload)},t.prototype.render=function(e){var t=this;return a("div",{id:e.id,ref:function(e){return t.container=e}})},t.prototype.onWindowResize=function(){var e=this.fitAddon;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(function(){return e.fit()},250)},t.prototype.onWindowUnload=function(e){var t="Close terminal? this will also terminate the command.";return e.returnValue=t,t},t.prototype.openTerminal=function(){var e=this;this.terminal&&this.terminal.dispose(),this.socket=new WebSocket(this.props.url,["tty"]),this.terminal=new I.Terminal(this.props.options);var t=this,i=t.socket,r=t.terminal,n=t.container,o=t.fitAddon,s=t.overlayAddon;window.term=r,i.binaryType="arraybuffer",i.onopen=this.onSocketOpen,i.onmessage=this.onSocketData,i.onclose=this.onSocketClose,r.loadAddon(o),r.loadAddon(s),r.loadAddon(new U.WebLinksAddon),r.onTitleChange(function(t){t&&""!==t&&(document.title=t+" | "+e.title)}),r.onData(this.onTerminalData),r.onResize(this.onTerminalResize),document.queryCommandSupported&&document.queryCommandSupported("copy")&&r.onSelectionChange(function(){s.showOverlay("✂",200),document.execCommand("copy")}),r.open(n),r.focus(),window.addEventListener("resize",this.onWindowResize),window.addEventListener("beforeunload",this.onWindowUnload)},t.prototype.onSocketOpen=function(){console.log("[ttyd] Websocket connection opened");var e=this.socket,t=this.textEncoder,i=this.fitAddon,r=window.tty_auth_token;e.send(t.encode(JSON.stringify({AuthToken:r}))),i.fit()},t.prototype.onSocketClose=function(e){console.log("[ttyd] websocket connection closed with code: "+e.code);var t=this.overlayAddon,i=this.openTerminal,r=this.autoReconnect;t.showOverlay("Connection Closed",null),window.removeEventListener("beforeunload",this.onWindowUnload),1008===e.code&&window.location.reload(),1e3!==e.code&&r>0&&setTimeout(i,1e3*r)},t.prototype.onSocketData=function(e){var t=this.terminal,i=this.textDecoder,r=new Uint8Array(e.data),n=String.fromCharCode(r[0]),o=r.slice(1);switch(n){case"0":t.writeUtf8(o);break;case"1":this.title=i.decode(o.buffer),document.title=this.title;break;case"2":var s=JSON.parse(i.decode(o.buffer));Object.keys(s).forEach(function(e){console.log("[ttyd] setting "+e+": "+s[e]),t.setOption(e,s[e])});break;case"3":this.autoReconnect=parseInt(i.decode(o.buffer)),console.log("[ttyd] enabling reconnect: "+this.autoReconnect+" seconds");break;default:console.warn("[ttyd] unknown command: "+n)}},t.prototype.onTerminalResize=function(e){var t=this.overlayAddon,i=this.socket,r=this.textEncoder;if(i.readyState===WebSocket.OPEN){var n=JSON.stringify({columns:e.cols,rows:e.rows});i.send(r.encode("1"+n))}setTimeout(function(){t.showOverlay(e.cols+"x"+e.rows)},500)},t.prototype.onTerminalData=function(e){var t=this.socket,i=this.textEncoder;t.readyState===WebSocket.OPEN&&t.send(i.encode("0"+e))},z([F.bind],t.prototype,"onWindowResize",null),z([F.bind],t.prototype,"openTerminal",null),z([F.bind],t.prototype,"onSocketOpen",null),z([F.bind],t.prototype,"onSocketClose",null),z([F.bind],t.prototype,"onSocketData",null),z([F.bind],t.prototype,"onTerminalResize",null),z([F.bind],t.prototype,"onTerminalData",null),t}(B),V=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),G="https:"===window.location.protocol?"wss://":"ws://",q=window.location.pathname.endsWith("/")?"ws":"/ws",J=[G,window.location.host,window.location.pathname,q,window.location.search].join(""),Y={fontSize:13,fontFamily:"Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace",theme:{foreground:"#d2d2d2",background:"#2b2b2b",cursor:"#adadad",black:"#000000",red:"#d81e00",green:"#5ea702",yellow:"#cfae00",blue:"#427ab3",magenta:"#89658e",cyan:"#00a7aa",white:"#dbded8",brightBlack:"#686a66",brightRed:"#f54235",brightGreen:"#99e343",brightYellow:"#fdeb61",brightBlue:"#84b0d8",brightMagenta:"#bc94b7",brightCyan:"#37e6e8",brightWhite:"#f1f1f0"}},Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return V(t,e),t.prototype.render=function(){return a(K,{id:"terminal-container",url:J,options:Y})},t}(B);i(65),function(e,t,i){x(i,e,{},!1,t,!1)}(a(Z,null),document.body)}]);</script></body></html>
\ No newline at end of file