/*! For license information please see gotty.js.LICENSE.txt */ (()=>{var e={276:e=>{"use strict";if(void 0!==t)throw new Error('Global "lib" object already exists.');var t={runtimeDependencies_:{},initCallbacks_:[],rtdep:function(e){var r;try{throw new Error}catch(e){var i=e.stack.split("\n");r=i.length>=3?i[2].replace(/^\s*at\s+/,""):i[1].replace(/^\s*global code@/,"")}for(var o=0;ot.length&&(t=t.repeat(e/t.length+1)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return(e-=this.length)<=0?String(this):(void 0===t&&(t=" "),e>t.length&&(t=t.repeat(e/t.length+1)),String(this)+t.slice(0,e))}),t.colors={},t.colors.re_={hex16:/#([a-f0-9])([a-f0-9])([a-f0-9])/i,hex24:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/i,rgb:new RegExp("^/s*rgb/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*/)/s*$".replace(/\//g,"\\"),"i"),rgba:new RegExp("^/s*rgba/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*(?:,/s*(/d+(?:/./d+)?)/s*)/)/s*$".replace(/\//g,"\\"),"i"),rgbx:new RegExp("^/s*rgba?/s*/(/s*(/d{1,3})/s*,/s*(/d{1,3})/s*,/s*(/d{1,3})/s*(?:,/s*(/d+(?:/./d+)?)/s*)?/)/s*$".replace(/\//g,"\\"),"i"),x11rgb:/^\s*rgb:([a-f0-9]{1,4})\/([a-f0-9]{1,4})\/([a-f0-9]{1,4})\s*$/i,name:/[a-z][a-z0-9\s]+/},t.colors.rgbToX11=function(e){function r(e){return e=(257*Math.min(e,255)).toString(16),t.f.zpad(e,4)}var i=e.match(t.colors.re_.rgbx);return i?"rgb:"+r(i[1])+"/"+r(i[2])+"/"+r(i[3]):null},t.colors.x11HexToCSS=function(e){if(!e.startsWith("#"))return null;if(e=e.substr(1),-1==[3,6,9,12].indexOf(e.length))return null;if(e.match(/[^a-f0-9]/i))return null;var r=e.length/3,i=e.substr(0,r),o=e.substr(r,r),n=e.substr(r+r,r);return t.colors.arrayToRGBA([i,o,n].map((function(e){return e=parseInt(e,16),2==r?e:1==r?e<<4:e>>4*(r-2)})))},t.colors.x11ToCSS=function(e){var r=e.match(t.colors.re_.x11rgb);return r?(r.splice(0,1),t.colors.arrayToRGBA(r.map((function(e){return 1==e.length?parseInt(e+e,16):2==e.length?parseInt(e,16):(3==e.length&&(e+=e.substr(2)),Math.round(parseInt(e,16)/257))})))):e.startsWith("#")?t.colors.x11HexToCSS(e):t.colors.nameToRGB(e)},t.colors.hexToRGB=function(e){var r=t.colors.re_.hex16,i=t.colors.re_.hex24;function o(e){4==e.length&&(e=e.replace(r,(function(e,t,r,i){return"#"+t+t+r+r+i+i})));var t=e.match(i);return t?"rgb("+parseInt(t[1],16)+", "+parseInt(t[2],16)+", "+parseInt(t[3],16)+")":null}if(e instanceof Array)for(var n=0;n3?e[3]:1;return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"},t.colors.setAlpha=function(e,r){var i=t.colors.crackRGB(e);return i[3]=r,t.colors.arrayToRGBA(i)},t.colors.mix=function(e,r,i){for(var o=t.colors.crackRGB(e),n=t.colors.crackRGB(r),s=0;s<4;++s){var a=n[s]-o[s];o[s]=Math.round(parseInt(o[s])+a*i)}return t.colors.arrayToRGBA(o)},t.colors.crackRGB=function(e){var r;if(e.startsWith("rgba")){if(r=e.match(t.colors.re_.rgba))return r.shift(),r}else if(r=e.match(t.colors.re_.rgb))return r.shift(),r.push(1),r;return console.error("Couldn't crack: "+e),null},t.colors.nameToRGB=function(e){return e in t.colors.colorNames||(e=e.toLowerCase())in t.colors.colorNames||(e=e.replace(/\s+/g,""))in t.colors.colorNames?t.colors.colorNames[e]:null},t.colors.stockColorPalette=t.colors.hexToRGB(["#000000","#CC0000","#4E9A06","#C4A000","#3465A4","#75507B","#06989A","#D3D7CF","#555753","#EF2929","#00BA13","#FCE94F","#729FCF","#F200CB","#00B5BD","#EEEEEC","#000000","#00005F","#000087","#0000AF","#0000D7","#0000FF","#005F00","#005F5F","#005F87","#005FAF","#005FD7","#005FFF","#008700","#00875F","#008787","#0087AF","#0087D7","#0087FF","#00AF00","#00AF5F","#00AF87","#00AFAF","#00AFD7","#00AFFF","#00D700","#00D75F","#00D787","#00D7AF","#00D7D7","#00D7FF","#00FF00","#00FF5F","#00FF87","#00FFAF","#00FFD7","#00FFFF","#5F0000","#5F005F","#5F0087","#5F00AF","#5F00D7","#5F00FF","#5F5F00","#5F5F5F","#5F5F87","#5F5FAF","#5F5FD7","#5F5FFF","#5F8700","#5F875F","#5F8787","#5F87AF","#5F87D7","#5F87FF","#5FAF00","#5FAF5F","#5FAF87","#5FAFAF","#5FAFD7","#5FAFFF","#5FD700","#5FD75F","#5FD787","#5FD7AF","#5FD7D7","#5FD7FF","#5FFF00","#5FFF5F","#5FFF87","#5FFFAF","#5FFFD7","#5FFFFF","#870000","#87005F","#870087","#8700AF","#8700D7","#8700FF","#875F00","#875F5F","#875F87","#875FAF","#875FD7","#875FFF","#878700","#87875F","#878787","#8787AF","#8787D7","#8787FF","#87AF00","#87AF5F","#87AF87","#87AFAF","#87AFD7","#87AFFF","#87D700","#87D75F","#87D787","#87D7AF","#87D7D7","#87D7FF","#87FF00","#87FF5F","#87FF87","#87FFAF","#87FFD7","#87FFFF","#AF0000","#AF005F","#AF0087","#AF00AF","#AF00D7","#AF00FF","#AF5F00","#AF5F5F","#AF5F87","#AF5FAF","#AF5FD7","#AF5FFF","#AF8700","#AF875F","#AF8787","#AF87AF","#AF87D7","#AF87FF","#AFAF00","#AFAF5F","#AFAF87","#AFAFAF","#AFAFD7","#AFAFFF","#AFD700","#AFD75F","#AFD787","#AFD7AF","#AFD7D7","#AFD7FF","#AFFF00","#AFFF5F","#AFFF87","#AFFFAF","#AFFFD7","#AFFFFF","#D70000","#D7005F","#D70087","#D700AF","#D700D7","#D700FF","#D75F00","#D75F5F","#D75F87","#D75FAF","#D75FD7","#D75FFF","#D78700","#D7875F","#D78787","#D787AF","#D787D7","#D787FF","#D7AF00","#D7AF5F","#D7AF87","#D7AFAF","#D7AFD7","#D7AFFF","#D7D700","#D7D75F","#D7D787","#D7D7AF","#D7D7D7","#D7D7FF","#D7FF00","#D7FF5F","#D7FF87","#D7FFAF","#D7FFD7","#D7FFFF","#FF0000","#FF005F","#FF0087","#FF00AF","#FF00D7","#FF00FF","#FF5F00","#FF5F5F","#FF5F87","#FF5FAF","#FF5FD7","#FF5FFF","#FF8700","#FF875F","#FF8787","#FF87AF","#FF87D7","#FF87FF","#FFAF00","#FFAF5F","#FFAF87","#FFAFAF","#FFAFD7","#FFAFFF","#FFD700","#FFD75F","#FFD787","#FFD7AF","#FFD7D7","#FFD7FF","#FFFF00","#FFFF5F","#FFFF87","#FFFFAF","#FFFFD7","#FFFFFF","#080808","#121212","#1C1C1C","#262626","#303030","#3A3A3A","#444444","#4E4E4E","#585858","#626262","#6C6C6C","#767676","#808080","#8A8A8A","#949494","#9E9E9E","#A8A8A8","#B2B2B2","#BCBCBC","#C6C6C6","#D0D0D0","#DADADA","#E4E4E4","#EEEEEE"]),t.colors.colorPalette=t.colors.stockColorPalette,t.colors.colorNames={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",antiquewhite1:"rgb(255, 239, 219)",antiquewhite2:"rgb(238, 223, 204)",antiquewhite3:"rgb(205, 192, 176)",antiquewhite4:"rgb(139, 131, 120)",aquamarine:"rgb(127, 255, 212)",aquamarine1:"rgb(127, 255, 212)",aquamarine2:"rgb(118, 238, 198)",aquamarine3:"rgb(102, 205, 170)",aquamarine4:"rgb(69, 139, 116)",azure:"rgb(240, 255, 255)",azure1:"rgb(240, 255, 255)",azure2:"rgb(224, 238, 238)",azure3:"rgb(193, 205, 205)",azure4:"rgb(131, 139, 139)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",bisque1:"rgb(255, 228, 196)",bisque2:"rgb(238, 213, 183)",bisque3:"rgb(205, 183, 158)",bisque4:"rgb(139, 125, 107)",black:"rgb(0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb(0, 0, 255)",blue1:"rgb(0, 0, 255)",blue2:"rgb(0, 0, 238)",blue3:"rgb(0, 0, 205)",blue4:"rgb(0, 0, 139)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",brown1:"rgb(255, 64, 64)",brown2:"rgb(238, 59, 59)",brown3:"rgb(205, 51, 51)",brown4:"rgb(139, 35, 35)",burlywood:"rgb(222, 184, 135)",burlywood1:"rgb(255, 211, 155)",burlywood2:"rgb(238, 197, 145)",burlywood3:"rgb(205, 170, 125)",burlywood4:"rgb(139, 115, 85)",cadetblue:"rgb(95, 158, 160)",cadetblue1:"rgb(152, 245, 255)",cadetblue2:"rgb(142, 229, 238)",cadetblue3:"rgb(122, 197, 205)",cadetblue4:"rgb(83, 134, 139)",chartreuse:"rgb(127, 255, 0)",chartreuse1:"rgb(127, 255, 0)",chartreuse2:"rgb(118, 238, 0)",chartreuse3:"rgb(102, 205, 0)",chartreuse4:"rgb(69, 139, 0)",chocolate:"rgb(210, 105, 30)",chocolate1:"rgb(255, 127, 36)",chocolate2:"rgb(238, 118, 33)",chocolate3:"rgb(205, 102, 29)",chocolate4:"rgb(139, 69, 19)",coral:"rgb(255, 127, 80)",coral1:"rgb(255, 114, 86)",coral2:"rgb(238, 106, 80)",coral3:"rgb(205, 91, 69)",coral4:"rgb(139, 62, 47)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",cornsilk1:"rgb(255, 248, 220)",cornsilk2:"rgb(238, 232, 205)",cornsilk3:"rgb(205, 200, 177)",cornsilk4:"rgb(139, 136, 120)",cyan:"rgb(0, 255, 255)",cyan1:"rgb(0, 255, 255)",cyan2:"rgb(0, 238, 238)",cyan3:"rgb(0, 205, 205)",cyan4:"rgb(0, 139, 139)",darkblue:"rgb(0, 0, 139)",darkcyan:"rgb(0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgoldenrod1:"rgb(255, 185, 15)",darkgoldenrod2:"rgb(238, 173, 14)",darkgoldenrod3:"rgb(205, 149, 12)",darkgoldenrod4:"rgb(139, 101, 8)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb(0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb(85, 107, 47)",darkolivegreen1:"rgb(202, 255, 112)",darkolivegreen2:"rgb(188, 238, 104)",darkolivegreen3:"rgb(162, 205, 90)",darkolivegreen4:"rgb(110, 139, 61)",darkorange:"rgb(255, 140, 0)",darkorange1:"rgb(255, 127, 0)",darkorange2:"rgb(238, 118, 0)",darkorange3:"rgb(205, 102, 0)",darkorange4:"rgb(139, 69, 0)",darkorchid:"rgb(153, 50, 204)",darkorchid1:"rgb(191, 62, 255)",darkorchid2:"rgb(178, 58, 238)",darkorchid3:"rgb(154, 50, 205)",darkorchid4:"rgb(104, 34, 139)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkseagreen1:"rgb(193, 255, 193)",darkseagreen2:"rgb(180, 238, 180)",darkseagreen3:"rgb(155, 205, 155)",darkseagreen4:"rgb(105, 139, 105)",darkslateblue:"rgb(72, 61, 139)",darkslategray:"rgb(47, 79, 79)",darkslategray1:"rgb(151, 255, 255)",darkslategray2:"rgb(141, 238, 238)",darkslategray3:"rgb(121, 205, 205)",darkslategray4:"rgb(82, 139, 139)",darkslategrey:"rgb(47, 79, 79)",darkturquoise:"rgb(0, 206, 209)",darkviolet:"rgb(148, 0, 211)",debianred:"rgb(215, 7, 81)",deeppink:"rgb(255, 20, 147)",deeppink1:"rgb(255, 20, 147)",deeppink2:"rgb(238, 18, 137)",deeppink3:"rgb(205, 16, 118)",deeppink4:"rgb(139, 10, 80)",deepskyblue:"rgb(0, 191, 255)",deepskyblue1:"rgb(0, 191, 255)",deepskyblue2:"rgb(0, 178, 238)",deepskyblue3:"rgb(0, 154, 205)",deepskyblue4:"rgb(0, 104, 139)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb(30, 144, 255)",dodgerblue1:"rgb(30, 144, 255)",dodgerblue2:"rgb(28, 134, 238)",dodgerblue3:"rgb(24, 116, 205)",dodgerblue4:"rgb(16, 78, 139)",firebrick:"rgb(178, 34, 34)",firebrick1:"rgb(255, 48, 48)",firebrick2:"rgb(238, 44, 44)",firebrick3:"rgb(205, 38, 38)",firebrick4:"rgb(139, 26, 26)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb(34, 139, 34)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",gold1:"rgb(255, 215, 0)",gold2:"rgb(238, 201, 0)",gold3:"rgb(205, 173, 0)",gold4:"rgb(139, 117, 0)",goldenrod:"rgb(218, 165, 32)",goldenrod1:"rgb(255, 193, 37)",goldenrod2:"rgb(238, 180, 34)",goldenrod3:"rgb(205, 155, 29)",goldenrod4:"rgb(139, 105, 20)",gray:"rgb(190, 190, 190)",gray0:"rgb(0, 0, 0)",gray1:"rgb(3, 3, 3)",gray10:"rgb(26, 26, 26)",gray100:"rgb(255, 255, 255)",gray11:"rgb(28, 28, 28)",gray12:"rgb(31, 31, 31)",gray13:"rgb(33, 33, 33)",gray14:"rgb(36, 36, 36)",gray15:"rgb(38, 38, 38)",gray16:"rgb(41, 41, 41)",gray17:"rgb(43, 43, 43)",gray18:"rgb(46, 46, 46)",gray19:"rgb(48, 48, 48)",gray2:"rgb(5, 5, 5)",gray20:"rgb(51, 51, 51)",gray21:"rgb(54, 54, 54)",gray22:"rgb(56, 56, 56)",gray23:"rgb(59, 59, 59)",gray24:"rgb(61, 61, 61)",gray25:"rgb(64, 64, 64)",gray26:"rgb(66, 66, 66)",gray27:"rgb(69, 69, 69)",gray28:"rgb(71, 71, 71)",gray29:"rgb(74, 74, 74)",gray3:"rgb(8, 8, 8)",gray30:"rgb(77, 77, 77)",gray31:"rgb(79, 79, 79)",gray32:"rgb(82, 82, 82)",gray33:"rgb(84, 84, 84)",gray34:"rgb(87, 87, 87)",gray35:"rgb(89, 89, 89)",gray36:"rgb(92, 92, 92)",gray37:"rgb(94, 94, 94)",gray38:"rgb(97, 97, 97)",gray39:"rgb(99, 99, 99)",gray4:"rgb(10, 10, 10)",gray40:"rgb(102, 102, 102)",gray41:"rgb(105, 105, 105)",gray42:"rgb(107, 107, 107)",gray43:"rgb(110, 110, 110)",gray44:"rgb(112, 112, 112)",gray45:"rgb(115, 115, 115)",gray46:"rgb(117, 117, 117)",gray47:"rgb(120, 120, 120)",gray48:"rgb(122, 122, 122)",gray49:"rgb(125, 125, 125)",gray5:"rgb(13, 13, 13)",gray50:"rgb(127, 127, 127)",gray51:"rgb(130, 130, 130)",gray52:"rgb(133, 133, 133)",gray53:"rgb(135, 135, 135)",gray54:"rgb(138, 138, 138)",gray55:"rgb(140, 140, 140)",gray56:"rgb(143, 143, 143)",gray57:"rgb(145, 145, 145)",gray58:"rgb(148, 148, 148)",gray59:"rgb(150, 150, 150)",gray6:"rgb(15, 15, 15)",gray60:"rgb(153, 153, 153)",gray61:"rgb(156, 156, 156)",gray62:"rgb(158, 158, 158)",gray63:"rgb(161, 161, 161)",gray64:"rgb(163, 163, 163)",gray65:"rgb(166, 166, 166)",gray66:"rgb(168, 168, 168)",gray67:"rgb(171, 171, 171)",gray68:"rgb(173, 173, 173)",gray69:"rgb(176, 176, 176)",gray7:"rgb(18, 18, 18)",gray70:"rgb(179, 179, 179)",gray71:"rgb(181, 181, 181)",gray72:"rgb(184, 184, 184)",gray73:"rgb(186, 186, 186)",gray74:"rgb(189, 189, 189)",gray75:"rgb(191, 191, 191)",gray76:"rgb(194, 194, 194)",gray77:"rgb(196, 196, 196)",gray78:"rgb(199, 199, 199)",gray79:"rgb(201, 201, 201)",gray8:"rgb(20, 20, 20)",gray80:"rgb(204, 204, 204)",gray81:"rgb(207, 207, 207)",gray82:"rgb(209, 209, 209)",gray83:"rgb(212, 212, 212)",gray84:"rgb(214, 214, 214)",gray85:"rgb(217, 217, 217)",gray86:"rgb(219, 219, 219)",gray87:"rgb(222, 222, 222)",gray88:"rgb(224, 224, 224)",gray89:"rgb(227, 227, 227)",gray9:"rgb(23, 23, 23)",gray90:"rgb(229, 229, 229)",gray91:"rgb(232, 232, 232)",gray92:"rgb(235, 235, 235)",gray93:"rgb(237, 237, 237)",gray94:"rgb(240, 240, 240)",gray95:"rgb(242, 242, 242)",gray96:"rgb(245, 245, 245)",gray97:"rgb(247, 247, 247)",gray98:"rgb(250, 250, 250)",gray99:"rgb(252, 252, 252)",green:"rgb(0, 255, 0)",green1:"rgb(0, 255, 0)",green2:"rgb(0, 238, 0)",green3:"rgb(0, 205, 0)",green4:"rgb(0, 139, 0)",greenyellow:"rgb(173, 255, 47)",grey:"rgb(190, 190, 190)",grey0:"rgb(0, 0, 0)",grey1:"rgb(3, 3, 3)",grey10:"rgb(26, 26, 26)",grey100:"rgb(255, 255, 255)",grey11:"rgb(28, 28, 28)",grey12:"rgb(31, 31, 31)",grey13:"rgb(33, 33, 33)",grey14:"rgb(36, 36, 36)",grey15:"rgb(38, 38, 38)",grey16:"rgb(41, 41, 41)",grey17:"rgb(43, 43, 43)",grey18:"rgb(46, 46, 46)",grey19:"rgb(48, 48, 48)",grey2:"rgb(5, 5, 5)",grey20:"rgb(51, 51, 51)",grey21:"rgb(54, 54, 54)",grey22:"rgb(56, 56, 56)",grey23:"rgb(59, 59, 59)",grey24:"rgb(61, 61, 61)",grey25:"rgb(64, 64, 64)",grey26:"rgb(66, 66, 66)",grey27:"rgb(69, 69, 69)",grey28:"rgb(71, 71, 71)",grey29:"rgb(74, 74, 74)",grey3:"rgb(8, 8, 8)",grey30:"rgb(77, 77, 77)",grey31:"rgb(79, 79, 79)",grey32:"rgb(82, 82, 82)",grey33:"rgb(84, 84, 84)",grey34:"rgb(87, 87, 87)",grey35:"rgb(89, 89, 89)",grey36:"rgb(92, 92, 92)",grey37:"rgb(94, 94, 94)",grey38:"rgb(97, 97, 97)",grey39:"rgb(99, 99, 99)",grey4:"rgb(10, 10, 10)",grey40:"rgb(102, 102, 102)",grey41:"rgb(105, 105, 105)",grey42:"rgb(107, 107, 107)",grey43:"rgb(110, 110, 110)",grey44:"rgb(112, 112, 112)",grey45:"rgb(115, 115, 115)",grey46:"rgb(117, 117, 117)",grey47:"rgb(120, 120, 120)",grey48:"rgb(122, 122, 122)",grey49:"rgb(125, 125, 125)",grey5:"rgb(13, 13, 13)",grey50:"rgb(127, 127, 127)",grey51:"rgb(130, 130, 130)",grey52:"rgb(133, 133, 133)",grey53:"rgb(135, 135, 135)",grey54:"rgb(138, 138, 138)",grey55:"rgb(140, 140, 140)",grey56:"rgb(143, 143, 143)",grey57:"rgb(145, 145, 145)",grey58:"rgb(148, 148, 148)",grey59:"rgb(150, 150, 150)",grey6:"rgb(15, 15, 15)",grey60:"rgb(153, 153, 153)",grey61:"rgb(156, 156, 156)",grey62:"rgb(158, 158, 158)",grey63:"rgb(161, 161, 161)",grey64:"rgb(163, 163, 163)",grey65:"rgb(166, 166, 166)",grey66:"rgb(168, 168, 168)",grey67:"rgb(171, 171, 171)",grey68:"rgb(173, 173, 173)",grey69:"rgb(176, 176, 176)",grey7:"rgb(18, 18, 18)",grey70:"rgb(179, 179, 179)",grey71:"rgb(181, 181, 181)",grey72:"rgb(184, 184, 184)",grey73:"rgb(186, 186, 186)",grey74:"rgb(189, 189, 189)",grey75:"rgb(191, 191, 191)",grey76:"rgb(194, 194, 194)",grey77:"rgb(196, 196, 196)",grey78:"rgb(199, 199, 199)",grey79:"rgb(201, 201, 201)",grey8:"rgb(20, 20, 20)",grey80:"rgb(204, 204, 204)",grey81:"rgb(207, 207, 207)",grey82:"rgb(209, 209, 209)",grey83:"rgb(212, 212, 212)",grey84:"rgb(214, 214, 214)",grey85:"rgb(217, 217, 217)",grey86:"rgb(219, 219, 219)",grey87:"rgb(222, 222, 222)",grey88:"rgb(224, 224, 224)",grey89:"rgb(227, 227, 227)",grey9:"rgb(23, 23, 23)",grey90:"rgb(229, 229, 229)",grey91:"rgb(232, 232, 232)",grey92:"rgb(235, 235, 235)",grey93:"rgb(237, 237, 237)",grey94:"rgb(240, 240, 240)",grey95:"rgb(242, 242, 242)",grey96:"rgb(245, 245, 245)",grey97:"rgb(247, 247, 247)",grey98:"rgb(250, 250, 250)",grey99:"rgb(252, 252, 252)",honeydew:"rgb(240, 255, 240)",honeydew1:"rgb(240, 255, 240)",honeydew2:"rgb(224, 238, 224)",honeydew3:"rgb(193, 205, 193)",honeydew4:"rgb(131, 139, 131)",hotpink:"rgb(255, 105, 180)",hotpink1:"rgb(255, 110, 180)",hotpink2:"rgb(238, 106, 167)",hotpink3:"rgb(205, 96, 144)",hotpink4:"rgb(139, 58, 98)",indianred:"rgb(205, 92, 92)",indianred1:"rgb(255, 106, 106)",indianred2:"rgb(238, 99, 99)",indianred3:"rgb(205, 85, 85)",indianred4:"rgb(139, 58, 58)",ivory:"rgb(255, 255, 240)",ivory1:"rgb(255, 255, 240)",ivory2:"rgb(238, 238, 224)",ivory3:"rgb(205, 205, 193)",ivory4:"rgb(139, 139, 131)",khaki:"rgb(240, 230, 140)",khaki1:"rgb(255, 246, 143)",khaki2:"rgb(238, 230, 133)",khaki3:"rgb(205, 198, 115)",khaki4:"rgb(139, 134, 78)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lavenderblush1:"rgb(255, 240, 245)",lavenderblush2:"rgb(238, 224, 229)",lavenderblush3:"rgb(205, 193, 197)",lavenderblush4:"rgb(139, 131, 134)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lemonchiffon1:"rgb(255, 250, 205)",lemonchiffon2:"rgb(238, 233, 191)",lemonchiffon3:"rgb(205, 201, 165)",lemonchiffon4:"rgb(139, 137, 112)",lightblue:"rgb(173, 216, 230)",lightblue1:"rgb(191, 239, 255)",lightblue2:"rgb(178, 223, 238)",lightblue3:"rgb(154, 192, 205)",lightblue4:"rgb(104, 131, 139)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightcyan1:"rgb(224, 255, 255)",lightcyan2:"rgb(209, 238, 238)",lightcyan3:"rgb(180, 205, 205)",lightcyan4:"rgb(122, 139, 139)",lightgoldenrod:"rgb(238, 221, 130)",lightgoldenrod1:"rgb(255, 236, 139)",lightgoldenrod2:"rgb(238, 220, 130)",lightgoldenrod3:"rgb(205, 190, 112)",lightgoldenrod4:"rgb(139, 129, 76)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightpink1:"rgb(255, 174, 185)",lightpink2:"rgb(238, 162, 173)",lightpink3:"rgb(205, 140, 149)",lightpink4:"rgb(139, 95, 101)",lightsalmon:"rgb(255, 160, 122)",lightsalmon1:"rgb(255, 160, 122)",lightsalmon2:"rgb(238, 149, 114)",lightsalmon3:"rgb(205, 129, 98)",lightsalmon4:"rgb(139, 87, 66)",lightseagreen:"rgb(32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightskyblue1:"rgb(176, 226, 255)",lightskyblue2:"rgb(164, 211, 238)",lightskyblue3:"rgb(141, 182, 205)",lightskyblue4:"rgb(96, 123, 139)",lightslateblue:"rgb(132, 112, 255)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightsteelblue1:"rgb(202, 225, 255)",lightsteelblue2:"rgb(188, 210, 238)",lightsteelblue3:"rgb(162, 181, 205)",lightsteelblue4:"rgb(110, 123, 139)",lightyellow:"rgb(255, 255, 224)",lightyellow1:"rgb(255, 255, 224)",lightyellow2:"rgb(238, 238, 209)",lightyellow3:"rgb(205, 205, 180)",lightyellow4:"rgb(139, 139, 122)",limegreen:"rgb(50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",magenta1:"rgb(255, 0, 255)",magenta2:"rgb(238, 0, 238)",magenta3:"rgb(205, 0, 205)",magenta4:"rgb(139, 0, 139)",maroon:"rgb(176, 48, 96)",maroon1:"rgb(255, 52, 179)",maroon2:"rgb(238, 48, 167)",maroon3:"rgb(205, 41, 144)",maroon4:"rgb(139, 28, 98)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb(0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumorchid1:"rgb(224, 102, 255)",mediumorchid2:"rgb(209, 95, 238)",mediumorchid3:"rgb(180, 82, 205)",mediumorchid4:"rgb(122, 55, 139)",mediumpurple:"rgb(147, 112, 219)",mediumpurple1:"rgb(171, 130, 255)",mediumpurple2:"rgb(159, 121, 238)",mediumpurple3:"rgb(137, 104, 205)",mediumpurple4:"rgb(93, 71, 139)",mediumseagreen:"rgb(60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb(0, 250, 154)",mediumturquoise:"rgb(72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb(25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",mistyrose1:"rgb(255, 228, 225)",mistyrose2:"rgb(238, 213, 210)",mistyrose3:"rgb(205, 183, 181)",mistyrose4:"rgb(139, 125, 123)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navajowhite1:"rgb(255, 222, 173)",navajowhite2:"rgb(238, 207, 161)",navajowhite3:"rgb(205, 179, 139)",navajowhite4:"rgb(139, 121, 94)",navy:"rgb(0, 0, 128)",navyblue:"rgb(0, 0, 128)",oldlace:"rgb(253, 245, 230)",olivedrab:"rgb(107, 142, 35)",olivedrab1:"rgb(192, 255, 62)",olivedrab2:"rgb(179, 238, 58)",olivedrab3:"rgb(154, 205, 50)",olivedrab4:"rgb(105, 139, 34)",orange:"rgb(255, 165, 0)",orange1:"rgb(255, 165, 0)",orange2:"rgb(238, 154, 0)",orange3:"rgb(205, 133, 0)",orange4:"rgb(139, 90, 0)",orangered:"rgb(255, 69, 0)",orangered1:"rgb(255, 69, 0)",orangered2:"rgb(238, 64, 0)",orangered3:"rgb(205, 55, 0)",orangered4:"rgb(139, 37, 0)",orchid:"rgb(218, 112, 214)",orchid1:"rgb(255, 131, 250)",orchid2:"rgb(238, 122, 233)",orchid3:"rgb(205, 105, 201)",orchid4:"rgb(139, 71, 137)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",palegreen1:"rgb(154, 255, 154)",palegreen2:"rgb(144, 238, 144)",palegreen3:"rgb(124, 205, 124)",palegreen4:"rgb(84, 139, 84)",paleturquoise:"rgb(175, 238, 238)",paleturquoise1:"rgb(187, 255, 255)",paleturquoise2:"rgb(174, 238, 238)",paleturquoise3:"rgb(150, 205, 205)",paleturquoise4:"rgb(102, 139, 139)",palevioletred:"rgb(219, 112, 147)",palevioletred1:"rgb(255, 130, 171)",palevioletred2:"rgb(238, 121, 159)",palevioletred3:"rgb(205, 104, 137)",palevioletred4:"rgb(139, 71, 93)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peachpuff1:"rgb(255, 218, 185)",peachpuff2:"rgb(238, 203, 173)",peachpuff3:"rgb(205, 175, 149)",peachpuff4:"rgb(139, 119, 101)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",pink1:"rgb(255, 181, 197)",pink2:"rgb(238, 169, 184)",pink3:"rgb(205, 145, 158)",pink4:"rgb(139, 99, 108)",plum:"rgb(221, 160, 221)",plum1:"rgb(255, 187, 255)",plum2:"rgb(238, 174, 238)",plum3:"rgb(205, 150, 205)",plum4:"rgb(139, 102, 139)",powderblue:"rgb(176, 224, 230)",purple:"rgb(160, 32, 240)",purple1:"rgb(155, 48, 255)",purple2:"rgb(145, 44, 238)",purple3:"rgb(125, 38, 205)",purple4:"rgb(85, 26, 139)",red:"rgb(255, 0, 0)",red1:"rgb(255, 0, 0)",red2:"rgb(238, 0, 0)",red3:"rgb(205, 0, 0)",red4:"rgb(139, 0, 0)",rosybrown:"rgb(188, 143, 143)",rosybrown1:"rgb(255, 193, 193)",rosybrown2:"rgb(238, 180, 180)",rosybrown3:"rgb(205, 155, 155)",rosybrown4:"rgb(139, 105, 105)",royalblue:"rgb(65, 105, 225)",royalblue1:"rgb(72, 118, 255)",royalblue2:"rgb(67, 110, 238)",royalblue3:"rgb(58, 95, 205)",royalblue4:"rgb(39, 64, 139)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",salmon1:"rgb(255, 140, 105)",salmon2:"rgb(238, 130, 98)",salmon3:"rgb(205, 112, 84)",salmon4:"rgb(139, 76, 57)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb(46, 139, 87)",seagreen1:"rgb(84, 255, 159)",seagreen2:"rgb(78, 238, 148)",seagreen3:"rgb(67, 205, 128)",seagreen4:"rgb(46, 139, 87)",seashell:"rgb(255, 245, 238)",seashell1:"rgb(255, 245, 238)",seashell2:"rgb(238, 229, 222)",seashell3:"rgb(205, 197, 191)",seashell4:"rgb(139, 134, 130)",sienna:"rgb(160, 82, 45)",sienna1:"rgb(255, 130, 71)",sienna2:"rgb(238, 121, 66)",sienna3:"rgb(205, 104, 57)",sienna4:"rgb(139, 71, 38)",skyblue:"rgb(135, 206, 235)",skyblue1:"rgb(135, 206, 255)",skyblue2:"rgb(126, 192, 238)",skyblue3:"rgb(108, 166, 205)",skyblue4:"rgb(74, 112, 139)",slateblue:"rgb(106, 90, 205)",slateblue1:"rgb(131, 111, 255)",slateblue2:"rgb(122, 103, 238)",slateblue3:"rgb(105, 89, 205)",slateblue4:"rgb(71, 60, 139)",slategray:"rgb(112, 128, 144)",slategray1:"rgb(198, 226, 255)",slategray2:"rgb(185, 211, 238)",slategray3:"rgb(159, 182, 205)",slategray4:"rgb(108, 123, 139)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",snow1:"rgb(255, 250, 250)",snow2:"rgb(238, 233, 233)",snow3:"rgb(205, 201, 201)",snow4:"rgb(139, 137, 137)",springgreen:"rgb(0, 255, 127)",springgreen1:"rgb(0, 255, 127)",springgreen2:"rgb(0, 238, 118)",springgreen3:"rgb(0, 205, 102)",springgreen4:"rgb(0, 139, 69)",steelblue:"rgb(70, 130, 180)",steelblue1:"rgb(99, 184, 255)",steelblue2:"rgb(92, 172, 238)",steelblue3:"rgb(79, 148, 205)",steelblue4:"rgb(54, 100, 139)",tan:"rgb(210, 180, 140)",tan1:"rgb(255, 165, 79)",tan2:"rgb(238, 154, 73)",tan3:"rgb(205, 133, 63)",tan4:"rgb(139, 90, 43)",thistle:"rgb(216, 191, 216)",thistle1:"rgb(255, 225, 255)",thistle2:"rgb(238, 210, 238)",thistle3:"rgb(205, 181, 205)",thistle4:"rgb(139, 123, 139)",tomato:"rgb(255, 99, 71)",tomato1:"rgb(255, 99, 71)",tomato2:"rgb(238, 92, 66)",tomato3:"rgb(205, 79, 57)",tomato4:"rgb(139, 54, 38)",turquoise:"rgb(64, 224, 208)",turquoise1:"rgb(0, 245, 255)",turquoise2:"rgb(0, 229, 238)",turquoise3:"rgb(0, 197, 205)",turquoise4:"rgb(0, 134, 139)",violet:"rgb(238, 130, 238)",violetred:"rgb(208, 32, 144)",violetred1:"rgb(255, 62, 150)",violetred2:"rgb(238, 58, 140)",violetred3:"rgb(205, 50, 120)",violetred4:"rgb(139, 34, 82)",wheat:"rgb(245, 222, 179)",wheat1:"rgb(255, 231, 186)",wheat2:"rgb(238, 216, 174)",wheat3:"rgb(205, 186, 150)",wheat4:"rgb(139, 126, 102)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellow1:"rgb(255, 255, 0)",yellow2:"rgb(238, 238, 0)",yellow3:"rgb(205, 205, 0)",yellow4:"rgb(139, 139, 0)",yellowgreen:"rgb(154, 205, 50)"},t.f={},t.f.createEnum=function(e){return new String(e)},t.f.replaceVars=function(e,r){return e.replace(/%([a-z]*)\(([^\)]+)\)/gi,(function(e,i,o){if(void 0===r[o])throw"Unknown variable: "+o;var n=r[o];if(i in t.f.replaceVars.functions)n=t.f.replaceVars.functions[i](n);else if(i)throw"Unknown escape function: "+i;return n}))},t.f.replaceVars.functions={encodeURI,encodeURIComponent,escapeHTML:function(e){var t={"<":"<",">":">","&":"&",'"':""","'":"'"};return e.replace(/[<>&\"\']/g,(function(e){return t[e]}))}},t.f.getAcceptLanguages=function(e){t.f.getAcceptLanguages.chromeSupported()?chrome.i18n.getAcceptLanguages(e):setTimeout((function(){e([navigator.language.replace(/-/g,"_")])}),0)},t.f.getAcceptLanguages.chromeSupported=function(){return window.chrome&&chrome.i18n},t.f.parseQuery=function(e){e.startsWith("?")&&(e=e.substr(1));for(var t={},r=e.split("&"),i=0;ir?r:e},t.f.zpad=function(e,t){return String(e).padStart(t,"0")},t.f.getWhitespace=function(e){if(e<=0)return"";var t=this.getWhitespace;for(t.whitespace||(t.whitespace=" ");e>t.whitespace.length;)t.whitespace+=t.whitespace;return t.whitespace.substr(0,e)},t.f.alarm=function(e,r){var i,o,n=r||5e3,s=t.f.getStack(1);return i=setTimeout((function(){var t="string"==typeof e?t:e.name;t=t?": "+t:"",console.warn("lib.f.alarm: timeout expired: "+n/1e3+"s"+t),console.log(s),i=null}),n),o=function(e){return function(){return i&&(clearTimeout(i),i=null),e.apply(null,arguments)}},"string"==typeof e?o:o(e)},t.f.getStack=function(e){var t,r=e?e+2:2;try{throw new Error}catch(e){t=e.stack.split("\n")}for(var i={},o=r;o=0&&this.observers.splice(t,1)},t.PreferenceManager.Record.prototype.get=function(){return this.currentValue===this.DEFAULT_VALUE?/^(string|number)$/.test(typeof this.defaultValue)?this.defaultValue:"object"==typeof this.defaultValue?JSON.parse(JSON.stringify(this.defaultValue)):this.defaultValue:this.currentValue},t.PreferenceManager.prototype.deactivate=function(){if(!this.isActive_)throw new Error("Not activated");this.isActive_=!1,this.storage.removeObserver(this.storageObserver_)},t.PreferenceManager.prototype.activate=function(){if(this.isActive_)throw new Error("Already activated");this.isActive_=!0,this.storage.addObserver(this.storageObserver_)},t.PreferenceManager.prototype.readStorage=function(e){var t=0;function r(){0==--t&&e&&e()}var i=Object.keys(this.prefRecords_).map(function(e){return this.prefix+e}.bind(this));this.trace&&console.log("Preferences read: "+this.prefix),this.storage.getItems(i,function(i){var o=this.prefix.length;for(var n in i){var s=i[n],a=n.substr(o),c=a in this.childLists_&&JSON.stringify(s)!=JSON.stringify(this.prefRecords_[a].currentValue);this.prefRecords_[a].currentValue=s,c&&(t++,this.syncChildList(a,r))}0==t&&e&&setTimeout(e)}.bind(this))},t.PreferenceManager.prototype.definePreference=function(e,r,i){var o=this.prefRecords_[e];o?this.changeDefault(e,r):o=this.prefRecords_[e]=new t.PreferenceManager.Record(e,r),i&&o.addObserver(i)},t.PreferenceManager.prototype.definePreferences=function(e){for(var t=0;t=0&&s.splice(l,1),!this.childLists_[e][c]){var h=this.childFactories_[e](this,c);if(!h){console.warn("Unable to restore child: "+e+": "+c);continue}h.trace=this.trace,this.childLists_[e][c]=h,i++,h.readStorage(o)}}for(a=0;a=0;i--){var o=e[i],n=this.storage_.getItem(o);if("string"==typeof n)try{r[o]=JSON.parse(n)}catch(e){r[o]=n}else e.splice(i,1)}setTimeout(t.bind(null,r),0)},t.Storage.Local.prototype.setItem=function(e,t,r){this.storage_.setItem(e,JSON.stringify(t)),r&&setTimeout(r,0)},t.Storage.Local.prototype.setItems=function(e,t){for(var r in e)this.storage_.setItem(r,JSON.stringify(e[r]));t&&setTimeout(t,0)},t.Storage.Local.prototype.removeItem=function(e,t){this.storage_.removeItem(e),t&&setTimeout(t,0)},t.Storage.Local.prototype.removeItems=function(e,t){for(var r=0;r=0;i--){var o=e[i],n=this.storage_[o];if("string"==typeof n)try{r[o]=JSON.parse(n)}catch(e){r[o]=n}else e.splice(i,1)}setTimeout(t.bind(null,r),0)},t.Storage.Memory.prototype.setItem=function(e,t,r){var i=this.storage_[e];this.storage_[e]=JSON.stringify(t);var o={};o[e]={oldValue:i,newValue:t},setTimeout(function(){for(var e=0;e{let t="";switch(e){case"debug":case"warn":case"error":t=e.toUpperCase()+": "}const r=this.console_[e];this[e]=this.console_[e]=(...e)=>{this.save&&(this.data+=this.prefix_+t+e.join(" ")+"\n"),r.apply(this.console_,e)}})),["group","groupCollapsed"].forEach((e=>{const t=this.console_[e];this[e]=this.console_[e]=(e="")=>{t(e),this.save&&(this.data+=this.prefix_+e+"\n"),this.prefix_=" ".repeat(++this.prefixStack_)}}));const t=this.console_.groupEnd;this.groupEnd=this.console_.groupEnd=()=>{t(),this.prefix_=" ".repeat(--this.prefixStack_)}},t.TestManager.Suite=function(e){function r(t,r){this.testManager_=t,this.suiteName=e,this.setup(r)}return r.suiteName=e,r.addTest=t.TestManager.Suite.addTest,r.disableTest=t.TestManager.Suite.disableTest,r.getTest=t.TestManager.Suite.getTest,r.getTestList=t.TestManager.Suite.getTestList,r.testList_=[],r.testMap_={},r.prototype=Object.create(t.TestManager.Suite.prototype),r.constructor=t.TestManager.Suite,t.TestManager.Suite.subclasses.push(r),r},t.TestManager.Suite.subclasses=[],t.TestManager.Suite.addTest=function(e,r){if(e in this.testMap_)throw"Duplicate test name: "+e;var i=new t.TestManager.Test(this,e,r);this.testMap_[e]=i,this.testList_.push(i)},t.TestManager.Suite.disableTest=function(e,r){if(e in this.testMap_)throw"Duplicate test name: "+e;var i=new t.TestManager.Test(this,e,r);console.log("Disabled test: "+i.fullName)},t.TestManager.Suite.getTest=function(e){return this.testMap_[e]},t.TestManager.Suite.getTestList=function(){return this.testList_},t.TestManager.Suite.prototype.setDefaults=function(e,t){for(var r in t)this[r]=r in e?e[r]:t[r]},t.TestManager.Suite.prototype.setup=function(e){},t.TestManager.Suite.prototype.preamble=function(e,t){},t.TestManager.Suite.prototype.postamble=function(e,t){},t.TestManager.Test=function(e,t,r){this.suiteClass=e,this.testName=t,this.fullName=e.suiteName+"["+t+"]",this.testFunction_=r},t.TestManager.Test.prototype.run=function(e){try{this.testFunction_.apply(e.suite,[e,e.testRun.cx])}catch(r){if(r instanceof t.TestManager.Result.TestComplete)return;e.println("Test raised an exception: "+r),r.stack&&(r.stack instanceof Array?e.println(r.stack.join("\n")):e.println(r.stack)),e.completeTest_(e.FAILED,!1)}},t.TestManager.TestRun=function(e,t){this.testManager=e,this.log=e.log,this.cx=t||{},this.failures=[],this.passes=[],this.startDate=null,this.duration=null,this.currentResult=null,this.maxFailures=0,this.panic=!1,this.testQueue_=[]},t.TestManager.TestRun.prototype.ALL_TESTS=t.f.createEnum(""),t.TestManager.TestRun.prototype.selectTest=function(e){this.testQueue_.push(e)},t.TestManager.TestRun.prototype.selectSuite=function(e,t){for(var r=t||this.ALL_TESTS,i=0,o=e.getTestList(),n=0;n500&&this.log.warn("Slow test took "+this.msToSeconds_(e.duration)),this.log.groupEnd(),e.status==e.FAILED)this.failures.push(e),this.currentSuite=null;else{if(e.status!=e.PASSED)return this.log.error("Unknown result status: "+e.test.fullName+": "+e.status),this.panic=!0;this.passes.push(e)}this.runNextTest_()},t.TestManager.TestRun.prototype.onResultReComplete=function(e,t){this.log.error("Late complete for test: "+e.test.fullName+": "+t);var r=this.passes.indexOf(e);r>=0&&(this.passes.splice(r,1),this.failures.push(e))},t.TestManager.TestRun.prototype.runNextTest_=function(){if(this.panic||!this.testQueue_.length)return this.onTestRunComplete_();if(this.maxFailures&&this.failures.length>=this.maxFailures)return this.log.error("Maximum failure count reached, aborting test run."),this.onTestRunComplete_();var e=this.testQueue_[0],r=this.currentResult?this.currentResult.suite:null;try{r&&r instanceof e.suiteClass||(r&&this.log.groupEnd(),this.log.group(e.suiteClass.suiteName),r=new e.suiteClass(this.testManager,this.cx))}catch(e){return this.log.error("Exception during setup: "+(e.stack?e.stack:e)),this.panic=!0,void this.onTestRunComplete_()}try{this.log.group(e.testName),this.currentResult=new t.TestManager.Result(this,r,e),this.testManager.testPreamble(this.currentResult,this.cx),r.preamble(this.currentResult,this.cx),this.testQueue_.shift()}catch(e){return this.log.error("Unexpected exception during test preamble: "+(e.stack?e.stack:e)),this.log.groupEnd(),this.panic=!0,void this.onTestRunComplete_()}try{this.currentResult.run()}catch(e){this.log.error("Unexpected exception during test run: "+(e.stack?e.stack:e)),this.panic=!0}},t.TestManager.TestRun.prototype.run=function(){this.log.info("Running "+this.testQueue_.length+" test(s)"),window.onerror=this.onUncaughtException_.bind(this),this.startDate=new Date,this.runNextTest_()},t.TestManager.TestRun.prototype.msToSeconds_=function(e){return(e/1e3).toFixed(2)+"s"},t.TestManager.TestRun.prototype.summarize=function(){if(this.failures.length)for(var e=0;e1?"\n"+t.join("\n"):t.join("\n")}if(e!==t&&!(t instanceof Array&&this.arrayEQ_(e,t))){var o=r?"["+r+"]":"";this.fail("assertEQ"+o+": "+this.getCallerLocation_(1)+": "+i(e)+" !== "+i(t))}},t.TestManager.Result.prototype.assert=function(e,t){if(!0!==e){var r=t?"["+t+"]":"";this.fail("assert"+r+": "+this.getCallerLocation_(1)+": "+String(e))}},t.TestManager.Result.prototype.getCallerLocation_=function(e){try{throw new Error}catch(r){var t=r.stack.split("\n")[e+2].match(/([^/]+:\d+):\d+\)?$/);return t?t[1]:"???"}},t.TestManager.Result.prototype.println=function(e){this.testRun.log.info(e)},t.TestManager.Result.prototype.fail=function(e){arguments.length&&this.println(e),this.completeTest_(this.FAILED,!0)},t.TestManager.Result.prototype.pass=function(){this.completeTest_(this.PASSED,!0)},t.UTF8Decoder=function(){this.bytesLeft=0,this.codePoint=0,this.lowerBound=0},t.UTF8Decoder.prototype.decode=function(e){for(var t="",r=0;r1114111?t+="�":o<65536?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode(55296+(o>>>10&1023),56320+(1023&o)))}}else t+="�",this.bytesLeft=0,r--}return t},t.decodeUTF8=function(e){return(new t.UTF8Decoder).decode(e)},t.encodeUTF8=function(e){for(var t="",r=0;r>>6),i=1):o<=65535?(t+=String.fromCharCode(224|o>>>12),i=2):(t+=String.fromCharCode(240|o>>>18),i=3);i>0;)i--,t+=String.fromCharCode(128|o>>>6*i&63)}return t},t.wc={},t.wc.nulWidth=0,t.wc.controlWidth=0,t.wc.regardCjkAmbiguous=!1,t.wc.cjkAmbiguousWidth=2,t.wc.combining=[[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],[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]],t.wc.ambiguous=[[161,161],[164,164],[167,168],[170,170],[174,174],[176,180],[182,186],[188,191],[198,198],[208,208],[215,216],[222,225],[230,230],[232,234],[236,237],[240,240],[242,243],[247,250],[252,252],[254,254],[257,257],[273,273],[275,275],[283,283],[294,295],[299,299],[305,307],[312,312],[319,322],[324,324],[328,331],[333,333],[338,339],[358,359],[363,363],[462,462],[464,464],[466,466],[468,468],[470,470],[472,472],[474,474],[476,476],[593,593],[609,609],[708,708],[711,711],[713,715],[717,717],[720,720],[728,731],[733,733],[735,735],[913,929],[931,937],[945,961],[963,969],[1025,1025],[1040,1103],[1105,1105],[8208,8208],[8211,8214],[8216,8217],[8220,8221],[8224,8226],[8228,8231],[8240,8240],[8242,8243],[8245,8245],[8251,8251],[8254,8254],[8308,8308],[8319,8319],[8321,8324],[8364,8364],[8451,8451],[8453,8453],[8457,8457],[8467,8467],[8470,8470],[8481,8482],[8486,8486],[8491,8491],[8531,8532],[8539,8542],[8544,8555],[8560,8569],[8592,8601],[8632,8633],[8658,8658],[8660,8660],[8679,8679],[8704,8704],[8706,8707],[8711,8712],[8715,8715],[8719,8719],[8721,8721],[8725,8725],[8730,8730],[8733,8736],[8739,8739],[8741,8741],[8743,8748],[8750,8750],[8756,8759],[8764,8765],[8776,8776],[8780,8780],[8786,8786],[8800,8801],[8804,8807],[8810,8811],[8814,8815],[8834,8835],[8838,8839],[8853,8853],[8857,8857],[8869,8869],[8895,8895],[8978,8978],[9312,9449],[9451,9547],[9552,9587],[9600,9615],[9618,9621],[9632,9633],[9635,9641],[9650,9651],[9654,9655],[9660,9661],[9664,9665],[9670,9672],[9675,9675],[9678,9681],[9698,9701],[9711,9711],[9733,9734],[9737,9737],[9742,9743],[9748,9749],[9756,9756],[9758,9758],[9792,9792],[9794,9794],[9824,9825],[9827,9829],[9831,9834],[9836,9837],[9839,9839],[10045,10045],[10102,10111],[57344,63743],[65533,65533],[983040,1048573],[1048576,1114109]],t.wc.isSpace=function(e){var r,i=0,o=t.wc.combining.length-1;if(et.wc.combining[o][1])return!1;for(;o>=i;)if(r=Math.floor((i+o)/2),e>t.wc.combining[r][1])i=r+1;else{if(!(et.wc.ambiguous[o][1])return!1;for(;o>=i;)if(r=Math.floor((i+o)/2),e>t.wc.ambiguous[r][1])i=r+1;else{if(!(e=127&&e<160?t.wc.controlWidth:e<127?1:t.wc.isSpace(e)?0:1+(e>=4352&&(e<=4447||9001==e||9002==e||e>=11904&&e<=42191&&12351!=e||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510||e>=131072&&e<=196605||e>=196608&&e<=262141))},t.wc.charWidthRegardAmbiguous=function(e){return t.wc.isCjkAmbiguous(e)?t.wc.cjkAmbiguousWidth:t.wc.charWidthDisregardAmbiguous(e)},t.wc.strWidth=function(e){for(var r,i=0,o=0;or);o++);if(null!=i){for(n=o,s=0;ni&&n--,e.substring(o,n)}return e.substr(o)},t.wc.substring=function(e,r,i){return t.wc.substr(e,r,i-r)},t.resource.add("libdot/changelog/version","text/plain","1.16"),t.resource.add("libdot/changelog/date","text/plain","2017-08-16"),t.rtdep("lib.Storage");var r={windowType:null,zoomWarningMessage:"ZOOM != 100%",notifyCopyMessage:"✂",desktopNotificationTitle:"♪ %(title) ♪",testDeps:["hterm.ScrollPort.Tests","hterm.Screen.Tests","hterm.Terminal.Tests","hterm.VT.Tests","hterm.VT.CannedTests"]};t.registerInit("hterm",(function(e){function i(t){r.windowType=t.type,setTimeout(e,0)}r.defaultStorage||(window.chrome&&chrome.storage&&chrome.storage.sync?r.defaultStorage=new t.Storage.Chrome(chrome.storage.sync):r.defaultStorage=new t.Storage.Local);var o=!1;if(window.chrome&&chrome.runtime&&chrome.runtime.getManifest){var n=chrome.runtime.getManifest();o=n.app&&n.app.background}o?setTimeout(i.bind(null,{type:"popup"}),0):window.chrome&&chrome.tabs?chrome.tabs.getCurrent((function(t){t&&window.chrome?chrome.windows.get(t.windowId,null,i):(r.windowType="normal",setTimeout(e,0))})):setTimeout(i.bind(null,{type:"normal"}),0)})),r.getClientSize=function(e){return e.getBoundingClientRect()},r.getClientWidth=function(e){return e.getBoundingClientRect().width},r.getClientHeight=function(e){return e.getBoundingClientRect().height},r.copySelectionToClipboard=function(e){try{e.execCommand("copy")}catch(e){}},r.pasteFromClipboard=function(e){try{return e.execCommand("paste")}catch(e){return!1}},r.notify=function(e){var i=(e,t)=>void 0!==e?e:t;null==e&&(e={});var o={body:e.body,icon:i(e.icon,t.resource.getDataUrl("hterm/images/icon-96"))},n=i(e.title,window.document.title);n||(n="hterm"),n=t.f.replaceVars(r.desktopNotificationTitle,{title:n});var s=new Notification(n,o);return s.onclick=function(){window.focus(),this.close()},s},r.Size=function(e,t){this.width=e,this.height=t},r.Size.prototype.resize=function(e,t){this.width=e,this.height=t},r.Size.prototype.clone=function(){return new r.Size(this.width,this.height)},r.Size.prototype.setTo=function(e){this.width=e.width,this.height=e.height},r.Size.prototype.equals=function(e){return this.width==e.width&&this.height==e.height},r.Size.prototype.toString=function(){return"[hterm.Size: "+this.width+", "+this.height+"]"},r.RowCol=function(e,t,r){this.row=e,this.column=t,this.overflow=!!r},r.RowCol.prototype.move=function(e,t,r){this.row=e,this.column=t,this.overflow=!!r},r.RowCol.prototype.clone=function(){return new r.RowCol(this.row,this.column,this.overflow)},r.RowCol.prototype.setTo=function(e){this.row=e.row,this.column=e.column,this.overflow=e.overflow},r.RowCol.prototype.equals=function(e){return this.row==e.row&&this.column==e.column&&this.overflow==e.overflow},r.RowCol.prototype.toString=function(){return"[hterm.RowCol: "+this.row+", "+this.column+", "+this.overflow+"]"},t.rtdep("lib.f"),r.Frame=function(e,t,r){this.terminal_=e,this.div_=e.div_,this.url=t,this.options=r||{},this.iframe_=null,this.container_=null,this.messageChannel_=null},r.Frame.prototype.onMessage_=function(e){switch(e.data.name){case"ipc-init-ok":return void this.sendTerminalInfo_();case"terminal-info-ok":return this.container_.style.display="flex",this.messageChannel_.port1.onmessage=this.onMessage.bind(this),void this.onLoad();default:return void console.log("Unknown message from frame:",e.data)}},r.Frame.prototype.onMessage=function(){},r.Frame.prototype.onLoad_=function(){this.messageChannel_=new MessageChannel,this.messageChannel_.port1.onmessage=this.onMessage_.bind(this),this.messageChannel_.port1.start(),this.iframe_.contentWindow.postMessage({name:"ipc-init",argv:[{messagePort:this.messageChannel_.port2}]},this.url,[this.messageChannel_.port2])},r.Frame.prototype.onLoad=function(){},r.Frame.prototype.sendTerminalInfo_=function(){t.f.getAcceptLanguages(function(e){this.postMessage("terminal-info",[{acceptLanguages:e,foregroundColor:this.terminal_.getForegroundColor(),backgroundColor:this.terminal_.getBackgroundColor(),cursorColor:this.terminal_.getCursorColor(),fontSize:this.terminal_.getFontSize(),fontFamily:this.terminal_.getFontFamily(),baseURL:t.f.getURL("/")}])}.bind(this))},r.Frame.prototype.onCloseClicked_=function(){this.close()},r.Frame.prototype.close=function(){this.container_&&this.container_.parentNode&&(this.container_.parentNode.removeChild(this.container_),this.onClose())},r.Frame.prototype.onClose=function(){},r.Frame.prototype.postMessage=function(e,t){if(!this.messageChannel_)throw new Error("Message channel is not set up.");this.messageChannel_.port1.postMessage({name:e,argv:t})},r.Frame.prototype.show=function(){var e=this;function t(t,r){return t in e.options?e.options[t]:r}if(e=this,this.container_&&this.container_.parentNode)console.error("Frame already visible");else{var i=r.getClientSize(this.div_),o=(t("width",640),t("height",480),i.width,i.height,this.terminal_.document_),n=this.container_=o.createElement("div");n.style.cssText="position: absolute;display: none;flex-direction: column;top: 10%;left: 4%;width: 90%;height: 80%;min-height: 20%;max-height: 80%;box-shadow: 0 0 2px "+this.terminal_.getForegroundColor()+";border: 2px "+this.terminal_.getForegroundColor()+" solid;";var s=this.iframe_=o.createElement("iframe");s.onload=this.onLoad_.bind(this),s.style.cssText="display: flex;flex: 1;width: 100%",s.setAttribute("src",this.url),s.setAttribute("seamless",!0),n.appendChild(s),this.div_.appendChild(n)}},t.rtdep("hterm.Keyboard.KeyMap"),r.Keyboard=function(e){this.terminal=e,this.keyboardElement_=null,this.handlers_=[["focusout",this.onFocusOut_.bind(this)],["keydown",this.onKeyDown_.bind(this)],["keypress",this.onKeyPress_.bind(this)],["keyup",this.onKeyUp_.bind(this)],["textInput",this.onTextInput_.bind(this)]],this.keyMap=new r.Keyboard.KeyMap(this),this.bindings=new r.Keyboard.Bindings(this),this.altGrMode="none",this.shiftInsertPaste=!0,this.homeKeysScroll=!1,this.pageKeysScroll=!1,this.ctrlPlusMinusZeroZoom=!0,this.ctrlCCopy=!1,this.ctrlVPaste=!1,this.applicationKeypad=!1,this.applicationCursor=!1,this.backspaceSendsBackspace=!1,this.characterEncoding="utf-8",this.metaSendsEscape=!0,this.passMetaV=!0,this.altSendsWhat="escape",this.altIsMeta=!1,this.altBackspaceIsMetaBackspace=!1,this.altKeyPressed=0,this.mediaKeysAreFKeys=!1,this.previousAltSendsWhat_=null},r.Keyboard.KeyActions={CANCEL:t.f.createEnum("CANCEL"),DEFAULT:t.f.createEnum("DEFAULT"),PASS:t.f.createEnum("PASS"),STRIP:t.f.createEnum("STRIP")},r.Keyboard.prototype.encode=function(e){return"utf-8"==this.characterEncoding?this.terminal.vt.encodeUTF8(e):e},r.Keyboard.prototype.installKeyboard=function(e){if(e!=this.keyboardElement_){e&&this.keyboardElement_&&this.installKeyboard(null);for(var t=0;t=32&&(r=e.charCode);r&&this.terminal.onVTKeystroke(String.fromCharCode(r)),e.preventDefault(),e.stopPropagation()}},r.Keyboard.prototype.preventChromeAppNonCtrlShiftDefault_=function(e){window.chrome&&window.chrome.app&&window.chrome.app.window&&(e.ctrlKey&&e.shiftKey||e.preventDefault())},r.Keyboard.prototype.onFocusOut_=function(e){this.altKeyPressed=0},r.Keyboard.prototype.onKeyUp_=function(e){18==e.keyCode&&(this.altKeyPressed=this.altKeyPressed&~(1<=64&&b<=95&&(i=String.fromCharCode(b-64))),u&&"8-bit"==this.altSendsWhat&&1==i.length){var b=i.charCodeAt(0)+128;i=String.fromCharCode(b)}(u&&"escape"==this.altSendsWhat||d&&this.metaSendsEscape)&&(i=""+i)}this.terminal.onVTKeystroke(i)}else console.warn("Invalid action: "+JSON.stringify(i))}else console.warn("No definition for keyCode: "+e.keyCode)},r.Keyboard.Bindings=function(){this.bindings_={}},r.Keyboard.Bindings.prototype.clear=function(){this.bindings_={}},r.Keyboard.Bindings.prototype.addBinding_=function(e,t){var i=null,o=this.bindings_[e.keyCode];if(o)for(var n=0;n",d,s(p,f),d,d],[191,"/?",d,n(c("_"),c("?")),d,d],[17,"[CTRL]",f,f,f,f],[18,"[ALT]",f,f,f,f],[91,"[LAPL]",f,f,f,f],[32," ",d,c("@"),d,d],[92,"[RAPL]",f,f,f,f],[93,"[RMENU]",f,f,f,f],[42,"[PRTSCR]",f,f,f,f],[145,"[SCRLK]",f,f,f,f],[19,"[BREAK]",f,f,f,f],[45,"[INSERT]",l("onKeyInsert_"),d,d,d],[36,"[HOME]",l("onKeyHome_"),d,d,d],[33,"[PGUP]",l("onKeyPageUp_"),d,d,d],[46,"[DEL]",l("onKeyDel_"),d,d,d],[35,"[END]",l("onKeyEnd_"),d,d,d],[34,"[PGDOWN]",l("onKeyPageDown_"),d,d,d],[38,"[UP]",l("onKeyArrowUp_"),d,d,d],[40,"[DOWN]",l("onKeyArrowDown_"),d,d,d],[39,"[RIGHT]",i("","OC"),d,d,d],[37,"[LEFT]",i("","OD"),d,d,d],[144,"[NUMLOCK]",f,f,f,f],[96,"[KP0]",d,d,d,d],[97,"[KP1]",d,d,d,d],[98,"[KP2]",d,d,d,d],[99,"[KP3]",d,d,d,d],[100,"[KP4]",d,d,d,d],[101,"[KP5]",d,d,d,d],[102,"[KP6]",d,d,d,d],[103,"[KP7]",d,d,d,d],[104,"[KP8]",d,d,d,d],[105,"[KP9]",d,d,d,d],[107,"[KP+]",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[109,"[KP-]",d,l("onPlusMinusZero_"),d,l("onPlusMinusZero_")],[106,"[KP*]",d,d,d,d],[111,"[KP/]",d,d,d,d],[110,"[KP.]",d,d,d,d],[166,"[BACK]",h(a("OP","")),d,"[23~",d],[167,"[FWD]",h(a("OQ","")),d,"[24~",d],[168,"[RELOAD]",h(a("OR","")),d,"[25~",d],[183,"[FSCR]",h(a("OS","")),d,"[26~",d],[182,"[WINS]",h("[15~"),d,"[28~",d],[216,"[BRIT-]",h("[17~"),d,"[29~",d],[217,"[BRIT+]",h("[18~"),d,"[31~",d])},r.Keyboard.KeyMap.prototype.onKeyInsert_=function(e){return this.keyboard.shiftInsertPaste&&e.shiftKey?r.Keyboard.KeyActions.PASS:"[2~"},r.Keyboard.KeyMap.prototype.onKeyHome_=function(e){return!this.keyboard.homeKeysScroll^e.shiftKey?e.altey||e.ctrlKey||e.shiftKey||!this.keyboard.applicationCursor?"":"OH":(this.keyboard.terminal.scrollHome(),r.Keyboard.KeyActions.CANCEL)},r.Keyboard.KeyMap.prototype.onKeyEnd_=function(e){return!this.keyboard.homeKeysScroll^e.shiftKey?e.altKey||e.ctrlKey||e.shiftKey||!this.keyboard.applicationCursor?"":"OF":(this.keyboard.terminal.scrollEnd(),r.Keyboard.KeyActions.CANCEL)},r.Keyboard.KeyMap.prototype.onKeyPageUp_=function(e){return!this.keyboard.pageKeysScroll^e.shiftKey?"[5~":(this.keyboard.terminal.scrollPageUp(),r.Keyboard.KeyActions.CANCEL)},r.Keyboard.KeyMap.prototype.onKeyDel_=function(e){return this.keyboard.altBackspaceIsMetaBackspace&&this.keyboard.altKeyPressed&&!e.altKey?"":"[3~"},r.Keyboard.KeyMap.prototype.onKeyPageDown_=function(e){return!this.keyboard.pageKeysScroll^e.shiftKey?"[6~":(this.keyboard.terminal.scrollPageDown(),r.Keyboard.KeyActions.CANCEL)},r.Keyboard.KeyMap.prototype.onKeyArrowUp_=function(e){return!this.keyboard.applicationCursor&&e.shiftKey?(this.keyboard.terminal.scrollLineUp(),r.Keyboard.KeyActions.CANCEL):e.shiftKey||e.ctrlKey||e.altKey||e.metaKey||!this.keyboard.applicationCursor?"":"OA"},r.Keyboard.KeyMap.prototype.onKeyArrowDown_=function(e){return!this.keyboard.applicationCursor&&e.shiftKey?(this.keyboard.terminal.scrollLineDown(),r.Keyboard.KeyActions.CANCEL):e.shiftKey||e.ctrlKey||e.altKey||e.metaKey||!this.keyboard.applicationCursor?"":"OB"},r.Keyboard.KeyMap.prototype.onClear_=function(e,t){return this.keyboard.terminal.wipeContents(),r.Keyboard.KeyActions.CANCEL},r.Keyboard.KeyMap.prototype.onCtrlNum_=function(e,t){function i(e){return String.fromCharCode(e.charCodeAt(0)-64)}if(this.keyboard.terminal.passCtrlNumber&&!e.shiftKey)return r.Keyboard.KeyActions.PASS;switch(t.keyCap.substr(0,1)){case"1":return"1";case"2":return i("@");case"3":return i("[");case"4":return i("\\");case"5":return i("]");case"6":return i("^");case"7":return i("_");case"8":return"";case"9":return"9"}},r.Keyboard.KeyMap.prototype.onAltNum_=function(e,t){return this.keyboard.terminal.passAltNumber&&!e.shiftKey?r.Keyboard.KeyActions.PASS:r.Keyboard.KeyActions.DEFAULT},r.Keyboard.KeyMap.prototype.onMetaNum_=function(e,t){return this.keyboard.terminal.passMetaNumber&&!e.shiftKey?r.Keyboard.KeyActions.PASS:r.Keyboard.KeyActions.DEFAULT},r.Keyboard.KeyMap.prototype.onCtrlC_=function(e,t){var i=this.keyboard.terminal.getDocument().getSelection();if(!i.isCollapsed){if(this.keyboard.ctrlCCopy&&!e.shiftKey)return this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout(i.collapseToEnd.bind(i),50),r.Keyboard.KeyActions.PASS;if(!this.keyboard.ctrlCCopy&&e.shiftKey)return this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout(i.collapseToEnd.bind(i),50),this.keyboard.terminal.copySelectionToClipboard(),r.Keyboard.KeyActions.CANCEL}return""},r.Keyboard.KeyMap.prototype.onCtrlN_=function(e,t){return e.shiftKey?(window.open(document.location.href,"","chrome=no,close=yes,resize=yes,scrollbars=yes,minimizable=yes,width="+window.innerWidth+",height="+window.innerHeight),r.Keyboard.KeyActions.CANCEL):""},r.Keyboard.KeyMap.prototype.onCtrlV_=function(e,t){return!e.shiftKey&&this.keyboard.ctrlVPaste||e.shiftKey&&!this.keyboard.ctrlVPaste?this.keyboard.terminal.paste()?r.Keyboard.KeyActions.CANCEL:r.Keyboard.KeyActions.PASS:""},r.Keyboard.KeyMap.prototype.onMetaN_=function(e,t){return e.shiftKey?(window.open(document.location.href,"","chrome=no,close=yes,resize=yes,scrollbars=yes,minimizable=yes,width="+window.outerWidth+",height="+window.outerHeight),r.Keyboard.KeyActions.CANCEL):r.Keyboard.KeyActions.DEFAULT},r.Keyboard.KeyMap.prototype.onMetaC_=function(e,t){var i=this.keyboard.terminal.getDocument();return e.shiftKey||i.getSelection().isCollapsed?t.keyCap.substr(e.shiftKey?1:0,1):(this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout((function(){i.getSelection().collapseToEnd()}),50),r.Keyboard.KeyActions.PASS)},r.Keyboard.KeyMap.prototype.onMetaV_=function(e,t){return e.shiftKey||this.keyboard.passMetaV?r.Keyboard.KeyActions.PASS:r.Keyboard.KeyActions.DEFAULT},r.Keyboard.KeyMap.prototype.onPlusMinusZero_=function(e,t){if(!(this.keyboard.ctrlPlusMinusZeroZoom^e.shiftKey))return"-_"==t.keyCap?"":r.Keyboard.KeyActions.CANCEL;if(1!=this.keyboard.terminal.getZoomFactor())return r.Keyboard.KeyActions.PASS;var i=t.keyCap.substr(0,1);if("0"==i)this.keyboard.terminal.setFontSize(0);else{var o=this.keyboard.terminal.getFontSize();"-"==i||"[KP-]"==t.keyCap?o-=1:o+=1,this.keyboard.terminal.setFontSize(o)}return r.Keyboard.KeyActions.CANCEL},r.Keyboard.KeyPattern=function(e){this.wildcardCount=0,this.keyCode=e.keyCode,r.Keyboard.KeyPattern.modifiers.forEach(function(t){this[t]=e[t]||!1,"*"==this[t]&&this.wildcardCount++}.bind(this))},r.Keyboard.KeyPattern.modifiers=["shift","ctrl","alt","meta"],r.Keyboard.KeyPattern.sortCompare=function(e,t){return e.wildcardCountt.wildcardCount?1:0},r.Keyboard.KeyPattern.prototype.match_=function(e,t){if(this.keyCode!=e.keyCode)return!1;var i=!0;return r.Keyboard.KeyPattern.modifiers.forEach(function(r){var o=r in e&&e[r];i&&(t||"*"!=this[r])&&this[r]!=o&&(i=!1)}.bind(this)),i},r.Keyboard.KeyPattern.prototype.matchKeyDown=function(e){return this.match_(e,!1)},r.Keyboard.KeyPattern.prototype.matchKeyPattern=function(e){return this.match_(e,!0)},r.Options=function(e){this.wraparound=!e||e.wraparound,this.reverseWraparound=!!e&&e.reverseWraparound,this.originMode=!!e&&e.originMode,this.autoCarriageReturn=!!e&&e.autoCarriageReturn,this.cursorVisible=!!e&&e.cursorVisible,this.cursorBlink=!!e&&e.cursorBlink,this.insertMode=!!e&&e.insertMode,this.reverseVideo=!!e&&e.reverseVideo,this.bracketedPaste=!!e&&e.bracketedPaste},t.rtdep("hterm.Keyboard.KeyActions"),r.Parser=function(){this.source="",this.pos=0,this.ch=null},r.Parser.prototype.error=function(e){return new Error("Parse error at "+this.pos+": "+e)},r.Parser.prototype.isComplete=function(){return this.pos==this.source.length},r.Parser.prototype.reset=function(e,t){this.source=e,this.pos=t||0,this.ch=e.substr(0,1)},r.Parser.prototype.parseKeySequence=function(){var e={keyCode:null};for(var t in r.Parser.identifiers.modifierKeys)e[r.Parser.identifiers.modifierKeys[t]]=!1;for(;this.pos 'none', else => 'right-alt'\n'none': Disable any AltGr related munging.\n'ctrl-alt': Assume Ctrl+Alt means AltGr.\n'left-alt': Assume left Alt means AltGr.\n'right-alt': Assume right Alt means AltGr.\n"],"alt-backspace-is-meta-backspace":[r.PreferenceManager.categories.Keyboard,!1,"bool","If set, undoes the Chrome OS Alt-Backspace->DEL remap, so that alt-backspace indeed is alt-backspace."],"alt-is-meta":[r.PreferenceManager.categories.Keyboard,!1,"bool","Set whether the alt key acts as a meta key or as a distinct alt key."],"alt-sends-what":[r.PreferenceManager.categories.Keyboard,"escape",["escape","8-bit","browser-key"],"Controls how the alt key is handled.\n\n escape....... Send an ESC prefix.\n 8-bit........ Add 128 to the unshifted character as in xterm.\n browser-key.. Wait for the keypress event and see what the browser \n says. (This won't work well on platforms where the \n browser performs a default action for some alt sequences.)"],"audible-bell-sound":[r.PreferenceManager.categories.Sounds,"lib-resource:hterm/audio/bell","url","URL of the terminal bell sound. Empty string for no audible bell."],"desktop-notification-bell":[r.PreferenceManager.categories.Sounds,!1,"bool",'If true, terminal bells in the background will create a Web Notification. https://www.w3.org/TR/notifications/\n\nDisplaying notifications requires permission from the user. When this option is set to true, hterm will attempt to ask the user for permission if necessary. Note browsers may not show this permission request if it did not originate from a user action.\n\nChrome extensions with the "notifications" permission have permission to display notifications.'],"background-color":[r.PreferenceManager.categories.Appearance,"rgb(16, 16, 16)","color","The background color for text with no other color attributes."],"background-image":[r.PreferenceManager.categories.Appearance,"","string","CSS value of the background image. Empty string for no image.\n\nFor example:\n url(https://goo.gl/anedTK)\n linear-gradient(top bottom, blue, red)"],"background-size":[r.PreferenceManager.categories.Appearance,"","string","CSS value of the background image size. Defaults to none."],"background-position":[r.PreferenceManager.categories.Appearance,"","string","CSS value of the background image position.\n\nFor example:\n 10% 10%\n center"],"backspace-sends-backspace":[r.PreferenceManager.categories.Keyboard,!1,"bool","If true, the backspace should send BS ('\\x08', aka ^H). Otherwise the backspace key should send '\\x7f'."],"character-map-overrides":[r.PreferenceManager.categories.Appearance,null,"value",'This is specified as an object. It is a sparse array, where each property is the character set code and the value is an object that is a sparse array itself. In that sparse array, each property is the received character and the value is the displayed character.\n\nFor example:\n {"0":{"+":"\\u2192",",":"\\u2190","-":"\\u2191",".":"\\u2193", "0":"\\u2588"}}'],"close-on-exit":[r.PreferenceManager.categories.Miscellaneous,!0,"bool","Whether or not to close the window when the command exits."],"cursor-blink":[r.PreferenceManager.categories.Appearance,!1,"bool","Whether or not to blink the cursor by default."],"cursor-blink-cycle":[r.PreferenceManager.categories.Appearance,[1e3,500],"value","The cursor blink rate in milliseconds.\n\nA two element array, the first of which is how long the cursor should be on, second is how long it should be off."],"cursor-color":[r.PreferenceManager.categories.Appearance,"rgba(255, 0, 0, 0.5)","color","The color of the visible cursor."],"color-palette-overrides":[r.PreferenceManager.categories.Appearance,null,"value","Override colors in the default palette.\n\nThis can be specified as an array or an object. If specified as an object it is assumed to be a sparse array, where each property is a numeric index into the color palette.\n\nValues can be specified as almost any css color value. This includes #RGB, #RRGGBB, rgb(...), rgba(...), and any color names that are also part of the stock X11 rgb.txt file.\n\nYou can use 'null' to specify that the default value should be not be changed. This is useful for skipping a small number of indices when the value is specified as an array."],"copy-on-select":[r.PreferenceManager.categories.CopyPaste,!0,"bool","Automatically copy mouse selection to the clipboard."],"use-default-window-copy":[r.PreferenceManager.categories.CopyPaste,!1,"bool","Whether to use the default window copy behavior"],"clear-selection-after-copy":[r.PreferenceManager.categories.CopyPaste,!0,"bool","Whether to clear the selection after copying."],"ctrl-plus-minus-zero-zoom":[r.PreferenceManager.categories.Keyboard,!0,"bool","If true, Ctrl-Plus/Minus/Zero controls zoom.\nIf false, Ctrl-Shift-Plus/Minus/Zero controls zoom, Ctrl-Minus sends ^_, Ctrl-Plus/Zero do nothing."],"ctrl-c-copy":[r.PreferenceManager.categories.Keyboard,!1,"bool","Ctrl+C copies if true, send ^C to host if false.\nCtrl+Shift+C sends ^C to host if true, copies if false."],"ctrl-v-paste":[r.PreferenceManager.categories.Keyboard,!1,"bool","Ctrl+V pastes if true, send ^V to host if false.\nCtrl+Shift+V sends ^V to host if true, pastes if false."],"east-asian-ambiguous-as-two-column":[r.PreferenceManager.categories.Keyboard,!1,"bool","Set whether East Asian Ambiguous characters have two column width."],"enable-8-bit-control":[r.PreferenceManager.categories.Keyboard,!1,"bool","True to enable 8-bit control characters, false to ignore them.\n\nWe'll respect the two-byte versions of these control characters regardless of this setting."],"enable-bold":[r.PreferenceManager.categories.Appearance,null,"tristate","True if we should use bold weight font for text with the bold/bright attribute. False to use the normal weight font. Null to autodetect."],"enable-bold-as-bright":[r.PreferenceManager.categories.Appearance,!0,"bool","True if we should use bright colors (8-15 on a 16 color palette) for any text with the bold attribute. False otherwise."],"enable-blink":[r.PreferenceManager.categories.Appearance,!0,"bool","True if we should respect the blink attribute. False to ignore it. "],"enable-clipboard-notice":[r.PreferenceManager.categories.CopyPaste,!0,"bool","Show a message in the terminal when the host writes to the clipboard."],"enable-clipboard-write":[r.PreferenceManager.categories.CopyPaste,!0,"bool","Allow the host to write directly to the system clipboard."],"enable-dec12":[r.PreferenceManager.categories.Miscellaneous,!1,"bool","Respect the host's attempt to change the cursor blink status using DEC Private Mode 12."],environment:[r.PreferenceManager.categories.Miscellaneous,{TERM:"xterm-256color"},"value","The default environment variables, as an object."],"font-family":[r.PreferenceManager.categories.Appearance,'"DejaVu Sans Mono", "Everson Mono", FreeMono, "Menlo", "Terminal", monospace',"string","Default font family for the terminal text."],"font-size":[r.PreferenceManager.categories.Appearance,15,"int","The default font size in pixels."],"font-smoothing":[r.PreferenceManager.categories.Appearance,"antialiased","string","CSS font-smoothing property."],"foreground-color":[r.PreferenceManager.categories.Appearance,"rgb(240, 240, 240)","color","The foreground color for text with no other color attributes."],"home-keys-scroll":[r.PreferenceManager.categories.Keyboard,!1,"bool","If true, home/end will control the terminal scrollbar and shift home/end will send the VT keycodes. If false then home/end sends VT codes and shift home/end scrolls."],keybindings:[r.PreferenceManager.categories.Keyboard,null,"value",'A map of key sequence to key actions. Key sequences include zero or more modifier keys followed by a key code. Key codes can be decimal or hexadecimal numbers, or a key identifier. Key actions can be specified a string to send to the host, or an action identifier. For a full explanation of the format, see https://goo.gl/LWRndr.\n\nSample keybindings:\n{\n "Ctrl-Alt-K": "clearScrollback",\n "Ctrl-Shift-L": "PASS",\n "Ctrl-H": "\'HELLO\\n\'"\n}'],"max-string-sequence":[r.PreferenceManager.categories.Encoding,1e5,"int","Max length of a DCS, OSC, PM, or APS sequence before we give up and ignore the code."],"media-keys-are-fkeys":[r.PreferenceManager.categories.Keyboard,!1,"bool","If true, convert media keys to their Fkey equivalent. If false, let the browser handle the keys."],"meta-sends-escape":[r.PreferenceManager.categories.Keyboard,!0,"bool","Set whether the meta key sends a leading escape or not."],"mouse-right-click-paste":[r.PreferenceManager.categories.CopyPaste,!0,"bool",'Paste on right mouse button clicks.\n\nThis option is activate independent of the "mouse-paste-button" setting.\n\nNote: This will handle left & right handed mice correctly.'],"mouse-paste-button":[r.PreferenceManager.categories.CopyPaste,null,[null,0,1,2,3,4,5,6],"Mouse paste button, or null to autodetect.\n\nFor autodetect, we'll use the middle mouse button for non-X11 platforms (including Chrome OS). On X11, we'll use the right mouse button (since the native window manager should paste via the middle mouse button).\n\n0 == left (primary) button.\n1 == middle (auxiliary) button.\n2 == right (secondary) button.\n\nThis option is activate independent of the \"mouse-right-click-paste\" setting.\n\nNote: This will handle left & right handed mice correctly."],"word-break-match-left":[r.PreferenceManager.categories.CopyPaste,"[^\\s\\[\\](){}<>\"'\\^!@#$%&*,;:`]","string",'Regular expression to halt matching to the left (start) of a selection.\n\nNormally this is a character class to reject specific characters.\nWe allow "~" and "." by default as paths frequently start with those.'],"word-break-match-right":[r.PreferenceManager.categories.CopyPaste,"[^\\s\\[\\](){}<>\"'\\^!@#$%&*,;:~.`]","string","Regular expression to halt matching to the right (end) of a selection.\n\nNormally this is a character class to reject specific characters."],"word-break-match-middle":[r.PreferenceManager.categories.CopyPaste,"[^\\s\\[\\](){}<>\"'\\^]*","string","Regular expression to match all the characters in the middle.\n\nNormally this is a character class to reject specific characters.\n\nUsed to expand the selection surrounding the starting point."],"page-keys-scroll":[r.PreferenceManager.categories.Keyboard,!1,"bool","If true, page up/down will control the terminal scrollbar and shift page up/down will send the VT keycodes. If false then page up/down sends VT codes and shift page up/down scrolls."],"pass-alt-number":[r.PreferenceManager.categories.Keyboard,null,"tristate","Set whether we should pass Alt-1..9 to the browser.\n\nThis is handy when running hterm in a browser tab, so that you don't lose Chrome's \"switch to tab\" keyboard accelerators. When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.\n\nIf true, Alt-1..9 will be handled by the browser. If false, Alt-1..9 will be sent to the host. If null, autodetect based on browser platform and window type."],"pass-ctrl-number":[r.PreferenceManager.categories.Keyboard,null,"tristate","Set whether we should pass Ctrl-1..9 to the browser.\n\nThis is handy when running hterm in a browser tab, so that you don't lose Chrome's \"switch to tab\" keyboard accelerators. When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.\n\nIf true, Ctrl-1..9 will be handled by the browser. If false, Ctrl-1..9 will be sent to the host. If null, autodetect based on browser platform and window type."],"pass-meta-number":[r.PreferenceManager.categories.Keyboard,null,"tristate","Set whether we should pass Meta-1..9 to the browser.\n\nThis is handy when running hterm in a browser tab, so that you don't lose Chrome's \"switch to tab\" keyboard accelerators. When not running in a tab it's better to send these keys to the host so they can be used in vim or emacs.\n\nIf true, Meta-1..9 will be handled by the browser. If false, Meta-1..9 will be sent to the host. If null, autodetect based on browser platform and window type."],"pass-meta-v":[r.PreferenceManager.categories.Keyboard,!0,"bool","Set whether meta-V gets passed to host."],"receive-encoding":[r.PreferenceManager.categories.Encoding,"utf-8",["utf-8","raw"],"Set the expected encoding for data received from the host.\n\nValid values are 'utf-8' and 'raw'."],"scroll-on-keystroke":[r.PreferenceManager.categories.Scrolling,!0,"bool","If true, scroll to the bottom on any keystroke."],"scroll-on-output":[r.PreferenceManager.categories.Scrolling,!1,"bool","If true, scroll to the bottom on terminal output."],"scrollbar-visible":[r.PreferenceManager.categories.Scrolling,!0,"bool","The vertical scrollbar mode."],"scroll-wheel-may-send-arrow-keys":[r.PreferenceManager.categories.Scrolling,!1,"bool","When using the alternative screen buffer, and DECCKM (Application Cursor Keys) is active, mouse wheel scroll events will emulate arrow keys.\n\nIt can be temporarily disabled by holding the shift key.\n\nThis frequently comes up when using pagers (less) or reading man pages or text editors (vi/nano) or using screen/tmux."],"scroll-wheel-move-multiplier":[r.PreferenceManager.categories.Scrolling,1,"int","The multiplier for the pixel delta in wheel events caused by the scroll wheel. Alters how fast the page scrolls."],"send-encoding":[r.PreferenceManager.categories.Encoding,"utf-8",["utf-8","raw"],"Set the encoding for data sent to host."],"terminal-encoding":[r.PreferenceManager.categories.Encoding,"iso-2022",["iso-2022","utf-8","utf-8-locked"],"The default terminal encoding (DOCS).\n\nISO-2022 enables character map translations (like graphics maps).\nUTF-8 disables support for those.\n\nThe locked variant means the encoding cannot be changed at runtime via terminal escape sequences.\n\nYou should stick with UTF-8 unless you notice broken rendering with legacy applications."],"shift-insert-paste":[r.PreferenceManager.categories.Keyboard,!0,"bool","Shift + Insert pastes if true, sent to host if false."],"user-css":[r.PreferenceManager.categories.Appearance,"","url","URL of user stylesheet to include in the terminal document."],"user-css-text":[r.PreferenceManager.categories.Appearance,"","multiline-string","Custom CSS text for styling the terminal."]},r.PreferenceManager.prototype=Object.create(t.PreferenceManager.prototype),r.PreferenceManager.constructor=r.PreferenceManager,r.PubSub=function(){this.observers_={}},r.PubSub.addBehavior=function(e){var t=new r.PubSub;for(var i in r.PubSub.prototype)e[i]=r.PubSub.prototype[i].bind(t)},r.PubSub.prototype.subscribe=function(e,t){e in this.observers_||(this.observers_[e]=[]),this.observers_[e].push(t)},r.PubSub.prototype.unsubscribe=function(e,t){var r=this.observers_[e];if(!r)throw"Invalid subject: "+e;var i=r.indexOf(t);if(i<0)throw"Not subscribed: "+e;r.splice(i,1)},r.PubSub.prototype.publish=function(e,t,r){var i=this.observers_[e];i&&(i=[].concat(i)),r&&(i?i.push(r):i=[r]),i&&setTimeout((function e(r){r=e&&this.setCursorPosition(this.cursorPosition.row,e-1)},r.Screen.prototype.shiftRow=function(){return this.shiftRows(1)[0]},r.Screen.prototype.shiftRows=function(e){return this.rowsArray.splice(0,e)},r.Screen.prototype.unshiftRow=function(e){this.rowsArray.splice(0,0,e)},r.Screen.prototype.unshiftRows=function(e){this.rowsArray.unshift.apply(this.rowsArray,e)},r.Screen.prototype.popRow=function(){return this.popRows(1)[0]},r.Screen.prototype.popRows=function(e){return this.rowsArray.splice(this.rowsArray.length-e,e)},r.Screen.prototype.pushRow=function(e){this.rowsArray.push(e)},r.Screen.prototype.pushRows=function(e){e.push.apply(this.rowsArray,e)},r.Screen.prototype.insertRow=function(e,t){this.rowsArray.splice(e,0,t)},r.Screen.prototype.insertRows=function(e,t){for(var r=0;r=this.rowsArray.length?(console.error("Row out of bounds: "+e),e=this.rowsArray.length-1):e<0&&(console.error("Row out of bounds: "+e),e=0),t>=this.columnCount_?(console.error("Column out of bounds: "+t),t=this.columnCount_-1):t<0&&(console.error("Column out of bounds: "+t),t=0),this.cursorPosition.overflow=!1;var i=this.rowsArray[e],o=i.firstChild;o||(o=i.ownerDocument.createTextNode(""),i.appendChild(o));var n=0;for(i==this.cursorRowNode_?t>=this.cursorPosition.column-this.cursorOffset_&&(o=this.cursorNode_,n=this.cursorPosition.column-this.cursorOffset_):this.cursorRowNode_=i,this.cursorPosition.move(e,t);o;){var s=t-n,a=r.TextAttributes.nodeWidth(o);if(!o.nextSibling||a>s)return this.cursorNode_=o,void(this.cursorOffset_=s);n+=a,o=o.nextSibling}}else console.warn("Attempt to set cursor position on empty screen.")},r.Screen.prototype.syncSelectionCaret=function(e){try{e.collapse(this.cursorNode_,this.cursorOffset_)}catch(e){}},r.Screen.prototype.splitNode_=function(e,i){var o=e.cloneNode(!1),n=e.textContent;e.textContent=r.TextAttributes.nodeSubstr(e,0,i),o.textContent=t.wc.substr(n,i),o.textContent&&e.parentNode.insertBefore(o,e.nextSibling),e.textContent||e.parentNode.removeChild(e)},r.Screen.prototype.maybeClipCurrentRow=function(){var e=r.TextAttributes.nodeWidth(this.cursorRowNode_);if(e<=this.columnCount_)this.cursorPosition.column>=this.columnCount_&&(this.setCursorPosition(this.cursorPosition.row,this.columnCount_-1),this.cursorPosition.overflow=!0);else{var t=this.cursorPosition.column;this.setCursorPosition(this.cursorPosition.row,this.columnCount_-1),e=r.TextAttributes.nodeWidth(this.cursorNode_),this.cursorOffset_r.TextAttributes.nodeWidth(e);){if(!e.hasAttribute("line-overflow")||!e.nextSibling)return-1;t-=r.TextAttributes.nodeWidth(e),e=e.nextSibling}return this.getNodeAndOffsetWithinRow_(e,t)},r.Screen.prototype.getNodeAndOffsetWithinRow_=function(e,t){for(var i=0;io)){var f=t.wc.substring(l,o,t.wc.strWidth(l)),p=new RegExp("^"+c+a),_=f.match(p);if(_){var g=o+t.wc.strWidth(_[0]);-1==g||gn.rowIndex)r();else if(i.focusNode==i.anchorNode)i.anchorOffset=this.lastRowCount_},r.ScrollPort.prototype.drawTopFold_=function(e){if(!this.selection.startRow||this.selection.startRow.rowIndex>=e)this.rowNodes_.firstChild!=this.topFold_&&this.rowNodes_.insertBefore(this.topFold_,this.rowNodes_.firstChild);else{if(!this.selection.isMultiline||this.selection.endRow.rowIndex>=e)this.selection.startRow.nextSibling!=this.topFold_&&this.rowNodes_.insertBefore(this.topFold_,this.selection.startRow.nextSibling);else for(this.selection.endRow.nextSibling!=this.topFold_&&this.rowNodes_.insertBefore(this.topFold_,this.selection.endRow.nextSibling);this.selection.startRow.nextSibling!=this.selection.endRow;)this.rowNodes_.removeChild(this.selection.startRow.nextSibling);for(;this.rowNodes_.firstChild!=this.selection.startRow;)this.rowNodes_.removeChild(this.rowNodes_.firstChild)}},r.ScrollPort.prototype.drawBottomFold_=function(e){if(!this.selection.endRow||this.selection.endRow.rowIndex<=e)this.rowNodes_.lastChild!=this.bottomFold_&&this.rowNodes_.appendChild(this.bottomFold_);else{if(!this.selection.isMultiline||this.selection.startRow.rowIndex<=e)this.bottomFold_.nextSibling!=this.selection.endRow&&this.rowNodes_.insertBefore(this.bottomFold_,this.selection.endRow);else for(this.bottomFold_.nextSibling!=this.selection.startRow&&this.rowNodes_.insertBefore(this.bottomFold_,this.selection.startRow);this.selection.startRow.nextSibling!=this.selection.endRow;)this.rowNodes_.removeChild(this.selection.startRow.nextSibling);for(;this.rowNodes_.lastChild!=this.selection.endRow;)this.rowNodes_.removeChild(this.rowNodes_.lastChild)}},r.ScrollPort.prototype.drawVisibleRows_=function(e,t){var r=this;function i(e,t){for(;e!=t;){if(!e)throw"Did not encounter target node";if(e==r.bottomFold_)throw"Encountered bottom fold before target node";var i=e;e=e.nextSibling,i.parentNode.removeChild(i)}}for(var o=this.selection.startRow,n=this.selection.endRow,s=this.bottomFold_,a=this.topFold_.nextSibling,c=Math.min(this.visibleRowCount,this.rowProvider_.getRowCount()),l=0;l=this.lastRowCount_;var t=e*this.characterSize.height+this.visibleRowTopMargin,r=this.getScrollMax_();t>r&&(t=r),this.screen_.scrollTop!=t&&(this.screen_.scrollTop=t,this.scheduleRedraw())},r.ScrollPort.prototype.scrollRowToBottom=function(e){this.syncScrollHeight(),this.isScrolledEnd=e+this.visibleRowCount>=this.lastRowCount_;var t=e*this.characterSize.height+this.visibleRowTopMargin+this.visibleRowBottomMargin;(t-=this.visibleRowCount*this.characterSize.height)<0&&(t=0),this.screen_.scrollTop!=t&&(this.screen_.scrollTop=t)},r.ScrollPort.prototype.getTopRowIndex=function(){return Math.round(this.screen_.scrollTop/this.characterSize.height)},r.ScrollPort.prototype.getBottomRowIndex=function(e){return e+this.visibleRowCount-1},r.ScrollPort.prototype.onScroll_=function(e){var t=this.getScreenSize();t.width==this.lastScreenWidth_&&t.height==this.lastScreenHeight_?(this.redraw_(),this.publish("scroll",{scrollPort:this})):this.resize()},r.ScrollPort.prototype.onScrollWheel=function(e){},r.ScrollPort.prototype.onScrollWheel_=function(e){if(this.onScrollWheel(e),!e.defaultPrevented){var t=this.scrollWheelDelta(e),r=this.screen_.scrollTop-t;r<0&&(r=0);var i=this.getScrollMax_();r>i&&(r=i),r!=this.screen_.scrollTop&&(this.screen_.scrollTop=r,e.preventDefault())}},r.ScrollPort.prototype.scrollWheelDelta=function(e){var t;switch(e.deltaMode){case WheelEvent.DOM_DELTA_PIXEL:t=e.deltaY*this.scrollWheelMultiplier_;break;case WheelEvent.DOM_DELTA_LINE:t=e.deltaY*this.characterSize.height;break;case WheelEvent.DOM_DELTA_PAGE:t=e.deltaY*this.characterSize.height*this.screen_.getHeight()}return-1*t},r.ScrollPort.prototype.onTouch=function(e){},r.ScrollPort.prototype.onTouch_=function(e){if(this.onTouch(e),!e.defaultPrevented){var t,r,i=function(e){return{id:e.identifier,y:e.clientY,x:e.clientX}};switch(e.type){case"touchstart":for(t=0;ts&&(n=s),n!=this.screen_.scrollTop&&(this.screen_.scrollTop=n)}e.preventDefault()}},r.ScrollPort.prototype.onResize_=function(e){this.syncCharacterSize(),this.resize()},r.ScrollPort.prototype.onCopy=function(e){},r.ScrollPort.prototype.onCopy_=function(e){if(this.onCopy(e),!e.defaultPrevented&&(this.resetSelectBags_(),this.selection.sync(),this.selection.startRow&&!(this.selection.endRow.rowIndex-this.selection.startRow.rowIndex<2))){var t,r,i=this.getTopRowIndex(),o=this.getBottomRowIndex(i);this.selection.startRow.rowIndexo&&(r=this.selection.startRow.rowIndex>o?this.selection.startRow.rowIndex+1:this.bottomFold_.previousSibling.rowIndex+1,this.bottomSelectBag_.textContent=this.rowProvider_.getRowsText(r,this.selection.endRow.rowIndex),this.rowNodes_.insertBefore(this.bottomSelectBag_,this.selection.endRow))}},r.ScrollPort.prototype.onBodyKeyDown_=function(e){if(this.ctrlVPaste){var t=String.fromCharCode(e.which).toLowerCase();(e.ctrlKey||e.metaKey)&&"v"==t&&this.pasteTarget_.focus()}},r.ScrollPort.prototype.onPaste_=function(e){this.pasteTarget_.focus();var t=this;setTimeout((function(){t.publish("paste",{text:t.pasteTarget_.value}),t.pasteTarget_.value="",t.screen_.focus()}),0)},r.ScrollPort.prototype.handlePasteTargetTextInput_=function(e){e.stopPropagation()},r.ScrollPort.prototype.setScrollbarVisible=function(e){this.screen_.style.overflowY=e?"scroll":"hidden"},r.ScrollPort.prototype.setScrollWheelMoveMultipler=function(e){this.scrollWheelMultiplier_=e},t.rtdep("lib.colors","lib.PreferenceManager","lib.resource","lib.wc","lib.f","hterm.Keyboard","hterm.Options","hterm.PreferenceManager","hterm.Screen","hterm.ScrollPort","hterm.Size","hterm.TextAttributes","hterm.VT"),r.Terminal=function(e){this.profileId_=null,this.primaryScreen_=new r.Screen,this.alternateScreen_=new r.Screen,this.screen_=this.primaryScreen_,this.screenSize=new r.Size(0,0),this.scrollPort_=new r.ScrollPort(this),this.scrollPort_.subscribe("resize",this.onResize_.bind(this)),this.scrollPort_.subscribe("scroll",this.onScroll_.bind(this)),this.scrollPort_.subscribe("paste",this.onPaste_.bind(this)),this.scrollPort_.onCopy=this.onCopy_.bind(this),this.div_=null,this.document_=window.document,this.scrollbackRows_=[],this.tabStops_=[],this.defaultTabStops=!0,this.vtScrollTop_=null,this.vtScrollBottom_=null,this.cursorNode_=null,this.cursorShape_=r.Terminal.cursorShape.BLOCK,this.cursorColor_=null,this.cursorBlinkCycle_=[100,100],this.myOnCursorBlink_=this.onCursorBlink_.bind(this),this.backgroundColor_=null,this.foregroundColor_=null,this.scrollOnOutput_=null,this.scrollOnKeystroke_=null,this.scrollWheelArrowKeys_=null,this.defeatMouseReports_=!1,this.bellAudio_=this.document_.createElement("audio"),this.bellAudio_.id="hterm:bell-audio",this.bellAudio_.setAttribute("preload","auto"),this.bellNotificationList_=[],this.desktopNotificationBell_=!1,this.savedOptions_={},this.options_=new r.Options,this.timeouts_={},this.vt=new r.VT(this),this.keyboard=new r.Keyboard(this),this.io=new r.Terminal.IO(this),this.enableMouseDragScroll=!0,this.copyOnSelect=null,this.mouseRightClickPaste=null,this.mousePasteButton=null,this.useDefaultWindowCopy=!1,this.clearSelectionAfterCopy=!0,this.realizeSize_(80,24),this.setDefaultTabStops(),this.setProfile(e||"default",function(){this.onTerminalReady()}.bind(this))},r.Terminal.cursorShape={BLOCK:"BLOCK",BEAM:"BEAM",UNDERLINE:"UNDERLINE"},r.Terminal.prototype.onTerminalReady=function(){},r.Terminal.prototype.tabWidth=8,r.Terminal.prototype.setProfile=function(e,i){this.profileId_=e.replace(/\//g,"");var o=this;this.prefs_&&this.prefs_.deactivate(),this.prefs_=new r.PreferenceManager(this.profileId_),this.prefs_.addObservers(null,{"alt-gr-mode":function(e){e=null==e?"en-us"==navigator.language.toLowerCase()?"none":"right-alt":"string"==typeof e?e.toLowerCase():"none",/^(none|ctrl-alt|left-alt|right-alt)$/.test(e)||(e="none"),o.keyboard.altGrMode=e},"alt-backspace-is-meta-backspace":function(e){o.keyboard.altBackspaceIsMetaBackspace=e},"alt-is-meta":function(e){o.keyboard.altIsMeta=e},"alt-sends-what":function(e){/^(escape|8-bit|browser-key)$/.test(e)||(e="escape"),o.keyboard.altSendsWhat=e},"audible-bell-sound":function(e){var r=e.match(/^lib-resource:(\S+)/);r?o.bellAudio_.setAttribute("src",t.resource.getDataUrl(r[1])):o.bellAudio_.setAttribute("src",e)},"desktop-notification-bell":function(e){e&&Notification?(o.desktopNotificationBell_="granted"===Notification.permission,o.desktopNotificationBell_||console.warn("desktop-notification-bell is true but we do not have permission to display notifications.")):o.desktopNotificationBell_=!1},"background-color":function(e){o.setBackgroundColor(e)},"background-image":function(e){o.scrollPort_.setBackgroundImage(e)},"background-size":function(e){o.scrollPort_.setBackgroundSize(e)},"background-position":function(e){o.scrollPort_.setBackgroundPosition(e)},"backspace-sends-backspace":function(e){o.keyboard.backspaceSendsBackspace=e},"character-map-overrides":function(e){null==e||e instanceof Object?(o.vt.characterMaps.reset(),o.vt.characterMaps.setOverrides(e)):console.warn("Preference character-map-modifications is not an object: "+e)},"cursor-blink":function(e){o.setCursorBlink(!!e)},"cursor-blink-cycle":function(e){e instanceof Array&&"number"==typeof e[0]&&"number"==typeof e[1]?o.cursorBlinkCycle_=e:o.cursorBlinkCycle_="number"==typeof e?[e,e]:[100,100]},"cursor-color":function(e){o.setCursorColor(e)},"color-palette-overrides":function(e){if(null==e||e instanceof Object||e instanceof Array){if(t.colors.colorPalette=t.colors.stockColorPalette.concat(),e)for(var r in e){var i=parseInt(r);if(isNaN(i)||i<0||i>255)console.log("Invalid value in palette: "+r+": "+e[r]);else if(e[i]){var n=t.colors.normalizeCSS(e[i]);n&&(t.colors.colorPalette[i]=n)}}o.primaryScreen_.textAttributes.resetColorPalette(),o.alternateScreen_.textAttributes.resetColorPalette()}else console.warn("Preference color-palette-overrides is not an array or object: "+e)},"copy-on-select":function(e){o.copyOnSelect=!!e},"use-default-window-copy":function(e){o.useDefaultWindowCopy=!!e},"clear-selection-after-copy":function(e){o.clearSelectionAfterCopy=!!e},"ctrl-plus-minus-zero-zoom":function(e){o.keyboard.ctrlPlusMinusZeroZoom=e},"ctrl-c-copy":function(e){o.keyboard.ctrlCCopy=e},"ctrl-v-paste":function(e){o.keyboard.ctrlVPaste=e,o.scrollPort_.setCtrlVPaste(e)},"east-asian-ambiguous-as-two-column":function(e){t.wc.regardCjkAmbiguous=e},"enable-8-bit-control":function(e){o.vt.enable8BitControl=!!e},"enable-bold":function(e){o.syncBoldSafeState()},"enable-bold-as-bright":function(e){o.primaryScreen_.textAttributes.enableBoldAsBright=!!e,o.alternateScreen_.textAttributes.enableBoldAsBright=!!e},"enable-blink":function(e){o.syncBlinkState()},"enable-clipboard-write":function(e){o.vt.enableClipboardWrite=!!e},"enable-dec12":function(e){o.vt.enableDec12=!!e},"font-family":function(e){o.syncFontFamily()},"font-size":function(e){o.setFontSize(e)},"font-smoothing":function(e){o.syncFontFamily()},"foreground-color":function(e){o.setForegroundColor(e)},"home-keys-scroll":function(e){o.keyboard.homeKeysScroll=e},keybindings:function(e){if(o.keyboard.bindings.clear(),e)if(e instanceof Object)try{o.keyboard.bindings.addBindings(e)}catch(e){console.error("Error in keybindings preference: "+e)}else console.error("Error in keybindings preference: Expected object")},"max-string-sequence":function(e){o.vt.maxStringSequence=e},"media-keys-are-fkeys":function(e){o.keyboard.mediaKeysAreFKeys=e},"meta-sends-escape":function(e){o.keyboard.metaSendsEscape=e},"mouse-right-click-paste":function(e){o.mouseRightClickPaste=e},"mouse-paste-button":function(e){o.syncMousePasteButton()},"page-keys-scroll":function(e){o.keyboard.pageKeysScroll=e},"pass-alt-number":function(e){null==e&&(e=!window.navigator.userAgent.match(/Mac OS X/)&&"popup"!=r.windowType),o.passAltNumber=e},"pass-ctrl-number":function(e){null==e&&(e=!window.navigator.userAgent.match(/Mac OS X/)&&"popup"!=r.windowType),o.passCtrlNumber=e},"pass-meta-number":function(e){null==e&&(e=window.navigator.userAgent.match(/Mac OS X/)&&"popup"!=r.windowType),o.passMetaNumber=e},"pass-meta-v":function(e){o.keyboard.passMetaV=e},"receive-encoding":function(e){/^(utf-8|raw)$/.test(e)||(console.warn('Invalid value for "receive-encoding": '+e),e="utf-8"),o.vt.characterEncoding=e},"scroll-on-keystroke":function(e){o.scrollOnKeystroke_=e},"scroll-on-output":function(e){o.scrollOnOutput_=e},"scrollbar-visible":function(e){o.setScrollbarVisible(e)},"scroll-wheel-may-send-arrow-keys":function(e){o.scrollWheelArrowKeys_=e},"scroll-wheel-move-multiplier":function(e){o.setScrollWheelMoveMultipler(e)},"send-encoding":function(e){/^(utf-8|raw)$/.test(e)||(console.warn('Invalid value for "send-encoding": '+e),e="utf-8"),o.keyboard.characterEncoding=e},"shift-insert-paste":function(e){o.keyboard.shiftInsertPaste=e},"terminal-encoding":function(e){o.vt.setEncoding(e)},"user-css":function(e){o.scrollPort_.setUserCssUrl(e)},"user-css-text":function(e){o.scrollPort_.setUserCssText(e)},"word-break-match-left":function(e){o.primaryScreen_.wordBreakMatchLeft=e,o.alternateScreen_.wordBreakMatchLeft=e},"word-break-match-right":function(e){o.primaryScreen_.wordBreakMatchRight=e,o.alternateScreen_.wordBreakMatchRight=e},"word-break-match-middle":function(e){o.primaryScreen_.wordBreakMatchMiddle=e,o.alternateScreen_.wordBreakMatchMiddle=e}}),this.prefs_.readStorage(function(){this.prefs_.notifyAll(),i&&i()}.bind(this))},r.Terminal.prototype.getPrefs=function(){return this.prefs_},r.Terminal.prototype.setBracketedPaste=function(e){this.options_.bracketedPaste=e},r.Terminal.prototype.setCursorColor=function(e){this.cursorColor_=e,this.cursorNode_.style.backgroundColor=e,this.cursorNode_.style.borderColor=e},r.Terminal.prototype.getCursorColor=function(){return this.cursorColor_},r.Terminal.prototype.setSelectionEnabled=function(e){this.enableMouseDragScroll=e},r.Terminal.prototype.setBackgroundColor=function(e){this.backgroundColor_=t.colors.normalizeCSS(e),this.primaryScreen_.textAttributes.setDefaults(this.foregroundColor_,this.backgroundColor_),this.alternateScreen_.textAttributes.setDefaults(this.foregroundColor_,this.backgroundColor_),this.scrollPort_.setBackgroundColor(e)},r.Terminal.prototype.getBackgroundColor=function(){return this.backgroundColor_},r.Terminal.prototype.setForegroundColor=function(e){this.foregroundColor_=t.colors.normalizeCSS(e),this.primaryScreen_.textAttributes.setDefaults(this.foregroundColor_,this.backgroundColor_),this.alternateScreen_.textAttributes.setDefaults(this.foregroundColor_,this.backgroundColor_),this.scrollPort_.setForegroundColor(e)},r.Terminal.prototype.getForegroundColor=function(){return this.foregroundColor_},r.Terminal.prototype.runCommandClass=function(e,t){var r=this.prefs_.get("environment");"object"==typeof r&&null!=r||(r={});var i=this;this.command=new e({argString:t||"",io:this.io.push(),environment:r,onExit:function(e){i.io.pop(),i.uninstallKeyboard(),i.prefs_.get("close-on-exit")&&window.close()}}),this.installKeyboard(),this.command.run()},r.Terminal.prototype.isPrimaryScreen=function(){return this.screen_==this.primaryScreen_},r.Terminal.prototype.installKeyboard=function(){this.keyboard.installKeyboard(this.scrollPort_.getDocument().body)},r.Terminal.prototype.uninstallKeyboard=function(){this.keyboard.installKeyboard(null)},r.Terminal.prototype.setCssVar=function(e,t,r="--hterm-"){this.document_.documentElement.style.setProperty(`${r}${e}`,t)},r.Terminal.prototype.setFontSize=function(e){0===e&&(e=this.prefs_.get("font-size")),this.scrollPort_.setFontSize(e),this.setCssVar("charsize-width",this.scrollPort_.characterSize.width+"px"),this.setCssVar("charsize-height",this.scrollPort_.characterSize.height+"px")},r.Terminal.prototype.getFontSize=function(){return this.scrollPort_.getFontSize()},r.Terminal.prototype.getFontFamily=function(){return this.scrollPort_.getFontFamily()},r.Terminal.prototype.syncFontFamily=function(){this.scrollPort_.setFontFamily(this.prefs_.get("font-family"),this.prefs_.get("font-smoothing")),this.syncBoldSafeState()},r.Terminal.prototype.syncMousePasteButton=function(){var e=this.prefs_.get("mouse-paste-button");if("number"!=typeof e){var t=navigator.userAgent.match(/\(X11;\s+(\S+)/);t&&"CrOS"!=t[1]?this.mousePasteButton=2:this.mousePasteButton=1}else this.mousePasteButton=e},r.Terminal.prototype.syncBoldSafeState=function(){var e=this.prefs_.get("enable-bold");if(null!==e)return this.primaryScreen_.textAttributes.enableBold=e,void(this.alternateScreen_.textAttributes.enableBold=e);var t=this.scrollPort_.measureCharacterSize(),r=this.scrollPort_.measureCharacterSize("bold"),i=t.equals(r);i||console.warn("Bold characters disabled: Size of bold weight differs from normal. Font family is: "+this.scrollPort_.getFontFamily()),this.primaryScreen_.textAttributes.enableBold=i,this.alternateScreen_.textAttributes.enableBold=i},r.Terminal.prototype.syncBlinkState=function(){this.setCssVar("node-duration",this.prefs_.get("enable-blink")?"0.7s":"0")},r.Terminal.prototype.syncMouseStyle=function(){this.setCssVar("mouse-cursor-style",this.vt.mouseReport==this.vt.MOUSE_REPORT_DISABLED?"var(--hterm-mouse-cursor-text)":"var(--hterm-mouse-cursor-pointer)")},r.Terminal.prototype.saveCursor=function(){return this.screen_.cursorPosition.clone()},r.Terminal.prototype.getTextAttributes=function(){return this.screen_.textAttributes},r.Terminal.prototype.setTextAttributes=function(e){this.screen_.textAttributes=e},r.Terminal.prototype.getZoomFactor=function(){return this.scrollPort_.characterSize.zoomFactor},r.Terminal.prototype.setWindowTitle=function(e){window.document.title=e},r.Terminal.prototype.restoreCursor=function(e){var r=t.f.clamp(e.row,0,this.screenSize.height-1),i=t.f.clamp(e.column,0,this.screenSize.width-1);this.screen_.setCursorPosition(r,i),(e.column>i||e.column==i&&e.overflow)&&(this.screen_.cursorPosition.overflow=!0)},r.Terminal.prototype.clearCursorOverflow=function(){this.screen_.cursorPosition.overflow=!1},r.Terminal.prototype.setCursorShape=function(e){this.cursorShape_=e,this.restyleCursor_()},r.Terminal.prototype.getCursorShape=function(){return this.cursorShape_},r.Terminal.prototype.setWidth=function(e){null!=e?(this.div_.style.width=Math.ceil(this.scrollPort_.characterSize.width*e+this.scrollPort_.currentScrollbarWidthPx)+"px",this.realizeSize_(e,this.screenSize.height),this.scheduleSyncCursorPosition_()):this.div_.style.width="100%"},r.Terminal.prototype.setHeight=function(e){null!=e?(this.div_.style.height=this.scrollPort_.characterSize.height*e+"px",this.realizeSize_(this.screenSize.width,e),this.scheduleSyncCursorPosition_()):this.div_.style.height="100%"},r.Terminal.prototype.realizeSize_=function(e,t){e!=this.screenSize.width&&this.realizeWidth_(e),t!=this.screenSize.height&&this.realizeHeight_(t),this.io.onTerminalResize_(e,t)},r.Terminal.prototype.realizeWidth_=function(e){if(e<=0)throw new Error("Attempt to realize bad width: "+e);var t=e-this.screen_.getWidth();if(this.screenSize.width=e,this.screen_.setColumnCount(e),t>0)this.defaultTabStops&&this.setDefaultTabStops(this.screenSize.width-t);else for(var r=this.tabStops_.length-1;r>=0&&!(this.tabStops_[r]0){if(t<=this.scrollbackRows_.length){var n=Math.min(t,this.scrollbackRows_.length),s=this.scrollbackRows_.splice(this.scrollbackRows_.length-n,n);this.screen_.unshiftRows(s),t-=n,r.row+=n}t&&this.appendRows_(t)}this.setVTScrollRegion(null,null),this.restoreCursor(r)},r.Terminal.prototype.scrollHome=function(){this.scrollPort_.scrollRowToTop(0)},r.Terminal.prototype.scrollEnd=function(){this.scrollPort_.scrollRowToBottom(this.getRowCount())},r.Terminal.prototype.scrollPageUp=function(){var e=this.scrollPort_.getTopRowIndex();this.scrollPort_.scrollRowToTop(e-this.screenSize.height+1)},r.Terminal.prototype.scrollPageDown=function(){var e=this.scrollPort_.getTopRowIndex();this.scrollPort_.scrollRowToTop(e+this.screenSize.height-1)},r.Terminal.prototype.scrollLineUp=function(){var e=this.scrollPort_.getTopRowIndex();this.scrollPort_.scrollRowToTop(e-1)},r.Terminal.prototype.scrollLineDown=function(){var e=this.scrollPort_.getTopRowIndex();this.scrollPort_.scrollRowToTop(e+1)},r.Terminal.prototype.wipeContents=function(){this.scrollbackRows_.length=0,this.scrollPort_.resetCache(),[this.primaryScreen_,this.alternateScreen_].forEach(function(e){var t=e.getHeight();t>0&&(this.renumberRows_(0,t),this.clearHome(e))}.bind(this)),this.syncCursorPosition_(),this.scrollPort_.invalidate()},r.Terminal.prototype.reset=function(){this.clearAllTabStops(),this.setDefaultTabStops(),this.clearHome(this.primaryScreen_),this.primaryScreen_.textAttributes.reset(),this.clearHome(this.alternateScreen_),this.alternateScreen_.textAttributes.reset(),this.setCursorBlink(!!this.prefs_.get("cursor-blink")),this.vt.reset(),this.softReset()},r.Terminal.prototype.softReset=function(){this.options_=new r.Options,this.options_.cursorBlink=!!this.timeouts_.cursorBlink,this.primaryScreen_.textAttributes.resetColorPalette(),this.alternateScreen_.textAttributes.resetColorPalette(),this.setVTScrollRegion(null,null),this.setCursorVisible(!0)},r.Terminal.prototype.forwardTabStop=function(){for(var e=this.screen_.cursorPosition.column,t=0;te)return void this.setCursorColumn(this.tabStops_[t]);var r=this.screen_.cursorPosition.overflow;this.setCursorColumn(this.screenSize.width-1),this.screen_.cursorPosition.overflow=r},r.Terminal.prototype.backwardTabStop=function(){for(var e=this.screen_.cursorPosition.column,t=this.tabStops_.length-1;t>=0;t--)if(this.tabStops_[t]=0;t--){if(this.tabStops_[t]==e)return;if(this.tabStops_[t]0){var s=this.screen_.shiftRows(n);Array.prototype.push.apply(this.scrollbackRows_,s),this.scrollPort_.isScrolledEnd&&this.scheduleScrollDown_()}t>=this.screen_.rowsArray.length&&(t=this.screen_.rowsArray.length-1),this.setAbsoluteCursorPosition(t,0)},r.Terminal.prototype.moveRows_=function(e,t,r){var i,o,n=this.screen_.removeRows(e,t);this.screen_.insertRows(r,n),e=this.screenSize.width&&(a=!0,s=this.screenSize.width-this.screen_.cursorPosition.column),a&&!this.options_.wraparound?(n=t.wc.substr(e,i,s-1)+t.wc.substr(e,o-1),s=o):n=t.wc.substr(e,i,s);for(var c=r.TextAttributes.splitWidecharString(n),l=0;l=0;o--)this.setAbsoluteCursorPosition(t+o,0),this.screen_.clearCursorRow()},r.Terminal.prototype.deleteLines=function(e){var t=this.saveCursor(),r=t.row,i=this.getVTScrollBottom(),o=i-r+1,n=i-(e=Math.min(e,o))+1;e!=o&&this.moveRows_(r,e,n);for(var s=0;st)this.setCssVar("cursor-offset-row","-1");else{this.options_.cursorVisible&&"none"==this.cursorNode_.style.display&&(this.cursorNode_.style.display=""),this.setCssVar("cursor-offset-row",r-e+" + "+`${this.scrollPort_.visibleRowTopMargin}px`),this.setCssVar("cursor-offset-col",this.screen_.cursorPosition.column),this.cursorNode_.setAttribute("title","("+this.screen_.cursorPosition.column+", "+this.screen_.cursorPosition.row+")");var i=this.document_.getSelection();i&&i.isCollapsed&&this.screen_.syncSelectionCaret(i)}},r.Terminal.prototype.restyleCursor_=function(){var e=this.cursorShape_;"false"==this.cursorNode_.getAttribute("focus")&&(e=r.Terminal.cursorShape.BLOCK);var t=this.cursorNode_.style;switch(e){case r.Terminal.cursorShape.BEAM:t.height="var(--hterm-charsize-height)",t.backgroundColor="transparent",t.borderBottomStyle=null,t.borderLeftStyle="solid";break;case r.Terminal.cursorShape.UNDERLINE:t.height=this.scrollPort_.characterSize.baseline+"px",t.backgroundColor="transparent",t.borderBottomStyle="solid",t.borderLeftStyle=null;break;default:t.height="var(--hterm-charsize-height)",t.backgroundColor=this.cursorColor_,t.borderBottomStyle=null,t.borderLeftStyle=null}},r.Terminal.prototype.scheduleSyncCursorPosition_=function(){if(!this.timeouts_.syncCursor){var e=this;this.timeouts_.syncCursor=setTimeout((function(){e.syncCursorPosition_(),delete e.timeouts_.syncCursor}),0)}},r.Terminal.prototype.showZoomWarning_=function(e){if(!this.zoomWarningNode_){if(!e)return;this.zoomWarningNode_=this.document_.createElement("div"),this.zoomWarningNode_.id="hterm:zoom-warning",this.zoomWarningNode_.style.cssText="color: black;background-color: #ff2222;font-size: large;border-radius: 8px;opacity: 0.75;padding: 0.2em 0.5em 0.2em 0.5em;top: 0.5em;right: 1.2em;position: absolute;-webkit-text-size-adjust: none;-webkit-user-select: none;-moz-text-size-adjust: none;-moz-user-select: none;",this.zoomWarningNode_.addEventListener("click",(function(e){this.parentNode.removeChild(this)}))}this.zoomWarningNode_.textContent=t.MessageManager.replaceReferences(r.zoomWarningMessage,[parseInt(100*this.scrollPort_.characterSize.zoomFactor)]),this.zoomWarningNode_.style.fontFamily=this.prefs_.get("font-family"),e?this.zoomWarningNode_.parentNode||this.div_.parentNode.appendChild(this.zoomWarningNode_):this.zoomWarningNode_.parentNode&&this.zoomWarningNode_.parentNode.removeChild(this.zoomWarningNode_)},r.Terminal.prototype.showOverlay=function(e,t){if(!this.overlayNode_){if(!this.div_)return;this.overlayNode_=this.document_.createElement("div"),this.overlayNode_.style.cssText="border-radius: 15px;font-size: xx-large;opacity: 0.75;padding: 0.2em 0.5em 0.2em 0.5em;position: absolute;-webkit-user-select: none;-webkit-transition: opacity 180ms ease-in;-moz-user-select: none;-moz-transition: opacity 180ms ease-in;",this.overlayNode_.addEventListener("mousedown",(function(e){e.preventDefault(),e.stopPropagation()}),!0)}this.overlayNode_.style.color=this.prefs_.get("background-color"),this.overlayNode_.style.backgroundColor=this.prefs_.get("foreground-color"),this.overlayNode_.style.fontFamily=this.prefs_.get("font-family"),this.overlayNode_.textContent=e,this.overlayNode_.style.opacity="0.75",this.overlayNode_.parentNode||this.div_.appendChild(this.overlayNode_);var i=r.getClientSize(this.div_),o=r.getClientSize(this.overlayNode_);this.overlayNode_.style.top=(i.height-o.height)/2+"px",this.overlayNode_.style.left=(i.width-o.width-this.scrollPort_.currentScrollbarWidthPx)/2+"px";var n=this;this.overlayTimeout_&&clearTimeout(this.overlayTimeout_),null!==t&&(this.overlayTimeout_=setTimeout((function(){n.overlayNode_.style.opacity="0",n.overlayTimeout_=setTimeout((function(){n.overlayNode_.parentNode&&n.overlayNode_.parentNode.removeChild(n.overlayNode_),n.overlayTimeout_=null,n.overlayNode_.style.opacity="0.75"}),200)}),t||1500))},r.Terminal.prototype.paste=function(){return r.pasteFromClipboard(this.document_)},r.Terminal.prototype.copyStringToClipboard=function(e){this.prefs_.get("enable-clipboard-notice")&&setTimeout(this.showOverlay.bind(this,r.notifyCopyMessage,500),200);var t=this.document_.createElement("pre");t.id="hterm:copy-to-clipboard-source",t.textContent=e,t.style.cssText="-webkit-user-select: text;-moz-user-select: text;position: absolute;top: -99px",this.document_.body.appendChild(t);var i=this.document_.getSelection(),o=i.anchorNode,n=i.anchorOffset,s=i.focusNode,a=i.focusOffset;i.selectAllChildren(t),r.copySelectionToClipboard(this.document_),i.extend&&(i.collapse(o,n),i.extend(s,a)),t.parentNode.removeChild(t)},r.Terminal.prototype.getSelectionText=function(){var e=this.scrollPort_.selection;if(e.sync(),e.isCollapsed)return null;var i=e.startOffset,o=e.startNode;if("X-ROW"!=o.nodeName)for("#text"==o.nodeName&&"SPAN"==o.parentNode.nodeName&&(o=o.parentNode);o.previousSibling;)o=o.previousSibling,i+=r.TextAttributes.nodeWidth(o);var n=r.TextAttributes.nodeWidth(e.endNode)-e.endOffset;if("X-ROW"!=(o=e.endNode).nodeName)for("#text"==o.nodeName&&"SPAN"==o.parentNode.nodeName&&(o=o.parentNode);o.nextSibling;)o=o.nextSibling,n+=r.TextAttributes.nodeWidth(o);var s=this.getRowsText(e.startRow.rowIndex,e.endRow.rowIndex+1);return t.wc.substring(s,i,t.wc.strWidth(s)-n)},r.Terminal.prototype.copySelectionToClipboard=function(){var e=this.getSelectionText();null!=e&&this.copyStringToClipboard(e)},r.Terminal.prototype.overlaySize=function(){this.showOverlay(this.screenSize.width+"x"+this.screenSize.height)},r.Terminal.prototype.onVTKeystroke=function(e){this.scrollOnKeystroke_&&this.scrollPort_.scrollRowToBottom(this.getRowCount()),this.io.onVTKeystroke(this.keyboard.encode(e))},r.Terminal.prototype.openUrl=function(e){window.chrome&&window.chrome.browser?chrome.browser.openTab({url:e}):window.open(e,"_blank").focus()},r.Terminal.prototype.openSelectedUrl_=function(){var e=this.getSelectionText();if((null!=e||(this.screen_.expandSelection(this.document_.getSelection()),null!=(e=this.getSelectionText())))&&!(e.length>2048||e.search(/[\s\[\](){}<>"'\\^`]/)>=0)){if(e.search("^[a-zA-Z][a-zA-Z0-9+.-]*://")<0)switch(e.split(":",1)[0]){case"mailto":break;default:e="http://"+e}this.openUrl(e)}},r.Terminal.prototype.onMouse_=function(e){if(!e.processedByTerminalHandler_){var r=!this.defeatMouseReports_&&this.vt.mouseReport!=this.vt.MOUSE_REPORT_DISABLED;if(e.processedByTerminalHandler_=!0,e.terminalRow=parseInt((e.clientY-this.scrollPort_.visibleRowTopMargin)/this.scrollPort_.characterSize.height)+1,e.terminalColumn=parseInt(e.clientX/this.scrollPort_.characterSize.width)+1,!("mousedown"==e.type&&e.terminalColumn>this.screenSize.width)){if(this.options_.cursorVisible&&!r&&(e.terminalRow-1==this.screen_.cursorPosition.row&&e.terminalColumn-1==this.screen_.cursorPosition.column?this.cursorNode_.style.display="none":"none"==this.cursorNode_.style.display&&(this.cursorNode_.style.display="")),"mousedown"==e.type&&(e.altKey||!r?(this.defeatMouseReports_=!0,this.setSelectionEnabled(!0)):(this.defeatMouseReports_=!1,this.document_.getSelection().collapseToEnd(),this.setSelectionEnabled(!1),e.preventDefault())),r)this.scrollBlockerNode_.engaged||("mousedown"==e.type?(this.scrollBlockerNode_.engaged=!0,this.scrollBlockerNode_.style.top=e.clientY-5+"px",this.scrollBlockerNode_.style.left=e.clientX-5+"px"):"mousemove"==e.type&&(this.document_.getSelection().collapseToEnd(),e.preventDefault())),this.onMouse(e);else{if("dblclick"==e.type&&this.copyOnSelect&&(this.screen_.expandSelection(this.document_.getSelection()),this.copySelectionToClipboard(this.document_)),"click"==e.type&&!e.shiftKey&&(e.ctrlKey||e.metaKey))return clearTimeout(this.timeouts_.openUrl),void(this.timeouts_.openUrl=setTimeout(this.openSelectedUrl_.bind(this),500));if("mousedown"==e.type&&(this.mouseRightClickPaste&&2==e.button||e.button==this.mousePasteButton)&&(this.paste()||console.warning("Could not paste manually due to web restrictions")),"mouseup"==e.type&&0==e.button&&this.copyOnSelect&&!this.document_.getSelection().isCollapsed&&this.copySelectionToClipboard(this.document_),"mousemove"!=e.type&&"mouseup"!=e.type||!this.scrollBlockerNode_.engaged||(this.scrollBlockerNode_.engaged=!1,this.scrollBlockerNode_.style.top="-99px"),this.scrollWheelArrowKeys_&&!e.shiftKey&&this.keyboard.applicationCursor&&!this.isPrimaryScreen()&&"wheel"==e.type){var i=this.scrollPort_.scrollWheelDelta(e),o=t.f.smartFloorDivide(Math.abs(i),this.scrollPort_.characterSize.height),n="O"+(i<0?"B":"A");this.io.sendString(n.repeat(o)),e.preventDefault()}}"mouseup"==e.type&&this.document_.getSelection().isCollapsed&&(this.defeatMouseReports_=!1)}}},r.Terminal.prototype.onMouse=function(e){},r.Terminal.prototype.onFocusChange_=function(e){this.cursorNode_.setAttribute("focus",e),this.restyleCursor_(),!0===e&&this.closeBellNotifications_()},r.Terminal.prototype.onScroll_=function(){this.scheduleSyncCursorPosition_()},r.Terminal.prototype.onPaste_=function(e){var t=e.text.replace(/\n/gm,"\r");t=this.keyboard.encode(t),this.options_.bracketedPaste&&(t="[200~"+t+"[201~"),this.io.sendString(t)},r.Terminal.prototype.onCopy_=function(e){this.useDefaultWindowCopy||(e.preventDefault(),setTimeout(this.copySelectionToClipboard.bind(this),0))},r.Terminal.prototype.onResize_=function(){var e=Math.floor(this.scrollPort_.getScreenWidth()/this.scrollPort_.characterSize.width)||0,r=t.f.smartFloorDivide(this.scrollPort_.getScreenHeight(),this.scrollPort_.characterSize.height)||0;if(!(e<=0||r<=0)){var i=e!=this.screenSize.width||r!=this.screenSize.height;this.realizeSize_(e,r),this.showZoomWarning_(1!=this.scrollPort_.characterSize.zoomFactor),i&&this.overlaySize(),this.restyleCursor_(),this.scheduleSyncCursorPosition_()}},r.Terminal.prototype.onCursorBlink_=function(){this.options_.cursorBlink?"false"==this.cursorNode_.getAttribute("focus")||"0"==this.cursorNode_.style.opacity?(this.cursorNode_.style.opacity="1",this.timeouts_.cursorBlink=setTimeout(this.myOnCursorBlink_,this.cursorBlinkCycle_[0])):(this.cursorNode_.style.opacity="0",this.timeouts_.cursorBlink=setTimeout(this.myOnCursorBlink_,this.cursorBlinkCycle_[1])):delete this.timeouts_.cursorBlink},r.Terminal.prototype.setScrollbarVisible=function(e){this.scrollPort_.setScrollbarVisible(e)},r.Terminal.prototype.setScrollWheelMoveMultipler=function(e){this.scrollPort_.setScrollWheelMoveMultipler(e)},r.Terminal.prototype.closeBellNotifications_=function(){this.bellNotificationList_.forEach((function(e){e.close()})),this.bellNotificationList_.length=0},t.rtdep("lib.encodeUTF8"),r.Terminal.IO=function(e){this.terminal_=e,this.previousIO_=null},r.Terminal.IO.prototype.showOverlay=function(e,t){this.terminal_.showOverlay(e,t)},r.Terminal.IO.prototype.createFrame=function(e,t){return new r.Frame(this.terminal_,e,t)},r.Terminal.IO.prototype.setTerminalProfile=function(e){this.terminal_.setProfile(e)},r.Terminal.IO.prototype.push=function(){var e=new r.Terminal.IO(this.terminal_);return e.keyboardCaptured_=this.keyboardCaptured_,e.columnCount=this.columnCount,e.rowCount=this.rowCount,e.previousIO_=this.terminal_.io,this.terminal_.io=e,e},r.Terminal.IO.prototype.pop=function(){this.terminal_.io=this.previousIO_},r.Terminal.IO.prototype.sendString=function(e){console.log("Unhandled sendString: "+e)},r.Terminal.IO.prototype.onVTKeystroke=function(e){console.log("Unobserverd VT keystroke: "+JSON.stringify(e))},r.Terminal.IO.prototype.onTerminalResize_=function(e,t){for(var r=this;r;)r.columnCount=e,r.rowCount=t,r=r.previousIO_;this.onTerminalResize(e,t)},r.Terminal.IO.prototype.onTerminalResize=function(e,t){},r.Terminal.IO.prototype.writeUTF8=function(e){if(this.terminal_.io!=this)throw"Attempt to print from inactive IO object.";this.terminal_.interpret(e)},r.Terminal.IO.prototype.writelnUTF8=function(e){if(this.terminal_.io!=this)throw"Attempt to print from inactive IO object.";this.terminal_.interpret(e+"\r\n")},r.Terminal.IO.prototype.print=r.Terminal.IO.prototype.writeUTF16=function(e){this.writeUTF8(t.encodeUTF8(e))},r.Terminal.IO.prototype.println=r.Terminal.IO.prototype.writelnUTF16=function(e){this.writelnUTF8(t.encodeUTF8(e))},t.rtdep("lib.colors"),r.TextAttributes=function(e){this.document_=e,this.foregroundSource=this.SRC_DEFAULT,this.backgroundSource=this.SRC_DEFAULT,this.foreground=this.DEFAULT_COLOR,this.background=this.DEFAULT_COLOR,this.defaultForeground="rgb(255, 255, 255)",this.defaultBackground="rgb(0, 0, 0)",this.bold=!1,this.faint=!1,this.italic=!1,this.blink=!1,this.underline=!1,this.strikethrough=!1,this.inverse=!1,this.invisible=!1,this.wcNode=!1,this.asciiNode=!0,this.tileData=null,this.colorPalette=null,this.resetColorPalette()},r.TextAttributes.prototype.enableBold=!0,r.TextAttributes.prototype.enableBoldAsBright=!0,r.TextAttributes.prototype.DEFAULT_COLOR=t.f.createEnum(""),r.TextAttributes.prototype.SRC_DEFAULT="default",r.TextAttributes.prototype.SRC_RGB="rgb",r.TextAttributes.prototype.setDocument=function(e){this.document_=e},r.TextAttributes.prototype.clone=function(){var e=new r.TextAttributes(null);for(var t in this)e[t]=this[t];return e.colorPalette=this.colorPalette.concat(),e},r.TextAttributes.prototype.reset=function(){this.foregroundSource=this.SRC_DEFAULT,this.backgroundSource=this.SRC_DEFAULT,this.foreground=this.DEFAULT_COLOR,this.background=this.DEFAULT_COLOR,this.bold=!1,this.faint=!1,this.italic=!1,this.blink=!1,this.underline=!1,this.strikethrough=!1,this.inverse=!1,this.invisible=!1,this.wcNode=!1,this.asciiNode=!0},r.TextAttributes.prototype.resetColorPalette=function(){this.colorPalette=t.colors.colorPalette.concat(),this.syncColors()},r.TextAttributes.prototype.isDefault=function(){return this.foregroundSource==this.SRC_DEFAULT&&this.backgroundSource==this.SRC_DEFAULT&&!this.bold&&!this.faint&&!this.italic&&!this.blink&&!this.underline&&!this.strikethrough&&!this.inverse&&!this.invisible&&!this.wcNode&&this.asciiNode&&null==this.tileData},r.TextAttributes.prototype.createContainer=function(e){if(this.isDefault())return this.document_.createTextNode(e);var t=this.document_.createElement("span"),r=t.style,i=[];this.foreground!=this.DEFAULT_COLOR&&(r.color=this.foreground),this.background!=this.DEFAULT_COLOR&&(r.backgroundColor=this.background),this.enableBold&&this.bold&&(r.fontWeight="bold"),this.faint&&(t.faint=!0),this.italic&&(r.fontStyle="italic"),this.blink&&(i.push("blink-node"),t.blinkNode=!0);var o="";return this.underline&&(o+=" underline",t.underline=!0),this.strikethrough&&(o+=" line-through",t.strikethrough=!0),o&&(r.textDecoration=o),this.wcNode&&(i.push("wc-node"),t.wcNode=!0,t.asciiNode=!1),null!=this.tileData&&(i.push("tile"),i.push("tile_"+this.tileData),t.tileNode=!0),e&&(t.textContent=e),i.length&&(t.className=i.join(" ")),t},r.TextAttributes.prototype.matchesContainer=function(e){if("string"==typeof e||3==e.nodeType)return this.isDefault();var t=e.style;return!(this.wcNode||e.wcNode||this.asciiNode!=this.asciiNode||null!=this.tileData||e.tileNode||this.foreground!=t.color||this.background!=t.backgroundColor||(this.enableBold&&this.bold)!=!!t.fontWeight||this.blink!=e.blinkNode||this.italic!=!!t.fontStyle||!!this.underline!=!!e.underline||!!this.strikethrough!=!!e.strikethrough)},r.TextAttributes.prototype.setDefaults=function(e,t){this.defaultForeground=e,this.defaultBackground=t,this.syncColors()},r.TextAttributes.prototype.syncColors=function(){var e,r=this.foregroundSource,i=this.backgroundSource,o=this.DEFAULT_COLOR,n=this.DEFAULT_COLOR;if(this.inverse&&(r=this.backgroundSource,i=this.foregroundSource,o=this.defaultBackground,n=this.defaultForeground),this.enableBoldAsBright&&this.bold&&r!=this.SRC_DEFAULT&&r!=this.SRC_RGB&&(r=(e=r)<8?e+8:e),this.invisible&&(r=i,o=this.defaultBackground),r!=this.SRC_RGB&&(this.foreground=r==this.SRC_DEFAULT?o:this.colorPalette[r]),this.faint&&!this.invisible){var s=this.foreground==this.DEFAULT_COLOR?this.defaultForeground:this.foreground;this.foreground=t.colors.mix(s,"rgb(0, 0, 0)",.3333)}i!=this.SRC_RGB&&(this.background=i==this.SRC_DEFAULT?n:this.colorPalette[i])},r.TextAttributes.containersMatch=function(e,t){if("string"==typeof e)return r.TextAttributes.containerIsDefault(t);if(e.nodeType!=t.nodeType)return!1;if(3==e.nodeType)return!0;var i=e.style,o=t.style;return i.color==o.color&&i.backgroundColor==o.backgroundColor&&i.fontWeight==o.fontWeight&&i.fontStyle==o.fontStyle&&i.textDecoration==o.textDecoration},r.TextAttributes.containerIsDefault=function(e){return"string"==typeof e||3==e.nodeType},r.TextAttributes.nodeWidth=function(e){return e.asciiNode?e.textContent.length:t.wc.strWidth(e.textContent)},r.TextAttributes.nodeSubstr=function(e,r,i){return e.asciiNode?e.textContent.substr(r,i):t.wc.substr(e.textContent,r,i)},r.TextAttributes.nodeSubstring=function(e,r,i){return e.asciiNode?e.textContent.substring(r,i):t.wc.substring(e.textContent,r,i)},r.TextAttributes.splitWidecharString=function(e){for(var r=[],i=0,o=0,n=!0,s=0;s0?0:1),s|=i,r=""+String.fromCharCode(s)+o+n,e.preventDefault();break;case"mousedown":var s=Math.min(e.button,2)+32;s|=i,r=""+String.fromCharCode(s)+o+n;break;case"mouseup":r="#"+o+n;break;case"mousemove":this.mouseReport==this.MOUSE_REPORT_DRAG&&e.buttons&&(s=32,1&e.buttons?s+=0:4&e.buttons?s+=1:2&e.buttons?s+=2:s+=3,s+=32,s|=i,r=""+String.fromCharCode(s)+o+n);break;case"click":case"dblclick":break;default:console.error("Unknown mouse event: "+e.type,e)}r&&this.terminal.io.sendString(r)}},r.VT.prototype.interpret=function(e){for(this.parseState_.resetBuf(this.decode(e));!this.parseState_.isComplete();){var t=this.parseState_.func,r=this.parseState_.pos;if(e=this.parseState_.buf,this.parseState_.func.call(this,this.parseState_),this.parseState_.func==t&&this.parseState_.pos==r&&this.parseState_.buf==e)throw"Parser did not alter the state!"}},r.VT.prototype.decode=function(e){return"utf-8"==this.characterEncoding?this.decodeUTF8(e):e},r.VT.prototype.encodeUTF8=function(e){return t.encodeUTF8(e)},r.VT.prototype.decodeUTF8=function(e){return this.utf8Decoder_.decode(e)},r.VT.prototype.setEncoding=function(e){switch(e){default:console.warn('Invalid value for "terminal-encoding": '+e);case"iso-2022":this.codingSystemUtf8_=!1,this.codingSystemLocked_=!1;break;case"utf-8-locked":this.codingSystemUtf8_=!0,this.codingSystemLocked_=!0;break;case"utf-8":this.codingSystemUtf8_=!0,this.codingSystemLocked_=!1}this.updateEncodingState_()},r.VT.prototype.updateEncodingState_=function(){var e=Object.keys(r.VT.CC1).filter((e=>!this.codingSystemUtf8_||e.charCodeAt()<128)).map((e=>"\\x"+t.f.zpad(e.charCodeAt().toString(16),2))).join("");this.cc1Pattern_=new RegExp(`[${e}]`)},r.VT.prototype.parseUnknown_=function(e){var t=this;function r(e){!t.codingSystemUtf8_&&t[t.GL].GL&&(e=t[t.GL].GL(e)),t.terminal.print(e)}var i=e.peekRemainingBuf(),o=i.search(this.cc1Pattern_);return 0==o?(this.dispatch("CC1",i.substr(0,1),e),void e.advance(1)):-1==o?(r(i),void e.reset()):(r(i.substr(0,o)),this.dispatch("CC1",i.substr(o,1),e),void e.advance(o+1))},r.VT.prototype.parseCSI_=function(e){var t=e.peekChar(),r=e.args;t>="@"&&t<="~"?(this.dispatch("CSI",this.leadingModifier_+this.trailingModifier_+t,e),e.resetParseFunction()):";"==t?this.trailingModifier_?e.resetParseFunction():(r.length||r.push(""),r.push("")):t>="0"&&t<="9"?this.trailingModifier_?e.resetParseFunction():r.length?r[r.length-1]+=t:r[0]=t:t>=" "&&t<="?"&&":"!=t?r.length?this.trailingModifier_+=t:this.leadingModifier_+=t:this.cc1Pattern_.test(t)?this.dispatch("CC1",t,e):e.resetParseFunction(),e.advance(1)},r.VT.prototype.parseUntilStringTerminator_=function(e){var t,r=e.peekRemainingBuf(),i=r.search(/(\x1b\\|\x07)/),o=e.args;return o.length||(o[0]="",o[1]=new Date),-1==i?(o[0]+=r,o[0].length>this.maxStringSequence&&(t="too long: "+o[0].length),-1!=o[0].indexOf("")&&(t="embedded escape: "+o[0].indexOf("")),new Date-o[1]>this.oscTimeLimit_&&(t="timeout expired: "+new Date-o[1]),t?(console.log("parseUntilStringTerminator_: aborting: "+t,o[0]),e.reset(o[0]),!1):(e.advance(r.length),!0)):o[0].length+i>this.maxStringSequence?(e.reset(o[0]+r),!1):(o[0]+=r.substr(0,i),e.resetParseFunction(),e.advance(i+(""==r.substr(i,1)?2:1)),!0)},r.VT.prototype.dispatch=function(e,t,i){var o=r.VT[e][t];o?o!=r.VT.ignore?"CC1"==e&&t>""&&!this.enable8BitControl?console.warn("Ignoring 8-bit control code: 0x"+t.charCodeAt(0).toString(16)):o.apply(this,[i,t]):this.warnUnimplemented&&console.warn("Ignored "+e+" code: "+JSON.stringify(t)):this.warnUnimplemented&&console.warn("Unknown "+e+" code: "+JSON.stringify(t))},r.VT.prototype.setANSIMode=function(e,t){4==e?this.terminal.setInsertMode(t):20==e?this.terminal.setAutoCarriageReturn(t):this.warnUnimplemented&&console.warn("Unimplemented ANSI Mode: "+e)},r.VT.prototype.setDECMode=function(e,t){switch(parseInt(e,10)){case 1:this.terminal.keyboard.applicationCursor=t;break;case 3:this.allowColumnWidthChanges_&&(this.terminal.setWidth(t?132:80),this.terminal.clearHome(),this.terminal.setVTScrollRegion(null,null));break;case 5:this.terminal.setReverseVideo(t);break;case 6:this.terminal.setOriginMode(t);break;case 7:this.terminal.setWraparound(t);break;case 12:this.enableDec12&&this.terminal.setCursorBlink(t);break;case 25:this.terminal.setCursorVisible(t);break;case 30:this.terminal.setScrollbarVisible(t);break;case 40:this.terminal.allowColumnWidthChanges_=t;break;case 45:this.terminal.setReverseWraparound(t);break;case 67:this.terminal.keyboard.backspaceSendsBackspace=t;break;case 1e3:this.mouseReport=t?this.MOUSE_REPORT_CLICK:this.MOUSE_REPORT_DISABLED,this.terminal.syncMouseStyle();break;case 1002:this.mouseReport=t?this.MOUSE_REPORT_DRAG:this.MOUSE_REPORT_DISABLED,this.terminal.syncMouseStyle();break;case 1010:this.terminal.scrollOnOutput=t;break;case 1011:this.terminal.scrollOnKeystroke=t;break;case 1036:this.terminal.keyboard.metaSendsEscape=t;break;case 1039:t?this.terminal.keyboard.previousAltSendsWhat_||(this.terminal.keyboard.previousAltSendsWhat_=this.terminal.keyboard.altSendsWhat,this.terminal.keyboard.altSendsWhat="escape"):this.terminal.keyboard.previousAltSendsWhat_&&(this.terminal.keyboard.altSendsWhat=this.terminal.keyboard.previousAltSendsWhat_,this.terminal.keyboard.previousAltSendsWhat_=null);break;case 47:case 1047:this.terminal.setAlternateMode(t);break;case 1048:this.savedState_.save();case 1049:t?(this.savedState_.save(),this.terminal.setAlternateMode(t),this.terminal.clear()):(this.terminal.setAlternateMode(t),this.savedState_.restore());break;case 2004:this.terminal.setBracketedPaste(t);break;default:this.warnUnimplemented&&console.warn("Unimplemented DEC Private Mode: "+e)}},r.VT.ignore=function(){},r.VT.CC1={},r.VT.ESC={},r.VT.CSI={},r.VT.OSC={},r.VT.VT52={},r.VT.CC1["\0"]=r.VT.ignore,r.VT.CC1[""]=r.VT.ignore,r.VT.CC1[""]=function(){this.terminal.ringBell()},r.VT.CC1["\b"]=function(){this.terminal.cursorLeft(1)},r.VT.CC1["\t"]=function(){this.terminal.forwardTabStop()},r.VT.CC1["\n"]=function(){this.terminal.formFeed()},r.VT.CC1["\v"]=r.VT.CC1["\n"],r.VT.CC1["\f"]=r.VT.CC1["\n"],r.VT.CC1["\r"]=function(){this.terminal.setCursorColumn(0)},r.VT.CC1[""]=function(){this.GL="G1"},r.VT.CC1[""]=function(){this.GL="G0"},r.VT.CC1[""]=r.VT.ignore,r.VT.CC1[""]=r.VT.ignore,r.VT.CC1[""]=function(e){"G1"==this.GL&&(this.GL="G0"),e.resetParseFunction(),this.terminal.print("?")},r.VT.CC1[""]=r.VT.CC1[""],r.VT.CC1[""]=function(e){e.func=function e(t){var r=t.consumeChar();""!=r&&(this.dispatch("ESC",r,t),t.func==e&&t.resetParseFunction())}},r.VT.CC1[""]=r.VT.ignore,r.VT.CC1["„"]=r.VT.ESC.D=function(){this.terminal.lineFeed()},r.VT.CC1["…"]=r.VT.ESC.E=function(){this.terminal.setCursorColumn(0),this.terminal.cursorDown(1)},r.VT.CC1["ˆ"]=r.VT.ESC.H=function(){this.terminal.setTabStop(this.terminal.getCursorColumn())},r.VT.CC1[""]=r.VT.ESC.M=function(){this.terminal.reverseLineFeed()},r.VT.CC1["Ž"]=r.VT.ESC.N=r.VT.ignore,r.VT.CC1[""]=r.VT.ESC.O=r.VT.ignore,r.VT.CC1[""]=r.VT.ESC.P=function(e){e.resetArguments(),e.func=this.parseUntilStringTerminator_},r.VT.CC1["–"]=r.VT.ESC.V=r.VT.ignore,r.VT.CC1["—"]=r.VT.ESC.W=r.VT.ignore,r.VT.CC1["˜"]=r.VT.ESC.X=r.VT.ignore,r.VT.CC1["š"]=r.VT.ESC.Z=function(){this.terminal.io.sendString("[?1;2c")},r.VT.CC1["›"]=r.VT.ESC["["]=function(e){e.resetArguments(),this.leadingModifier_="",this.trailingModifier_="",e.func=this.parseCSI_},r.VT.CC1["œ"]=r.VT.ESC["\\"]=r.VT.ignore,r.VT.CC1[""]=r.VT.ESC["]"]=function(e){e.resetArguments(),e.func=function e(t){if(this.parseUntilStringTerminator_(t)&&t.func!=e){var r=t.args[0].match(/^(\d+);(.*)$/);r?(t.args[0]=r[2],this.dispatch("OSC",r[1],t)):console.warn("Invalid OSC: "+JSON.stringify(t.args[0]))}}},r.VT.CC1["ž"]=r.VT.ESC["^"]=function(e){e.resetArguments(),e.func=this.parseUntilStringTerminator_},r.VT.CC1["Ÿ"]=r.VT.ESC._=function(e){e.resetArguments(),e.func=this.parseUntilStringTerminator_},r.VT.ESC[" "]=function(e){e.func=function(e){var t=e.consumeChar();this.warnUnimplemented&&console.warn("Unimplemented sequence: ESC 0x20 "+t),e.resetParseFunction()}},r.VT.ESC["#"]=function(e){e.func=function(e){"8"==e.consumeChar()&&this.terminal.fill("E"),e.resetParseFunction()}},r.VT.ESC["%"]=function(e){e.func=function(e){var t=e.consumeChar();if(this.codingSystemLocked_)return"/"==t&&e.consumeChar(),void e.resetParseFunction();switch(t){case"@":this.setEncoding("iso-2022");break;case"G":this.setEncoding("utf-8");break;case"/":switch(t=e.consumeChar()){case"G":case"H":case"I":this.setEncoding("utf-8-locked");break;default:this.warnUnimplemented&&console.warn("Unknown ESC % / argument: "+JSON.stringify(t))}break;default:this.warnUnimplemented&&console.warn("Unknown ESC % argument: "+JSON.stringify(t))}e.resetParseFunction()}},r.VT.ESC["("]=r.VT.ESC[")"]=r.VT.ESC["*"]=r.VT.ESC["+"]=r.VT.ESC["-"]=r.VT.ESC["."]=r.VT.ESC["/"]=function(e,t){e.func=function(e){var r=e.consumeChar();if(""==r)return e.resetParseFunction(),void e.func();var i=this.characterMaps.getMap(r);void 0!==i?"("==t?this.G0=i:")"==t||"-"==t?this.G1=i:"*"==t||"."==t?this.G2=i:"+"!=t&&"/"!=t||(this.G3=i):this.warnUnimplemented&&console.log('Invalid character set for "'+t+'": '+r),e.resetParseFunction()}},r.VT.ESC[6]=r.VT.ignore,r.VT.ESC[7]=function(){this.savedState_.save()},r.VT.ESC[8]=function(){this.savedState_.restore()},r.VT.ESC[9]=r.VT.ignore,r.VT.ESC["="]=function(){this.terminal.keyboard.applicationKeypad=!0},r.VT.ESC[">"]=function(){this.terminal.keyboard.applicationKeypad=!1},r.VT.ESC.F=r.VT.ignore,r.VT.ESC.c=function(){this.reset(),this.terminal.reset()},r.VT.ESC.l=r.VT.ESC.m=r.VT.ignore,r.VT.ESC.n=function(){this.GL="G2"},r.VT.ESC.o=function(){this.GL="G3"},r.VT.ESC["|"]=function(){this.GR="G3"},r.VT.ESC["}"]=function(){this.GR="G2"},r.VT.ESC["~"]=function(){this.GR="G1"},r.VT.OSC[0]=function(e){this.terminal.setWindowTitle(e.args[0])},r.VT.OSC[2]=r.VT.OSC[0],r.VT.OSC[4]=function(e){for(var r=e.args[0].split(";"),i=parseInt(r.length/2),o=this.terminal.getTextAttributes().colorPalette,n=[],s=0;s=o.length||("?"!=c?(c=t.colors.x11ToCSS(c))&&(o[a]=c):(c=t.colors.rgbToX11(o[a]))&&n.push(a+";"+c))}n.length&&this.terminal.io.sendString("]4;"+n.join(";")+"")},r.VT.OSC[9]=function(e){r.notify({body:e.args[0]})},r.VT.OSC[10]=function(e){var i=e.args[0].split(";");if(i){var o=t.colors.x11ToCSS(i.shift());o&&this.terminal.setForegroundColor(o),i.length>0&&(e.args[0]=i.join(";"),r.VT.OSC[11].apply(this,[e]))}},r.VT.OSC[11]=function(e){var r=e.args[0].split(";");if(r){var i=t.colors.x11ToCSS(r.shift());i&&this.terminal.setBackgroundColor(i)}},r.VT.OSC[50]=function(e){var t=e.args[0].match(/CursorShape=(.)/i);if(t)switch(t[1]){case"1":this.terminal.setCursorShape(r.Terminal.cursorShape.BEAM);break;case"2":this.terminal.setCursorShape(r.Terminal.cursorShape.UNDERLINE);break;default:this.terminal.setCursorShape(r.Terminal.cursorShape.BLOCK)}else console.warn("Could not parse OSC 50 args: "+e.args[0])},r.VT.OSC[52]=function(e){var t=e.args[0].match(/^[cps01234567]*;(.*)/);if(t){var r=window.atob(t[1]);r&&this.terminal.copyStringToClipboard(this.decode(r))}},r.VT.OSC[777]=function(e){var t;switch(e.args[0].split(";",1)[0]){case"notify":var i,o;(t=e.args[0].match(/^[^;]+;([^;]*)(;([\s\S]*))?$/))&&(i=t[1],o=t[3]),r.notify({title:i,body:o});break;default:console.warn("Unknown urxvt module: "+e.args[0])}},r.VT.CSI["@"]=function(e){this.terminal.insertSpace(e.iarg(0,1))},r.VT.CSI.A=function(e){this.terminal.cursorUp(e.iarg(0,1))},r.VT.CSI.B=function(e){this.terminal.cursorDown(e.iarg(0,1))},r.VT.CSI.C=function(e){this.terminal.cursorRight(e.iarg(0,1))},r.VT.CSI.D=function(e){this.terminal.cursorLeft(e.iarg(0,1))},r.VT.CSI.E=function(e){this.terminal.cursorDown(e.iarg(0,1)),this.terminal.setCursorColumn(0)},r.VT.CSI.F=function(e){this.terminal.cursorUp(e.iarg(0,1)),this.terminal.setCursorColumn(0)},r.VT.CSI.G=function(e){this.terminal.setCursorColumn(e.iarg(0,1)-1)},r.VT.CSI.H=function(e){this.terminal.setCursorPosition(e.iarg(0,1)-1,e.iarg(1,1)-1)},r.VT.CSI.I=function(e){var r=e.iarg(0,1);r=t.f.clamp(r,1,this.terminal.screenSize.width);for(var i=0;iT"]=r.VT.ignore,r.VT.CSI.X=function(e){this.terminal.eraseToRight(e.iarg(0,1))},r.VT.CSI.Z=function(e){var r=e.iarg(0,1);r=t.f.clamp(r,1,this.terminal.screenSize.width);for(var i=0;ic"]=function(e){this.terminal.io.sendString("[>0;256;0c")},r.VT.CSI.d=function(e){this.terminal.setAbsoluteCursorRow(e.iarg(0,1)-1)},r.VT.CSI.f=r.VT.CSI.H,r.VT.CSI.g=function(e){e.args[0]&&0!=e.args[0]?3==e.args[0]&&this.terminal.clearAllTabStops():this.terminal.clearTabStopAtCursor(!1)},r.VT.CSI.h=function(e){for(var t=0;t=i.colorPalette.length)continue;i.foregroundSource=a}else if(39==n)i.foregroundSource=i.SRC_DEFAULT;else if(n<48)i.backgroundSource=n-40;else if(48==n){var s;if(null!=(s=r(o)))i.backgroundSource=i.SRC_RGB,i.background=s,o+=5;else{var a;if(null==(a=t(o)))break;if(o+=2,a>=i.colorPalette.length)continue;i.backgroundSource=a}}else i.backgroundSource=i.SRC_DEFAULT;else n>=90&&n<=97?i.foregroundSource=n-90+8:n>=100&&n<=107&&(i.backgroundSource=n-100+8)}i.setDefaults(this.terminal.getForegroundColor(),this.terminal.getBackgroundColor())}else i.reset()},r.VT.CSI[">m"]=r.VT.ignore,r.VT.CSI.n=function(e){if(5==e.args[0])this.terminal.io.sendString("0n");else if(6==e.args[0]){var t=this.terminal.getCursorRow()+1,r=this.terminal.getCursorColumn()+1;this.terminal.io.sendString("["+t+";"+r+"R")}},r.VT.CSI[">n"]=r.VT.ignore,r.VT.CSI["?n"]=function(e){if(6==e.args[0]){var t=this.terminal.getCursorRow()+1,r=this.terminal.getCursorColumn()+1;this.terminal.io.sendString("["+t+";"+r+"R")}else 15==e.args[0]?this.terminal.io.sendString("[?11n"):25==e.args[0]?this.terminal.io.sendString("[?21n"):26==e.args[0]?this.terminal.io.sendString("[?12;1;0;0n"):53==e.args[0]&&this.terminal.io.sendString("[?50n")},r.VT.CSI[">p"]=r.VT.ignore,r.VT.CSI["!p"]=function(){this.reset(),this.terminal.softReset()},r.VT.CSI.$p=r.VT.ignore,r.VT.CSI["?$p"]=r.VT.ignore,r.VT.CSI['"p']=r.VT.ignore,r.VT.CSI.q=r.VT.ignore,r.VT.CSI[" q"]=function(e){var t=e.args[0];0==t||1==t?(this.terminal.setCursorShape(r.Terminal.cursorShape.BLOCK),this.terminal.setCursorBlink(!0)):2==t?(this.terminal.setCursorShape(r.Terminal.cursorShape.BLOCK),this.terminal.setCursorBlink(!1)):3==t?(this.terminal.setCursorShape(r.Terminal.cursorShape.UNDERLINE),this.terminal.setCursorBlink(!0)):4==t?(this.terminal.setCursorShape(r.Terminal.cursorShape.UNDERLINE),this.terminal.setCursorBlink(!1)):5==t?(this.terminal.setCursorShape(r.Terminal.cursorShape.BEAM),this.terminal.setCursorBlink(!0)):6==t?(this.terminal.setCursorShape(r.Terminal.cursorShape.BEAM),this.terminal.setCursorBlink(!1)):console.warn("Unknown cursor style: "+t)},r.VT.CSI['"q']=r.VT.ignore,r.VT.CSI.r=function(e){var t=e.args,r=t[0]?parseInt(t[0],10)-1:null,i=t[1]?parseInt(t[1],10)-1:null;this.terminal.setVTScrollRegion(r,i),this.terminal.setCursorPosition(0,0)},r.VT.CSI["?r"]=r.VT.ignore,r.VT.CSI.$r=r.VT.ignore,r.VT.CSI.s=function(){this.savedState_.save()},r.VT.CSI["?s"]=r.VT.ignore,r.VT.CSI.t=r.VT.ignore,r.VT.CSI.$t=r.VT.ignore,r.VT.CSI[">t"]=r.VT.ignore,r.VT.CSI[" t"]=r.VT.ignore,r.VT.CSI.u=function(){this.savedState_.restore()},r.VT.CSI[" u"]=r.VT.ignore,r.VT.CSI.$v=r.VT.ignore,r.VT.CSI["'w"]=r.VT.ignore,r.VT.CSI.x=r.VT.ignore,r.VT.CSI["*x"]=r.VT.ignore,r.VT.CSI.$x=r.VT.ignore,r.VT.CSI.z=function(e){if(!(e.args.length<1)){var t=e.args[0];if(0==t){if(e.args.length<2)return;this.terminal.getTextAttributes().tileData=e.args[1]}else 1==t&&(this.terminal.getTextAttributes().tileData=null)}},r.VT.CSI["'z"]=r.VT.ignore,r.VT.CSI.$z=r.VT.ignore,r.VT.CSI["'{"]=r.VT.ignore,r.VT.CSI["'|"]=r.VT.ignore,r.VT.CSI["'}"]=r.VT.ignore,r.VT.CSI["'~"]=r.VT.ignore,t.rtdep("lib.f"),r.VT.CharacterMap=function(e,t){this.description=e,this.GL=null,this.glmapBase_=t,this.sync_()},r.VT.CharacterMap.prototype.sync_=function(e){if(!this.glmapBase_&&!e)return this.GL=null,delete this.glmap_,void delete this.glre_;this.glmap_=e?Object.assign({},this.glmapBase_,e):this.glmapBase_;var r=Object.keys(this.glmap_).map((e=>"\\x"+t.f.zpad(e.charCodeAt(0).toString(16))));this.glre_=new RegExp("["+r.join("")+"]","g"),this.GL=e=>e.replace(this.glre_,(e=>this.glmap_[e]))},r.VT.CharacterMap.prototype.reset=function(){this.glmap_!==this.glmapBase_&&this.sync_()},r.VT.CharacterMap.prototype.setOverrides=function(e){this.sync_(e)},r.VT.CharacterMap.prototype.clone=function(){var e=new r.VT.CharacterMap(this.description,this.glmapBase_);return this.glmap_!==this.glmapBase_&&e.setOverrides(this.glmap_),e},r.VT.CharacterMaps=function(){this.maps_=r.VT.CharacterMaps.DefaultMaps,this.mapsBase_=this.maps_},r.VT.CharacterMaps.prototype.getMap=function(e){return this.maps_.hasOwnProperty(e)?this.maps_[e]:void 0},r.VT.CharacterMaps.prototype.addMap=function(e,t){this.maps_===this.mapsBase_&&(this.maps_=Object.assign({},this.mapsBase_)),this.maps_[e]=t},r.VT.CharacterMaps.prototype.reset=function(){this.maps_!==r.VT.CharacterMaps.DefaultMaps&&(this.maps_=r.VT.CharacterMaps.DefaultMaps)},r.VT.CharacterMaps.prototype.setOverrides=function(e){for(var t in this.maps_===this.mapsBase_&&(this.maps_=Object.assign({},this.mapsBase_)),e){var i=this.getMap(t);void 0!==i?(this.maps_[t]=i.clone(),this.maps_[t].setOverrides(e[t])):this.addMap(t,new r.VT.CharacterMap("user "+t,e[t]))}},r.VT.CharacterMaps.DefaultMaps={},r.VT.CharacterMaps.DefaultMaps[0]=new r.VT.CharacterMap("graphic",{"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"}),r.VT.CharacterMaps.DefaultMaps.A=new r.VT.CharacterMap("british",{"#":"£"}),r.VT.CharacterMaps.DefaultMaps.B=new r.VT.CharacterMap("us",null),r.VT.CharacterMaps.DefaultMaps[4]=new r.VT.CharacterMap("dutch",{"#":"£","@":"¾","[":"IJ","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"}),r.VT.CharacterMaps.DefaultMaps.C=r.VT.CharacterMaps.DefaultMaps[5]=new r.VT.CharacterMap("finnish",{"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"}),r.VT.CharacterMaps.DefaultMaps.R=new r.VT.CharacterMap("french",{"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"}),r.VT.CharacterMaps.DefaultMaps.Q=new r.VT.CharacterMap("french canadian",{"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"}),r.VT.CharacterMaps.DefaultMaps.K=new r.VT.CharacterMap("german",{"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"}),r.VT.CharacterMaps.DefaultMaps.Y=new r.VT.CharacterMap("italian",{"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"}),r.VT.CharacterMaps.DefaultMaps.E=r.VT.CharacterMaps.DefaultMaps[6]=new r.VT.CharacterMap("norwegian/danish",{"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"}),r.VT.CharacterMaps.DefaultMaps.Z=new r.VT.CharacterMap("spanish",{"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"}),r.VT.CharacterMaps.DefaultMaps[7]=r.VT.CharacterMaps.DefaultMaps.H=new r.VT.CharacterMap("swedish",{"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"}),r.VT.CharacterMaps.DefaultMaps["="]=new r.VT.CharacterMap("swiss",{"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}),t.resource.add("hterm/audio/bell","audio/ogg;base64","T2dnUwACAAAAAAAAAADhqW5KAAAAAMFvEjYBHgF2b3JiaXMAAAAAAYC7AAAAAAAAAHcBAAAAAAC4AU9nZ1MAAAAAAAAAAAAA4aluSgEAAAAAesI3EC3//////////////////8kDdm9yYmlzHQAAAFhpcGguT3JnIGxpYlZvcmJpcyBJIDIwMDkwNzA5AAAAAAEFdm9yYmlzKUJDVgEACAAAADFMIMWA0JBVAAAQAABgJCkOk2ZJKaWUoSh5mJRISSmllMUwiZiUicUYY4wxxhhjjDHGGGOMIDRkFQAABACAKAmOo+ZJas45ZxgnjnKgOWlOOKcgB4pR4DkJwvUmY26mtKZrbs4pJQgNWQUAAAIAQEghhRRSSCGFFGKIIYYYYoghhxxyyCGnnHIKKqigggoyyCCDTDLppJNOOumoo4466ii00EILLbTSSkwx1VZjrr0GXXxzzjnnnHPOOeecc84JQkNWAQAgAAAEQgYZZBBCCCGFFFKIKaaYcgoyyIDQkFUAACAAgAAAAABHkRRJsRTLsRzN0SRP8ixREzXRM0VTVE1VVVVVdV1XdmXXdnXXdn1ZmIVbuH1ZuIVb2IVd94VhGIZhGIZhGIZh+H3f933f930gNGQVACABAKAjOZbjKaIiGqLiOaIDhIasAgBkAAAEACAJkiIpkqNJpmZqrmmbtmirtm3LsizLsgyEhqwCAAABAAQAAAAAAKBpmqZpmqZpmqZpmqZpmqZpmqZpmmZZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZlmVZQGjIKgBAAgBAx3Ecx3EkRVIkx3IsBwgNWQUAyAAACABAUizFcjRHczTHczzHczxHdETJlEzN9EwPCA1ZBQAAAgAIAAAAAABAMRzFcRzJ0SRPUi3TcjVXcz3Xc03XdV1XVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVYHQkFUAAAQAACGdZpZqgAgzkGEgNGQVAIAAAAAYoQhDDAgNWQUAAAQAAIih5CCa0JrzzTkOmuWgqRSb08GJVJsnuamYm3POOeecbM4Z45xzzinKmcWgmdCac85JDJqloJnQmnPOeRKbB62p0ppzzhnnnA7GGWGcc85p0poHqdlYm3POWdCa5qi5FJtzzomUmye1uVSbc84555xzzjnnnHPOqV6czsE54Zxzzonam2u5CV2cc875ZJzuzQnhnHPOOeecc84555xzzglCQ1YBAEAAAARh2BjGnYIgfY4GYhQhpiGTHnSPDpOgMcgppB6NjkZKqYNQUhknpXSC0JBVAAAgAACEEFJIIYUUUkghhRRSSCGGGGKIIaeccgoqqKSSiirKKLPMMssss8wyy6zDzjrrsMMQQwwxtNJKLDXVVmONteaec645SGultdZaK6WUUkoppSA0ZBUAAAIAQCBkkEEGGYUUUkghhphyyimnoIIKCA1ZBQAAAgAIAAAA8CTPER3RER3RER3RER3RER3P8RxREiVREiXRMi1TMz1VVFVXdm1Zl3Xbt4Vd2HXf133f141fF4ZlWZZlWZZlWZZlWZZlWZZlCUJDVgEAIAAAAEIIIYQUUkghhZRijDHHnINOQgmB0JBVAAAgAIAAAAAAR3EUx5EcyZEkS7IkTdIszfI0T/M00RNFUTRNUxVd0RV10xZlUzZd0zVl01Vl1XZl2bZlW7d9WbZ93/d93/d93/d93/d939d1IDRkFQAgAQCgIzmSIimSIjmO40iSBISGrAIAZAAABACgKI7iOI4jSZIkWZImeZZniZqpmZ7pqaIKhIasAgAAAQAEAAAAAACgaIqnmIqniIrniI4oiZZpiZqquaJsyq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7rukBoyCoAQAIAQEdyJEdyJEVSJEVyJAcIDVkFAMgAAAgAwDEcQ1Ikx7IsTfM0T/M00RM90TM9VXRFFwgNWQUAAAIACAAAAAAAwJAMS7EczdEkUVIt1VI11VItVVQ9VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV1TRN0zSB0JCVAAAZAAAjQQYZhBCKcpBCbj1YCDHmJAWhOQahxBiEpxAzDDkNInSQQSc9uJI5wwzz4FIoFURMg40lN44gDcKmXEnlOAhCQ1YEAFEAAIAxyDHEGHLOScmgRM4xCZ2UyDknpZPSSSktlhgzKSWmEmPjnKPSScmklBhLip2kEmOJrQAAgAAHAIAAC6HQkBUBQBQAAGIMUgophZRSzinmkFLKMeUcUko5p5xTzjkIHYTKMQadgxAppRxTzinHHITMQeWcg9BBKAAAIMABACDAQig0ZEUAECcA4HAkz5M0SxQlSxNFzxRl1xNN15U0zTQ1UVRVyxNV1VRV2xZNVbYlTRNNTfRUVRNFVRVV05ZNVbVtzzRl2VRV3RZV1bZl2xZ+V5Z13zNNWRZV1dZNVbV115Z9X9ZtXZg0zTQ1UVRVTRRV1VRV2zZV17Y1UXRVUVVlWVRVWXZlWfdVV9Z9SxRV1VNN2RVVVbZV2fVtVZZ94XRVXVdl2fdVWRZ+W9eF4fZ94RhV1dZN19V1VZZ9YdZlYbd13yhpmmlqoqiqmiiqqqmqtm2qrq1bouiqoqrKsmeqrqzKsq+rrmzrmiiqrqiqsiyqqiyrsqz7qizrtqiquq3KsrCbrqvrtu8LwyzrunCqrq6rsuz7qizruq3rxnHrujB8pinLpqvquqm6um7runHMtm0co6rqvirLwrDKsu/rui+0dSFRVXXdlF3jV2VZ921fd55b94WybTu/rfvKceu60vg5z28cubZtHLNuG7+t+8bzKz9hOI6lZ5q2baqqrZuqq+uybivDrOtCUVV9XZVl3zddWRdu3zeOW9eNoqrquirLvrDKsjHcxm8cuzAcXds2jlvXnbKtC31jyPcJz2vbxnH7OuP2daOvDAnHjwAAgAEHAIAAE8pAoSErAoA4AQAGIecUUxAqxSB0EFLqIKRUMQYhc05KxRyUUEpqIZTUKsYgVI5JyJyTEkpoKZTSUgehpVBKa6GU1lJrsabUYu0gpBZKaS2U0lpqqcbUWowRYxAy56RkzkkJpbQWSmktc05K56CkDkJKpaQUS0otVsxJyaCj0kFIqaQSU0mptVBKa6WkFktKMbYUW24x1hxKaS2kEltJKcYUU20txpojxiBkzknJnJMSSmktlNJa5ZiUDkJKmYOSSkqtlZJSzJyT0kFIqYOOSkkptpJKTKGU1kpKsYVSWmwx1pxSbDWU0lpJKcaSSmwtxlpbTLV1EFoLpbQWSmmttVZraq3GUEprJaUYS0qxtRZrbjHmGkppraQSW0mpxRZbji3GmlNrNabWam4x5hpbbT3WmnNKrdbUUo0txppjbb3VmnvvIKQWSmktlNJiai3G1mKtoZTWSiqxlZJabDHm2lqMOZTSYkmpxZJSjC3GmltsuaaWamwx5ppSi7Xm2nNsNfbUWqwtxppTS7XWWnOPufVWAADAgAMAQIAJZaDQkJUAQBQAAEGIUs5JaRByzDkqCULMOSepckxCKSlVzEEIJbXOOSkpxdY5CCWlFksqLcVWaykptRZrLQAAoMABACDABk2JxQEKDVkJAEQBACDGIMQYhAYZpRiD0BikFGMQIqUYc05KpRRjzknJGHMOQioZY85BKCmEUEoqKYUQSkklpQIAAAocAAACbNCUWByg0JAVAUAUAABgDGIMMYYgdFQyKhGETEonqYEQWgutddZSa6XFzFpqrbTYQAithdYySyXG1FpmrcSYWisAAOzAAQDswEIoNGQlAJAHAEAYoxRjzjlnEGLMOegcNAgx5hyEDirGnIMOQggVY85BCCGEzDkIIYQQQuYchBBCCKGDEEIIpZTSQQghhFJK6SCEEEIppXQQQgihlFIKAAAqcAAACLBRZHOCkaBCQ1YCAHkAAIAxSjkHoZRGKcYglJJSoxRjEEpJqXIMQikpxVY5B6GUlFrsIJTSWmw1dhBKaS3GWkNKrcVYa64hpdZirDXX1FqMteaaa0otxlprzbkAANwFBwCwAxtFNicYCSo0ZCUAkAcAgCCkFGOMMYYUYoox55xDCCnFmHPOKaYYc84555RijDnnnHOMMeecc845xphzzjnnHHPOOeecc44555xzzjnnnHPOOeecc84555xzzgkAACpwAAAIsFFkc4KRoEJDVgIAqQAAABFWYowxxhgbCDHGGGOMMUYSYowxxhhjbDHGGGOMMcaYYowxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGGFtrrbXWWmuttdZaa6211lprrQBAvwoHAP8HG1ZHOCkaCyw0ZCUAEA4AABjDmHOOOQYdhIYp6KSEDkIIoUNKOSglhFBKKSlzTkpKpaSUWkqZc1JSKiWlllLqIKTUWkottdZaByWl1lJqrbXWOgiltNRaa6212EFIKaXWWostxlBKSq212GKMNYZSUmqtxdhirDGk0lJsLcYYY6yhlNZaazHGGGstKbXWYoy1xlprSam11mKLNdZaCwDgbnAAgEiwcYaVpLPC0eBCQ1YCACEBAARCjDnnnHMQQgghUoox56CDEEIIIURKMeYcdBBCCCGEjDHnoIMQQgghhJAx5hx0EEIIIYQQOucchBBCCKGEUkrnHHQQQgghlFBC6SCEEEIIoYRSSikdhBBCKKGEUkopJYQQQgmllFJKKaWEEEIIoYQSSimllBBCCKWUUkoppZQSQgghlFJKKaWUUkIIoZRQSimllFJKCCGEUkoppZRSSgkhhFBKKaWUUkopIYQSSimllFJKKaUAAIADBwCAACPoJKPKImw04cIDUGjISgCADAAAcdhq6ynWyCDFnISWS4SQchBiLhFSijlHsWVIGcUY1ZQxpRRTUmvonGKMUU+dY0oxw6yUVkookYLScqy1dswBAAAgCAAwECEzgUABFBjIAIADhAQpAKCwwNAxXAQE5BIyCgwKx4Rz0mkDABCEyAyRiFgMEhOqgaJiOgBYXGDIB4AMjY20iwvoMsAFXdx1IIQgBCGIxQEUkICDE2544g1PuMEJOkWlDgIAAAAA4AAAHgAAkg0gIiKaOY4Ojw+QEJERkhKTE5QAAAAAALABgA8AgCQFiIiIZo6jw+MDJERkhKTE5AQlAAAAAAAAAAAACAgIAAAAAAAEAAAACAhPZ2dTAAQYOwAAAAAAAOGpbkoCAAAAmc74DRgyNjM69TAzOTk74dnLubewsbagmZiNp4d0KbsExSY/I3XUTwJgkeZdn1HY4zoj33/q9DFtv3Ui1/jmx7lCUtPt18/sYf9MkgAsAGRBd3gMGP4sU+qCPYBy9VrA3YqJosW3W2/ef1iO/u3cg8ZG/57jU+pPmbGEJUgkfnaI39DbPqxddZphbMRmCc5rKlkUMkyx8iIoug5dJv1OYH9a59c+3Gevqc7Z2XFdDjL/qHztRfjWEWxJ/aiGezjohu9HsCZdQBKbiH0VtU/3m85lDG2T/+xkZcYnX+E+aqzv/xTgOoTFG+x7SNqQ4N+oAABSxuVXw77Jd5bmmTmuJakX7509HH0kGYKvARPpwfOSAPySPAc2EkneDwB2HwAAJlQDYK5586N79GJCjx4+p6aDUd27XSvRyXLJkIC5YZ1jLv5lpOhZTz0s+DmnF1diptrnM6UDgIW11Xh8cHTd0/SmbgOAdxcyWwMAAGIrZ3fNSfZbzKiYrK4+tPqtnMVLOeWOG2kVvUY+p2PJ/hkCl5aFRO4TLGYPZcIU3vYM1hohS4jHFlnyW/2T5J7kGsShXWT8N05V+3C/GPqJ1QdWisGPxEzHqXISBPIinWDUt7IeJv/f5OtzBxpTzZZQ+CYEhHXfqG4aABQli72GJhN4oJv+hXcApAJSErAW8G2raAX4NUcABnVt77CzZAB+LsHcVe+Q4h+QB1wh/ZrJTPxSBdI8mgTeAdTsQOoFUEng9BHcVPhxSRRYkKWZJXOFYP6V4AEripJoEjXgA2wJRZHSExmJDm8F0A6gEXsg5a4ZsALItrMB7+fh7UKLvYWSdtsDwFf1mzYzS1F82N1h2Oyt2e76B1QdS0SAsQigLPMOgJS9JRC7hFXA6kUsLFNKD5cA5cTRvgSqPc3Fl99xW3QTi/MHR8DEm6WnvaVQATwRqRKjywQ9BrrhugR2AKTsPQeQckrAOgDOhbTESyrXQ50CkNpXdtWjW7W2/3UjeX3U95gIdalfRAoAmqUEiwp53hCdcCwlg47fcbfzlmQMAgaBkh7c+fcDgF+ifwDXfzegLPcLYJsAAJQArTXjnh/uXGy3v1Hk3pV6/3t5ruW81f6prfbM2Q3WNVy98BwUtbCwhFhAWuPev6Oe/4ZaFQUcgKrVs4defzh1TADA1DEh5b3VlDaECw5b+bPfkKos3tIAue3vJZOih3ga3l6O3PSfIkrLv0PAS86PPdL7g8oc2KteNFKKzKRehOv2gJoFLBPXmaXvPBQILgJon0bbWBszrYZYYwE7jl2j+vTdU7Vpk21LiU0QajPkywAAHqbUC0/YsYOdb4e6BOp7E0cCi04Ao/TgD8ZVAMid6h/A8IeBNkp6/xsAACZELEYIk+yvI6Qz1NN6lIftB/6IMWjWJNOqPTMedAmyaj6Es0QBklJpiSWWHnQ2CoYbGWAmt+0gLQBFKCBnp2QUUQZ/1thtZDBJUpFWY82z34ocorB62oX7qB5y0oPAv/foxH25wVmgIHf2xFOr8leZcBq1Kx3ZvCq9Bga639AxuHuPNL/71YCF4EywJpqHFAX6XF0sjVbuANnvvdLcrufYwOM/iDa6iA468AYAAB6mNBMXcgTD8HSRqJ4vw8CjAlCEPACASlX/APwPOJKl9xQAAAPmnev2eWp33Xgyw3Dvfz6myGk3oyP8YTKsCOvzAgALQi0o1c6Nzs2O2Pg2h4ACIJAgAGP0aNn5x0BDgVfH7u2TtyfDcRIuYAyQhBF/lvSRAttgA6TPbWZA9gaUrZWAUEAA+Dx47Q3/r87HxUUqZmB0BmUuMlojFjHt1gDunnvuX8MImsjSq5WkzSzGS62OEIlOufWWezxWpv6FBgDgJVltfXFYtNAAnqU0xQoD0YLiXo5cF5QV4CnY1tBLAkZCOABAhbk/AM+/AwSCCdlWAAAMcFjS7owb8GVDzveDiZvznbt2tF4bL5odN1YKl88TAEABCZvufq9YCTBtMwVAQUEAwGtNltzSaHvADYC3TxLVjqiRA+OZAMhzcqEgRcAOwoCgvdTxsTHLQEF6+oOb2+PAI8ciPQcXg7pOY+LjxQSv2fjmFuj34gGwz310/bGK6z3xgT887eomWULEaDd04wHetYxdjcgV2SxvSwn0VoZXJRqkRC5ASQ/muVoAUsX7AgAQMBNaVwAAlABRxT/1PmfqLqSRNDbhXb07berpB3b94jpuWEZjBCD2OcdXFpCKEgCDfcFPMw8AAADUwT4lnUm50lmwrpMMhPQIKj6u0E8fr2vGBngMNdIlrZsigjahljud6AFVg+tzXwUnXL3TJLpajaWKA4VAAAAMiFfqJgKAZ08XrtS3dxtQNYcpPvYEG8ClvrQRJgBephwnNWJjtGqmp6VEPSvBe7EBiU3qgJbQAwD4Le8LAMDMhHbNAAAlgK+tFs5O+YyJc9yCnJa3rxLPulGnxwsXV9Fsk2k4PisCAHC8FkwbGE9gJQAAoMnyksj0CdFMZLLgoz8M+FxziwYBgIx+zHiCBAKAlBKNpF1sO9JpVcyEi9ar15YlHgrut5fPJnkdJ6vEwZPyAHQBIEDUrlMcBAAd2KAS0Qq+JwRsE4AJZtMnAD6GnOYwYlOIZvtzUNdjreB7fiMkWI0CmBB6AIAKc38A9osEFlTSGECB+cbeRDC0aRpLHqNPplcK/76Lxn2rpmqyXsYJWRi/FQAAAKBQk9MCAOibrQBQADCDsqpooPutd+05Ce9g6iEdiYXgVmQAI4+4wskEBEiBloNQ6Ki0/KTQ0QjWfjxzi+AeuXKoMjEVfQOZzr0y941qLgM2AExvbZOqcxZ6J6krlrj4y2j9AdgKDx6GnJsVLhbc42uq584+ouSdNBpoCiCVHrz+WzUA/DDtD8ATgA3h0lMCAAzcFv+S+fSSNkeYWlTpb34mf2RfmqqJeMeklhHAfu7VoAEACgAApKRktL+KkQDWMwYCUAAAAHCKsp80xhp91UjqQBw3x45cetqkjQEyu3G9B6N+R650Uq8OVig7wOm6Wun0ea4lKDPoabJs6aLqgbhPzpv4KR4iODilw88ZpY7q1IOMcbASAOAVtmcCnobcrkG4KGS7/ZnskVWRNF9J0RUHKOnByy9WA8Dv6L4AAARMCQUA4GritfVM2lcZfH3Q3T/vZ47J2YHhcmBazjfdyuV25gLAzrc0cwAAAAAYCh6PdwAAAGyWjFW4yScjaWa2mGcofHxWxewKALglWBpLUvwwk+UOh5eNGyUOs1/EF+pZr+ud5OzoGwYdAABg2p52LiSgAY/ZVlOmilEgHn6G3OcwYjzI7vOj1t6xsx4S3lBY96EUQBF6AIBAmPYH4PoGYCoJAADWe+OZJZi7/x76/yH7Lzf9M5XzRKnFPmveMsilQHwVAAAAAKB3LQD8PCIAAADga0QujBLywzeJ4a6Z/ERVBAUlAEDqvoM7BQBAuAguzFqILtmjH3Kd4wfKobnOhA3z85qWoRPm9hwoOHoDAAlCbwDAA56FHAuXflHo3fe2ttG9XUDeA9YmYCBQ0oPr/1QC8IvuCwAAApbUAQCK22MmE3O78VAbHQT9PIPNoT9zNc3l2Oe7TAVLANBufT8MAQAAAGzT4PS8AQAAoELGHb2uaCwwEv1EWhFriUkbAaAZ27/fVZnTZXbWz3BwWpjUaMZKRj7dZ0J//gUeTdpVEwAAZOFsNxKAjQSgA+ABPoY8Jj5y2wje81jsXc/1TOQWTDYZBmAkNDiqVwuA2NJ9AQAAEBKAt9Vrsfs/2N19MO91S9rd8EHTZHnzC5MYmfQEACy/FBcAAADA5c4gi4z8RANs/m6FNXVo9DV46JG1BBDukqlw/Va5G7QbuGVSI+2aZaoLXJrdVj2zlC9Z5QEAEFz/5QzgVZwAAAAA/oXcxyC6WfTu+09Ve/c766J4VTAGUFmA51+VANKi/QPoPwYgYAkA715OH4S0s5KDHvj99MMq8TPFc3roKZnGOoT1bmIhVgc7XAMBAAAAAMAW1VbQw3gapzOpJd+Kd2fc4iSO62fJv9+movui1wUNPAj059N3OVxzk4gV73PmE8FIA2F5mRq37Evc76vLXfF4rD5UJJAw46hW6LZCb5sNLdx+kzMCAAB+hfy95+965ZCLP7B3/VlTHCvDEKtQhTm4KiCgAEAbrfbWTPssAAAAXpee1tVrozYYn41wD1aeYtkKfswN5/SXPO0JDnhO/4laUortv/s412fybe/nONdncoCHnBVliu0CQGBWlPY/5Kwom2L/kruPM6Q7oz4tvDQy+bZ3HzOi+gNHA4DZEgA="),t.resource.add("hterm/images/icon-96","image/png;base64","iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAFKhJREFUeNrtXXlsXMd5/30z8649uDzEmxRFibIsOXZ8VInTJFYSW3actE1ctWkctEF6I0VRFEWAoihQoAjQFmiBogWaIEADFCmQXklto04TO0ndWI4bxZalWHJinTYtkRJFkctzl9zd977+8c49+UjuipbCD1y+9+ae75vvmJlv3gO2YRu2YRu2YRu2YUuAtroBN3nfeKsaSXWurarvRvUrTnlccV/5a3lDReRKFdc4Za6nzvW2b7OIpwZh7N37iHYiPztyvy4iqA00Tng/WXH1f3GQsFki0Qbz+cAV12jeRkTwwUd2yfsVI89OjbLrwnoJILw8EoAOIAFgLwDTCxcAJBEJIiIAgoiICAIgIgIBJGpdPRCRq3sPCBAJAii8QgAk/PIFkSBBQvh3QRkQXtECBKpxH9br5hMikhcg4QV4dYkgARFBSkmlUmnp7LmLX8rl8q95OPKJ0DQCkPeTEcQrAD179+7+7LsP3vtJw9A1ZvbwFfQM/r1/AyD64KLBv5JHIaIwIpI5GIbevd82r0I3OMjvJfOo5ffCqw1EhIRlQQi3a37p0atfTVB22PhIuHt95tnnBr75zHN/AGASoYjyxVVTCOCPfOWN9sGfue+df/L4r3z8MSGUOv3aWYDIq43BEXXEQRPCQK5qFleFMdduOwMV3WKUBXFVyVXhtm3jrjtvw13vuL1uPXGAAUghkGlLPXJ9ZvZzL738oz8HsOhFF2u3aH0E8JEvAWhe+n2PHD70Z7/xmccfLBSK9M1nX0AqnYFSKiB7fIiOzg3k21BeYHW1gMkr1/DBB+6HkGLTxmRfbxf9+qc/8WszM9lzF99468twxZCAq5wbQiMCREWPBkDXde3eI489+he/+1u/et/c3AK+/uSzyLTvgK7rm+tBE4CZA1HRaFT7oqNQKCCdsqBp61GD9eHBD77XunJ16o/+6q+/cLJYLP2fhzfGGkRYiwBRK2fnL/3iRz7/uT/8nfuuz2Txla8+hXRbJ6QUKBaLuJmgVLJRKuShlIBpatiEFApACIFHH/lA//NHj33qe0ePvQJXEa/JnHEIoABYd925/zOPf+JjBxMJC//yxX+GYaZgGAZse00ue1uByyWMQrGEldVVKCWbQgAA6OnegQP7997zvaPH2gGsIpQidWuoRwA/o2/bDz70off+nFIa/fczz2Pq2hzSbRksLCxsNT43BI7jYCW/ihd/cBKWZTZhQcFV9qMjQ0gmEwm4hkqsOVEjDogq37bOjvaElBKLizmYVgKWZW01HjeOLGaAbUipoJTWHAKwa4KYpmHCJUB0lQCoU0scK0gCMJRSqqOjHel0EqZpIpFIbDUeNwwOM2y7gO4dnWhrSzVFBDEzMpkULNM04BIgFsS1ggxNUzKVSiCRsEBEUEoFiRq2v5HNXjMd18pSHVeZnuuniZaopIIQBAIhnUqgvb1tU3OBKFiWCdMydABWBH+bIoCvA3RNU9KyDOiahG2XAAAzszO4NHkZINcKALuddRHi3VWFReLcWy8dhxO5aFpvkhamD5HFwQQuStgwLPpsOza45GD/yD4MDw2jVCrCMHSkUwmws3kCMADD0GCZpialMG3bia4trVsJ+xkJAKSUStM0oWsSQrgTGdu2MXllEmezF/HRhz+C4b6hyEgrnyjVLLzhcho1iFsDiGomOzt+Ds/8z7PIzmfR39eP1dVVSOEijR0nRsFrg1ISpmkoQ9cTufxKrBbHmoUoJZWmlPDXRZgdMDNsx8HuXbtx3zvvhRQKTdFmLQACoT2dwY9efRWlvA1m1xJy2IEggkPrnUvXB9M0lGkaiVx+xR/ADQuPRQAppaY0JfzOBB0joFAs4Oyb59E0Y7pF4DDDdmw47LgygQHbbs7Ij4JpGMIwjGRFcF0xFJcDdE0pUb3YQ1hYWsDFSxff7vgHMyO3kkMGiaAPzScAwzB0YVlmAuHo3zQHkKaUppTHAUQBLQnAYm4J41feCldAGeHe2FaCq9fdXQMP8qt5sB6OlGbP4pkBwzBgGHoKMdcIG82Ew0RK6UqTxHAJEHSBCLmVHCavXwUcwGpXMJIS2YnVhrq01cAOQxkC7YMG5i6vwi65LV4trIK10GJyHLvpTTR0DZZlJtEEMxR+IVJJTSlFAFdZL47joFgswrEZ3X06Dv3eAH787Vm8/t0s8nMld9PjBhHCN1G7dlm490g3rIzCt/5yHIWiA5dxGQ5HOcBpatuYGZquwTSNTXMAogVoSukuAXwlzFUpSRCyl1cx+VoOBz/Zi93vyeDE16bx1iuLsIsOSLSWCuwwEh0a9h/uxDs+2gWnxDj+79dQKjhlg4bZl/vkiaDmtkvXNFimmURMJ4VYOkBpSldSug91TDYiIDdXwtEvTeDNlxZw3y/34PDnduLCi/M4+eQ0Zt5cCdI1G/FKFxg5mME9R7rRMWTi/AtzOPnENLKXV2tyrA+lFqzkKk3BNI0k3BWE5swDXA7wlm0bFEkEODbjzWPzmDqTw4HDnbjz57swdHcKp56+jte/k0VurtRUInSPJXD3Y90YfXcbZt7I49t/M45LJ5ZgF7lMAbsN9BfiXE5uthXEzFBK+TpAhrVunAAEeEp4DQ4oyyQI+fkSjn/tGsZfWcA9j3Xjvk/0Yte72vD8FyZw/Y2VauRsAA483ImDn+oF28DL/zqFn3wni/xcESSoTvkExxdBBNilFnCAlLBMM+Hhdk3HtThoIE1TulTuDlscAgAuNxCA6XN5HP+Pa8heWsHAgSQyA0ZzFr8IGHhHCukeHedfmMOpb8wgly021jXkTsjYm9C0YjNJSgFvHuAP7qbMA3TpcwAo1ooDOwwjKTH2QDvu/lg3lCnwg69cxcSpJc8dZJPgACeeuAYhgf0Pd6JjyMArX5/GlZ8sg23U5TCf+ESt0QFCCFiWYcF131kT4lhBpDSXAMy+Eq1PAXYAIYHBu9O490g3evclMf7yAk785zSuX8i7Y68ZOoCA6xdW8N2/u4TRd2dw75FuPPqnu3Dmu7N49RszWLiyGvgGRfM47HjNdzmg6U6kRLAs02wGAXwieBwgggoaMUD7oI67fmEHbjvUgfmrBTz395fw5ksLKK26pmgzO0wCsFcZ576XxeTpZdzxaCfu+HAXRg624eST0zh/dB6FXDjK3TUgVwQREUot0AFCEEx3U8ZoBgEAVwdoUnheFnWGLztA1y4Tj/zxCIyUwI+emsaPn5nF8qyvFFs0D/C805Zni3jpq1MY/+EC7jnSg/f+5gB69yXw/BcnYBfDIeMrYaLW6ACAYFmmjpi7YqpmCRWMq2maLgIOqFcUQ7MErp5ZxqmnZ0Jx0+IJWNBIr5qpszl852/fwp73ZNC3PwmhKCQAUWCGAu5MuNlriEQEy6zaFauLhHg6QClNejte9YQICcL1i3k8/4UJd/bZZHETGwGCYK8yzjw3h4vHFmAXym19dxfNE0EtcqkxTVPTdd0qFApRPNaEtcxQAiA0TelCeKvRDTSoXWTYJb5ho75Rq0kApbwDrphrOREd0Ip5AOBuyhiGHsttpB4BohiUmqZpgel4Mx1qournYCbcUg4wpLccUasVZVCLAJUZhKaUTp5hvTWCpXnAcEIOsG00fxuVYRq6MA3dX5JuCGt5xhEAqWkq4IC4M+GYbV0/bLJ6h92dmlaJIG9ThkyzbE9gQ0rYB6lpSgUc0CT8C0nQzPUvCDk2o7iysUU0gmsFcSCCnJZspeq6BtPUk3HSxrGChKZpmu/U2gwKsMPo2Z/E+397AELFL48EMHFqGd//x0k49gYwR+VWUGvmAQxD12GZZgox1tpiuSa6HOCJIJ8umxo5hELOxvSFPEiuIxcR5idXNzVqqwnQXBZghr8r5m/KbHgxzs+oNE1T/sBvhggiAcyOr+B//+FyUzsfD0ERM7RFIkjTgj2BNTmgnhUUXcd2N4SpBUp4C6DVHABmaEr5+8L+rtiGlTADUK4I8kJ8XeDDes/KAw37zPUSrYUn5tpJOJqE4ThOSACn+RzAAKSU/p7AmgI2phWkyeB4ZqQiAsFZtkFOZI+Ao7SgytVgeJoQVBkf+HRGrxVhVBFGqHj24imSP3psFUAylYCSEsWSDdu2y86WNQukuytmIdwVq3tSJo5zrtI0JUMjiAJzbrB/AA8YRnCWNnLON3JuFyEiIj8AZen9Vc0wL0JkRtMgGlfjDHBwDSLKzwp7dRZL+aYivZwAApZlWnAPt0TxuSYBKocCA1BKUxIgMBy0taUAOCiVikilUkin0/FbFnEz3xxQLGMg6rpemX9paQm37x2DlLLMU6IZIITwOUCraEAVERotR4ccoDQJAI7DGBrsx8MP3o+nv/V9dHf3BAc1IjguO00d+OpHffYrw5ir09WMi5wd4PC8QLDHXHGmIHr1G8dgsOOgoyOJB973LjR/KSLYFYtuymxYCZOUUtM8z2i/w48cPgTTMPDD46eQX1mG768Smqq+qAFEROwIQSASZVdBAiQIQggI8q7+c/AjSCEgZBgm/TgZ3stovKy4RsqzLBMjOweRSiXhNOFwRi0CmJbhE2BTm/KspNQ0pcrMVaUkDj/0fnzg0P0olkqhs+4a71xoeA0LKCurIrhmf2rJzca9cl0Um3U0qZoAqNwV25AS9pEdnA2IguM4kFLC95bYLPiiJYIjtEI83BggWKapCSEsx3E2txinlPJOx9z8k7AbBUTBSRkrl8tv+GUdDIClksphFsvL+ZacKLn1gL3V0DICrOuQXvSohUNE2rnz41QqcdPNtVsRGEBbOgnbdkjTVKUZWgWqRn4fHABOoVBcNE2ztHPnoL7NAfHANHS8dPzE0sxMdsILqvsGrXocEGRYXFx67fUz5y729e7Yw4ADjumb2AJoWq2xCtrwdh0TQRz74YmLpZI9HitHjTCCa0KZANKGoX88lUo+pCmlhBASYMmAjE76Ea4CoNyerDYuUZHRXwiq2Pan8r/yNkcMAiqvv+pwFFWmpQqbl6isaqoVVtajsJfB0piXwCEidhyHp6/PHpudnfs8gDm4b07xX+xXBnEW43jv2Ojo73/20x+ezc47Fy6MN/IOXZ+ZxBvIE6eeCovbn0FXzjXqt4urEsVlGsPQ8NFHP0RP/dez4sv/9G8ZuK8wq2uKxtkRs+44cNs7e3t61NEXXwVIVUye1o+f+nnXsT1ZlrwiH9dKjLp+TZVhoRNy/Jb5PrPjlyfAzDiwf28vgD4AV+AuS5dq5au3FuS/I0IB6B3bM7L7wsW3IJSBjvb2ls0gb3YgIiym0hi/NImB/p5Mpi09Or+weBqu+CliHYtx/ruCpGWZu3cOD/Sceu08ioUiFhcX12rHTy0QEXTdwKVLV7B/326tt3fHnvmFRQMu8v03aAERIjTyC5IAtJGdg/s7OjLmbHYBXV29TVt6uFVB13VMXZtFwrIwMNA3dvbcGxaAFYQb9LE5QAFI7Nk9cgdAyOeL2CFlS8XPrbDUoZTC4lIexVIJw0P9IwDScBVxzVOT9QggvbiuvWOjY9nsPBxmLC0tbc+G1wApJWyHMTObxcjwYB+ALgBTCN8+WTYpa0QAQUTDu0eH+ycmp5BOtyGVSm0r4Big6wYmJqYwNNTfIaXss237DEIRVMYFUQIEnnDwOGBwoG9ff19P+tXT52BZiVtCRLS6D8wM0zRx6fJV/Oz991jdOzp3Xp2a9iVKlTlayQFR89PYPTp8wLJMys4tItNuYH5+fqvx97YHIQQ0XcfUtRmkUgnq7+8duTo1raGOj1AlB0TnAOm9Y6O35XJ5MAskk8lt8bMOmMzOwHEYw0P9IydOnjYR6oC6BADK5wD9e8d2DV65Og3dMKGUuuUUcCvFkcPA/PwCRnYODAJoA3AdNRy1anGABCA7O9vHRnYOdrx84sdgBubm5rY5ICa4m/8Sk1enMTQ00A2gG8BbKOcCBmpzgASgj44M7+/oaJfXpmfR3t5xy07AWsUFhUIRlyemcOcde9OpVHJgaWn5FawhgqLfhkmOje26nZmRyxXQtePmfU3xVoFpmbg2PYtMW1rr6+3eeX5pOaqEgyWJShHkJ9px297RXddnsiiWbCwuLv5UiJ9aX/bYSBlE7nV5OYe2dAqDA727zl94s5IAZSIoKv9FImHt2rN7pDs7N4/l5WVIOesRwH8Tbs2qgwvXi6uKr9PB+u8ujomSeKlonZG0RmRl6AcPHcTAQC8GB/uGEb5RPToh46j3bhCxc3hg39Bgn9nbswPpVBK53ErZR2tqOV358eVx4X2wzRRx2K103q12yEXo5Bvcry99I4ewuI5kYdsj6SIOxV5omXOwphS6ujoghMDw0EAvXEvoSgTfAKrfaUMA9F0jQ7d3d3chk0njoQ+9b83NiK0VTnHendOqdnLdIIY7K3YJ0N8ppeixbecMYixFpHaNDI+mU0n3pdl8a9n+NxJ87ujv7030dO8YvHL1mr8zWsYBlZrZymTSKaUlQNLAVo/vmxsIxCV0tLeJzs72bo8AboSH71qroStLS8u567PzyK86G9ox32yjW1lU6/sTrYFhmQqWZSGdSmZqpVZlqV3IzcxkZ6evTWFpebWmT2+tj6MF76OtdbSL61gyzDXTlZ0hKE9Q9rEGrrK8uELec1Vc+bcJIvfRwyM1wpiry2sU5opvRqYtCcuUKBSKJYQf/QzcFX0CRN0Rc8dPnD5qJZ7okVKCHYd8V27/RRcM9gAAewc/2bsLH+GnCf+Xp/PmFsFtEBumLqss8oTIX9lzUFCQJ9rAijRV92VtjTxHyquqpKzLjn+Fu+xsKyULzLzyxhuXnkSNL66WnYRB+KnCDNydHP/dZzpCU7WWUuAGzxwjvlYZ9cLWm4cbxMUpD2vkqQzzkVwEUIC7Gb/iXQvez3fSYlWR0YZLuUUvkYHw453+JGK9EKdTrdT0Db2TW9CO6DeGSyhHetWXVqOfvXAq7m0vY9xvBW+28RvJ3ygP4ca3KcpJUU7wER/VAQBqK2H/DRZ+hspDe81EYKsQsZV1Vg7oKNKjyGegsXNuFOE302Ywr/G8Fe2pq4fqIfZmQvjbHbZ6AGzDNmzDNmzD2xT+H+5UT7Tyxc2HAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE2LTA2LTMwVDExOjUwOjAyLTA0OjAwOaSkCgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxMy0xMS0wMVQxMDozODoyNC0wNDowMNba8BsAAAAASUVORK5CYII="),t.resource.add("hterm/concat/date","text/plain","Tue, 22 Aug 2017 06:42:31 +0000"),t.resource.add("hterm/changelog/version","text/plain","1.70"),t.resource.add("hterm/changelog/date","text/plain","2017-08-16"),t.resource.add("hterm/git/HEAD","text/plain","git rev-parse HEAD"),e.exports={hterm:r,lib:t}},881:e=>{self,e.exports=(()=>{"use strict";var e={775:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 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._renderService.clear(),this._terminal.resize(e.cols,e.rows))}},e.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element&&this._terminal.element.parentElement){var e=this._terminal._core;if(0!==e._renderService.dimensions.actualCellWidth&&0!==e._renderService.dimensions.actualCellHeight){var t=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(t.getPropertyValue("height")),i=Math.max(0,parseInt(t.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),n=r-(parseInt(o.getPropertyValue("padding-top"))+parseInt(o.getPropertyValue("padding-bottom"))),s=i-(parseInt(o.getPropertyValue("padding-right"))+parseInt(o.getPropertyValue("padding-left")))-e.viewport.scrollBarWidth;return{cols:Math.max(2,Math.floor(s/e._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(n/e._renderService.dimensions.actualCellHeight))}}}},e}();t.FitAddon=r}},t={};return function r(i){if(t[i])return t[i].exports;var o=t[i]={exports:{}};return e[i](o,o.exports,r),o.exports}(775)})()},962:e=>{window,e.exports=function(e){var t={};function r(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebLinksAddon=void 0;var i=r(1),o=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){var r=window.open();r?(r.opener=null,r.location.href=t):console.warn("Opening link blocked as opener could not be cleared")}var s=function(){function e(e,t,r){void 0===e&&(e=n),void 0===t&&(t={}),void 0===r&&(r=!1),this._handler=e,this._options=t,this._useLinkProvider=r,this._options.matchIndex=1}return e.prototype.activate=function(e){this._terminal=e,this._useLinkProvider&&"registerLinkProvider"in this._terminal?this._linkProvider=this._terminal.registerLinkProvider(new i.WebLinkProvider(this._terminal,o,this._handler)):this._linkMatcherId=this._terminal.registerLinkMatcher(o,this._handler,this._options)},e.prototype.dispose=function(){var e;void 0!==this._linkMatcherId&&void 0!==this._terminal&&this._terminal.deregisterLinkMatcher(this._linkMatcherId),null===(e=this._linkProvider)||void 0===e||e.dispose()},e}();t.WebLinksAddon=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0;var i=function(){function e(e,t,r){this._terminal=e,this._regex=t,this._handler=r}return e.prototype.provideLinks=function(e,t){t(o.computeLink(e,this._regex,this._terminal,this._handler))},e}();t.WebLinkProvider=i;var o=function(){function e(){}return e.computeLink=function(t,r,i,o){for(var n,s=new RegExp(r.source,(r.flags||"")+"g"),a=e._translateBufferLineToStringWithWrap(t-1,!1,i),c=a[0],l=a[1],h=-1,u=[];null!==(n=s.exec(c));){var d=n[1];if(!d){console.log("match found without corresponding matchIndex");break}if(h=c.indexOf(d,h+1),s.lastIndex=h+d.length,h<0)break;for(var f=h+d.length,p=l+1;f>i.cols;)f-=i.cols,p++;var _={start:{x:h+1,y:l+1},end:{x:f,y:p}};u.push({range:_,text:d,activate:o})}return u},e._translateBufferLineToStringWithWrap=function(e,t,r){var i,o,n="";do{if(!(a=r.buffer.active.getLine(e)))break;a.isWrapped&&e--,o=a.isWrapped}while(o);var s=e;do{var a,c=r.buffer.active.getLine(e+1);if(i=!!c&&c.isWrapped,!(a=r.buffer.active.getLine(e)))break;n+=a.translateToString(!i&&t).substring(0,r.cols),e++}while(i);return[n,s]},e}();t.LinkComputer=o}])},445:e=>{self,e.exports=(()=>{"use strict";var e={965:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphRenderer=void 0;var i=r(381),o=r(310),n=r(455),s=r(259),a=r(855),c=r(147),l=10,h=l*Float32Array.BYTES_PER_ELEMENT,u=function(){function e(e,t,r,o){this._terminal=e,this._colors=t,this._gl=r,this._dimensions=o,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)],selectionAttributes:new Float32Array(0)};var n=this._gl,s=i.throwIfFalsy(i.createProgram(n,"#version 300 es\nlayout (location = 0) in vec2 a_unitquad;\nlayout (location = 1) in vec2 a_cellpos;\nlayout (location = 2) in vec2 a_offset;\nlayout (location = 3) in vec2 a_size;\nlayout (location = 4) in vec2 a_texcoord;\nlayout (location = 5) in vec2 a_texsize;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec2 v_texcoord;\n\nvoid main() {\n vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_texcoord = a_texcoord + a_unitquad * a_texsize;\n}","#version 300 es\nprecision lowp float;\n\nin vec2 v_texcoord;\n\nuniform sampler2D u_texture;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = texture(u_texture, v_texcoord);\n}"));this._program=s,this._projectionLocation=i.throwIfFalsy(n.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=i.throwIfFalsy(n.getUniformLocation(this._program,"u_resolution")),this._textureLocation=i.throwIfFalsy(n.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=n.createVertexArray(),n.bindVertexArray(this._vertexArrayObject);var a=new Float32Array([0,0,1,0,0,1,1,1]),c=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,c),n.bufferData(n.ARRAY_BUFFER,a,n.STATIC_DRAW),n.enableVertexAttribArray(0),n.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);var l=new Uint8Array([0,1,3,0,2,3]),u=n.createBuffer();n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,u),n.bufferData(n.ELEMENT_ARRAY_BUFFER,l,n.STATIC_DRAW),this._attributesBuffer=i.throwIfFalsy(n.createBuffer()),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.enableVertexAttribArray(2),n.vertexAttribPointer(2,2,n.FLOAT,!1,h,0),n.vertexAttribDivisor(2,1),n.enableVertexAttribArray(3),n.vertexAttribPointer(3,2,n.FLOAT,!1,h,2*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(3,1),n.enableVertexAttribArray(4),n.vertexAttribPointer(4,2,n.FLOAT,!1,h,4*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(4,1),n.enableVertexAttribArray(5),n.vertexAttribPointer(5,2,n.FLOAT,!1,h,6*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(5,1),n.enableVertexAttribArray(1),n.vertexAttribPointer(1,2,n.FLOAT,!1,h,8*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(1,1),this._atlasTexture=i.throwIfFalsy(n.createTexture()),n.bindTexture(n.TEXTURE_2D,this._atlasTexture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,1,1,0,n.RGBA,n.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.enable(n.BLEND),n.blendFunc(n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),this.onResize()}return e.prototype.beginFrame=function(){return!this._atlas||this._atlas.beginFrame()},e.prototype.updateCell=function(e,t,r,i,o,n){this._updateCell(this._vertices.attributes,e,t,r,i,o,n)},e.prototype._updateCell=function(e,t,r,i,o,s,c){var h,u=(r*this._terminal.cols+t)*l;i!==a.NULL_CELL_CODE&&i!==a.WHITESPACE_CELL_CODE&&void 0!==i?this._atlas&&((h=c&&c.length>1?this._atlas.getRasterizedGlyphCombinedChar(c,o,s):this._atlas.getRasterizedGlyph(i,o,s))?(e[u]=-h.offset.x+this._dimensions.scaledCharLeft,e[u+1]=-h.offset.y+this._dimensions.scaledCharTop,e[u+2]=h.size.x/this._dimensions.scaledCanvasWidth,e[u+3]=h.size.y/this._dimensions.scaledCanvasHeight,e[u+4]=h.texturePositionClipSpace.x,e[u+5]=h.texturePositionClipSpace.y,e[u+6]=h.sizeClipSpace.x,e[u+7]=h.sizeClipSpace.y):n.fill(e,0,u,u+l-1-2)):n.fill(e,0,u,u+l-1-2)},e.prototype.updateSelection=function(e){var t=this._terminal;this._vertices.selectionAttributes=s.slice(this._vertices.attributes,0);var r=this._colors.selectionOpaque.rgba>>>8|50331648;if(e.selection.columnSelectMode)for(var i=e.selection.startCol,o=e.selection.endCol-i,n=e.selection.viewportCappedEndRow-e.selection.viewportCappedStartRow+1,a=e.selection.viewportCappedStartRow;a>8&16711680|_>>8&65280|_>>8&255;case 50331648:var g=c.AttributeData.toColorRGB(p.getBgColor());f|=g[0]<<16|g[1]<<8|g[2]<<0;case 0:default:var v=this._colors.background.rgba;f|=v>>8&16711680|v>>8&65280|v>>8&255}f|=50331648}if(d&o.COMBINED_CHAR_BIT_MASK){s||(s=a.buffer.active.getLine(l));var b=s.getCell(h).getChars();this._updateCell(this._vertices.selectionAttributes,h,r,i.cells[u],n,f,b)}else this._updateCell(this._vertices.selectionAttributes,h,r,i.cells[u],n,f)}},e.prototype._getColorFromAnsiIndex=function(e){if(e>=this._colors.ansi.length)throw new Error("No color found for idx "+e);return this._colors.ansi[e]},e.prototype.onResize=function(){var e=this._terminal,t=this._gl;t.viewport(0,0,t.canvas.width,t.canvas.height);var r=e.cols*e.rows*l;if(this._vertices.count!==r){this._vertices.count=r,this._vertices.attributes=new Float32Array(r);for(var i=0;i{Object.defineProperty(t,"__esModule",{value:!0}),t.RectangleRenderer=void 0;var i=r(381),o=r(455),n=r(310),s=8*Float32Array.BYTES_PER_ELEMENT,a=function(){function e(e,t,r,o){this._terminal=e,this._colors=t,this._gl=r,this._dimensions=o,this._vertices={count:0,attributes:new Float32Array(160),selection:new Float32Array(24)};var n=this._gl;this._program=i.throwIfFalsy(i.createProgram(n,"#version 300 es\nlayout (location = 0) in vec2 a_position;\nlayout (location = 1) in vec2 a_size;\nlayout (location = 2) in vec4 a_color;\nlayout (location = 3) in vec2 a_unitquad;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 zeroToOne = (a_position + (a_unitquad * a_size)) / u_resolution;\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_color = a_color;\n}","#version 300 es\nprecision lowp float;\n\nin vec4 v_color;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = v_color;\n}")),this._resolutionLocation=i.throwIfFalsy(n.getUniformLocation(this._program,"u_resolution")),this._projectionLocation=i.throwIfFalsy(n.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=n.createVertexArray(),n.bindVertexArray(this._vertexArrayObject);var a=new Float32Array([0,0,1,0,0,1,1,1]),c=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,c),n.bufferData(n.ARRAY_BUFFER,a,n.STATIC_DRAW),n.enableVertexAttribArray(3),n.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);var l=new Uint8Array([0,1,3,0,2,3]),h=n.createBuffer();n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,h),n.bufferData(n.ELEMENT_ARRAY_BUFFER,l,n.STATIC_DRAW),this._attributesBuffer=i.throwIfFalsy(n.createBuffer()),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.enableVertexAttribArray(0),n.vertexAttribPointer(0,2,n.FLOAT,!1,s,0),n.vertexAttribDivisor(0,1),n.enableVertexAttribArray(1),n.vertexAttribPointer(1,2,n.FLOAT,!1,s,2*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(1,1),n.enableVertexAttribArray(2),n.vertexAttribPointer(2,4,n.FLOAT,!1,s,4*Float32Array.BYTES_PER_ELEMENT),n.vertexAttribDivisor(2,1),this._updateCachedColors()}return e.prototype.render=function(){var e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,i.PROJECTION_MATRIX),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,this._vertices.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLES,6,e.UNSIGNED_BYTE,0,this._vertices.count),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,this._vertices.selection,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLES,6,e.UNSIGNED_BYTE,0,3)},e.prototype.onResize=function(){this._updateViewportRectangle()},e.prototype.setColors=function(){this._updateCachedColors(),this._updateViewportRectangle()},e.prototype._updateCachedColors=function(){this._bgFloat=this._colorToFloat32Array(this._colors.background),this._selectionFloat=this._colorToFloat32Array(this._colors.selectionOpaque)},e.prototype._updateViewportRectangle=function(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.scaledCellWidth,this._terminal.rows*this._dimensions.scaledCellHeight,this._bgFloat)},e.prototype.updateSelection=function(e){var t=this._terminal;if(e.hasSelection)if(e.columnSelectMode){var r=e.startCol,i=e.endCol-r,n=e.viewportCappedEndRow-e.viewportCappedStartRow+1;this._addRectangleFloat(this._vertices.selection,0,r*this._dimensions.scaledCellWidth,e.viewportCappedStartRow*this._dimensions.scaledCellHeight,i*this._dimensions.scaledCellWidth,n*this._dimensions.scaledCellHeight,this._selectionFloat),o.fill(this._vertices.selection,0,8)}else{r=e.viewportStartRow===e.viewportCappedStartRow?e.startCol:0;var s=e.viewportCappedStartRow===e.viewportEndRow?e.endCol:t.cols;this._addRectangleFloat(this._vertices.selection,0,r*this._dimensions.scaledCellWidth,e.viewportCappedStartRow*this._dimensions.scaledCellHeight,(s-r)*this._dimensions.scaledCellWidth,this._dimensions.scaledCellHeight,this._selectionFloat);var a=Math.max(e.viewportCappedEndRow-e.viewportCappedStartRow-1,0);if(this._addRectangleFloat(this._vertices.selection,8,0,(e.viewportCappedStartRow+1)*this._dimensions.scaledCellHeight,t.cols*this._dimensions.scaledCellWidth,a*this._dimensions.scaledCellHeight,this._selectionFloat),e.viewportCappedStartRow!==e.viewportCappedEndRow){var c=e.viewportEndRow===e.viewportCappedEndRow?e.endCol:t.cols;this._addRectangleFloat(this._vertices.selection,16,0,e.viewportCappedEndRow*this._dimensions.scaledCellHeight,c*this._dimensions.scaledCellWidth,this._dimensions.scaledCellHeight,this._selectionFloat)}else o.fill(this._vertices.selection,0,16)}else o.fill(this._vertices.selection,0,0)},e.prototype.updateBackgrounds=function(e){for(var t=this._terminal,r=this._vertices,i=1,o=0;o>24&255)/255,d=(c>>16&255)/255,f=(c>>8&255)/255;this._addRectangle(e.attributes,t,l,h,(s-n)*this._dimensions.scaledCellWidth,this._dimensions.scaledCellHeight,u,d,f,1)},e.prototype._addRectangle=function(e,t,r,i,o,n,s,a,c,l){e[t]=r,e[t+1]=i,e[t+2]=o,e[t+3]=n,e[t+4]=s,e[t+5]=a,e[t+6]=c,e[t+7]=l},e.prototype._addRectangleFloat=function(e,t,r,i,o,n,s){e[t]=r,e[t+1]=i,e[t+2]=o,e[t+3]=n,e[t+4]=s[0],e[t+5]=s[1],e[t+6]=s[2],e[t+7]=s[3]},e.prototype._colorToFloat32Array=function(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])},e}();t.RectangleRenderer=a},310:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;var i=r(455);t.RENDER_MODEL_INDICIES_PER_CELL=3,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.COMBINED_CHAR_BIT_MASK=2147483648;var o=function(){function e(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection={hasSelection:!1,columnSelectMode:!1,viewportStartRow:0,viewportEndRow:0,viewportCappedStartRow:0,viewportCappedEndRow:0,startCol:0,endCol:0}}return e.prototype.resize=function(e,r){var i=e*r*t.RENDER_MODEL_INDICIES_PER_CELL;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(r))},e.prototype.clear=function(){i.fill(this.cells,0,0),i.fill(this.lineLengths,0,0)},e.prototype.clearSelection=function(){this.selection.hasSelection=!1,this.selection.viewportStartRow=0,this.selection.viewportEndRow=0,this.selection.viewportCappedStartRow=0,this.selection.viewportCappedEndRow=0,this.selection.startCol=0,this.selection.endCol=0},e}();t.RenderModel=o},259:(e,t)=>{function r(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length),t<0&&(t=(e.length+t)%e.length),r=r>=e.length?e.length:(e.length+r)%e.length,t=Math.min(t,r);for(var i=new e.constructor(r-t),o=0;o{Object.defineProperty(t,"__esModule",{value:!0}),t.WebglAddon=void 0;var i=r(666),o=function(){function e(e){this._preserveDrawingBuffer=e}return e.prototype.activate=function(e){if(!e.element)throw new Error("Cannot activate WebglAddon before Terminal.open");this._terminal=e;var t=e._core._renderService,r=e._core._colorManager.colors;this._renderer=new i.WebglRenderer(e,r,this._preserveDrawingBuffer),t.setRenderer(this._renderer)},e.prototype.dispose=function(){if(!this._terminal)throw new Error("Cannot dispose WebglAddon because it is activated");var e=this._terminal._core._renderService;e.setRenderer(this._terminal._core._createRenderer()),e.onResize(this._terminal.cols,this._terminal.rows),this._renderer=void 0},Object.defineProperty(e.prototype,"textureAtlas",{get:function(){var e;return null===(e=this._renderer)||void 0===e?void 0:e.textureAtlas},enumerable:!1,configurable:!0}),e.prototype.clearTextureAtlas=function(){var e;null===(e=this._renderer)||void 0===e||e.clearCharAtlas()},e}();t.WebglAddon=o},666:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.WebglRenderer=void 0;var n=r(965),s=r(733),a=r(461),c=r(713),l=r(344),h=r(310),u=r(859),d=r(855),f=r(345),p=r(782),_=function(e){function t(t,r,i){var o=e.call(this)||this;o._terminal=t,o._colors=r,o._model=new h.RenderModel,o._workCell=new p.CellData,o._onRequestRedraw=new f.EventEmitter,o._core=o._terminal._core,o._renderLayers=[new s.LinkRenderLayer(o._core.screenElement,2,o._colors,o._core),new a.CursorRenderLayer(o._core.screenElement,3,o._colors,o._onRequestRedraw)],o.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},o._devicePixelRatio=window.devicePixelRatio,o._updateDimensions(),o._canvas=document.createElement("canvas");var c={antialias:!1,depth:!1,preserveDrawingBuffer:i};if(o._gl=o._canvas.getContext("webgl2",c),!o._gl)throw new Error("WebGL2 not supported "+o._gl);return o._core.screenElement.appendChild(o._canvas),o._rectangleRenderer=new l.RectangleRenderer(o._terminal,o._colors,o._gl,o.dimensions),o._glyphRenderer=new n.GlyphRenderer(o._terminal,o._colors,o._gl,o.dimensions),o.onCharSizeChanged(),o._isAttached=document.body.contains(o._core.screenElement),o}return o(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._renderLayers.forEach((function(e){return e.dispose()})),this._core.screenElement.removeChild(this._canvas),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"textureAtlas",{get:function(){var e;return null===(e=this._charAtlas)||void 0===e?void 0:e.cacheCanvas},enumerable:!1,configurable:!0}),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)})),this._rectangleRenderer.setColors(),this._glyphRenderer.setColors(),this._refreshCharAtlas(),this._model.clear()},t.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._terminal.cols,this._terminal.rows))},t.prototype.onResize=function(e,t){var r=this;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows),this._renderLayers.forEach((function(e){return e.resize(r._terminal,r.dimensions)})),this._canvas.width=this.dimensions.scaledCanvasWidth,this._canvas.height=this.dimensions.scaledCanvasHeight,this._canvas.style.width=this.dimensions.canvasWidth+"px",this._canvas.style.height=this.dimensions.canvasHeight+"px",this._core.screenElement.style.width=this.dimensions.canvasWidth+"px",this._core.screenElement.style.height=this.dimensions.canvasHeight+"px",this._rectangleRenderer.onResize(),this._model.selection.hasSelection&&this._rectangleRenderer.updateSelection(this._model.selection),this._glyphRenderer.setDimensions(this.dimensions),this._glyphRenderer.onResize(),this._refreshCharAtlas(),this._model.clear()},t.prototype.onCharSizeChanged=function(){this.onResize(this._terminal.cols,this._terminal.rows)},t.prototype.onBlur=function(){var e=this;this._renderLayers.forEach((function(t){return t.onBlur(e._terminal)}))},t.prototype.onFocus=function(){var e=this;this._renderLayers.forEach((function(t){return t.onFocus(e._terminal)}))},t.prototype.onSelectionChanged=function(e,t,r){var i=this;this._renderLayers.forEach((function(o){return o.onSelectionChanged(i._terminal,e,t,r)})),this._updateSelectionModel(e,t,r),this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})},t.prototype.onCursorMove=function(){var e=this;this._renderLayers.forEach((function(t){return t.onCursorMove(e._terminal)}))},t.prototype.onOptionsChanged=function(){var e=this;this._renderLayers.forEach((function(t){return t.onOptionsChanged(e._terminal)})),this._updateDimensions(),this._refreshCharAtlas()},t.prototype._refreshCharAtlas=function(){if(this.dimensions.scaledCharWidth<=0&&this.dimensions.scaledCharHeight<=0)this._isAttached=!1;else{var e=c.acquireCharAtlas(this._terminal,this._colors,this.dimensions.scaledCharWidth,this.dimensions.scaledCharHeight);if(!("getRasterizedGlyph"in e))throw new Error("The webgl renderer only works with the webgl char atlas");this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.setAtlas(this._charAtlas)}},t.prototype.clearCharAtlas=function(){var e;null===(e=this._charAtlas)||void 0===e||e.clearTexture(),this._model.clear(),this._updateModel(0,this._terminal.rows-1),this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})},t.prototype.clear=function(){var e=this;this._renderLayers.forEach((function(t){return t.reset(e._terminal)}))},t.prototype.registerCharacterJoiner=function(e){return-1},t.prototype.deregisterCharacterJoiner=function(e){return!1},t.prototype.renderRows=function(e,t){var r=this;if(!this._isAttached){if(!(document.body.contains(this._core.screenElement)&&this._core._charSizeService.width&&this._core._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}this._renderLayers.forEach((function(i){return i.onGridChanged(r._terminal,e,t)})),this._glyphRenderer.beginFrame()&&(this._model.clear(),this._updateSelectionModel(void 0,void 0)),this._updateModel(e,t),this._rectangleRenderer.render(),this._glyphRenderer.render(this._model,this._model.selection.hasSelection)},t.prototype._updateModel=function(e,t){for(var r=this._core,i=e;i<=t;i++){var o=i+r.buffer.ydisp,n=r.buffer.lines.get(o);this._model.lineLengths[i]=0;for(var s=0;s1&&(c|=h.COMBINED_CHAR_BIT_MASK),this._model.cells[l]=c,this._model.cells[l+h.RENDER_MODEL_BG_OFFSET]=this._workCell.bg,this._model.cells[l+h.RENDER_MODEL_FG_OFFSET]=this._workCell.fg,this._glyphRenderer.updateCell(s,i,c,this._workCell.bg,this._workCell.fg,a))}}this._rectangleRenderer.updateBackgrounds(this._model),this._model.selection.hasSelection&&this._glyphRenderer.updateSelection(this._model)},t.prototype._updateSelectionModel=function(e,t,r){void 0===r&&(r=!1);var i=this._terminal;if(!e||!t||e[0]===t[0]&&e[1]===t[1])return this._model.clearSelection(),void this._rectangleRenderer.updateSelection(this._model.selection);var o=e[1]-i.buffer.active.viewportY,n=t[1]-i.buffer.active.viewportY,s=Math.max(o,0),a=Math.min(n,i.rows-1);if(s>=i.rows||a<0)return this._model.clearSelection(),void this._rectangleRenderer.updateSelection(this._model.selection);this._model.selection.hasSelection=!0,this._model.selection.columnSelectMode=r,this._model.selection.viewportStartRow=o,this._model.selection.viewportEndRow=n,this._model.selection.viewportCappedStartRow=s,this._model.selection.viewportCappedEndRow=a,this._model.selection.startCol=e[0],this._model.selection.endCol=t[0],this._rectangleRenderer.updateSelection(this._model.selection)},t.prototype._updateDimensions=function(){this._core._charSizeService.width&&this._core._charSizeService.height&&(this.dimensions.scaledCharWidth=Math.floor(this._core._charSizeService.width*this._devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._core._charSizeService.height*this._devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.getOption("lineHeight")),this.dimensions.scaledCharTop=1===this._terminal.getOption("lineHeight")?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.getOption("letterSpacing")),this.dimensions.scaledCharLeft=Math.floor(this._terminal.getOption("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/this._devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/this._devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.scaledCellHeight/this._devicePixelRatio,this.dimensions.actualCellWidth=this.dimensions.scaledCellWidth/this._devicePixelRatio)},t}(u.Disposable);t.WebglRenderer=_},381:(e,t)=>{function r(e,t,r){var o=i(e.createShader(t));if(e.shaderSource(o,r),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS))return o;console.error(e.getShaderInfoLog(o)),e.deleteShader(o)}function i(e){if(!e)throw new Error("value must not be falsy");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0,t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(e,t,o){var n=i(e.createProgram());if(e.attachShader(n,i(r(e,e.VERTEX_SHADER,t))),e.attachShader(n,i(r(e,e.FRAGMENT_SHADER,o))),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS))return n;console.error(e.getProgramInfoLog(n)),e.deleteProgram(n)},t.createShader=r,t.expandFloat32Array=function(e,t){for(var r=Math.min(2*e.length,t),i=new Float32Array(r),o=0;o{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireCharAtlas=void 0;var i=r(433),o=r(167),n=[];t.acquireCharAtlas=function(e,t,r,s){for(var a=i.generateConfig(r,s,e,t),c=0;c=0){if(i.configEquals(h.config,a))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),n.splice(c,1)):h.ownedBy.splice(l,1);break}}for(c=0;c{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;var r={css:"",rgba:0};t.generateConfig=function(e,t,i,o){var n={foreground:o.foreground,background:o.background,cursor:r,cursorAccent:r,selectionTransparent:r,selectionOpaque:r,ansi:o.ansi.slice(),contrastCache:o.contrastCache};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:i.getOption("fontFamily"),fontSize:i.getOption("fontSize"),fontWeight:i.getOption("fontWeight"),fontWeightBold:i.getOption("fontWeightBold"),allowTransparency:i.getOption("allowTransparency"),drawBoldTextInBrightColors:i.getOption("drawBoldTextInBrightColors"),minimumContrastRatio:i.getOption("minimumContrastRatio"),colors:n}},t.configEquals=function(e,t){for(var r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.WebglCharAtlas=void 0;var i=r(499),o=r(855),n=r(381),s=r(147),a=r(742),c=1024,l=1024,h=Math.floor(819.2),u={css:"rgba(0, 0, 0, 0)",rgba:0},d={offset:{x:0,y:0},texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},f=function(){function e(e,t){this._config=t,this._didWarmUp=!1,this._cacheMap={},this._cacheMapCombined={},this._currentRowY=0,this._currentRowX=0,this._currentRowHeight=0,this.hasCanvasChanged=!1,this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new s.AttributeData,this.cacheCanvas=e.createElement("canvas"),this.cacheCanvas.width=c,this.cacheCanvas.height=l,this._cacheCtx=n.throwIfFalsy(this.cacheCanvas.getContext("2d",{alpha:!0})),this._tmpCanvas=e.createElement("canvas"),this._tmpCanvas.width=2*this._config.scaledCharWidth+4,this._tmpCanvas.height=this._config.scaledCharHeight+4,this._tmpCtx=n.throwIfFalsy(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency}))}return e.prototype.dispose=function(){this.cacheCanvas.parentElement&&this.cacheCanvas.parentElement.removeChild(this.cacheCanvas)},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){for(var e,t,r=33;r<126;r++){var i=this._drawToCache(r,o.DEFAULT_COLOR,o.DEFAULT_COLOR);this._cacheMap[r]=((e={})[o.DEFAULT_COLOR]=((t={})[o.DEFAULT_COLOR]=i,t),e)}},e.prototype.beginFrame=function(){return this._currentRowY>h&&(this.clearTexture(),this.warmUp(),!0)},e.prototype.clearTexture=function(){0===this._currentRowX&&0===this._currentRowY||(this._cacheCtx.clearRect(0,0,c,l),this._cacheMap={},this._cacheMapCombined={},this._currentRowHeight=0,this._currentRowX=0,this._currentRowY=0,this._didWarmUp=!1)},e.prototype.getRasterizedGlyphCombinedChar=function(e,t,r){var i,o=this._cacheMapCombined[e];o||(o={},this._cacheMapCombined[e]=o);var n=o[t];return n&&(i=n[r]),i||(i=this._drawToCache(e,t,r),o[t]||(o[t]={}),o[t][r]=i),i},e.prototype.getRasterizedGlyph=function(e,t,r){var i,o=this._cacheMap[e];o||(o={},this._cacheMap[e]=o);var n=o[t];return n&&(i=n[r]),i||(i=this._drawToCache(e,t,r),o[t]||(o[t]={}),o[t][r]=i),i},e.prototype._getColorFromAnsiIndex=function(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]},e.prototype._getBackgroundColor=function(e,t,r){if(this._config.allowTransparency)return u;switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t);case 50331648:var i=s.AttributeData.toColorRGB(t);return{rgba:t<<8,css:"#"+p(i[0])+p(i[1])+p(i[2])};case 0:default:return r?this._config.colors.foreground:this._config.colors.background}},e.prototype._getForegroundCss=function(e,t,r,i,o,n,c,l){var h=this._getMinimumContrastCss(e,t,r,i,o,n,c,l);if(h)return h;switch(o){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&l&&n<8&&(n+=8),this._getColorFromAnsiIndex(n).css;case 50331648:var u=s.AttributeData.toColorRGB(n);return a.channels.toCss(u[0],u[1],u[2]);case 0:default:if(c){var d=this._config.colors.background.css;return 9===d.length?d.substr(0,7):d}return this._config.colors.foreground.css}},e.prototype._resolveBackgroundRgba=function(e,t,r){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;case 0:default:return r?this._config.colors.foreground.rgba:this._config.colors.background.rgba}},e.prototype._resolveForegroundRgba=function(e,t,r,i){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&i&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;case 0:default:return r?this._config.colors.background.rgba:this._config.colors.foreground.rgba}},e.prototype._getMinimumContrastCss=function(e,t,r,i,o,n,s,c){if(1!==this._config.minimumContrastRatio){var l=this._config.colors.contrastCache.getCss(e,i);if(void 0!==l)return l||void 0;var h=this._resolveBackgroundRgba(t,r,s),u=this._resolveForegroundRgba(o,n,s,c),d=a.rgba.ensureContrastRatio(h,u,this._config.minimumContrastRatio);if(d){var f=a.channels.toCss(d>>24&255,d>>16&255,d>>8&255);return this._config.colors.contrastCache.setCss(e,i,f),f}this._config.colors.contrastCache.setCss(e,i,null)}},e.prototype._drawToCache=function(e,t,r){var o="number"==typeof e?String.fromCharCode(e):e;if(this.hasCanvasChanged=!0,this._tmpCtx.save(),this._workAttributeData.fg=r,this._workAttributeData.bg=t,this._workAttributeData.isInvisible())return d;var n=!!this._workAttributeData.isBold(),s=!!this._workAttributeData.isInverse(),a=!!this._workAttributeData.isDim(),h=!!this._workAttributeData.isItalic(),u=this._workAttributeData.getFgColor(),f=this._workAttributeData.getFgColorMode(),p=this._workAttributeData.getBgColor(),_=this._workAttributeData.getBgColorMode();if(s){var g=u;u=p,p=g;var v=f;f=_,_=v}var b=this._getBackgroundColor(_,p,s);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=b.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";var y=n?this._config.fontWeightBold:this._config.fontWeight,m=h?"italic":"";this._tmpCtx.font=m+" "+y+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundCss(t,_,p,r,f,u,s,n),a&&(this._tmpCtx.globalAlpha=i.DIM_OPACITY),this._tmpCtx.fillText(o,2,2+this._config.scaledCharHeight/2),this._tmpCtx.restore();var C=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);if(function(e,t){for(var r=!0,i=t.rgba>>>24,o=t.rgba>>>16&255,n=t.rgba>>>8&255,s=0;sc&&(this._currentRowX=0,this._currentRowY+=this._currentRowHeight,this._currentRowHeight=0),S.texturePosition.x=this._currentRowX,S.texturePosition.y=this._currentRowY,S.texturePositionClipSpace.x=this._currentRowX/c,S.texturePositionClipSpace.y=this._currentRowY/l,this._currentRowHeight=Math.max(this._currentRowHeight,S.size.y),this._currentRowX+=S.size.x,this._cacheCtx.putImageData(w,S.texturePosition.x,S.texturePosition.y),S},e.prototype._findGlyphBoundingBox=function(e,t){t.top=0;for(var r=!1,i=0;i=0;o--){for(i=0;i=0;i--){for(o=0;o{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;var i=r(713),o=r(381),n=function(){function e(e,t,r,i,o){this._container=e,this._alpha=i,this._colors=o,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=r.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=o.throwIfFalsy(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,r){},e.prototype.onSelectionChanged=function(e,t,r,i){void 0===i&&(i=!1)},e.prototype.setColors=function(e,t){this._refreshCharAtlas(e,t)},e.prototype._setTransparency=function(e,t){if(t!==this._alpha){var r=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),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=i.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,r,i){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight)},e.prototype._fillBottomLineAtCells=function(e,t,r){void 0===r&&(r=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},e.prototype._fillLeftLineAtCell=function(e,t,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio*r,this._scaledCellHeight)},e.prototype._strokeRectAtCell=function(e,t,r,i){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,i*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,r,i){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight))},e.prototype._fillCharTrueColor=function(e,t,r,i){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline="middle",this._clipRow(e,i),this._ctx.fillText(t.getChars(),r*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},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,r){return(r?"italic":"")+" "+(t?e.getOption("fontWeightBold"):e.getOption("fontWeight"))+" "+e.getOption("fontSize")*window.devicePixelRatio+"px "+e.getOption("fontFamily")},e}();t.BaseRenderLayer=n},461:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;var n=r(592),s=r(782),a=600,c=function(e){function t(t,r,i,o){var n=e.call(this,t,"cursor",r,!0,i)||this;return n._onRequestRefreshRowsEvent=o,n._cell=new s.CellData,n._state={x:0,y:0,isFocused:!1,style:"",width:0},n._cursorRenderers={bar:n._renderBarCursor.bind(n),block:n._renderBlockCursor.bind(n),underline:n._renderUnderlineCursor.bind(n)},n}return o(t,e),t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},t.prototype.reset=function(e){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this.onOptionsChanged(e))},t.prototype.onBlur=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRefreshRowsEvent.fire({start:e.buffer.active.cursorY,end:e.buffer.active.cursorY})},t.prototype.onFocus=function(e){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(e):this._onRequestRefreshRowsEvent.fire({start:e.buffer.active.cursorY,end:e.buffer.active.cursorY})},t.prototype.onOptionsChanged=function(e){var t,r=this;e.getOption("cursorBlink")?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new l(e,(function(){r._render(e,!0)}))):(null===(t=this._cursorBlinkStateManager)||void 0===t||t.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRefreshRowsEvent.fire({start:e.buffer.active.cursorY,end:e.buffer.active.cursorY})},t.prototype.onCursorMove=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype.onGridChanged=function(e,t,r){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(e,!1):this._cursorBlinkStateManager.restartBlinkAnimation(e)},t.prototype._render=function(e,t){if(e._core._coreService.isCursorInitialized&&!e._core._coreService.isCursorHidden){var r=e.buffer.active.baseY+e.buffer.active.cursorY,i=r-e.buffer.active.viewportY,o=Math.min(e.buffer.active.cursorX,e.cols-1);if(i<0||i>=e.rows)this._clearCursor();else if(e._core.buffer.lines.get(r).loadCell(o,this._cell),void 0!==this._cell.content){if(!h(e)){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var n=e.getOption("cursorStyle");return n&&"block"!==n?this._cursorRenderers[n](e,o,i,this._cell):this._renderBlurCursor(e,o,i,this._cell),this._ctx.restore(),this._state.x=o,this._state.y=i,this._state.isFocused=!1,this._state.style=n,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===o&&this._state.y===i&&this._state.isFocused===h(e)&&this._state.style===e.getOption("cursorStyle")&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.getOption("cursorStyle")||"block"](e,o,i,this._cell),this._ctx.restore(),this._state.x=o,this._state.y=i,this._state.isFocused=!1,this._state.style=e.getOption("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:0,y:0,isFocused:!1,style:"",width:0})},t.prototype._renderBarCursor=function(e,t,r,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(t,r,e.getOption("cursorWidth")),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,r,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(t,r,i.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(e,i,t,r),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,r,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(t,r),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,r,i){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(t,r,i.getWidth(),1),this._ctx.restore()},t}(n.BaseRenderLayer);t.CursorRenderLayer=c;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,h(e)&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},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=void 0}))))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=a),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout((function(){if(t._animationTimeRestarted){var e=a-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=void 0,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0})),t._blinkInterval=window.setInterval((function(){if(t._animationTimeRestarted){var e=a-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=void 0,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0}))}),a)}),e)},e.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.resume=function(e){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation(e)},e}();function h(e){return document.activeElement===e.textarea&&document.hasFocus()}},733:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;var n=r(592),s=r(499),a=r(433),c=function(e){function t(t,r,i,o){var n=e.call(this,t,"link",r,!0,i)||this;return o.linkifier.onShowLinkUnderline((function(e){return n._onShowLinkUnderline(e)})),o.linkifier.onHideLinkUnderline((function(e){return n._onHideLinkUnderline(e)})),o.linkifier2.onShowLinkUnderline((function(e){return n._onShowLinkUnderline(e)})),o.linkifier2.onHideLinkUnderline((function(e){return n._onHideLinkUnderline(e)})),n}return o(t,e),t.prototype.resize=function(t,r){e.prototype.resize.call(this,t,r),this._state=void 0},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=void 0}},t.prototype._onShowLinkUnderline=function(e){if(e.fg===s.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:void 0!==e.fg&&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{var r,i,o,n;function s(e){var t=e.toString(16);return t.length<2?"0"+t:t}function a(e,t){return e>>0}}(r=t.channels||(t.channels={})),(i=t.color||(t.color={})).blend=function(e,t){var i=(255&t.rgba)/255;if(1===i)return{css:t.css,rgba:t.rgba};var o=t.rgba>>24&255,n=t.rgba>>16&255,s=t.rgba>>8&255,a=e.rgba>>24&255,c=e.rgba>>16&255,l=e.rgba>>8&255,h=a+Math.round((o-a)*i),u=c+Math.round((n-c)*i),d=l+Math.round((s-l)*i);return{css:r.toCss(h,u,d),rgba:r.toRgba(h,u,d)}},i.isOpaque=function(e){return 255==(255&e.rgba)},i.ensureContrastRatio=function(e,t,r){var i=n.ensureContrastRatio(e.rgba,t.rgba,r);if(i)return n.toColor(i>>24&255,i>>16&255,i>>8&255)},i.opaque=function(e){var t=(255|e.rgba)>>>0,i=n.toChannels(t),o=i[0],s=i[1],a=i[2];return{css:r.toCss(o,s,a),rgba:t}},i.opacity=function(e,t){var i=Math.round(255*t),o=n.toChannels(e.rgba),s=o[0],a=o[1],c=o[2];return{css:r.toCss(s,a,c,i),rgba:r.toRgba(s,a,c,i)}},(t.css||(t.css={})).toColor=function(e){switch(e.length){case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(e){function t(e,t,r){var i=e/255,o=t/255,n=r/255;return.2126*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.7152*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(o=t.rgb||(t.rgb={})),function(e){function t(e,t,r){for(var i=e>>24&255,n=e>>16&255,s=e>>8&255,c=t>>24&255,l=t>>16&255,h=t>>8&255,u=a(o.relativeLuminance2(c,h,l),o.relativeLuminance2(i,n,s));u0||l>0||h>0);)c-=Math.max(0,Math.ceil(.1*c)),l-=Math.max(0,Math.ceil(.1*l)),h-=Math.max(0,Math.ceil(.1*h)),u=a(o.relativeLuminance2(c,h,l),o.relativeLuminance2(i,n,s));return(c<<24|l<<16|h<<8|255)>>>0}function i(e,t,r){for(var i=e>>24&255,n=e>>16&255,s=e>>8&255,c=t>>24&255,l=t>>16&255,h=t>>8&255,u=a(o.relativeLuminance2(c,h,l),o.relativeLuminance2(i,n,s));u>>0}e.ensureContrastRatio=function(e,r,n){var s=o.relativeLuminance(e>>8),c=o.relativeLuminance(r>>8);if(a(s,c)>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,i){return{css:r.toCss(e,t,i),rgba:r.toRgba(e,t,i)}}}(n=t.rgba||(t.rgba={})),t.toPaddedHex=s,t.contrastRatio=a},499:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR_ATLAS_CELL_SPACING=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0,t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},345:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0;var r=function(){function e(){this._listeners=[],this._disposed=!1}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(){if(!e._disposed)for(var r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.Disposable=void 0;var r=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0;for(var e=0,t=this._disposables;e{function r(e,t,r,i){if(void 0===r&&(r=0),void 0===i&&(i=e.length),r>=e.length)return e;r=(e.length+r)%e.length,i=i>=e.length?e.length:(e.length+i)%e.length;for(var o=r;o{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;var r=function(){function e(){this.fg=0,this.bg=0,this.extended=new i}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.extended=this.extended.clone(),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.isAttributeDefault=function(){return 0===this.fg&&0===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.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},e.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},e.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},e.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},e.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()},e.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()},e.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()},e.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},e}();t.AttributeData=r;var i=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=-1),this.underlineStyle=e,this.underlineColor=t}return e.prototype.clone=function(){return new e(this.underlineStyle,this.underlineColor)},e.prototype.isEmpty=function(){return 0===this.underlineStyle},e}();t.ExtendedAttrs=i},782:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;var n=r(133),s=r(855),a=r(147),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.extended=new a.ExtendedAttrs,t.combinedData="",t}return o(t,e),t.fromCharData=function(e){var r=new t;return r.setFromCharData(e),r},t.prototype.isCombined=function(){return 2097152&this.content},t.prototype.getWidth=function(){return this.content>>22},t.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?n.stringFromCodePoint(2097151&this.content):""},t.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},t.prototype.setFromCharData=function(e){this.fg=e[s.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(e[s.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[s.CHAR_DATA_CHAR_INDEX].length){var r=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){var i=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(r-55296)+i-56320+65536|e[s.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[s.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[s.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[s.CHAR_DATA_WIDTH_INDEX]<<22)},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(a.AttributeData);t.CellData=c},855:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.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},133:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 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,r){void 0===t&&(t=0),void 0===r&&(r=e.length);for(var i="",o=t;o65535?(n-=65536,i+=String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):i+=String.fromCharCode(n)}return i};var r=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var i=0,o=0;this._interim&&(56320<=(a=e.charCodeAt(o++))&&a<=57343?t[i++]=1024*(this._interim-55296)+a-56320+65536:(t[i++]=this._interim,t[i++]=a),this._interim=0);for(var n=o;n=r)return this._interim=s,i;var a;56320<=(a=e.charCodeAt(n))&&a<=57343?t[i++]=1024*(s-55296)+a-56320+65536:(t[i++]=s,t[i++]=a)}else 65279!==s&&(t[i++]=s)}return i},e}();t.StringToUtf32=r;var i=function(){function e(){this.interim=new Uint8Array(3)}return e.prototype.clear=function(){this.interim.fill(0)},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var i,o,n,s,a=0,c=0,l=0;if(this.interim[0]){var h=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var d=0,f=void 0;(f=63&this.interim[++d])&&d<4;)u<<=6,u|=f;for(var p=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,_=p-d;l<_;){if(l>=r)return 0;if(128!=(192&(f=e[l++]))){l--,h=!0;break}this.interim[d++]=f,u<<=6,u|=63&f}h||(2===p?u<128?l--:t[a++]=u:3===p?u<2048||u>=55296&&u<=57343||65279===u||(t[a++]=u):u<65536||u>1114111||(t[a++]=u)),this.interim.fill(0)}for(var g=r-4,v=l;v=r)return this.interim[0]=i,a;if(128!=(192&(o=e[v++]))){v--;continue}if((c=(31&i)<<6|63&o)<128){v--;continue}t[a++]=c}else if(224==(240&i)){if(v>=r)return this.interim[0]=i,a;if(128!=(192&(o=e[v++]))){v--;continue}if(v>=r)return this.interim[0]=i,this.interim[1]=o,a;if(128!=(192&(n=e[v++]))){v--;continue}if((c=(15&i)<<12|(63&o)<<6|63&n)<2048||c>=55296&&c<=57343||65279===c)continue;t[a++]=c}else if(240==(248&i)){if(v>=r)return this.interim[0]=i,a;if(128!=(192&(o=e[v++]))){v--;continue}if(v>=r)return this.interim[0]=i,this.interim[1]=o,a;if(128!=(192&(n=e[v++]))){v--;continue}if(v>=r)return this.interim[0]=i,this.interim[1]=o,this.interim[2]=n,a;if(128!=(192&(s=e[v++]))){v--;continue}if((c=(7&i)<<18|(63&o)<<12|(63&n)<<6|63&s)<65536||c>1114111)continue;t[a++]=c}}return a},e}();t.Utf8ToUtf32=i}},t={};return function r(i){if(t[i])return t[i].exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,r),o.exports}(795)})()},841:e=>{self,e.exports=(()=>{"use strict";var e={4567:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;var n=r(9042),s=r(6114),a=r(6193),c=r(3656),l=r(844),h=r(5596),u=r(9631),d=function(e){function t(t,r){var i=e.call(this)||this;i._terminal=t,i._renderService=r,i._liveRegionLineCount=0,i._charsToConsume=[],i._charsToAnnounce="",i._accessibilityTreeRoot=document.createElement("div"),i._accessibilityTreeRoot.classList.add("xterm-accessibility"),i._rowContainer=document.createElement("div"),i._rowContainer.setAttribute("role","list"),i._rowContainer.classList.add("xterm-accessibility-tree"),i._rowElements=[];for(var o=0;oe;)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;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=n.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&&u.removeElementFromParent(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 r=this._terminal.buffer,i=r.lines.length.toString(),o=e;o<=t;o++){var n=r.translateBufferLineToString(r.ydisp+o,!0),s=(r.ydisp+o+1).toString(),a=this._rowElements[o];a&&(0===n.length?a.innerText=" ":a.textContent=n,a.setAttribute("aria-posinset",s),a.setAttribute("aria-setsize",i))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e{function r(e){return e.replace(/\r?\n/g,"\r")}function i(e,t){return t?"[200~"+e+"[201~":e}function o(e,t,o){e=i(e=r(e),o.decPrivateModes.bracketedPasteMode),o.triggerDataEvent(e,!0),t.value=""}function n(e,t,r){var i=r.getBoundingClientRect(),o=e.clientX-i.left-10,n=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=o+"px",t.style.top=n+"px",t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=r,t.bracketTextForPaste=i,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,r){e.stopPropagation(),e.clipboardData&&o(e.clipboardData.getData("text/plain"),t,r)},t.paste=o,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(e,t,r,i,o){n(e,t,r),o&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}},4774:(e,t)=>{var r,i,o,n;function s(e){var t=e.toString(16);return t.length<2?"0"+t:t}function a(e,t){return e>>0}}(r=t.channels||(t.channels={})),(i=t.color||(t.color={})).blend=function(e,t){var i=(255&t.rgba)/255;if(1===i)return{css:t.css,rgba:t.rgba};var o=t.rgba>>24&255,n=t.rgba>>16&255,s=t.rgba>>8&255,a=e.rgba>>24&255,c=e.rgba>>16&255,l=e.rgba>>8&255,h=a+Math.round((o-a)*i),u=c+Math.round((n-c)*i),d=l+Math.round((s-l)*i);return{css:r.toCss(h,u,d),rgba:r.toRgba(h,u,d)}},i.isOpaque=function(e){return 255==(255&e.rgba)},i.ensureContrastRatio=function(e,t,r){var i=n.ensureContrastRatio(e.rgba,t.rgba,r);if(i)return n.toColor(i>>24&255,i>>16&255,i>>8&255)},i.opaque=function(e){var t=(255|e.rgba)>>>0,i=n.toChannels(t),o=i[0],s=i[1],a=i[2];return{css:r.toCss(o,s,a),rgba:t}},i.opacity=function(e,t){var i=Math.round(255*t),o=n.toChannels(e.rgba),s=o[0],a=o[1],c=o[2];return{css:r.toCss(s,a,c,i),rgba:r.toRgba(s,a,c,i)}},(t.css||(t.css={})).toColor=function(e){switch(e.length){case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(e){function t(e,t,r){var i=e/255,o=t/255,n=r/255;return.2126*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.7152*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(o=t.rgb||(t.rgb={})),function(e){function t(e,t,r){for(var i=e>>24&255,n=e>>16&255,s=e>>8&255,c=t>>24&255,l=t>>16&255,h=t>>8&255,u=a(o.relativeLuminance2(c,h,l),o.relativeLuminance2(i,n,s));u0||l>0||h>0);)c-=Math.max(0,Math.ceil(.1*c)),l-=Math.max(0,Math.ceil(.1*l)),h-=Math.max(0,Math.ceil(.1*h)),u=a(o.relativeLuminance2(c,h,l),o.relativeLuminance2(i,n,s));return(c<<24|l<<16|h<<8|255)>>>0}function i(e,t,r){for(var i=e>>24&255,n=e>>16&255,s=e>>8&255,c=t>>24&255,l=t>>16&255,h=t>>8&255,u=a(o.relativeLuminance2(c,h,l),o.relativeLuminance2(i,n,s));u>>0}e.ensureContrastRatio=function(e,r,n){var s=o.relativeLuminance(e>>8),c=o.relativeLuminance(r>>8);if(a(s,c)>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,i){return{css:r.toCss(e,t,i),rgba:r.toRgba(e,t,i)}}}(n=t.rgba||(t.rgba={})),t.toPaddedHex=s,t.contrastRatio=a},7239:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;var r=function(){function e(){this._color={},this._rgba={}}return e.prototype.clear=function(){this._color={},this._rgba={}},e.prototype.setCss=function(e,t,r){this._rgba[e]||(this._rgba[e]={}),this._rgba[e][t]=r},e.prototype.getCss=function(e,t){return this._rgba[e]?this._rgba[e][t]:void 0},e.prototype.setColor=function(e,t,r){this._color[e]||(this._color[e]={}),this._color[e][t]=r},e.prototype.getColor=function(e,t){return this._color[e]?this._color[e][t]:void 0},e}();t.ColorContrastCache=r},5680:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorManager=t.DEFAULT_ANSI_COLORS=void 0;var i=r(4774),o=r(7239),n=i.css.toColor("#ffffff"),s=i.css.toColor("#000000"),a=i.css.toColor("#ffffff"),c=i.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze(function(){for(var e=[i.css.toColor("#2e3436"),i.css.toColor("#cc0000"),i.css.toColor("#4e9a06"),i.css.toColor("#c4a000"),i.css.toColor("#3465a4"),i.css.toColor("#75507b"),i.css.toColor("#06989a"),i.css.toColor("#d3d7cf"),i.css.toColor("#555753"),i.css.toColor("#ef2929"),i.css.toColor("#8ae234"),i.css.toColor("#fce94f"),i.css.toColor("#729fcf"),i.css.toColor("#ad7fa8"),i.css.toColor("#34e2e2"),i.css.toColor("#eeeeec")],t=[0,95,135,175,215,255],r=0;r<216;r++){var o=t[r/36%6|0],n=t[r/6%6|0],s=t[r%6];e.push({css:i.channels.toCss(o,n,s),rgba:i.channels.toRgba(o,n,s)})}for(r=0;r<24;r++){var a=8+10*r;e.push({css:i.channels.toCss(a,a,a),rgba:i.channels.toRgba(a,a,a)})}return e}());var h=function(){function e(e,r){this.allowTransparency=r;var h=e.createElement("canvas");h.width=1,h.height=1;var u=h.getContext("2d");if(!u)throw new Error("Could not get rendering context");this._ctx=u,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new o.ColorContrastCache,this.colors={foreground:n,background:s,cursor:a,cursorAccent:c,selectionTransparent:l,selectionOpaque:i.color.blend(s,l),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return e.prototype.onOptionsChange=function(e){"minimumContrastRatio"===e&&this._contrastCache.clear()},e.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,n),this.colors.background=this._parseColor(e.background,s),this.colors.cursor=this._parseColor(e.cursor,a,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,c,!0),this.colors.selectionTransparent=this._parseColor(e.selection,l,!0),this.colors.selectionOpaque=i.color.blend(this.colors.background,this.colors.selectionTransparent),i.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=i.color.opacity(this.colors.selectionTransparent,.3)),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]),this._contrastCache.clear()},e.prototype._parseColor=function(e,t,r){if(void 0===r&&(r=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 o=this._ctx.getImageData(0,0,1,1).data;if(255!==o[3]){if(!r)return console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t;var n=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map((function(e){return Number(e)})),s=n[0],a=n[1],c=n[2],l=n[3],h=Math.round(255*l);return{rgba:i.channels.toRgba(s,a,c,h),css:e}}return{css:this._ctx.fillStyle,rgba:i.channels.toRgba(o[0],o[1],o[2],o[3])}},e}();t.ColorManager=h},9631:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(){for(var e,t=[],r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,r,i){e.addEventListener(t,r,i);var o=!1;return{dispose:function(){o||(o=!0,e.removeEventListener(t,r,i))}}}},3551:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZone=t.Linkifier=void 0;var n=r(8460),s=r(2585),a=function(){function e(e,t,r){this._bufferService=e,this._logService=t,this._unicodeService=r,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new n.EventEmitter,this._onHideLinkUnderline=new n.EventEmitter,this._onLinkTooltip=new n.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(e.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),e.prototype.attachToDom=function(e,t){this._element=e,this._mouseZoneManager=t},e.prototype.linkifyRows=function(t,r){var i=this;this._mouseZoneManager&&(void 0===this._rowsToLinkify.start||void 0===this._rowsToLinkify.end?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=r):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,r)),this._mouseZoneManager.clearAll(t,r),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout((function(){return i._linkifyRows()}),e._timeBeforeLatency))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var e=this._bufferService.buffer;if(void 0!==this._rowsToLinkify.start&&void 0!==this._rowsToLinkify.end){var t=e.ydisp+this._rowsToLinkify.start;if(!(t>=e.lines.length)){for(var r=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,i=Math.ceil(2e3/this._bufferService.cols),o=this._bufferService.buffer.iterator(!1,t,r,i,i);o.hasNext();)for(var n=o.next(),s=0;s=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>9&511:void 0;r.validationCallback?r.validationCallback(a,(function(e){o._rowsTimeoutId||e&&o._addLink(l[1],l[0]-o._bufferService.buffer.ydisp,a,r,d)})):c._addLink(l[1],l[0]-c._bufferService.buffer.ydisp,a,r,d)},c=this;null!==(i=n.exec(t))&&"break"!==a(););},e.prototype._addLink=function(e,t,r,i,o){var n=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(r),a=e%this._bufferService.cols,l=t+Math.floor(e/this._bufferService.cols),h=(a+s)%this._bufferService.cols,u=l+Math.floor((a+s)/this._bufferService.cols);0===h&&(h=this._bufferService.cols,u--),this._mouseZoneManager.add(new c(a+1,l+1,h+1,u+1,(function(e){if(i.handler)return i.handler(e,r);var t=window.open();t?(t.opener=null,t.location.href=r):console.warn("Opening link blocked as opener could not be cleared")}),(function(){n._onShowLinkUnderline.fire(n._createLinkHoverEvent(a,l,h,u,o)),n._element.classList.add("xterm-cursor-pointer")}),(function(e){n._onLinkTooltip.fire(n._createLinkHoverEvent(a,l,h,u,o)),i.hoverTooltipCallback&&i.hoverTooltipCallback(e,r,{start:{x:a,y:l},end:{x:h,y:u}})}),(function(){n._onHideLinkUnderline.fire(n._createLinkHoverEvent(a,l,h,u,o)),n._element.classList.remove("xterm-cursor-pointer"),i.hoverLeaveCallback&&i.hoverLeaveCallback()}),(function(e){return!i.willLinkActivate||i.willLinkActivate(e,r)})))}},e.prototype._createLinkHoverEvent=function(e,t,r,i,o){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:o}},e._timeBeforeLatency=200,e=i([o(0,s.IBufferService),o(1,s.ILogService),o(2,s.IUnicodeService)],e)}();t.Linkifier=a;var c=function(e,t,r,i,o,n,s,a,c){this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.clickCallback=o,this.hoverCallback=n,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=c};t.MouseZone=c},6465:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;var a=r(2585),c=r(8460),l=r(844),h=r(3656),u=function(e){function t(t){var r=e.call(this)||this;return r._bufferService=t,r._linkProviders=[],r._linkCacheDisposables=[],r._isMouseOut=!0,r._activeLine=-1,r._onShowLinkUnderline=r.register(new c.EventEmitter),r._onHideLinkUnderline=r.register(new c.EventEmitter),r.register(l.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return o(t,e),Object.defineProperty(t.prototype,"currentLink",{get:function(){return this._currentLink},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),t.prototype.registerLinkProvider=function(e){var t=this;return this._linkProviders.push(e),{dispose:function(){var r=t._linkProviders.indexOf(e);-1!==r&&t._linkProviders.splice(r,1)}}},t.prototype.attachToDom=function(e,t,r){var i=this;this._element=e,this._mouseService=t,this._renderService=r,this.register(h.addDisposableDomListener(this._element,"mouseleave",(function(){i._isMouseOut=!0,i._clearCurrentLink()}))),this.register(h.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(h.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},t.prototype._onMouseMove=function(e){if(this._lastMouseEvent=e,this._element&&this._mouseService){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(t){this._isMouseOut=!1;for(var r=e.composedPath(),i=0;ie?this._bufferService.cols:s.link.range.end.x,l=a;l<=c;l++){if(r.has(l)){o.splice(n--,1);break}r.add(l)}}},t.prototype._checkLinkProviderResult=function(e,t,r){var i,o=this;if(!this._activeProviderReplies)return r;for(var n=this._activeProviderReplies.get(e),s=!1,a=0;a=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,l.disposeArray(this._linkCacheDisposables))},t.prototype._handleNewLink=function(e){var t=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(e.link,r)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:function(){var e,r;return null===(r=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===r?void 0:r.decorations.pointerCursor},set:function(e){var r,i;(null===(r=t._currentLink)||void 0===r?void 0:r.state)&&t._currentLink.state.decorations.pointerCursor!==e&&(t._currentLink.state.decorations.pointerCursor=e,t._currentLink.state.isHovered&&(null===(i=t._element)||void 0===i||i.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:function(){var e,r;return null===(r=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===r?void 0:r.decorations.underline},set:function(r){var i,o,n;(null===(i=t._currentLink)||void 0===i?void 0:i.state)&&(null===(n=null===(o=t._currentLink)||void 0===o?void 0:o.state)||void 0===n?void 0:n.decorations.underline)!==r&&(t._currentLink.state.decorations.underline=r,t._currentLink.state.isHovered&&t._fireUnderlineEvent(e.link,r))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange((function(e){var r=0===e.start?0:e.start+1+t._bufferService.buffer.ydisp;t._clearCurrentLink(r,e.end+1+t._bufferService.buffer.ydisp)}))))}},t.prototype._linkHover=function(e,t,r){var i;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)},t.prototype._fireUnderlineEvent=function(e,t){var r=e.range,i=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-i-1,r.end.x,r.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)},t.prototype._linkLeave=function(e,t,r){var i;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)},t.prototype._linkAtPosition=function(e,t){var r=e.range.start.y===e.range.end.y,i=e.range.start.yt.y;return(r&&e.range.start.x<=t.x&&e.range.end.x>=t.x||i&&e.range.end.x>=t.x||o&&e.range.start.x<=t.x||i&&o)&&e.range.start.y<=t.y&&e.range.end.y>=t.y},t.prototype._positionFromMouseEvent=function(e,t,r){var i=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}},t.prototype._createLinkUnderlineEvent=function(e,t,r,i,o){return{x1:e,y1:t,x2:r,y2:i,cols:this._bufferService.cols,fg:o}},n([s(0,a.IBufferService)],t)}(l.Disposable);t.Linkifier2=u},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},6954:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZoneManager=void 0;var a=r(844),c=r(3656),l=r(4725),h=r(2585),u=function(e){function t(t,r,i,o,n,s){var a=e.call(this)||this;return a._element=t,a._screenElement=r,a._bufferService=i,a._mouseService=o,a._selectionService=n,a._optionsService=s,a._zones=[],a._areZonesActive=!1,a._lastHoverCoords=[void 0,void 0],a._initialSelectionLength=0,a.register(c.addDisposableDomListener(a._element,"mousedown",(function(e){return a._onMouseDown(e)}))),a._mouseMoveListener=function(e){return a._onMouseMove(e)},a._mouseLeaveListener=function(e){return a._onMouseLeave(e)},a._clickListener=function(e){return a._onClick(e)},a}return o(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){e&&t||(e=0,t=this._bufferService.rows-1);for(var r=0;re&&i.y1<=t+1||i.y2>e&&i.y2<=t+1||i.y1t+1)&&(this._currentZone&&this._currentZone===i&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(r--,1))}0===this._zones.length&&this._deactivate()}},t.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},t.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},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,r=this._findZoneEventAt(e);r!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),r&&(this._currentZone=r,r.hoverCallback&&r.hoverCallback(e),this._tooltipTimeout=window.setTimeout((function(){return t._onTooltip(e)}),this._optionsService.options.linkTooltipHoverDuration)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);null==t||t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var t=this._findZoneEventAt(e);(null==t?void 0:t.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e),r=this._getSelectionLength();t&&r===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},t.prototype._findZoneEventAt=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(t)for(var r=t[0],i=t[1],o=0;o=n.x1&&r=n.x1||i===n.y2&&rn.y1&&i{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 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,r){var i=this;this._rowCount=r,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 i._innerRefresh()})))},e.prototype._innerRefresh=function(){if(void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount){var e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(e,t)}},e}();t.RenderDebouncer=r},5596:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;var n=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}return o(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(){var e;this._outerListener&&(null===(e=this._resolutionMediaMatchList)||void 0===e||e.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}(r(844).Disposable);t.ScreenDprMonitor=n},3236:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;var n=r(2950),s=r(1680),a=r(3614),c=r(2584),l=r(5435),h=r(3525),u=r(3551),d=r(9312),f=r(6114),p=r(3656),_=r(9042),g=r(357),v=r(6954),b=r(4567),y=r(1296),m=r(7399),C=r(8460),S=r(8437),w=r(5680),A=r(3230),T=r(4725),E=r(428),R=r(8934),k=r(6465),x=r(5114),P=r(8969),L=r(4774),M=r(4269),D="undefined"!=typeof window?window.document:null,O=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,t)||this;return r.browser=f,r._keyDownHandled=!1,r._onCursorMove=new C.EventEmitter,r._onKey=new C.EventEmitter,r._onRender=new C.EventEmitter,r._onSelectionChange=new C.EventEmitter,r._onTitleChange=new C.EventEmitter,r._onBell=new C.EventEmitter,r._onFocus=new C.EventEmitter,r._onBlur=new C.EventEmitter,r._onA11yCharEmitter=new C.EventEmitter,r._onA11yTabEmitter=new C.EventEmitter,r._setup(),r.linkifier=r._instantiationService.createInstance(u.Linkifier),r.linkifier2=r.register(r._instantiationService.createInstance(k.Linkifier2)),r.register(r._inputHandler.onRequestBell((function(){return r.bell()}))),r.register(r._inputHandler.onRequestRefreshRows((function(e,t){return r.refresh(e,t)}))),r.register(r._inputHandler.onRequestReset((function(){return r.reset()}))),r.register(r._inputHandler.onRequestWindowsOptionsReport((function(e){return r._reportWindowsOptions(e)}))),r.register(r._inputHandler.onAnsiColorChange((function(e){return r._changeAnsiColor(e)}))),r.register(C.forwardEvent(r._inputHandler.onCursorMove,r._onCursorMove)),r.register(C.forwardEvent(r._inputHandler.onTitleChange,r._onTitleChange)),r.register(C.forwardEvent(r._inputHandler.onA11yChar,r._onA11yCharEmitter)),r.register(C.forwardEvent(r._inputHandler.onA11yTab,r._onA11yTabEmitter)),r.register(r._bufferService.onResize((function(e){return r._afterResize(e.cols,e.rows)}))),r}return o(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBell",{get:function(){return this._onBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),t.prototype._changeAnsiColor=function(e){var t,r;if(this._colorManager){for(var i=0,o=e.colors;i4)&&t._coreMouseService.triggerMouseEvent({col:o.x-33,row:o.y-33,button:r,action:i,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey})}var o={mouseup:null,wheel:null,mousedrag:null,mousemove:null},n=function(t){return i(t),t.buttons||(e._document.removeEventListener("mouseup",o.mouseup),o.mousedrag&&e._document.removeEventListener("mousemove",o.mousedrag)),e.cancel(t)},s=function(t){return i(t),t.preventDefault(),e.cancel(t)},a=function(e){e.buttons&&i(e)},l=function(e){e.buttons||i(e)};this.register(this._coreMouseService.onProtocolChange((function(t){t?("debug"===e.optionsService.options.logLevel&&e._logService.debug("Binding to mouse events:",e._coreMouseService.explainEvents(t)),e.element.classList.add("enable-mouse-events"),e._selectionService.disable()):(e._logService.debug("Unbinding from mouse events."),e.element.classList.remove("enable-mouse-events"),e._selectionService.enable()),8&t?o.mousemove||(r.addEventListener("mousemove",l),o.mousemove=l):(r.removeEventListener("mousemove",o.mousemove),o.mousemove=null),16&t?o.wheel||(r.addEventListener("wheel",s,{passive:!1}),o.wheel=s):(r.removeEventListener("wheel",o.wheel),o.wheel=null),2&t?o.mouseup||(o.mouseup=n):(e._document.removeEventListener("mouseup",o.mouseup),o.mouseup=null),4&t?o.mousedrag||(o.mousedrag=a):(e._document.removeEventListener("mousemove",o.mousedrag),o.mousedrag=null)}))),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(p.addDisposableDomListener(r,"mousedown",(function(t){if(t.preventDefault(),e.focus(),e._coreMouseService.areMouseEventsActive&&!e._selectionService.shouldForceSelection(t))return i(t),o.mouseup&&e._document.addEventListener("mouseup",o.mouseup),o.mousedrag&&e._document.addEventListener("mousemove",o.mousedrag),e.cancel(t)}))),this.register(p.addDisposableDomListener(r,"wheel",(function(t){if(o.wheel);else if(!e.buffer.hasScrollback){var r=e.viewport.getLinesScrolled(t);if(0===r)return;for(var i=c.C0.ESC+(e._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(t.deltaY<0?"A":"B"),n="",s=0;s47)},t.prototype._keyUp=function(e){this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e))},t.prototype._keyPress=function(e){var t;if(this._keyDownHandled)return!1;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._onKey.fire({key:t,domEvent:e}),this._showCursor(),this._coreService.triggerDataEvent(t,!0),0))},t.prototype.bell=function(){var e;this._soundBell()&&(null===(e=this._soundService)||void 0===e||e.playBellSound()),this._onBell.fire()},t.prototype.resize=function(t,r){t!==this.cols||r!==this.rows?e.prototype.resize.call(this,t,r):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},t.prototype._afterResize=function(e,t){var r,i;null===(r=this._charSizeService)||void 0===r||r.measure(),null===(i=this.viewport)||void 0===i||i.syncScrollArea(!0)},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=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;var a=r(844),c=r(3656),l=r(4725),h=r(2585),u=function(e){function t(t,r,i,o,n,s,a){var l=e.call(this)||this;return l._scrollLines=t,l._viewportElement=r,l._scrollArea=i,l._bufferService=o,l._optionsService=n,l._charSizeService=s,l._renderService=a,l.scrollBarWidth=0,l._currentRowHeight=0,l._lastRecordedBufferLength=0,l._lastRecordedViewportHeight=0,l._lastRecordedBufferHeight=0,l._lastTouchY=0,l._lastScrollTop=0,l._wheelPartialScroll=0,l._refreshAnimationFrame=null,l._ignoreNextScrollEvent=!1,l.scrollBarWidth=l._viewportElement.offsetWidth-l._scrollArea.offsetWidth||15,l.register(c.addDisposableDomListener(l._viewportElement,"scroll",l._onScroll.bind(l))),setTimeout((function(){return l.syncScrollArea()}),0),l}return o(t,e),t.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(e){var t=this;if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame((function(){return t._innerRefresh()})))},t.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(e){if(void 0===e&&(e=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===t&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)}else this._refresh(e)},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent){if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t)}},t.prototype._bubbleScroll=function(e,t){var r=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&r0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t},t.prototype._applyScrollModifier=function(e,t){var r=this._optionsService.options.fastScrollModifier;return"alt"===r&&t.altKey||"ctrl"===r&&t.ctrlKey||"shift"===r&&t.shiftKey?e*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:e*this._optionsService.options.scrollSensitivity},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},n([s(3,h.IBufferService),s(4,h.IOptionsService),s(5,l.ICharSizeService),s(6,l.IRenderService)],t)}(a.Disposable);t.Viewport=u},2950:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;var n=r(4725),s=r(2585),a=function(){function e(e,t,r,i,o,n){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=i,this._coreService=o,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}return Object.defineProperty(e.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",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,e){var r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((function(){var e;t._isSendingComposition&&(t._isSendingComposition=!1,r.start+=t._dataAlreadySent.length,(e=t._isComposing?t._textarea.value.substring(r.start,r.end):t._textarea.value.substring(r.start)).length>0&&t._coreService.triggerDataEvent(e,!0))}),0)}else{this._isSendingComposition=!1;var i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout((function(){if(!e._isComposing){var r=e._textarea.value.replace(t,"");r.length>0&&(e._dataAlreadySent=r,e._coreService.triggerDataEvent(r,!0))}}),0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.actualCellHeight,o=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,n=r*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=n+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var s=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout((function(){return t.updateCompositionElements(!0)}),0)}},i([o(2,s.IBufferService),o(3,s.IOptionsService),o(4,s.ICoreService),o(5,n.IRenderService)],e)}();t.CompositionHelper=a},9806:(e,t)=>{function r(e,t){var r=t.getBoundingClientRect();return[e.clientX-r.left,e.clientY-r.top]}Object.defineProperty(t,"__esModule",{value:!0}),t.getRawByteCoords=t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=r,t.getCoords=function(e,t,i,o,n,s,a,c){if(n){var l=r(e,t);if(l)return l[0]=Math.ceil((l[0]+(c?s/2:0))/s),l[1]=Math.ceil(l[1]/a),l[0]=Math.min(Math.max(l[0],1),i+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),o),l}},t.getRawByteCoords=function(e){if(e)return{x:e[0]+32,y:e[1]+32}}},9504:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;var i=r(2584);function o(e,t,r,i){var o=e-n(r,e),a=t-n(r,t);return l(Math.abs(o-a)-function(e,t,r){for(var i=0,o=e-n(r,e),a=t-n(r,t),c=0;c=0&&tt?"A":"B"}function a(e,t,r,i,o,n){for(var s=e,a=t,c="";s!==r||a!==i;)s+=o?1:-1,o&&s>n.cols-1?(c+=n.buffer.translateBufferLineToString(a,!1,e,s),s=0,e=0,a++):!o&&s<0&&(c+=n.buffer.translateBufferLineToString(a,!1,0,e+1),e=s=n.cols-1,a--);return c+n.buffer.translateBufferLineToString(a,!1,e,s)}function c(e,t){var r=t?"O":"[";return i.C0.ESC+r+e}function l(e,t){e=Math.floor(e);for(var r="",i=0;i0?i-n(s,i):t;var d=i,f=function(e,t,r,i,s,a){var c;return c=o(r,i,s,a).length>0?i-n(s,i):t,e=r&&ce?"D":"C",l(Math.abs(h-e),c(s,i));s=u>t?"D":"C";var d=Math.abs(u-t);return l(function(e,t){return t.cols-e}(u>t?e:h,r)+(d-1)*r.cols+1+((u>t?h:e)-1),c(s,i))}},244:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 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 r=this,i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=function(){return r._wrappedAddonDispose(i)},t.activate(e)},e.prototype._wrappedAddonDispose=function(e){if(!e.isDisposed){for(var t=-1,r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;var i=r(511),o=r(3236),n=r(9042),s=r(8460),a=r(244),c=function(){function e(e){this._core=new o.Terminal(e),this._addonManager=new a.AddonManager}return e.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBell",{get:function(){return this._core.onBell},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new d(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unicode",{get:function(){return this._checkProposedApi(),new f(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._checkProposedApi(),this._buffer||(this._buffer=new h(this._core)),this._buffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.resize=function(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)},e.prototype.open=function(e){this._core.open(e)},e.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},e.prototype.registerLinkMatcher=function(e,t,r){return this._checkProposedApi(),this._core.registerLinkMatcher(e,t,r)},e.prototype.deregisterLinkMatcher=function(e){this._checkProposedApi(),this._core.deregisterLinkMatcher(e)},e.prototype.registerLinkProvider=function(e){return this._checkProposedApi(),this._core.registerLinkProvider(e)},e.prototype.registerCharacterJoiner=function(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)},e.prototype.deregisterCharacterJoiner=function(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)},e.prototype.registerMarker=function(e){return this._checkProposedApi(),this._verifyIntegers(e),this._core.addMarker(e)},e.prototype.addMarker=function(e){return this.registerMarker(e)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.select=function(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)},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._verifyIntegers(e,t),this._core.selectLines(e,t)},e.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},e.prototype.scrollLines=function(e){this._verifyIntegers(e),this._core.scrollLines(e)},e.prototype.scrollPages=function(e){this._verifyIntegers(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._verifyIntegers(e),this._core.scrollToLine(e)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(e,t){this._core.write(e,t)},e.prototype.writeUtf8=function(e,t){this._core.write(e,t)},e.prototype.writeln=function(e,t){this._core.write(e),this._core.write("\r\n",t)},e.prototype.paste=function(e){this._core.paste(e)},e.prototype.getOption=function(e){return this._core.optionsService.getOption(e)},e.prototype.setOption=function(e,t){this._core.optionsService.setOption(e,t)},e.prototype.refresh=function(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)},e.prototype.reset=function(){this._core.reset()},e.prototype.loadAddon=function(e){return this._addonManager.loadAddon(this,e)},Object.defineProperty(e,"strings",{get:function(){return n},enumerable:!1,configurable:!0}),e.prototype._verifyIntegers=function(){for(var e=[],t=0;t=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new i.CellData)},e.prototype.translateToString=function(e,t,r){return this._line.translateToString(e,t,r)},e}(),d=function(){function e(e){this._core=e}return e.prototype.registerCsiHandler=function(e,t){return this._core.registerCsiHandler(e,(function(e){return t(e.toArray())}))},e.prototype.addCsiHandler=function(e,t){return this.registerCsiHandler(e,t)},e.prototype.registerDcsHandler=function(e,t){return this._core.registerDcsHandler(e,(function(e,r){return t(e,r.toArray())}))},e.prototype.addDcsHandler=function(e,t){return this.registerDcsHandler(e,t)},e.prototype.registerEscHandler=function(e,t){return this._core.registerEscHandler(e,t)},e.prototype.addEscHandler=function(e,t){return this.registerEscHandler(e,t)},e.prototype.registerOscHandler=function(e,t){return this._core.registerOscHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this.registerOscHandler(e,t)},e}(),f=function(){function e(e){this._core=e}return e.prototype.register=function(e){this._core.unicodeService.register(e)},Object.defineProperty(e.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(e){this._core.unicodeService.activeVersion=e},enumerable:!1,configurable:!0}),e}()},1546:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;var i=r(643),o=r(8803),n=r(1420),s=r(3734),a=r(1752),c=r(4774),l=r(9631),h=function(){function e(e,t,r,i,o,n,s,a){this._container=e,this._alpha=i,this._colors=o,this._rendererId=n,this._bufferService=s,this._optionsService=a,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){var e;l.removeElementFromParent(this._canvas),null===(e=this._charAtlas)||void 0===e||e.dispose()},e.prototype._initCanvas=function(){this._ctx=a.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},e.prototype.onOptionsChanged=function(){},e.prototype.onBlur=function(){},e.prototype.onFocus=function(){},e.prototype.onCursorMove=function(){},e.prototype.onGridChanged=function(e,t){},e.prototype.onSelectionChanged=function(e,t,r){void 0===r&&(r=!1)},e.prototype.setColors=function(e){this._refreshCharAtlas(e)},e.prototype._setTransparency=function(e){if(e!==this._alpha){var t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},e.prototype._refreshCharAtlas=function(e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=n.acquireCharAtlas(this._optionsService.options,this._rendererId,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},e.prototype._fillCells=function(e,t,r,i){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight)},e.prototype._fillBottomLineAtCells=function(e,t,r){void 0===r&&(r=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},e.prototype._fillLeftLineAtCell=function(e,t,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio*r,this._scaledCellHeight)},e.prototype._strokeRectAtCell=function(e,t,r,i){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,i*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,r,i){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight))},e.prototype._fillCharTrueColor=function(e,t,r){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="ideographic",this._clipRow(r),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight)},e.prototype._drawChars=function(e,t,r){var n,s,a=this._getContrastColor(e);a||e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(e,t,r,a):(e.isInverse()?(n=e.isBgDefault()?o.INVERTED_DEFAULT_COLOR:e.getBgColor(),s=e.isFgDefault()?o.INVERTED_DEFAULT_COLOR:e.getFgColor()):(s=e.isBgDefault()?i.DEFAULT_COLOR:e.getBgColor(),n=e.isFgDefault()?i.DEFAULT_COLOR:e.getFgColor()),n+=this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8?8:0,this._currentGlyphIdentifier.chars=e.getChars()||i.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||i.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=s,this._currentGlyphIdentifier.fg=n,this._currentGlyphIdentifier.bold=!!e.isBold(),this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,r))},e.prototype._drawUncachedChars=function(e,t,r,i){if(this._ctx.save(),this._ctx.font=this._getFont(!!e.isBold(),!!e.isItalic()),this._ctx.textBaseline="ideographic",e.isInverse())if(i)this._ctx.fillStyle=i.css;else if(e.isBgDefault())this._ctx.fillStyle=c.color.opaque(this._colors.background).css;else if(e.isBgRGB())this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var n=e.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),this._ctx.fillStyle=this._colors.ansi[n].css}else if(i)this._ctx.fillStyle=i.css;else if(e.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(e.isFgRGB())this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var a=e.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&a<8&&(a+=8),this._ctx.fillStyle=this._colors.ansi[a].css}this._clipRow(r),e.isDim()&&(this._ctx.globalAlpha=o.DIM_OPACITY),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight),this._ctx.restore()},e.prototype._clipRow=function(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t){return(t?"italic":"")+" "+(e?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},e.prototype._getContrastColor=function(e){if(1!==this._optionsService.options.minimumContrastRatio){var t=this._colors.contrastCache.getColor(e.bg,e.fg);if(void 0!==t)return t||void 0;var r=e.getFgColor(),i=e.getFgColorMode(),o=e.getBgColor(),n=e.getBgColorMode(),s=!!e.isInverse(),a=!!e.isInverse();if(s){var l=r;r=o,o=l;var h=i;i=n,n=h}var u=this._resolveBackgroundRgba(n,o,s),d=this._resolveForegroundRgba(i,r,s,a),f=c.rgba.ensureContrastRatio(u,d,this._optionsService.options.minimumContrastRatio);if(f){var p={css:c.channels.toCss(f>>24&255,f>>16&255,f>>8&255),rgba:f};return this._colors.contrastCache.setColor(e.bg,e.fg,p),p}this._colors.contrastCache.setColor(e.bg,e.fg,null)}},e.prototype._resolveBackgroundRgba=function(e,t,r){switch(e){case 16777216:case 33554432:return this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return r?this._colors.foreground.rgba:this._colors.background.rgba}},e.prototype._resolveForegroundRgba=function(e,t,r,i){switch(e){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&i&&t<8&&(t+=8),this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return r?this._colors.background.rgba:this._colors.foreground.rgba}},e}();t.BaseRenderLayer=h},2512:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;var a=r(1546),c=r(511),l=r(2585),h=r(4725),u=600,d=function(e){function t(t,r,i,o,n,s,a,l,h){var u=e.call(this,t,"cursor",r,!0,i,o,s,a)||this;return u._onRequestRedraw=n,u._coreService=l,u._coreBrowserService=h,u._cell=new c.CellData,u._state={x:0,y:0,isFocused:!1,style:"",width:0},u._cursorRenderers={bar:u._renderBarCursor.bind(u),block:u._renderBlockCursor.bind(u),underline:u._renderUnderlineCursor.bind(u)},u}return o(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},t.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},t.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onOptionsChanged=function(){var e,t=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new f(this._coreBrowserService.isFocused,(function(){t._render(!0)}))):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype.onGridChanged=function(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype._render=function(e){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,r=t-this._bufferService.buffer.ydisp;if(r<0||r>=this._bufferService.rows)this._clearCursor();else{var i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(i,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var o=this._optionsService.options.cursorStyle;return o&&"block"!==o?this._cursorRenderers[o](i,r,this._cell):this._renderBlurCursor(i,r,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=r,this._state.isFocused=!1,this._state.style=o,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===r&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](i,r,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=r,this._state.isFocused=!1,this._state.style=this._optionsService.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:0,y:0,isFocused:!1,style:"",width:0})},t.prototype._renderBarCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.options.cursorWidth),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,t,r.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(r,e,t),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,t,r.getWidth(),1),this._ctx.restore()},n([s(5,l.IBufferService),s(6,l.IOptionsService),s(7,l.ICoreService),s(8,h.ICoreBrowserService)],t)}(a.BaseRenderLayer);t.CursorRenderLayer=d;var f=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.restartBlinkAnimation=function(){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){e._renderCallback(),e._animationFrame=void 0}))))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=u),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout((function(){if(t._animationTimeRestarted){var e=u-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=void 0,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0})),t._blinkInterval=window.setInterval((function(){if(t._animationTimeRestarted){var e=u-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=void 0,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0}))}),u)}),e)},e.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},e}()},3700:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0;var r=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var r=0;r=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;var a=r(1546),c=r(8803),l=r(2040),h=r(2585),u=function(e){function t(t,r,i,o,n,s,a,c){var l=e.call(this,t,"link",r,!0,i,o,a,c)||this;return n.onShowLinkUnderline((function(e){return l._onShowLinkUnderline(e)})),n.onHideLinkUnderline((function(e){return l._onHideLinkUnderline(e)})),s.onShowLinkUnderline((function(e){return l._onShowLinkUnderline(e)})),s.onHideLinkUnderline((function(e){return l._onHideLinkUnderline(e)})),l}return o(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._state=void 0},t.prototype.reset=function(){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=void 0}},t.prototype._onShowLinkUnderline=function(e){if(e.fg===c.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:e.fg&&l.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=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;var a=r(9596),c=r(4149),l=r(2512),h=r(5098),u=r(844),d=r(4725),f=r(2585),p=r(1420),_=r(8460),g=1,v=function(e){function t(t,r,i,o,n,s,u,d){var f=e.call(this)||this;f._colors=t,f._screenElement=r,f._bufferService=s,f._charSizeService=u,f._optionsService=d,f._id=g++,f._onRequestRedraw=new _.EventEmitter;var p=f._optionsService.options.allowTransparency;return f._renderLayers=[n.createInstance(a.TextRenderLayer,f._screenElement,0,f._colors,p,f._id),n.createInstance(c.SelectionRenderLayer,f._screenElement,1,f._colors,f._id),n.createInstance(h.LinkRenderLayer,f._screenElement,2,f._colors,f._id,i,o),n.createInstance(l.CursorRenderLayer,f._screenElement,3,f._colors,f._id,f._onRequestRedraw)],f.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},f._devicePixelRatio=window.devicePixelRatio,f._updateDimensions(),f.onOptionsChanged(),f}return o(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){for(var t=0,r=this._renderLayers;t{Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e}},4149:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;var a=r(1546),c=r(2585),l=function(e){function t(t,r,i,o,n,s){var a=e.call(this,t,"selection",r,!0,i,o,n,s)||this;return a._clearState(),a}return o(t,e),t.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._clearState()},t.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},t.prototype.onSelectionChanged=function(e,t,r){if(this._didStateChange(e,t,r,this._bufferService.buffer.ydisp))if(this._clearAll(),e&&t){var i=e[1]-this._bufferService.buffer.ydisp,o=t[1]-this._bufferService.buffer.ydisp,n=Math.max(i,0),s=Math.min(o,this._bufferService.rows-1);if(n>=this._bufferService.rows||s<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=this._colors.selectionTransparent.css,r){var a=e[0],c=t[0]-a,l=s-n+1;this._fillCells(a,n,c,l)}else{a=i===n?e[0]:0;var h=n===o?t[0]:this._bufferService.cols;this._fillCells(a,n,h-a,1);var u=Math.max(s-n-1,0);if(this._fillCells(0,n+1,this._bufferService.cols,u),n!==s){var d=o===s?t[0]:this._bufferService.cols;this._fillCells(0,s,d,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=r,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,r,i){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||r!==this._state.columnSelectMode||i!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},n([s(4,c.IBufferService),s(5,c.IOptionsService)],t)}(a.BaseRenderLayer);t.SelectionRenderLayer=l},9596:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;var a=r(3700),c=r(1546),l=r(3734),h=r(643),u=r(511),d=r(2585),f=r(4725),p=r(4269),_=function(e){function t(t,r,i,o,n,s,c,l){var h=e.call(this,t,"text",r,o,i,n,s,c)||this;return h._characterJoinerService=l,h._characterWidth=0,h._characterFont="",h._characterOverlapCache={},h._workCell=new u.CellData,h._state=new a.GridCache,h}return o(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t);var r=this._getFont(!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===r||(this._characterWidth=t.scaledCharWidth,this._characterFont=r,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},t.prototype.reset=function(){this._state.clear(),this._clearAll()},t.prototype._forEachCell=function(e,t,r){for(var i=e;i<=t;i++)for(var o=i+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.lines.get(o),s=this._characterJoinerService.getJoinedCharacters(o),a=0;a0&&a===s[0][0]){l=!0;var d=s.shift();c=new p.JoinedCellData(this._workCell,n.translateToString(!0,d[0],d[1]),d[1]-d[0]),u=d[1]-1}!l&&this._isOverlapping(c)&&uthis._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=r,r},n([s(5,d.IBufferService),s(6,d.IOptionsService),s(7,f.ICharacterJoinerService)],t)}(c.BaseRenderLayer);t.TextRenderLayer=_},9616:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseCharAtlas=void 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.BaseCharAtlas=r},1420:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireCharAtlas=void 0;var i=r(2040),o=r(1906),n=[];t.acquireCharAtlas=function(e,t,r,s,a){for(var c=i.generateConfig(s,a,e,r),l=0;l=0){if(i.configEquals(u.config,c))return u.atlas;1===u.ownedBy.length?(u.atlas.dispose(),n.splice(l,1)):u.ownedBy.splice(h,1);break}}for(l=0;l{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;var i=r(643);t.generateConfig=function(e,t,r,i){var o={foreground:i.foreground,background:i.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:i.ansi};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,colors:o}},t.configEquals=function(e,t){for(var r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR_ATLAS_CELL_SPACING=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0,t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},1906:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.NoneCharAtlas=t.DynamicCharAtlas=t.getGlyphCacheKey=void 0;var n=r(8803),s=r(9616),a=r(5680),c=r(7001),l=r(6114),h=r(1752),u=r(4774),d={css:"rgba(0, 0, 0, 0)",rgba:0};function f(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=f;var p=function(e){function t(t,r){var i=e.call(this)||this;i._config=r,i._drawToCacheCount=0,i._glyphsWaitingOnBitmap=[],i._bitmapCommitTimeout=null,i._bitmap=null,i._cacheCanvas=t.createElement("canvas"),i._cacheCanvas.width=1024,i._cacheCanvas.height=1024,i._cacheCtx=h.throwIfFalsy(i._cacheCanvas.getContext("2d",{alpha:!0}));var o=t.createElement("canvas");o.width=i._config.scaledCharWidth,o.height=i._config.scaledCharHeight,i._tmpCtx=h.throwIfFalsy(o.getContext("2d",{alpha:i._config.allowTransparency})),i._width=Math.floor(1024/i._config.scaledCharWidth),i._height=Math.floor(1024/i._config.scaledCharHeight);var n=i._width*i._height;return i._cacheMap=new c.LRUMap(n),i._cacheMap.prealloc(n),i}return o(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,r,i){if(32===t.code)return!0;if(!this._canCache(t))return!1;var o=f(t),n=this._cacheMap.get(o);if(null!=n)return this._drawFromCache(e,n,r,i),!0;if(this._drawToCacheCount<100){var s;s=this._cacheMap.size>>24,o=t.rgba>>>16&255,n=t.rgba>>>8&255,s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.LRUMap=void 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,r=e.next;e===this._head&&(this._head=r),e===this._tail&&(this._tail=t),null!==t&&(t.next=r),null!==r&&(r.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,r=0;r=this.capacity)r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=e,r.value=t,this._map[e]=r;else{var i=this._nodePool;i.length>0?((r=i.pop()).key=e,r.value=t):r={prev:null,next:null,key:e,value:t},this._map[e]=r,this.size++}this._appendNode(r)},e}();t.LRUMap=r},1296:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;var a=r(3787),c=r(8803),l=r(844),h=r(4725),u=r(2585),d=r(8460),f=r(4774),p=r(9631),_="xterm-dom-renderer-owner-",g="xterm-fg-",v="xterm-bg-",b="xterm-focus",y=1,m=function(e){function t(t,r,i,o,n,s,c,l,h,u){var d=e.call(this)||this;return d._colors=t,d._element=r,d._screenElement=i,d._viewportElement=o,d._linkifier=n,d._linkifier2=s,d._charSizeService=l,d._optionsService=h,d._bufferService=u,d._terminalClass=y++,d._rowElements=[],d._rowContainer=document.createElement("div"),d._rowContainer.classList.add("xterm-rows"),d._rowContainer.style.lineHeight="normal",d._rowContainer.setAttribute("aria-hidden","true"),d._refreshRowElements(d._bufferService.cols,d._bufferService.rows),d._selectionContainer=document.createElement("div"),d._selectionContainer.classList.add("xterm-selection"),d._selectionContainer.setAttribute("aria-hidden","true"),d.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},d._updateDimensions(),d._injectCss(),d._rowFactory=c.createInstance(a.DomRendererRowFactory,document,d._colors),d._element.classList.add(_+d._terminalClass),d._screenElement.appendChild(d._rowContainer),d._screenElement.appendChild(d._selectionContainer),d._linkifier.onShowLinkUnderline((function(e){return d._onLinkHover(e)})),d._linkifier.onHideLinkUnderline((function(e){return d._onLinkLeave(e)})),d._linkifier2.onShowLinkUnderline((function(e){return d._onLinkHover(e)})),d._linkifier2.onHideLinkUnderline((function(e){return d._onLinkLeave(e)})),d}return o(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return(new d.EventEmitter).event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._element.classList.remove(_+this._terminalClass),p.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var e=0,t=this._rowElements;et;)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(b)},t.prototype.onFocus=function(){this._rowContainer.classList.add(b)},t.prototype.onSelectionChanged=function(e,t,r){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var i=e[1]-this._bufferService.buffer.ydisp,o=t[1]-this._bufferService.buffer.ydisp,n=Math.max(i,0),s=Math.min(o,this._bufferService.rows-1);if(!(n>=this._bufferService.rows||s<0)){var a=document.createDocumentFragment();if(r)a.appendChild(this._createSelectionElement(n,e[0],t[0],s-n+1));else{var c=i===n?e[0]:0,l=n===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,c,l));var h=s-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,h)),n!==s){var u=o===s?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},t.prototype._createSelectionElement=function(e,t,r,i){void 0===i&&(i=1);var o=document.createElement("div");return o.style.height=i*this.dimensions.actualCellHeight+"px",o.style.top=e*this.dimensions.actualCellHeight+"px",o.style.left=t*this.dimensions.actualCellWidth+"px",o.style.width=this.dimensions.actualCellWidth*(r-t)+"px",o},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},t.prototype.clear=function(){for(var e=0,t=this._rowElements;e=o&&(e=0,r++)}},n([s(6,u.IInstantiationService),s(7,h.ICharSizeService),s(8,u.IOptionsService),s(9,u.IBufferService)],t)}(l.Disposable);t.DomRenderer=m},3787:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=t.CURSOR_STYLE_UNDERLINE_CLASS=t.CURSOR_STYLE_BAR_CLASS=t.CURSOR_STYLE_BLOCK_CLASS=t.CURSOR_BLINK_CLASS=t.CURSOR_CLASS=t.UNDERLINE_CLASS=t.ITALIC_CLASS=t.DIM_CLASS=t.BOLD_CLASS=void 0;var n=r(8803),s=r(643),a=r(511),c=r(2585),l=r(4774),h=r(4725),u=r(4269);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 d=function(){function e(e,t,r,i){this._document=e,this._colors=t,this._characterJoinerService=r,this._optionsService=i,this._workCell=new a.CellData}return e.prototype.setColors=function(e){this._colors=e},e.prototype.createRow=function(e,r,i,o,a,c,h,d){for(var p=this._document.createDocumentFragment(),_=this._characterJoinerService.getJoinedCharacters(r),g=0,v=Math.min(e.length,d)-1;v>=0;v--)if(e.loadCell(v,this._workCell).getCode()!==s.NULL_CELL_CODE||i&&v===a){g=v+1;break}for(v=0;v0&&v===_[0][0]){y=!0;var S=_.shift();C=new u.JoinedCellData(this._workCell,e.translateToString(!0,S[0],S[1]),S[1]-S[0]),m=S[1]-1,b=C.getWidth()}var w=this._document.createElement("span");if(b>1&&(w.style.width=h*b+"px"),y&&(w.style.display="inline",a>=v&&a<=m&&(a=v)),i&&v===a)switch(w.classList.add(t.CURSOR_CLASS),c&&w.classList.add(t.CURSOR_BLINK_CLASS),o){case"bar":w.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":w.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:w.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}C.isBold()&&w.classList.add(t.BOLD_CLASS),C.isItalic()&&w.classList.add(t.ITALIC_CLASS),C.isDim()&&w.classList.add(t.DIM_CLASS),C.isUnderline()&&w.classList.add(t.UNDERLINE_CLASS),C.isInvisible()?w.textContent=s.WHITESPACE_CELL_CHAR:w.textContent=C.getChars()||s.WHITESPACE_CELL_CHAR;var A=C.getFgColor(),T=C.getFgColorMode(),E=C.getBgColor(),R=C.getBgColorMode(),k=!!C.isInverse();if(k){var x=A;A=E,E=x;var P=T;T=R,R=P}switch(T){case 16777216:case 33554432:C.isBold()&&A<8&&this._optionsService.options.drawBoldTextInBrightColors&&(A+=8),this._applyMinimumContrast(w,this._colors.background,this._colors.ansi[A])||w.classList.add("xterm-fg-"+A);break;case 50331648:var L=l.rgba.toColor(A>>16&255,A>>8&255,255&A);this._applyMinimumContrast(w,this._colors.background,L)||this._addStyle(w,"color:#"+f(A.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(w,this._colors.background,this._colors.foreground)||k&&w.classList.add("xterm-fg-"+n.INVERTED_DEFAULT_COLOR)}switch(R){case 16777216:case 33554432:w.classList.add("xterm-bg-"+E);break;case 50331648:this._addStyle(w,"background-color:#"+f(E.toString(16),"0",6));break;case 0:default:k&&w.classList.add("xterm-bg-"+n.INVERTED_DEFAULT_COLOR)}p.appendChild(w),v=m}}return p},e.prototype._applyMinimumContrast=function(e,t,r){if(1===this._optionsService.options.minimumContrastRatio)return!1;var i=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===i&&(i=l.color.ensureContrastRatio(t,r,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=i?i:null)),!!i&&(this._addStyle(e,"color:"+i.css),!0)},e.prototype._addStyle=function(e,t){e.setAttribute("style",""+(e.getAttribute("style")||"")+t+";")},i([o(2,h.ICharacterJoinerService),o(3,c.IOptionsService)],e)}();function f(e,t,r){for(;e.length{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0;var r=function(){function e(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}return e.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,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:!1,configurable:!0}),Object.defineProperty(e.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),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},428:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;var n=r(2585),s=r(8460),a=function(){function e(e,t,r){this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=new s.EventEmitter,this._measureStrategy=new c(e,t,this._optionsService)}return Object.defineProperty(e.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),e.prototype.measure=function(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())},i([o(2,n.IOptionsService)],e)}();t.CharSizeService=a;var c=function(){function e(e,t,r){this._document=e,this._parentElement=t,this._optionsService=r,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return e.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result},e}()},4269:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;var a=r(3734),c=r(643),l=r(511),h=r(2585),u=function(e){function t(t,r,i){var o=e.call(this)||this;return o.content=0,o.combinedData="",o.fg=t.fg,o.bg=t.bg,o.combinedData=r,o._width=i,o}return o(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}(a.AttributeData);t.JoinedCellData=u;var d=function(){function e(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new l.CellData}return e.prototype.register=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregister=function(e){for(var t=0;t1)for(var u=this._getJoinedRanges(i,s,n,t,o),d=0;d1)for(u=this._getJoinedRanges(i,s,n,t,o),d=0;d{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;var r=function(){function e(e){this._textarea=e}return Object.defineProperty(e.prototype,"isFocused",{get:function(){return(this._textarea.getRootNode?this._textarea.getRootNode():document).activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),e}();t.CoreBrowserService=r},8934:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;var n=r(4725),s=r(9806),a=function(){function e(e,t){this._renderService=e,this._charSizeService=t}return e.prototype.getCoords=function(e,t,r,i,o){return s.getCoords(e,t,r,i,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,o)},e.prototype.getRawByteCoords=function(e,t,r,i){var o=this.getCoords(e,t,r,i);return s.getRawByteCoords(o)},i([o(0,n.IRenderService),o(1,n.ICharSizeService)],e)}();t.MouseService=a},3230:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;var a=r(6193),c=r(8460),l=r(844),h=r(5596),u=r(3656),d=r(2585),f=r(4725),p=function(e){function t(t,r,i,o,n,s){var l=e.call(this)||this;if(l._renderer=t,l._rowCount=r,l._charSizeService=n,l._isPaused=!1,l._needsFullRefresh=!1,l._isNextRenderRedrawOnly=!0,l._needsSelectionRefresh=!1,l._canvasWidth=0,l._canvasHeight=0,l._selectionState={start:void 0,end:void 0,columnSelectMode:!1},l._onDimensionsChange=new c.EventEmitter,l._onRender=new c.EventEmitter,l._onRefreshRequest=new c.EventEmitter,l.register({dispose:function(){return l._renderer.dispose()}}),l._renderDebouncer=new a.RenderDebouncer((function(e,t){return l._renderRows(e,t)})),l.register(l._renderDebouncer),l._screenDprMonitor=new h.ScreenDprMonitor,l._screenDprMonitor.setListener((function(){return l.onDevicePixelRatioChange()})),l.register(l._screenDprMonitor),l.register(s.onResize((function(e){return l._fullRefresh()}))),l.register(o.onOptionChange((function(){return l._renderer.onOptionsChanged()}))),l.register(l._charSizeService.onCharSizeChange((function(){return l.onCharSizeChanged()}))),l._renderer.onRequestRedraw((function(e){return l.refreshRows(e.start,e.end,!0)})),l.register(u.addDisposableDomListener(window,"resize",(function(){return l.onDevicePixelRatioChange()}))),"IntersectionObserver"in window){var d=new IntersectionObserver((function(e){return l._onIntersectionChange(e[e.length-1])}),{threshold:0});d.observe(i),l.register({dispose:function(){return d.disconnect()}})}return l}return o(t,e),Object.defineProperty(t.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),t.prototype._onIntersectionChange=function(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},t.prototype.refreshRows=function(e,t,r){void 0===r&&(r=!1),this._isPaused?this._needsFullRefresh=!0:(r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))},t.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0},t.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},t.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),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.dispose=function(){e.prototype.dispose.call(this)},t.prototype.setRenderer=function(e){var t=this;this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw((function(e){return t.refreshRows(e.start,e.end,!0)})),this._needsSelectionRefresh=!0,this._fullRefresh()},t.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},t.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},t.prototype.onDevicePixelRatioChange=function(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},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,r){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,this._renderer.onSelectionChanged(e,t,r)},t.prototype.onCursorMove=function(){this._renderer.onCursorMove()},t.prototype.clear=function(){this._renderer.clear()},n([s(3,d.IOptionsService),s(4,f.ICharSizeService),s(5,d.IBufferService)],t)}(l.Disposable);t.RenderService=p},9312:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;var a=r(6114),c=r(456),l=r(511),h=r(8460),u=r(4725),d=r(2585),f=r(9806),p=r(9504),_=r(844),g=r(4841),v=String.fromCharCode(160),b=new RegExp(v,"g"),y=function(e){function t(t,r,i,o,n,s,a,u){var d=e.call(this)||this;return d._element=t,d._screenElement=r,d._linkifier=i,d._bufferService=o,d._coreService=n,d._mouseService=s,d._optionsService=a,d._renderService=u,d._dragScrollAmount=0,d._enabled=!0,d._workCell=new l.CellData,d._mouseDownTimeStamp=0,d._oldHasSelection=!1,d._oldSelectionStart=void 0,d._oldSelectionEnd=void 0,d._onLinuxMouseSelection=d.register(new h.EventEmitter),d._onRedrawRequest=d.register(new h.EventEmitter),d._onSelectionChange=d.register(new h.EventEmitter),d._onRequestScrollLines=d.register(new h.EventEmitter),d._mouseMoveListener=function(e){return d._onMouseMove(e)},d._mouseUpListener=function(e){return d._onMouseUp(e)},d._coreService.onUserInput((function(){d.hasSelection&&d.clearSelection()})),d._trimListener=d._bufferService.buffer.lines.onTrim((function(e){return d._onTrim(e)})),d.register(d._bufferService.buffers.onBufferActivate((function(e){return d._onBufferActivate(e)}))),d.enable(),d._model=new c.SelectionModel(d._bufferService),d._activeSelectionMode=0,d}return o(t,e),Object.defineProperty(t.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._removeMouseDownListeners()},t.prototype.reset=function(){this.clearSelection()},t.prototype.disable=function(){this.clearSelection(),this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(t.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:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var r=this._bufferService.buffer,i=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var o=e[1];o<=t[1];o++){var n=r.translateBufferLineToString(o,!0,e[0],t[0]);i.push(n)}}else{var s=e[1]===t[1]?t[0]:void 0;for(i.push(r.translateBufferLineToString(e[1],!0,e[0],s)),o=e[1]+1;o<=t[1]-1;o++){var c=r.lines.get(o);n=r.translateBufferLineToString(o,!0),c&&c.isWrapped?i[i.length-1]+=n:i.push(n)}e[1]!==t[1]&&(c=r.lines.get(t[1]),n=r.translateBufferLineToString(t[1],!0,0,t[0]),c&&c.isWrapped?i[i.length-1]+=n:i.push(n))}return i.map((function(e){return e.replace(b," ")})).join(a.isWindows?"\r\n":"\n")},enumerable:!1,configurable:!0}),t.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},t.prototype.refresh=function(e){var t=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame((function(){return t._refresh()}))),a.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},t.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},t.prototype._isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!!(r&&i&&t)&&this._areCoordsInSelection(t,r,i)},t.prototype._areCoordsInSelection=function(e,t,r){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]},t.prototype._selectWordAtCursor=function(e,t){var r,i,o=null===(i=null===(r=this._linkifier.currentLink)||void 0===r?void 0:r.link)||void 0===i?void 0:i.range;if(o)return this._model.selectionStart=[o.start.x-1,o.start.y-1],this._model.selectionStartLength=g.getRangeLength(o,this._bufferService.cols),this._model.selectionEnd=void 0,!0;var n=this._getMouseBufferCoords(e);return!!n&&(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0)},t.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},t.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()},t.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},t.prototype._getMouseBufferCoords=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t},t.prototype._getMouseEventScrollAmount=function(e){var t=f.getCoordsRelativeToElement(e,this._screenElement)[1],r=this._renderService.dimensions.canvasHeight;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},t.prototype.shouldForceSelection=function(e){return a.isMac?e.altKey&&this._optionsService.options.macOptionClickForcesSelection:e.shiftKey},t.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)}},t.prototype._addMouseDownListeners=function(){var e=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval((function(){return e._dragScroll()}),50)},t.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},t.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},t.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=void 0;var t=this._bufferService.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]++}},t.prototype._onDoubleClick=function(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)},t.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},t.prototype.shouldColumnSelect=function(e){return e.altKey&&!(a.isMac&&this._optionsService.options.macOptionClickForcesSelection)},t.prototype._onMouseMove=function(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var r=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}},t.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.getOption("altClickMovesCursor")){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&void 0!==r[0]&&void 0!==r[1]){var i=p.moveToCellSequence(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!0)}}}else this._fireEventIfSelectionChanged()},t.prototype._fireEventIfSelectionChanged=function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);r?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,r)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,r)},t.prototype._fireOnSelectionChange=function(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()},t.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((function(e){return t._onTrim(e)}))},t.prototype._convertViewportColToCharacterIndex=function(e,t){for(var r=t[0],i=0;t[0]>=i;i++){var o=e.loadCell(i,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:o>1&&t[0]!==i&&(r+=o-1)}return r},t.prototype.setSelection=function(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh()},t.prototype.rightClickSelect=function(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())},t.prototype._getWordAt=function(e,t,r,i){if(void 0===r&&(r=!0),void 0===i&&(i=!0),!(e[0]>=this._bufferService.cols)){var o=this._bufferService.buffer,n=o.lines.get(e[1]);if(n){var s=o.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(n,e),c=a,l=e[0]-a,h=0,u=0,d=0,f=0;if(" "===s.charAt(a)){for(;a>0&&" "===s.charAt(a-1);)a--;for(;c1&&(f+=g-1,c+=g-1);p>0&&a>0&&!this._isCharWordSeparator(n.loadCell(p-1,this._workCell));){n.loadCell(p-1,this._workCell);var v=this._workCell.getChars().length;0===this._workCell.getWidth()?(h++,p--):v>1&&(d+=v-1,a-=v-1),a--,p--}for(;_1&&(f+=b-1,c+=b-1),c++,_++}}c++;var y=a+l-h+d,m=Math.min(this._bufferService.cols,c-a+h+u-d-f);if(t||""!==s.slice(a,c).trim()){if(r&&0===y&&32!==n.getCodePoint(0)){var C=o.lines.get(e[1]-1);if(C&&n.isWrapped&&32!==C.getCodePoint(this._bufferService.cols-1)){var S=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(S){var w=this._bufferService.cols-S.start;y-=w,m+=w}}}if(i&&y+m===this._bufferService.cols&&32!==n.getCodePoint(this._bufferService.cols-1)){var A=o.lines.get(e[1]+1);if(A&&A.isWrapped&&32!==A.getCodePoint(0)){var T=this._getWordAt([0,e[1]+1],!1,!1,!0);T&&(m+=T.length)}}return{start:y,length:m}}}}},t.prototype._selectWordAt=function(e,t){var r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}},t.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var r=e[1];t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}},t.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&this._optionsService.options.wordSeparator.indexOf(e.getChars())>=0},t.prototype._selectLineAt=function(e){var t=this._bufferService.buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._bufferService.cols,t.last],this._model.selectionStartLength=0},n([s(3,d.IBufferService),s(4,d.ICoreService),s(5,u.IMouseService),s(6,d.IOptionsService),s(7,u.IRenderService)],t)}(_.Disposable);t.SelectionService=y},4725:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ICharacterJoinerService=t.ISoundService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;var i=r(8343);t.ICharSizeService=i.createDecorator("CharSizeService"),t.ICoreBrowserService=i.createDecorator("CoreBrowserService"),t.IMouseService=i.createDecorator("MouseService"),t.IRenderService=i.createDecorator("RenderService"),t.ISelectionService=i.createDecorator("SelectionService"),t.ISoundService=i.createDecorator("SoundService"),t.ICharacterJoinerService=i.createDecorator("CharacterJoinerService")},357:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SoundService=void 0;var n=r(2585),s=function(){function e(e){this._optionsService=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:!1,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var r=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),(function(e){r.buffer=e,r.connect(t.destination),r.start(0)}))}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),r=t.length,i=new Uint8Array(r),o=0;o{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;var i=r(8460),o=function(){function e(e){this._maxLength=e,this.onDeleteEmitter=new i.EventEmitter,this.onInsertEmitter=new i.EventEmitter,this.onTrimEmitter=new i.EventEmitter,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:!1,configurable:!0}),Object.defineProperty(e.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,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),r=0;rthis._length)for(var t=this._length;t=e;o--)this._array[this._getCyclicIndex(o+r.length)]=this._array[this._getCyclicIndex(o)];for(o=0;othis._maxLength){var n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.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,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(var i=t-1;i>=0;i--)this.set(e+i+r,this.get(e+i));var o=e+t+r-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(i=0;i{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,r){if(void 0===r&&(r=5),"object"!=typeof t)return t;var i=Array.isArray(t)?[]:{};for(var o in t)i[o]=r<=1?t[o]:t[o]?e(t[o],r-1):t[o];return i}},8969:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;var n=r(844),s=r(2585),a=r(4348),c=r(7866),l=r(744),h=r(7302),u=r(6975),d=r(8460),f=r(1753),p=r(3730),_=r(1480),g=r(7994),v=r(9282),b=r(5435),y=r(5981),m=!1,C=function(e){function t(t){var r=e.call(this)||this;return r._onBinary=new d.EventEmitter,r._onData=new d.EventEmitter,r._onLineFeed=new d.EventEmitter,r._onResize=new d.EventEmitter,r._onScroll=new d.EventEmitter,r._instantiationService=new a.InstantiationService,r.optionsService=new h.OptionsService(t),r._instantiationService.setService(s.IOptionsService,r.optionsService),r._bufferService=r.register(r._instantiationService.createInstance(l.BufferService)),r._instantiationService.setService(s.IBufferService,r._bufferService),r._logService=r._instantiationService.createInstance(c.LogService),r._instantiationService.setService(s.ILogService,r._logService),r._coreService=r.register(r._instantiationService.createInstance(u.CoreService,(function(){return r.scrollToBottom()}))),r._instantiationService.setService(s.ICoreService,r._coreService),r._coreMouseService=r._instantiationService.createInstance(f.CoreMouseService),r._instantiationService.setService(s.ICoreMouseService,r._coreMouseService),r._dirtyRowService=r._instantiationService.createInstance(p.DirtyRowService),r._instantiationService.setService(s.IDirtyRowService,r._dirtyRowService),r.unicodeService=r._instantiationService.createInstance(_.UnicodeService),r._instantiationService.setService(s.IUnicodeService,r.unicodeService),r._charsetService=r._instantiationService.createInstance(g.CharsetService),r._instantiationService.setService(s.ICharsetService,r._charsetService),r._inputHandler=new b.InputHandler(r._bufferService,r._charsetService,r._coreService,r._dirtyRowService,r._logService,r.optionsService,r._coreMouseService,r.unicodeService),r.register(d.forwardEvent(r._inputHandler.onLineFeed,r._onLineFeed)),r.register(r._inputHandler),r.register(d.forwardEvent(r._bufferService.onResize,r._onResize)),r.register(d.forwardEvent(r._coreService.onData,r._onData)),r.register(d.forwardEvent(r._coreService.onBinary,r._onBinary)),r.register(r.optionsService.onOptionChange((function(e){return r._updateOptions(e)}))),r.register(r._bufferService.onScroll((function(e){r._onScroll.fire({position:r._bufferService.buffer.ydisp,source:0}),r._dirtyRowService.markRangeDirty(r._bufferService.buffer.scrollTop,r._bufferService.buffer.scrollBottom)}))),r._writeBuffer=new y.WriteBuffer((function(e,t){return r._inputHandler.parse(e,t)})),r}return o(t,e),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){var e=this;return this._onScrollApi||(this._onScrollApi=new d.EventEmitter,this.register(this._onScroll.event((function(t){var r;null===(r=e._onScrollApi)||void 0===r||r.fire(t.position)})))),this._onScrollApi.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var t;this._isDisposed||(e.prototype.dispose.call(this),null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)},t.prototype.write=function(e,t){this._writeBuffer.write(e,t)},t.prototype.writeSync=function(e,t){this._logService.logLevel<=s.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e,t)},t.prototype.resize=function(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,l.MINIMUM_COLS),t=Math.max(t,l.MINIMUM_ROWS),this._bufferService.resize(e,t))},t.prototype.scroll=function(e,t){void 0===t&&(t=!1),this._bufferService.scroll(e,t)},t.prototype.scrollLines=function(e,t,r){this._bufferService.scrollLines(e,t,r)},t.prototype.scrollPages=function(e){this._bufferService.scrollPages(e)},t.prototype.scrollToTop=function(){this._bufferService.scrollToTop()},t.prototype.scrollToBottom=function(){this._bufferService.scrollToBottom()},t.prototype.scrollToLine=function(e){this._bufferService.scrollToLine(e)},t.prototype.registerEscHandler=function(e,t){return this._inputHandler.registerEscHandler(e,t)},t.prototype.registerDcsHandler=function(e,t){return this._inputHandler.registerDcsHandler(e,t)},t.prototype.registerCsiHandler=function(e,t){return this._inputHandler.registerCsiHandler(e,t)},t.prototype.registerOscHandler=function(e,t){return this._inputHandler.registerOscHandler(e,t)},t.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},t.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},t.prototype._updateOptions=function(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}},t.prototype._enableWindowsMode=function(){var e=this;if(!this._windowsMode){var t=[];t.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},(function(){return v.updateWindowsModeWrappedState(e._bufferService),!1}))),this._windowsMode={dispose:function(){for(var e=0,r=t;e{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0;var r=function(){function e(){this._listeners=[],this._disposed=!1}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(){if(!e._disposed)for(var r=0;r24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(n=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));var w=function(){function e(e,t,r,i){this._bufferService=e,this._coreService=t,this._logService=r,this._optionsService=i,this._data=new Uint32Array(0)}return e.prototype.hook=function(e){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,r){this._data=h.concat(this._data,e.subarray(t,r))},e.prototype.unhook=function(e){if(!e)return this._data=new Uint32Array(0),!0;var t=u.utf32ToString(this._data);switch(this._data=new Uint32Array(0),t){case'"q':this._coreService.triggerDataEvent(s.C0.ESC+'P1$r0"q'+s.C0.ESC+"\\");break;case'"p':this._coreService.triggerDataEvent(s.C0.ESC+'P1$r61;1"p'+s.C0.ESC+"\\");break;case"r":var r=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";this._coreService.triggerDataEvent(s.C0.ESC+"P1$r"+r+s.C0.ESC+"\\");break;case"m":this._coreService.triggerDataEvent(s.C0.ESC+"P1$r0m"+s.C0.ESC+"\\");break;case" q":var i={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];i-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(s.C0.ESC+"P1$r"+i+" q"+s.C0.ESC+"\\");break;default:this._logService.debug("Unknown DCS $q %s",t),this._coreService.triggerDataEvent(s.C0.ESC+"P0$r"+s.C0.ESC+"\\")}return!0},e}(),A=function(e){function t(t,r,i,o,n,l,h,p,g){void 0===g&&(g=new c.EscapeSequenceParser);var v=e.call(this)||this;v._bufferService=t,v._charsetService=r,v._coreService=i,v._dirtyRowService=o,v._logService=n,v._optionsService=l,v._coreMouseService=h,v._unicodeService=p,v._parser=g,v._parseBuffer=new Uint32Array(4096),v._stringDecoder=new u.StringToUtf32,v._utf8Decoder=new u.Utf8ToUtf32,v._workCell=new _.CellData,v._windowTitle="",v._iconName="",v._windowTitleStack=[],v._iconNameStack=[],v._curAttrData=d.DEFAULT_ATTR_DATA.clone(),v._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),v._onRequestBell=new f.EventEmitter,v._onRequestRefreshRows=new f.EventEmitter,v._onRequestReset=new f.EventEmitter,v._onRequestSyncScrollBar=new f.EventEmitter,v._onRequestWindowsOptionsReport=new f.EventEmitter,v._onA11yChar=new f.EventEmitter,v._onA11yTab=new f.EventEmitter,v._onCursorMove=new f.EventEmitter,v._onLineFeed=new f.EventEmitter,v._onScroll=new f.EventEmitter,v._onTitleChange=new f.EventEmitter,v._onAnsiColorChange=new f.EventEmitter,v._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},v.register(v._parser),v._parser.setCsiHandlerFallback((function(e,t){v._logService.debug("Unknown CSI code: ",{identifier:v._parser.identToString(e),params:t.toArray()})})),v._parser.setEscHandlerFallback((function(e){v._logService.debug("Unknown ESC code: ",{identifier:v._parser.identToString(e)})})),v._parser.setExecuteHandlerFallback((function(e){v._logService.debug("Unknown EXECUTE code: ",{code:e})})),v._parser.setOscHandlerFallback((function(e,t,r){v._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:r})})),v._parser.setDcsHandlerFallback((function(e,t,r){"HOOK"===t&&(r=r.toArray()),v._logService.debug("Unknown DCS code: ",{identifier:v._parser.identToString(e),action:t,payload:r})})),v._parser.setPrintHandler((function(e,t,r){return v.print(e,t,r)})),v._parser.registerCsiHandler({final:"@"},(function(e){return v.insertChars(e)})),v._parser.registerCsiHandler({intermediates:" ",final:"@"},(function(e){return v.scrollLeft(e)})),v._parser.registerCsiHandler({final:"A"},(function(e){return v.cursorUp(e)})),v._parser.registerCsiHandler({intermediates:" ",final:"A"},(function(e){return v.scrollRight(e)})),v._parser.registerCsiHandler({final:"B"},(function(e){return v.cursorDown(e)})),v._parser.registerCsiHandler({final:"C"},(function(e){return v.cursorForward(e)})),v._parser.registerCsiHandler({final:"D"},(function(e){return v.cursorBackward(e)})),v._parser.registerCsiHandler({final:"E"},(function(e){return v.cursorNextLine(e)})),v._parser.registerCsiHandler({final:"F"},(function(e){return v.cursorPrecedingLine(e)})),v._parser.registerCsiHandler({final:"G"},(function(e){return v.cursorCharAbsolute(e)})),v._parser.registerCsiHandler({final:"H"},(function(e){return v.cursorPosition(e)})),v._parser.registerCsiHandler({final:"I"},(function(e){return v.cursorForwardTab(e)})),v._parser.registerCsiHandler({final:"J"},(function(e){return v.eraseInDisplay(e)})),v._parser.registerCsiHandler({prefix:"?",final:"J"},(function(e){return v.eraseInDisplay(e)})),v._parser.registerCsiHandler({final:"K"},(function(e){return v.eraseInLine(e)})),v._parser.registerCsiHandler({prefix:"?",final:"K"},(function(e){return v.eraseInLine(e)})),v._parser.registerCsiHandler({final:"L"},(function(e){return v.insertLines(e)})),v._parser.registerCsiHandler({final:"M"},(function(e){return v.deleteLines(e)})),v._parser.registerCsiHandler({final:"P"},(function(e){return v.deleteChars(e)})),v._parser.registerCsiHandler({final:"S"},(function(e){return v.scrollUp(e)})),v._parser.registerCsiHandler({final:"T"},(function(e){return v.scrollDown(e)})),v._parser.registerCsiHandler({final:"X"},(function(e){return v.eraseChars(e)})),v._parser.registerCsiHandler({final:"Z"},(function(e){return v.cursorBackwardTab(e)})),v._parser.registerCsiHandler({final:"`"},(function(e){return v.charPosAbsolute(e)})),v._parser.registerCsiHandler({final:"a"},(function(e){return v.hPositionRelative(e)})),v._parser.registerCsiHandler({final:"b"},(function(e){return v.repeatPrecedingCharacter(e)})),v._parser.registerCsiHandler({final:"c"},(function(e){return v.sendDeviceAttributesPrimary(e)})),v._parser.registerCsiHandler({prefix:">",final:"c"},(function(e){return v.sendDeviceAttributesSecondary(e)})),v._parser.registerCsiHandler({final:"d"},(function(e){return v.linePosAbsolute(e)})),v._parser.registerCsiHandler({final:"e"},(function(e){return v.vPositionRelative(e)})),v._parser.registerCsiHandler({final:"f"},(function(e){return v.hVPosition(e)})),v._parser.registerCsiHandler({final:"g"},(function(e){return v.tabClear(e)})),v._parser.registerCsiHandler({final:"h"},(function(e){return v.setMode(e)})),v._parser.registerCsiHandler({prefix:"?",final:"h"},(function(e){return v.setModePrivate(e)})),v._parser.registerCsiHandler({final:"l"},(function(e){return v.resetMode(e)})),v._parser.registerCsiHandler({prefix:"?",final:"l"},(function(e){return v.resetModePrivate(e)})),v._parser.registerCsiHandler({final:"m"},(function(e){return v.charAttributes(e)})),v._parser.registerCsiHandler({final:"n"},(function(e){return v.deviceStatus(e)})),v._parser.registerCsiHandler({prefix:"?",final:"n"},(function(e){return v.deviceStatusPrivate(e)})),v._parser.registerCsiHandler({intermediates:"!",final:"p"},(function(e){return v.softReset(e)})),v._parser.registerCsiHandler({intermediates:" ",final:"q"},(function(e){return v.setCursorStyle(e)})),v._parser.registerCsiHandler({final:"r"},(function(e){return v.setScrollRegion(e)})),v._parser.registerCsiHandler({final:"s"},(function(e){return v.saveCursor(e)})),v._parser.registerCsiHandler({final:"t"},(function(e){return v.windowOptions(e)})),v._parser.registerCsiHandler({final:"u"},(function(e){return v.restoreCursor(e)})),v._parser.registerCsiHandler({intermediates:"'",final:"}"},(function(e){return v.insertColumns(e)})),v._parser.registerCsiHandler({intermediates:"'",final:"~"},(function(e){return v.deleteColumns(e)})),v._parser.setExecuteHandler(s.C0.BEL,(function(){return v.bell()})),v._parser.setExecuteHandler(s.C0.LF,(function(){return v.lineFeed()})),v._parser.setExecuteHandler(s.C0.VT,(function(){return v.lineFeed()})),v._parser.setExecuteHandler(s.C0.FF,(function(){return v.lineFeed()})),v._parser.setExecuteHandler(s.C0.CR,(function(){return v.carriageReturn()})),v._parser.setExecuteHandler(s.C0.BS,(function(){return v.backspace()})),v._parser.setExecuteHandler(s.C0.HT,(function(){return v.tab()})),v._parser.setExecuteHandler(s.C0.SO,(function(){return v.shiftOut()})),v._parser.setExecuteHandler(s.C0.SI,(function(){return v.shiftIn()})),v._parser.setExecuteHandler(s.C1.IND,(function(){return v.index()})),v._parser.setExecuteHandler(s.C1.NEL,(function(){return v.nextLine()})),v._parser.setExecuteHandler(s.C1.HTS,(function(){return v.tabSet()})),v._parser.registerOscHandler(0,new b.OscHandler((function(e){return v.setTitle(e),v.setIconName(e),!0}))),v._parser.registerOscHandler(1,new b.OscHandler((function(e){return v.setIconName(e)}))),v._parser.registerOscHandler(2,new b.OscHandler((function(e){return v.setTitle(e)}))),v._parser.registerOscHandler(4,new b.OscHandler((function(e){return v.setAnsiColor(e)}))),v._parser.registerEscHandler({final:"7"},(function(){return v.saveCursor()})),v._parser.registerEscHandler({final:"8"},(function(){return v.restoreCursor()})),v._parser.registerEscHandler({final:"D"},(function(){return v.index()})),v._parser.registerEscHandler({final:"E"},(function(){return v.nextLine()})),v._parser.registerEscHandler({final:"H"},(function(){return v.tabSet()})),v._parser.registerEscHandler({final:"M"},(function(){return v.reverseIndex()})),v._parser.registerEscHandler({final:"="},(function(){return v.keypadApplicationMode()})),v._parser.registerEscHandler({final:">"},(function(){return v.keypadNumericMode()})),v._parser.registerEscHandler({final:"c"},(function(){return v.fullReset()})),v._parser.registerEscHandler({final:"n"},(function(){return v.setgLevel(2)})),v._parser.registerEscHandler({final:"o"},(function(){return v.setgLevel(3)})),v._parser.registerEscHandler({final:"|"},(function(){return v.setgLevel(3)})),v._parser.registerEscHandler({final:"}"},(function(){return v.setgLevel(2)})),v._parser.registerEscHandler({final:"~"},(function(){return v.setgLevel(1)})),v._parser.registerEscHandler({intermediates:"%",final:"@"},(function(){return v.selectDefaultCharset()})),v._parser.registerEscHandler({intermediates:"%",final:"G"},(function(){return v.selectDefaultCharset()}));var y=function(e){m._parser.registerEscHandler({intermediates:"(",final:e},(function(){return v.selectCharset("("+e)})),m._parser.registerEscHandler({intermediates:")",final:e},(function(){return v.selectCharset(")"+e)})),m._parser.registerEscHandler({intermediates:"*",final:e},(function(){return v.selectCharset("*"+e)})),m._parser.registerEscHandler({intermediates:"+",final:e},(function(){return v.selectCharset("+"+e)})),m._parser.registerEscHandler({intermediates:"-",final:e},(function(){return v.selectCharset("-"+e)})),m._parser.registerEscHandler({intermediates:".",final:e},(function(){return v.selectCharset("."+e)})),m._parser.registerEscHandler({intermediates:"/",final:e},(function(){return v.selectCharset("/"+e)}))},m=this;for(var C in a.CHARSETS)y(C);return v._parser.registerEscHandler({intermediates:"#",final:"8"},(function(){return v.screenAlignmentPattern()})),v._parser.setErrorHandler((function(e){return v._logService.error("Parsing error: ",e),e})),v._parser.registerDcsHandler({intermediates:"$",final:"q"},new w(v._bufferService,v._coreService,v._logService,v._optionsService)),v}return o(t,e),Object.defineProperty(t.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAnsiColorChange",{get:function(){return this._onAnsiColorChange.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype._preserveStack=function(e,t,r,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=i},t.prototype._logSlowResolvingAsync=function(e){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([e,new Promise((function(e,t){return setTimeout((function(){return t("#SLOW_TIMEOUT")}),5e3)}))]).catch((function(e){if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")}))},t.prototype.parse=function(e,t){var r,i=this._bufferService.buffer,o=i.x,n=i.y,s=0,a=this._parseStack.paused;if(a){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;o=this._parseStack.cursorStartX,n=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>C&&(s=this._parseStack.position+C)}if(this._logService.debug("parsing data",e),this._parseBuffer.lengthC)for(var c=s;c0&&2===f.getWidth(n.x-1)&&f.setCellFromCodePoint(n.x-1,0,1,d.fg,d.bg,d.extended);for(var _=t;_=c)if(l){for(;n.x=this._bufferService.rows&&(n.y=this._bufferService.rows-1),n.lines.get(n.ybase+n.y).isWrapped=!0),f=n.lines.get(n.ybase+n.y)}else if(n.x=c-1,2===o)continue;if(h&&(f.insertCells(n.x,o,n.getNullCell(d),d),2===f.getWidth(c-1)&&f.setCellFromCodePoint(c-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,d.fg,d.bg,d.extended)),f.setCellFromCodePoint(n.x++,i,o,d.fg,d.bg,d.extended),o>0)for(;--o;)f.setCellFromCodePoint(n.x++,0,0,d.fg,d.bg,d.extended)}else f.getWidth(n.x-1)?f.addCodepointToCell(n.x-1,i):f.addCodepointToCell(n.x-2,i)}r-t>0&&(f.loadCell(n.x-1,this._workCell),2===this._workCell.getWidth()||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),n.x0&&0===f.getWidth(n.x)&&!f.hasContent(n.x)&&f.setCellFromCodePoint(n.x,0,1,d.fg,d.bg,d.extended),this._dirtyRowService.markDirty(n.y)},t.prototype.registerCsiHandler=function(e,t){var r=this;return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(function(e){return!S(e.params[0],r._optionsService.options.windowOptions)||t(e)}))},t.prototype.registerDcsHandler=function(e,t){return this._parser.registerDcsHandler(e,new y.DcsHandler(t))},t.prototype.registerEscHandler=function(e,t){return this._parser.registerEscHandler(e,t)},t.prototype.registerOscHandler=function(e,t){return this._parser.registerOscHandler(e,new b.OscHandler(t))},t.prototype.bell=function(){return this._onRequestBell.fire(),!0},t.prototype.lineFeed=function(){var e=this._bufferService.buffer;return this._dirtyRowService.markDirty(e.y),this._optionsService.options.convertEol&&(e.x=0),e.y++,e.y===e.scrollBottom+1?(e.y--,this._bufferService.scroll(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.x>=this._bufferService.cols&&e.x--,this._dirtyRowService.markDirty(e.y),this._onLineFeed.fire(),!0},t.prototype.carriageReturn=function(){return this._bufferService.buffer.x=0,!0},t.prototype.backspace=function(){var e,t=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),t.x>0&&t.x--,!0;if(this._restrictCursor(this._bufferService.cols),t.x>0)t.x--;else if(0===t.x&&t.y>t.scrollTop&&t.y<=t.scrollBottom&&(null===(e=t.lines.get(t.ybase+t.y))||void 0===e?void 0:e.isWrapped)){t.lines.get(t.ybase+t.y).isWrapped=!1,t.y--,t.x=this._bufferService.cols-1;var r=t.lines.get(t.ybase+t.y);r.hasWidth(t.x)&&!r.hasContent(t.x)&&t.x--}return this._restrictCursor(),!0},t.prototype.tab=function(){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;var e=this._bufferService.buffer.x;return this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-e),!0},t.prototype.shiftOut=function(){return this._charsetService.setgLevel(1),!0},t.prototype.shiftIn=function(){return this._charsetService.setgLevel(0),!0},t.prototype._restrictCursor=function(e){void 0===e&&(e=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(e,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype._setCursor=function(e,t){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=e,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+t):(this._bufferService.buffer.x=e,this._bufferService.buffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype._moveCursor=function(e,t){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+e,this._bufferService.buffer.y+t)},t.prototype.cursorUp=function(e){var t=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0},t.prototype.cursorDown=function(e){var t=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0},t.prototype.cursorForward=function(e){return this._moveCursor(e.params[0]||1,0),!0},t.prototype.cursorBackward=function(e){return this._moveCursor(-(e.params[0]||1),0),!0},t.prototype.cursorNextLine=function(e){return this.cursorDown(e),this._bufferService.buffer.x=0,!0},t.prototype.cursorPrecedingLine=function(e){return this.cursorUp(e),this._bufferService.buffer.x=0,!0},t.prototype.cursorCharAbsolute=function(e){return this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y),!0},t.prototype.cursorPosition=function(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0},t.prototype.charPosAbsolute=function(e){return this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y),!0},t.prototype.hPositionRelative=function(e){return this._moveCursor(e.params[0]||1,0),!0},t.prototype.linePosAbsolute=function(e){return this._setCursor(this._bufferService.buffer.x,(e.params[0]||1)-1),!0},t.prototype.vPositionRelative=function(e){return this._moveCursor(0,e.params[0]||1),!0},t.prototype.hVPosition=function(e){return this.cursorPosition(e),!0},t.prototype.tabClear=function(e){var t=e.params[0];return 0===t?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===t&&(this._bufferService.buffer.tabs={}),!0},t.prototype.cursorForwardTab=function(e){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;for(var t=e.params[0]||1;t--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop();return!0},t.prototype.cursorBackwardTab=function(e){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;for(var t=e.params[0]||1,r=this._bufferService.buffer;t--;)r.x=r.prevStop();return!0},t.prototype._eraseInBufferLine=function(e,t,r,i){void 0===i&&(i=!1);var o=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);o.replaceCells(t,r,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i&&(o.isWrapped=!1)},t.prototype._resetBufferLine=function(e){var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);t.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),t.isWrapped=!1},t.prototype.eraseInDisplay=function(e){var t;switch(this._restrictCursor(),e.params[0]){case 0:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t++,this._bufferService.buffer.x,this._bufferService.cols,0===this._bufferService.buffer.x);t=this._bufferService.cols&&(this._bufferService.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 2:for(t=this._bufferService.rows,this._dirtyRowService.markDirty(t-1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 3:var r=this._bufferService.buffer.lines.length-this._bufferService.rows;r>0&&(this._bufferService.buffer.lines.trimStart(r),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-r,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-r,0),this._onScroll.fire(0))}return!0},t.prototype.eraseInLine=function(e){switch(this._restrictCursor(),e.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}return this._dirtyRowService.markDirty(this._bufferService.buffer.y),!0},t.prototype.insertLines=function(e){this._restrictCursor();var t=e.params[0]||1,r=this._bufferService.buffer;if(r.y>r.scrollBottom||r.yr.scrollBottom||r.yt.scrollBottom||t.yt.scrollBottom||t.yt.scrollBottom||t.yt.scrollBottom||t.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(s.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(s.C0.ESC+"[?6c")),!0},t.prototype.sendDeviceAttributesSecondary=function(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(s.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(s.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(s.C0.ESC+"[>83;40003;0c")),!0},t.prototype._is=function(e){return 0===(this._optionsService.options.termName+"").indexOf(e)},t.prototype.setMode=function(e){for(var t=0;t=2||2===i[1]&&n+o>=5)break;i[1]&&(o=1)}while(++n+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()},t.prototype.charAttributes=function(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=d.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=d.DEFAULT_ATTR_DATA.bg,!0;for(var t,r=e.length,i=this._curAttrData,o=0;o=30&&t<=37?(i.fg&=-50331904,i.fg|=16777216|t-30):t>=40&&t<=47?(i.bg&=-50331904,i.bg|=16777216|t-40):t>=90&&t<=97?(i.fg&=-50331904,i.fg|=16777224|t-90):t>=100&&t<=107?(i.bg&=-50331904,i.bg|=16777224|t-100):0===t?(i.fg=d.DEFAULT_ATTR_DATA.fg,i.bg=d.DEFAULT_ATTR_DATA.bg):1===t?i.fg|=134217728:3===t?i.bg|=67108864:4===t?(i.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,i)):5===t?i.fg|=536870912:7===t?i.fg|=67108864:8===t?i.fg|=1073741824:2===t?i.bg|=134217728:21===t?this._processUnderline(2,i):22===t?(i.fg&=-134217729,i.bg&=-134217729):23===t?i.bg&=-67108865:24===t?i.fg&=-268435457:25===t?i.fg&=-536870913:27===t?i.fg&=-67108865:28===t?i.fg&=-1073741825:39===t?(i.fg&=-67108864,i.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):49===t?(i.bg&=-67108864,i.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):38===t||48===t||58===t?o+=this._extractColor(e,o,i):59===t?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):100===t?(i.fg&=-67108864,i.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,i.bg&=-67108864,i.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",t);return!0},t.prototype.deviceStatus=function(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(s.C0.ESC+"[0n");break;case 6:var t=this._bufferService.buffer.y+1,r=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(s.C0.ESC+"["+t+";"+r+"R")}return!0},t.prototype.deviceStatusPrivate=function(e){switch(e.params[0]){case 6:var t=this._bufferService.buffer.y+1,r=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(s.C0.ESC+"[?"+t+";"+r+"R")}return!0},t.prototype.softReset=function(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0},t.prototype.setCursorStyle=function(e){var t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var r=t%2==1;return this._optionsService.options.cursorBlink=r,!0},t.prototype.setScrollRegion=function(e){var t,r=e.params[0]||1;return(e.length<2||(t=e.params[1])>this._bufferService.rows||0===t)&&(t=this._bufferService.rows),t>r&&(this._bufferService.buffer.scrollTop=r-1,this._bufferService.buffer.scrollBottom=t-1,this._setCursor(0,0)),!0},t.prototype.windowOptions=function(e){if(!S(e.params[0],this._optionsService.options.windowOptions))return!0;var t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(n.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(n.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(s.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0},t.prototype.saveCursor=function(e){return this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,!0},t.prototype.restoreCursor=function(e){return this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor(),!0},t.prototype.setTitle=function(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0},t.prototype.setIconName=function(e){return this._iconName=e,!0},t.prototype._parseAnsiColorChange=function(e){for(var t,r={colors:[]},i=/(\d+);rgb:([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})/gi;null!==(t=i.exec(e));)r.colors.push({colorIndex:parseInt(t[1]),red:parseInt(t[2],16),green:parseInt(t[3],16),blue:parseInt(t[4],16)});return 0===r.colors.length?null:r},t.prototype.setAnsiColor=function(e){var t=this._parseAnsiColorChange(e);return t?this._onAnsiColorChange.fire(t):this._logService.warn("Expected format ;rgb:// but got data: "+e),!0},t.prototype.nextLine=function(){return this._bufferService.buffer.x=0,this.index(),!0},t.prototype.keypadApplicationMode=function(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0},t.prototype.keypadNumericMode=function(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0},t.prototype.selectDefaultCharset=function(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,a.DEFAULT_CHARSET),!0},t.prototype.selectCharset=function(e){return 2!==e.length?(this.selectDefaultCharset(),!0):("/"===e[0]||this._charsetService.setgCharset(m[e[0]],a.CHARSETS[e[1]]||a.DEFAULT_CHARSET),!0)},t.prototype.index=function(){this._restrictCursor();var e=this._bufferService.buffer;return this._bufferService.buffer.y++,e.y===e.scrollBottom+1?(e.y--,this._bufferService.scroll(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),this._restrictCursor(),!0},t.prototype.tabSet=function(){return this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0,!0},t.prototype.reverseIndex=function(){this._restrictCursor();var e=this._bufferService.buffer;if(e.y===e.scrollTop){var t=e.scrollBottom-e.scrollTop;e.lines.shiftElements(e.ybase+e.y,t,1),e.lines.set(e.ybase+e.y,e.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(e.scrollTop,e.scrollBottom)}else e.y--,this._restrictCursor();return!0},t.prototype.fullReset=function(){return this._parser.reset(),this._onRequestReset.fire(),!0},t.prototype.reset=function(){this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()},t.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},t.prototype.setgLevel=function(e){return this._charsetService.setgLevel(e),!0},t.prototype.screenAlignmentPattern=function(){var e=new _.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg;var t=this._bufferService.buffer;this._setCursor(0,0);for(var r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.Disposable=void 0;var r=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0;for(var e=0,t=this._disposables;e{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isFirefox=void 0;var r="undefined"==typeof navigator,i=r?"node":navigator.userAgent,o=r?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(o),t.isIpad="iPad"===o,t.isIphone="iPhone"===o,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(o),t.isLinux=o.indexOf("Linux")>=0},8273:(e,t)=>{function r(e,t,r,i){if(void 0===r&&(r=0),void 0===i&&(i=e.length),r>=e.length)return e;r=(e.length+r)%e.length,i=i>=e.length?e.length:(e.length+i)%e.length;for(var o=r;o{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;var i=r(643);t.updateWindowsModeWrappedState=function(e){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),r=null==t?void 0:t.get(e.cols-1),o=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);o&&r&&(o.isWrapped=r[i.CHAR_DATA_CODE_INDEX]!==i.NULL_CELL_CODE&&r[i.CHAR_DATA_CODE_INDEX]!==i.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;var r=function(){function e(){this.fg=0,this.bg=0,this.extended=new i}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.extended=this.extended.clone(),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.isAttributeDefault=function(){return 0===this.fg&&0===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.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},e.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},e.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},e.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},e.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()},e.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()},e.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()},e.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},e}();t.AttributeData=r;var i=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=-1),this.underlineStyle=e,this.underlineColor=t}return e.prototype.clone=function(){return new e(this.underlineStyle,this.underlineColor)},e.prototype.isEmpty=function(){return 0===this.underlineStyle},e}();t.ExtendedAttrs=i},9092:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;var i=r(6349),o=r(8437),n=r(511),s=r(643),a=r(4634),c=r(4863),l=r(7116),h=r(3734);t.MAX_BUFFER_SIZE=4294967295;var u=function(){function e(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=n.CellData.fromCharData([0,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,s.WHITESPACE_CELL_CHAR,s.WHITESPACE_CELL_WIDTH,s.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return e.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell},e.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell},e.prototype.getBlankLine=function(e,t){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e),t)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&et.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:r},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=o.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 i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,t){var r=this.getNullCell(o.DEFAULT_ATTR_DATA),i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e,r)));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(i0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),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(n=0;nthis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var r=a.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA));if(r.length>0){var i=a.reflowLargerCreateNewLayout(this.lines,r);a.reflowLargerApplyNewLayout(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,t,r){for(var i=this.getNullCell(o.DEFAULT_ATTR_DATA),n=r;n-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length=0;s--){var c=this.lines.get(s);if(!(!c||!c.isWrapped&&c.getTrimmedLength()<=e)){for(var l=[c];c.isWrapped&&s>0;)c=this.lines.get(--s),l.unshift(c);var h=this.ybase+this.y;if(!(h>=s&&h0&&(i.push({start:s+l.length+n,newLines:_}),n+=_.length),l.push.apply(l,_);var b=f.length-1,y=f[b];0===y&&(y=f[--b]);for(var m=l.length-p-1,C=d;m>=0;){var S=Math.min(C,y);if(l[b].copyCellsFrom(l[m],C-S,y-S,S,!0),0==(y-=S)&&(y=f[--b]),0==(C-=S)){m--;var w=Math.max(m,0);C=a.getWrappedLineTrimmedLength(l,w,this._cols)}}for(g=0;g0;)0===this.ybase?this.y0){var T=[],E=[];for(g=0;g=0;g--)if(P&&P.start>k+L){for(var M=P.newLines.length-1;M>=0;M--)this.lines.set(g--,P.newLines[M]);g++,T.push({index:k+1,amount:P.newLines.length}),L+=P.newLines.length,P=i[++x]}else this.lines.set(g,E[k--]);var D=0;for(g=T.length-1;g>=0;g--)T[g].index+=D,this.lines.onInsertEmitter.fire(T[g]),D+=T[g].amount;var O=Math.max(0,R+n-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}},e.prototype.stringIndexToBufferIndex=function(e,t,r){for(void 0===r&&(r=!1);t;){var i=this.lines.get(e);if(!i)return[-1,-1];for(var o=r?i.getTrimmedLength():i.length,n=0;n0&&this.lines.get(t).isWrapped;)t--;for(;r+10;);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?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,r=new c.Marker(e);return this.markers.push(r),r.register(this.lines.onTrim((function(e){r.line-=e,r.line<0&&r.dispose()}))),r.register(this.lines.onInsert((function(e){r.line>=e.index&&(r.line+=e.amount)}))),r.register(this.lines.onDelete((function(e){r.line>=e.index&&r.linee.index&&(r.line-=e.amount)}))),r.register(r.onDispose((function(){return t._removeMarker(r)}))),r},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,r,i,o){return new d(this,e,t,r,i,o)},e}();t.Buffer=u;var d=function(){function e(e,t,r,i,o,n){void 0===r&&(r=0),void 0===i&&(i=e.lines.length),void 0===o&&(o=0),void 0===n&&(n=0),this._buffer=e,this._trimRight=t,this._startIndex=r,this._endIndex=i,this._startOverscan=o,this._endOverscan=n,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._currentthis._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",r=e.first;r<=e.last;++r)t+=this._buffer.translateBufferLineToString(r,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=d},8437:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;var i=r(482),o=r(643),n=r(511),s=r(3734);t.DEFAULT_ATTR_DATA=Object.freeze(new s.AttributeData);var a=function(){function e(e,t,r){void 0===r&&(r=!1),this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);for(var i=t||n.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),s=0;s>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):r]},e.prototype.set=function(e,t){this._data[3*e+1]=t[o.CHAR_DATA_ATTR_INDEX],t[o.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[o.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[o.CHAR_DATA_WIDTH_INDEX]<<22},e.prototype.getWidth=function(e){return this._data[3*e+0]>>22},e.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},e.prototype.getFg=function(e){return this._data[3*e+1]},e.prototype.getBg=function(e){return this._data[3*e+2]},e.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},e.prototype.getCodePoint=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},e.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},e.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?i.stringFromCodePoint(2097151&t):""},e.prototype.loadCell=function(e,t){var r=3*e;return t.content=this._data[r+0],t.fg=this._data[r+1],t.bg=this._data[r+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t},e.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg},e.prototype.setCellFromCodePoint=function(e,t,r,i,o,n){268435456&o&&(this._extendedAttrs[e]=n),this._data[3*e+0]=t|r<<22,this._data[3*e+1]=i,this._data[3*e+2]=o},e.prototype.addCodepointToCell=function(e,t){var r=this._data[3*e+0];2097152&r?this._combined[e]+=i.stringFromCodePoint(t):(2097151&r?(this._combined[e]=i.stringFromCodePoint(2097151&r)+i.stringFromCodePoint(t),r&=-2097152,r|=2097152):r=t|1<<22,this._data[3*e+0]=r)},e.prototype.insertCells=function(e,t,r,i){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==i?void 0:i.fg)||0,(null==i?void 0:i.bg)||0,(null==i?void 0:i.extended)||new s.ExtendedAttrs),t=0;--a)this.setCell(e+t+a,this.loadCell(e+a,o));for(a=0;athis.length){var r=new Uint32Array(3*e);this.length&&(3*e=e&&delete this._combined[n]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={},this._extendedAttrs={};for(var t=0;t=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0},e.prototype.copyCellsFrom=function(e,t,r,i,o){var n=e._data;if(o)for(var s=i-1;s>=0;s--)for(var a=0;a<3;a++)this._data[3*(r+s)+a]=n[3*(t+s)+a];else for(s=0;s=t&&(this._combined[l-t+r]=e._combined[l])}},e.prototype.translateToString=function(e,t,r){void 0===e&&(e=!1),void 0===t&&(t=0),void 0===r&&(r=this.length),e&&(r=Math.min(r,this.getTrimmedLength()));for(var n="";t>22||1}return n},e}();t.BufferLine=a},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y===e.end.y)return e.end.x-e.start.x+1;if(e.start.y>e.end.y)throw new Error("Buffer range end ("+e.end.x+", "+e.end.y+") cannot be before start ("+e.start.x+", "+e.start.y+")");return t*(e.end.y-e.start.y-1)+t-e.start.x+e.end.x}},4634:(e,t)=>{function r(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();var i=!e[t].hasContent(r-1)&&1===e[t].getWidth(r-1),o=2===e[t+1].getWidth(0);return i&&o?r-1:r}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,i,o,n){for(var s=[],a=0;a=a&&o0&&(m>u||0===h[m].getTrimmedLength());m--)y++;y>0&&(s.push(a+h.length-y),s.push(y)),a+=h.length-1}}}return s},t.reflowLargerCreateNewLayout=function(e,t){for(var r=[],i=0,o=t[i],n=0,s=0;sl&&(s-=l,a++);var h=2===e[a].getWidth(s-1);h&&s--;var u=h?i-1:i;o.push(u),c+=u}return o},t.getWrappedLineTrimmedLength=r},5295:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;var n=r(9092),s=r(8460),a=function(e){function t(t,r){var i=e.call(this)||this;return i._optionsService=t,i._bufferService=r,i._onBufferActivate=i.register(new s.EventEmitter),i.reset(),i}return o(t,e),Object.defineProperty(t.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this.setupTabStops()},Object.defineProperty(t.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),t.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}))},t.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}))},t.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},t.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},t}(r(844).Disposable);t.BufferSet=a},511:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;var n=r(482),s=r(643),a=r(3734),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.extended=new a.ExtendedAttrs,t.combinedData="",t}return o(t,e),t.fromCharData=function(e){var r=new t;return r.setFromCharData(e),r},t.prototype.isCombined=function(){return 2097152&this.content},t.prototype.getWidth=function(){return this.content>>22},t.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?n.stringFromCodePoint(2097151&this.content):""},t.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},t.prototype.setFromCharData=function(e){this.fg=e[s.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(e[s.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[s.CHAR_DATA_CHAR_INDEX].length){var r=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){var i=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=i&&i<=57343?this.content=1024*(r-55296)+i-56320+65536|e[s.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[s.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[s.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[s.CHAR_DATA_WIDTH_INDEX]<<22)},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(a.AttributeData);t.CellData=c},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.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},4863:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;var n=r(8460),s=function(e){function t(r){var i=e.call(this)||this;return i.line=r,i._id=t._nextId++,i.isDisposed=!1,i._onDispose=new n.EventEmitter,i}return o(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),e.prototype.dispose.call(this))},t._nextId=1,t}(r(844).Disposable);t.Marker=s},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,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["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(e,t)=>{var r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.C1=t.C0=void 0,(i=t.C0||(t.C0={})).NUL="\0",i.SOH="",i.STX="",i.ETX="",i.EOT="",i.ENQ="",i.ACK="",i.BEL="",i.BS="\b",i.HT="\t",i.LF="\n",i.VT="\v",i.FF="\f",i.CR="\r",i.SO="",i.SI="",i.DLE="",i.DC1="",i.DC2="",i.DC3="",i.DC4="",i.NAK="",i.SYN="",i.ETB="",i.CAN="",i.EM="",i.SUB="",i.ESC="",i.FS="",i.GS="",i.RS="",i.US="",i.SP=" ",i.DEL="",(r=t.C1||(t.C1={})).PAD="€",r.HOP="",r.BPH="‚",r.NBH="ƒ",r.IND="„",r.NEL="…",r.SSA="†",r.ESA="‡",r.HTS="ˆ",r.HTJ="‰",r.VTS="Š",r.PLD="‹",r.PLU="Œ",r.RI="",r.SS2="Ž",r.SS3="",r.DCS="",r.PU1="‘",r.PU2="’",r.STS="“",r.CCH="”",r.MW="•",r.SPA="–",r.EPA="—",r.SOS="˜",r.SGCI="™",r.SCI="š",r.CSI="›",r.ST="œ",r.OSC="",r.PM="ž",r.APC="Ÿ"},7399:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;var i=r(2584),o={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,r,n){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?i.C0.ESC+"OA":i.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?s.key=t?i.C0.ESC+"OD":i.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?s.key=t?i.C0.ESC+"OC":i.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(s.key=t?i.C0.ESC+"OB":i.C0.ESC+"[B");break;case 8:if(e.shiftKey){s.key=i.C0.BS;break}if(e.altKey){s.key=i.C0.ESC+i.C0.DEL;break}s.key=i.C0.DEL;break;case 9:if(e.shiftKey){s.key=i.C0.ESC+"[Z";break}s.key=i.C0.HT,s.cancel=!0;break;case 13:s.key=e.altKey?i.C0.ESC+i.C0.CR:i.C0.CR,s.cancel=!0;break;case 27:s.key=i.C0.ESC,e.altKey&&(s.key=i.C0.ESC+i.C0.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;a?(s.key=i.C0.ESC+"[1;"+(a+1)+"D",s.key===i.C0.ESC+"[1;3D"&&(s.key=i.C0.ESC+(r?"b":"[1;5D"))):s.key=t?i.C0.ESC+"OD":i.C0.ESC+"[D";break;case 39:if(e.metaKey)break;a?(s.key=i.C0.ESC+"[1;"+(a+1)+"C",s.key===i.C0.ESC+"[1;3C"&&(s.key=i.C0.ESC+(r?"f":"[1;5C"))):s.key=t?i.C0.ESC+"OC":i.C0.ESC+"[C";break;case 38:if(e.metaKey)break;a?(s.key=i.C0.ESC+"[1;"+(a+1)+"A",r||s.key!==i.C0.ESC+"[1;3A"||(s.key=i.C0.ESC+"[1;5A")):s.key=t?i.C0.ESC+"OA":i.C0.ESC+"[A";break;case 40:if(e.metaKey)break;a?(s.key=i.C0.ESC+"[1;"+(a+1)+"B",r||s.key!==i.C0.ESC+"[1;3B"||(s.key=i.C0.ESC+"[1;5B")):s.key=t?i.C0.ESC+"OB":i.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(s.key=i.C0.ESC+"[2~");break;case 46:s.key=a?i.C0.ESC+"[3;"+(a+1)+"~":i.C0.ESC+"[3~";break;case 36:s.key=a?i.C0.ESC+"[1;"+(a+1)+"H":t?i.C0.ESC+"OH":i.C0.ESC+"[H";break;case 35:s.key=a?i.C0.ESC+"[1;"+(a+1)+"F":t?i.C0.ESC+"OF":i.C0.ESC+"[F";break;case 33:e.shiftKey?s.type=2:s.key=i.C0.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:s.key=i.C0.ESC+"[6~";break;case 112:s.key=a?i.C0.ESC+"[1;"+(a+1)+"P":i.C0.ESC+"OP";break;case 113:s.key=a?i.C0.ESC+"[1;"+(a+1)+"Q":i.C0.ESC+"OQ";break;case 114:s.key=a?i.C0.ESC+"[1;"+(a+1)+"R":i.C0.ESC+"OR";break;case 115:s.key=a?i.C0.ESC+"[1;"+(a+1)+"S":i.C0.ESC+"OS";break;case 116:s.key=a?i.C0.ESC+"[15;"+(a+1)+"~":i.C0.ESC+"[15~";break;case 117:s.key=a?i.C0.ESC+"[17;"+(a+1)+"~":i.C0.ESC+"[17~";break;case 118:s.key=a?i.C0.ESC+"[18;"+(a+1)+"~":i.C0.ESC+"[18~";break;case 119:s.key=a?i.C0.ESC+"[19;"+(a+1)+"~":i.C0.ESC+"[19~";break;case 120:s.key=a?i.C0.ESC+"[20;"+(a+1)+"~":i.C0.ESC+"[20~";break;case 121:s.key=a?i.C0.ESC+"[21;"+(a+1)+"~":i.C0.ESC+"[21~";break;case 122:s.key=a?i.C0.ESC+"[23;"+(a+1)+"~":i.C0.ESC+"[23~";break;case 123:s.key=a?i.C0.ESC+"[24;"+(a+1)+"~":i.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(r&&!n||!e.altKey||e.metaKey)!r||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?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=i.C0.US):65===e.keyCode&&(s.type=1);else{var c=o[e.keyCode],l=c&&c[e.shiftKey?1:0];if(l)s.key=i.C0.ESC+l;else if(e.keyCode>=65&&e.keyCode<=90){var h=e.ctrlKey?e.keyCode-64:e.keyCode+32;s.key=i.C0.ESC+String.fromCharCode(h)}}else e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?s.key=i.C0.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?s.key=i.C0.DEL:219===e.keyCode?s.key=i.C0.ESC:220===e.keyCode?s.key=i.C0.FS:221===e.keyCode&&(s.key=i.C0.GS)}return s}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 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,r){void 0===t&&(t=0),void 0===r&&(r=e.length);for(var i="",o=t;o65535?(n-=65536,i+=String.fromCharCode(55296+(n>>10))+String.fromCharCode(n%1024+56320)):i+=String.fromCharCode(n)}return i};var r=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var i=0,o=0;this._interim&&(56320<=(a=e.charCodeAt(o++))&&a<=57343?t[i++]=1024*(this._interim-55296)+a-56320+65536:(t[i++]=this._interim,t[i++]=a),this._interim=0);for(var n=o;n=r)return this._interim=s,i;var a;56320<=(a=e.charCodeAt(n))&&a<=57343?t[i++]=1024*(s-55296)+a-56320+65536:(t[i++]=s,t[i++]=a)}else 65279!==s&&(t[i++]=s)}return i},e}();t.StringToUtf32=r;var i=function(){function e(){this.interim=new Uint8Array(3)}return e.prototype.clear=function(){this.interim.fill(0)},e.prototype.decode=function(e,t){var r=e.length;if(!r)return 0;var i,o,n,s,a=0,c=0,l=0;if(this.interim[0]){var h=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var d=0,f=void 0;(f=63&this.interim[++d])&&d<4;)u<<=6,u|=f;for(var p=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,_=p-d;l<_;){if(l>=r)return 0;if(128!=(192&(f=e[l++]))){l--,h=!0;break}this.interim[d++]=f,u<<=6,u|=63&f}h||(2===p?u<128?l--:t[a++]=u:3===p?u<2048||u>=55296&&u<=57343||65279===u||(t[a++]=u):u<65536||u>1114111||(t[a++]=u)),this.interim.fill(0)}for(var g=r-4,v=l;v=r)return this.interim[0]=i,a;if(128!=(192&(o=e[v++]))){v--;continue}if((c=(31&i)<<6|63&o)<128){v--;continue}t[a++]=c}else if(224==(240&i)){if(v>=r)return this.interim[0]=i,a;if(128!=(192&(o=e[v++]))){v--;continue}if(v>=r)return this.interim[0]=i,this.interim[1]=o,a;if(128!=(192&(n=e[v++]))){v--;continue}if((c=(15&i)<<12|(63&o)<<6|63&n)<2048||c>=55296&&c<=57343||65279===c)continue;t[a++]=c}else if(240==(248&i)){if(v>=r)return this.interim[0]=i,a;if(128!=(192&(o=e[v++]))){v--;continue}if(v>=r)return this.interim[0]=i,this.interim[1]=o,a;if(128!=(192&(n=e[v++]))){v--;continue}if(v>=r)return this.interim[0]=i,this.interim[1]=o,this.interim[2]=n,a;if(128!=(192&(s=e[v++]))){v--;continue}if((c=(7&i)<<18|(63&o)<<12|(63&n)<<6|63&s)<65536||c>1114111)continue;t[a++]=c}}return a},e}();t.Utf8ToUtf32=i},225:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;var i,o=r(8273),n=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],s=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],a=function(){function e(){if(this.version="6",!i){i=new Uint8Array(65536),o.fill(i,1),i[0]=0,o.fill(i,0,1,32),o.fill(i,0,127,160),o.fill(i,2,4352,4448),i[9001]=2,i[9002]=2,o.fill(i,2,11904,42192),i[12351]=1,o.fill(i,2,44032,55204),o.fill(i,2,63744,64256),o.fill(i,2,65040,65050),o.fill(i,2,65072,65136),o.fill(i,2,65280,65377),o.fill(i,2,65504,65511);for(var e=0;et[o][1])return!1;for(;o>=i;)if(e>t[r=i+o>>1][1])i=r+1;else{if(!(e=131072&&e<=196605||e>=196608&&e<=262141?2:1},e}();t.UnicodeV6=a},5981:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;var r="undefined"==typeof queueMicrotask?function(e){Promise.resolve().then(e)}:queueMicrotask,i=function(){function e(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0}return e.prototype.writeSync=function(e,t){if(void 0!==t&&this._syncCalls>t)this._syncCalls=0;else if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){var r;for(this._isSyncWriting=!0;r=this._writeBuffer.shift();){this._action(r);var i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}},e.prototype.write=function(e,t){var r=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout((function(){return r._innerWrite()}))),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)},e.prototype._innerWrite=function(e,t){var i=this;void 0===e&&(e=0),void 0===t&&(t=!0);for(var o=e||Date.now();this._writeBuffer.length>this._bufferOffset;){var n=this._writeBuffer[this._bufferOffset],s=this._action(n,t);if(s)return void s.catch((function(e){return r((function(){throw e})),Promise.resolve(!1)})).then((function(e){return Date.now()-o>=12?setTimeout((function(){return i._innerWrite(0,e)})):i._innerWrite(o,e)}));var a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-o>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((function(){return i._innerWrite()}))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0)},e}();t.WriteBuffer=i},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;var i=r(482),o=r(8742),n=r(5770),s=[],a=function(){function e(){this._handlers=Object.create(null),this._active=s,this._ident=0,this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=s},e.prototype.registerHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var r=this._handlers[e];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.reset=function(){if(this._active.length)for(var e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=s,this._ident=0},e.prototype.hook=function(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||s,this._active.length)for(var r=this._active.length-1;r>=0;r--)this._active[r].hook(t);else this._handlerFb(this._ident,"HOOK",t)},e.prototype.put=function(e,t,r){if(this._active.length)for(var o=this._active.length-1;o>=0;o--)this._active[o].put(e,t,r);else this._handlerFb(this._ident,"PUT",i.utf32ToString(e,t,r))},e.prototype.unhook=function(e,t){if(void 0===t&&(t=!0),this._active.length){var r=!1,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&!1===r){for(;i>=0&&!0!==(r=this._active[i].unhook(e));i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if((r=this._active[i].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",e);this._active=s,this._ident=0},e}();t.DcsParser=a;var c=new o.Params;c.addParam(0);var l=function(){function e(e){this._handler=e,this._data="",this._params=c,this._hitLimit=!1}return e.prototype.hook=function(e){this._params=e.length>1||e.params[0]?e.clone():c,this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,r){this._hitLimit||(this._data+=i.utf32ToString(e,t,r),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.unhook=function(e){var t=this,r=!1;if(this._hitLimit)r=!1;else if(e&&(r=this._handler(this._data,this._params))instanceof Promise)return r.then((function(e){return t._params=c,t._data="",t._hitLimit=!1,e}));return this._params=c,this._data="",this._hitLimit=!1,r},e}();t.DcsHandler=l},2015:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;var n=r(844),s=r(8273),a=r(8742),c=r(6242),l=r(6351),h=function(){function e(e){this.table=new Uint8Array(e)}return e.prototype.setDefault=function(e,t){s.fill(this.table,e<<4|t)},e.prototype.add=function(e,t,r,i){this.table[t<<8|e]=r<<4|i},e.prototype.addMany=function(e,t,r,i){for(var o=0;o1)throw new Error("only one byte as prefix supported");if((r=e.prefix.charCodeAt(0))&&60>r||r>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var i=0;io||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=o}}if(1!==e.final.length)throw new Error("final must be a single byte");var n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error("final must be in range "+t[0]+" .. "+t[1]);return(r<<=8)|n},r.prototype.identToString=function(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")},r.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},r.prototype.setPrintHandler=function(e){this._printHandler=e},r.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},r.prototype.registerEscHandler=function(e,t){var r=this._identifier(e,[48,126]);void 0===this._escHandlers[r]&&(this._escHandlers[r]=[]);var i=this._escHandlers[r];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},r.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},r.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},r.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},r.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},r.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},r.prototype.registerCsiHandler=function(e,t){var r=this._identifier(e);void 0===this._csiHandlers[r]&&(this._csiHandlers[r]=[]);var i=this._csiHandlers[r];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},r.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},r.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},r.prototype.registerDcsHandler=function(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)},r.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},r.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},r.prototype.registerOscHandler=function(e,t){return this._oscParser.registerHandler(e,t)},r.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},r.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},r.prototype.setErrorHandler=function(e){this._errorHandler=e},r.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},r.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])},r.prototype._preserveStack=function(e,t,r,i,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=i,this._parseStack.chunkPos=o},r.prototype.parse=function(e,t,r){var i,o=0,n=0,s=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,s=this._parseStack.chunkPos+1;else{if(void 0===r||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");var a=this._parseStack.handlers,c=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===r&&c>-1)for(;c>=0&&!0!==(i=a[c](this._params));c--)if(i instanceof Promise)return this._parseStack.handlerPos=c,i;this._parseStack.handlers=[];break;case 4:if(!1===r&&c>-1)for(;c>=0&&!0!==(i=a[c]());c--)if(i instanceof Promise)return this._parseStack.handlerPos=c,i;this._parseStack.handlers=[];break;case 6:if(o=e[this._parseStack.chunkPos],i=this._dcsParser.unhook(24!==o&&26!==o,r))return i;27===o&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(o=e[this._parseStack.chunkPos],i=this._oscParser.end(24!==o&&26!==o,r))return i;27===o&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,s=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(var l=s;l>4){case 2:for(var h=l+1;;++h){if(h>=t||(o=e[h])<32||o>126&&o=t||(o=e[h])<32||o>126&&o=t||(o=e[h])<32||o>126&&o=t||(o=e[h])<32||o>126&&o=0&&!0!==(i=a[d](this._params));d--)if(i instanceof Promise)return this._preserveStack(3,a,d,n,l),i;d<0&&this._csiHandlerFb(this._collect<<8|o,this._params),this.precedingCodepoint=0;break;case 8:do{switch(o){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(o-48)}}while(++l47&&o<60);l--;break;case 9:this._collect<<=8,this._collect|=o;break;case 10:for(var f=this._escHandlers[this._collect<<8|o],p=f?f.length-1:-1;p>=0&&!0!==(i=f[p]());p--)if(i instanceof Promise)return this._preserveStack(4,f,p,n,l),i;p<0&&this._escHandlerFb(this._collect<<8|o),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|o,this._params);break;case 13:for(var _=l+1;;++_)if(_>=t||24===(o=e[_])||26===o||27===o||o>127&&o=t||(o=e[g])<32||o>127&&o{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;var i=r(5770),o=r(482),n=[],s=function(){function e(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return e.prototype.registerHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var r=this._handlers[e];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=n},e.prototype.reset=function(){if(2===this._state)for(var e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0},e.prototype._start=function(){if(this._active=this._handlers[this._id]||n,this._active.length)for(var e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")},e.prototype._put=function(e,t,r){if(this._active.length)for(var i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,r);else this._handlerFb(this._id,"PUT",o.utf32ToString(e,t,r))},e.prototype.start=function(){this.reset(),this._state=1},e.prototype.put=function(e,t,r){if(3!==this._state){if(1===this._state)for(;t0&&this._put(e,t,r)}},e.prototype.end=function(e,t){if(void 0===t&&(t=!0),0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){var r=!1,i=this._active.length-1,o=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,r=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&!1===r){for(;i>=0&&!0!==(r=this._active[i].end(e));i--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,r;i--}for(;i>=0;i--)if((r=this._active[i].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,r}else this._handlerFb(this._id,"END",e);this._active=n,this._id=-1,this._state=0}},e}();t.OscParser=s;var a=function(){function e(e){this._handler=e,this._data="",this._hitLimit=!1}return e.prototype.start=function(){this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,r){this._hitLimit||(this._data+=o.utf32ToString(e,t,r),this._data.length>i.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.end=function(e){var t=this,r=!1;if(this._hitLimit)r=!1;else if(e&&(r=this._handler(this._data))instanceof Promise)return r.then((function(e){return t._data="",t._hitLimit=!1,e}));return this._data="",this._hitLimit=!1,r},e}();t.OscHandler=a},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;var r=2147483647,i=function(){function e(e,t){if(void 0===e&&(e=32),void 0===t&&(t=32),this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return e.fromArray=function(t){var r=new e;if(!t.length)return r;for(var i=t[0]instanceof Array?1:0;i>8,i=255&this._subParamsIdx[t];i-r>0&&e.push(Array.prototype.slice.call(this._subParams,r,i))}return e},e.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},e.prototype.addParam=function(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>r?r:e}},e.prototype.addSubParam=function(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>r?r:e,this._subParamsIdx[this.length-1]++}},e.prototype.hasSubParams=function(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0},e.prototype.getSubParams=function(e){var t=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];return r-t>0?this._subParams.subarray(t,r):null},e.prototype.getSubParamsAll=function(){for(var e={},t=0;t>8,i=255&this._subParamsIdx[t];i-r>0&&(e[t]=this._subParams.slice(r,i))}return e},e.prototype.addDigit=function(e){var t;if(!(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var i=this._digitIsSub?this._subParams:this.params,o=i[t-1];i[t-1]=~o?Math.min(10*o+e,r):e}},e}();t.Params=i},744:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;var a=r(2585),c=r(5295),l=r(8460),h=r(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;var u=function(e){function r(r){var i=e.call(this)||this;return i._optionsService=r,i.isUserScrolling=!1,i._onResize=new l.EventEmitter,i._onScroll=new l.EventEmitter,i.cols=Math.max(r.options.cols,t.MINIMUM_COLS),i.rows=Math.max(r.options.rows,t.MINIMUM_ROWS),i.buffers=new c.BufferSet(r,i),i}return o(r,e),Object.defineProperty(r.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),r.prototype.dispose=function(){e.prototype.dispose.call(this),this.buffers.dispose()},r.prototype.resize=function(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})},r.prototype.reset=function(){this.buffers.reset(),this.isUserScrolling=!1},r.prototype.scroll=function(e,t){void 0===t&&(t=!1);var r,i=this.buffer;(r=this._cachedBlankLine)&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=i.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;var o=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(0===i.scrollTop){var s=i.lines.isFull;n===i.lines.length-1?s?i.lines.recycle().copyFrom(r):i.lines.push(r.clone()):i.lines.splice(n+1,0,r.clone()),s?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{var a=n-o+1;i.lines.shiftElements(o+1,a-1,-1),i.lines.set(n,r.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)},r.prototype.scrollLines=function(e,t,r){var i=this.buffer;if(e<0){if(0===i.ydisp)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);var o=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),o!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))},r.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},r.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},r.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},r.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)},n([s(0,a.IOptionsService)],r)}(h.Disposable);t.BufferService=u},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0;var r=function(){function e(){this.glevel=0,this._charsets=[]}return e.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},e.prototype.setgLevel=function(e){this.glevel=e,this.charset=this._charsets[e]},e.prototype.setgCharset=function(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)},e}();t.CharsetService=r},1753:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;var n=r(2585),s=r(8460),a={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(e){return 4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)}},VT200:{events:19,restrict:function(e){return 32!==e.action}},DRAG:{events:23,restrict:function(e){return 32!==e.action||3!==e.button}},ANY:{events:31,restrict:function(e){return!0}}};function c(e,t){var r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(r|=64,r|=e.action):(r|=3&e.button,4&e.button&&(r|=64),8&e.button&&(r|=128),32===e.action?r|=32:0!==e.action||t||(r|=3)),r}var l=String.fromCharCode,h={DEFAULT:function(e){var t=[c(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":""+l(t[0])+l(t[1])+l(t[2])},SGR:function(e){var t=0===e.action&&4!==e.button?"m":"M";return"[<"+c(e,!0)+";"+e.col+";"+e.row+t}},u=function(){function e(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new s.EventEmitter,this._lastEvent=null;for(var r=0,i=Object.keys(a);r=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._compareEvents(this._lastEvent,e))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;var t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0},e.prototype.explainEvents=function(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}},e.prototype._compareEvents=function(e,t){return e.col===t.col&&e.row===t.row&&e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift},i([o(0,n.IBufferService),o(1,n.ICoreService)],e)}();t.CoreMouseService=u},6975:function(e,t,r){var i,o=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),n=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},s=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;var a=r(2585),c=r(8460),l=r(1439),h=r(844),u=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),f=function(e){function t(t,r,i,o){var n=e.call(this)||this;return n._bufferService=r,n._logService=i,n._optionsService=o,n.isCursorInitialized=!1,n.isCursorHidden=!1,n._onData=n.register(new c.EventEmitter),n._onUserInput=n.register(new c.EventEmitter),n._onBinary=n.register(new c.EventEmitter),n._scrollToBottom=t,n.register({dispose:function(){return n._scrollToBottom=void 0}}),n.modes=l.clone(u),n.decPrivateModes=l.clone(d),n}return o(t,e),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.modes=l.clone(u),this.decPrivateModes=l.clone(d)},t.prototype.triggerDataEvent=function(e,t){if(void 0===t&&(t=!1),!this._optionsService.options.disableStdin){var r=this._bufferService.buffer;r.ybase!==r.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug('sending data "'+e+'"',(function(){return e.split("").map((function(e){return e.charCodeAt(0)}))})),this._onData.fire(e)}},t.prototype.triggerBinaryEvent=function(e){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+e+'"',(function(){return e.split("").map((function(e){return e.charCodeAt(0)}))})),this._onBinary.fire(e))},n([s(1,a.IBufferService),s(2,a.ILogService),s(3,a.IOptionsService)],t)}(h.Disposable);t.CoreService=f},3730:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0;var n=r(2585),s=function(){function e(e){this._bufferService=e,this.clearRange()}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),e.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},e.prototype.markDirty=function(e){ethis._end&&(this._end=e)},e.prototype.markRangeDirty=function(e,t){if(e>t){var r=e;e=t,t=r}ethis._end&&(this._end=t)},e.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},i([o(0,n.IBufferService)],e)}();t.DirtyRowService=s},4348:function(e,t,r){var i=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t0?o[0].index:t.length;if(t.length!==u)throw new Error("[createInstance] First service dependency of "+e.name+" at position "+(u+1)+" conflicts with "+t.length+" static arguments");return new(e.bind.apply(e,i([void 0],i(t,s))))},e}();t.InstantiationService=a},7866:function(e,t,r){var i=this&&this.__decorate||function(e,t,r,i){var o,n=arguments.length,s=n<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,r,s):o(t,r))||s);return n>3&&s&&Object.defineProperty(t,r,s),s},o=this&&this.__param||function(e,t){return function(r,i){t(r,i,e)}},n=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=t.DEFAULT_BELL_SOUND=void 0;var i=r(8460),o=r(6114),n=r(1439);t.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",t.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:t.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:o.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1});var s=["normal","bold","100","200","300","400","500","600","700","800","900"],a=["cols","rows"],c=function(){function e(e){this._onOptionChange=new i.EventEmitter,this.options=n.clone(t.DEFAULT_OPTIONS);for(var r=0,o=Object.keys(e);r{function r(e,t,r){t.di$target===t?t.di$dependencies.push({id:e,index:r}):(t.di$dependencies=[{id:e,index:r}],t.di$target=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);var i=function(e,t,o){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");r(i,e,o)};return i.toString=function(){return e},t.serviceRegistry.set(e,i),i}},2585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IUnicodeService=t.LogLevelEnum=t.IOptionsService=t.ILogService=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;var i,o=r(8343);t.IBufferService=o.createDecorator("BufferService"),t.ICoreMouseService=o.createDecorator("CoreMouseService"),t.ICoreService=o.createDecorator("CoreService"),t.ICharsetService=o.createDecorator("CharsetService"),t.IDirtyRowService=o.createDecorator("DirtyRowService"),t.IInstantiationService=o.createDecorator("InstantiationService"),t.ILogService=o.createDecorator("LogService"),t.IOptionsService=o.createDecorator("OptionsService"),(i=t.LogLevelEnum||(t.LogLevelEnum={}))[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i[i.OFF=4]="OFF",t.IUnicodeService=o.createDecorator("UnicodeService")},1480:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;var i=r(8460),o=r(225),n=function(){function e(){this._providers=Object.create(null),this._active="",this._onChange=new i.EventEmitter;var e=new o.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}return Object.defineProperty(e.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._active},set:function(e){if(!this._providers[e])throw new Error('unknown Unicode version "'+e+'"');this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)},enumerable:!1,configurable:!0}),e.prototype.register=function(e){this._providers[e.version]=e},e.prototype.wcwidth=function(e){return this._activeProvider.wcwidth(e)},e.prototype.getStringCellWidth=function(e){for(var t=0,r=e.length,i=0;i=r)return t+this.wcwidth(o);var n=e.charCodeAt(i);56320<=n&&n<=57343?o=1024*(o-55296)+n-56320+65536:t+=this.wcwidth(n)}t+=this.wcwidth(o)}return t},e}();t.UnicodeService=n}},t={};return function r(i){if(t[i])return t[i].exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,r),o.exports}(4389)})()},114:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hterm=void 0;var i=r(276),o=function(){function e(e){this.elem=e,i.hterm.defaultStorage=new i.lib.Storage.Memory,this.term=new i.hterm.Terminal,this.term.getPrefs().set("send-encoding","raw"),this.term.decorate(this.elem),this.io=this.term.io.push(),this.term.installKeyboard()}return e.prototype.info=function(){return{columns:this.columns,rows:this.rows}},e.prototype.output=function(e){null!=this.term.io&&this.term.io.writeUTF8(e)},e.prototype.showMessage=function(e,t){this.message=e,t>0?this.term.io.showOverlay(e,t):this.term.io.showOverlay(e,null)},e.prototype.removeMessage=function(){this.term.io.showOverlay(this.message,0)},e.prototype.setWindowTitle=function(e){this.term.setWindowTitle(e)},e.prototype.setPreferences=function(e){var t=this;Object.keys(e).forEach((function(r){"EnableWebGL"!=r&&t.term.getPrefs().set(r,e[r])}))},e.prototype.onInput=function(e){this.io.onVTKeystroke=function(t){e(t)},this.io.sendString=function(t){e(t)}},e.prototype.onResize=function(e){var t=this;this.io.onTerminalResize=function(r,i){t.columns=r,t.rows=i,e(r,i)}},e.prototype.deactivate=function(){this.io.onVTKeystroke=function(){},this.io.sendString=function(){},this.io.onTerminalResize=function(){},this.term.uninstallKeyboard()},e.prototype.reset=function(){this.removeMessage(),this.term.installKeyboard()},e.prototype.close=function(){this.term.uninstallKeyboard()},e}();t.Hterm=o},69:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=t.ConnectionFactory=void 0;var r=function(){function e(e,t){this.url=e,this.protocols=t}return e.prototype.create=function(){return new i(this.url,this.protocols)},e}();t.ConnectionFactory=r;var i=function(){function e(e,t){this.bare=new WebSocket(e,t)}return e.prototype.open=function(){},e.prototype.close=function(){this.bare.close()},e.prototype.send=function(e){this.bare.send(e)},e.prototype.isOpen=function(){return this.bare.readyState==WebSocket.CONNECTING||this.bare.readyState==WebSocket.OPEN},e.prototype.onOpen=function(e){this.bare.onopen=function(t){e()}},e.prototype.onReceive=function(e){this.bare.onmessage=function(t){e(t.data)}},e.prototype.onClose=function(e){this.bare.onclose=function(t){e()}},e}();t.Connection=i},818:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebTTY=t.msgSetBufferSize=t.msgSetReconnect=t.msgSetPreferences=t.msgSetWindowTitle=t.msgPong=t.msgOutput=t.msgUnknownOutput=t.msgResizeTerminal=t.msgPing=t.msgInput=t.msgInputUnknown=t.protocols=void 0,t.protocols=["webtty"],t.msgInputUnknown="0",t.msgInput="1",t.msgPing="2",t.msgResizeTerminal="3",t.msgUnknownOutput="0",t.msgOutput="1",t.msgPong="2",t.msgSetWindowTitle="3",t.msgSetPreferences="4",t.msgSetReconnect="5",t.msgSetBufferSize="6";var r=function(){function e(e,t,r,i){this.term=e,this.connectionFactory=t,this.args=r,this.authToken=i,this.reconnect=-1,this.bufSize=1024}return e.prototype.open=function(){var e,r,i=this,o=this.connectionFactory.create(),n=function(){o.onOpen((function(){var r=i.term.info();o.send(JSON.stringify({Arguments:i.args,AuthToken:i.authToken}));var n=function(e,r){o.send(t.msgResizeTerminal+JSON.stringify({columns:e,rows:r}))};i.term.onResize(n),n(r.columns,r.rows),i.term.onInput((function(e){for(var r=i.bufSize-1,n=0;n0&&(r=setTimeout((function(){o=i.connectionFactory.create(),i.term.reset(),n()}),1e3*i.reconnect))})),o.open()};return n(),function(){clearTimeout(r),o.close()}},e}();t.WebTTY=r},949:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Xterm=void 0;var i=r(841),o=r(881),n=r(962),s=r(445),a=r(276),c=function(){function e(e){var t=this;this.elem=e,this.term=new i.Terminal,this.fitAddOn=new o.FitAddon,this.term.loadAddon(new n.WebLinksAddon),this.term.loadAddon(this.fitAddOn),this.message=e.ownerDocument.createElement("div"),this.message.className="xterm-overlay",this.messageTimeout=2e3,this.resizeListener=function(){t.fitAddOn.fit(),t.term.scrollToBottom(),t.showMessage(String(t.term.cols)+"x"+String(t.term.rows),t.messageTimeout)},this.term.open(e),this.term.focus(),this.resizeListener(),window.addEventListener("resize",(function(){t.resizeListener()})),this.decoder=new a.lib.UTF8Decoder}return e.prototype.info=function(){return{columns:this.term.cols,rows:this.term.rows}},e.prototype.output=function(e){this.term.write(this.decoder.decode(e))},e.prototype.showMessage=function(e,t){var r=this;this.message.textContent=e,this.elem.appendChild(this.message),this.messageTimer&&clearTimeout(this.messageTimer),t>0&&(this.messageTimer=setTimeout((function(){r.elem.removeChild(r.message)}),t))},e.prototype.removeMessage=function(){this.message.parentNode==this.elem&&this.elem.removeChild(this.message)},e.prototype.setWindowTitle=function(e){document.title=e},e.prototype.setPreferences=function(e){var t=this;Object.keys(e).forEach((function(r){"EnableWebGL"==r&&r?t.term.loadAddon(new s.WebglAddon):"font-size"==r?t.term.setOption("fontSize",e[r]):"font-family"==r&&t.term.setOption("fontFamily",e[r])}))},e.prototype.onInput=function(e){this.onDataHandler=this.term.onData((function(t){e(t)}))},e.prototype.onResize=function(e){var t=this;this.onResizeHandler=this.term.onResize((function(){e(t.term.cols,t.term.rows)}))},e.prototype.deactivate=function(){this.onDataHandler.dispose(),this.onResizeHandler.dispose(),this.term.blur()},e.prototype.reset=function(){this.removeMessage(),this.term.clear()},e.prototype.close=function(){window.removeEventListener("resize",this.resizeListener),this.term.dispose()},e}();t.Xterm=c}},t={};function r(i){var o=t[i];if(void 0!==o)return o.exports;var n=t[i]={exports:{}};return e[i](n,n.exports,r),n.exports}(()=>{"use strict";var e=r(114),t=r(949),i=r(818),o=r(69),n=document.getElementById("terminal");if(null!==n){var s;s="hterm"==gotty_term?new e.Hterm(n):new t.Xterm(n);var a=("https:"==window.location.protocol?"wss://":"ws://")+window.location.host+window.location.pathname+"ws",c=window.location.search,l=new o.ConnectionFactory(a,i.protocols),h=new i.WebTTY(s,l,c,gotty_auth_token).open();window.addEventListener("unload",(function(){h(),s.close()}))}})()})(); //# sourceMappingURL=gotty.js.map