"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function handler(e){return e.returnValue="Are you sure?",e.returnValue}var _createClass=function(){function e(e,t){for(var r=0;r=3?r[2].replace(/^\s*at\s+/,""):r[1].replace(/^\s*global code@/,"")}for(var o=0;o3?e[3]:1;return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"},lib.colors.setAlpha=function(e,t){var r=lib.colors.crackRGB(e);return r[3]=t,lib.colors.arrayToRGBA(r)},lib.colors.mix=function(e,t,r){for(var o=lib.colors.crackRGB(e),i=lib.colors.crackRGB(t),s=0;s<4;++s){var n=i[s]-o[s];o[s]=Math.round(parseInt(o[s])+n*r)}return lib.colors.arrayToRGBA(o)},lib.colors.crackRGB=function(e){if("rgba"==e.substr(0,4)){if(t=e.match(lib.colors.re_.rgba))return t.shift(),t}else{var t=e.match(lib.colors.re_.rgb);if(t)return t.shift(),t.push(1),t}return console.error("Couldn't crack: "+e),null},lib.colors.nameToRGB=function(e){return e in lib.colors.colorNames?lib.colors.colorNames[e]:(e=e.toLowerCase())in lib.colors.colorNames?lib.colors.colorNames[e]:(e=e.replace(/\s+/g,""))in lib.colors.colorNames?lib.colors.colorNames[e]:null},lib.colors.stockColorPalette=lib.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"]),lib.colors.colorPalette=lib.colors.stockColorPalette,lib.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)"},lib.f={},lib.f.replaceVars=function(e,t){return e.replace(/%([a-z]*)\(([^\)]+)\)/gi,function(e,r,o){if(void 0===t[o])throw"Unknown variable: "+o;var i=t[o];if(r in lib.f.replaceVars.functions)i=lib.f.replaceVars.functions[r](i);else if(r)throw"Unknown escape function: "+r;return i})},lib.f.replaceVars.functions={encodeURI:encodeURI,encodeURIComponent:encodeURIComponent,escapeHTML:function(e){var t={"<":"<",">":">","&":"&",'"':""","'":"'"};return e.replace(/[<>&\"\']/g,function(e){return t[e]})}},lib.f.getAcceptLanguages=function(e){window.chrome&&chrome.i18n?chrome.i18n.getAcceptLanguages(e):setTimeout(function(){e([navigator.language.replace(/-/g,"_")])},0)},lib.f.parseQuery=function(e){"?"==e.substr(0,1)&&(e=e.substr(1));for(var t={},r=e.split("&"),o=0;or?r:e},lib.f.lpad=function(e,t,r){for(e=String(e),r=r||" ";e.lengtht.whitespace.length;)t.whitespace+=t.whitespace;return t.whitespace.substr(0,e)},lib.f.alarm=function(e,t){var r=t||5e3,o=lib.f.getStack(1);return function(){var t=setTimeout(function(){var i="string"==typeof e?i:e.name;i=i?": "+i:"",console.warn("lib.f.alarm: timeout expired: "+r/1e3+"s"+i),console.log(o),t=null},r),i=function(e){return function(){return t&&(clearTimeout(t),t=null),e.apply(null,arguments)}};return"string"==typeof e?i:i(e)}()},lib.f.getStack=function(e){var t,r=e?e+2:2;try{throw new Error}catch(e){t=e.stack.split("\n")}for(var o={},i=r;i=0&&this.observers.splice(t,1)},lib.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},lib.PreferenceManager.prototype.deactivate=function(){if(!this.isActive_)throw new Error("Not activated");this.isActive_=!1,this.storage.removeObserver(this.storageObserver_)},lib.PreferenceManager.prototype.activate=function(){if(this.isActive_)throw new Error("Already activated");this.isActive_=!0,this.storage.addObserver(this.storageObserver_)},lib.PreferenceManager.prototype.readStorage=function(e){function t(){0==--r&&e&&e()}var r=0,o=Object.keys(this.prefRecords_).map(function(e){return this.prefix+e}.bind(this));this.trace&&console.log("Preferences read: "+this.prefix),this.storage.getItems(o,function(o){var i=this.prefix.length;for(var s in o){var n=o[s],a=s.substr(i),l=a in this.childLists_&&JSON.stringify(n)!=JSON.stringify(this.prefRecords_[a].currentValue);this.prefRecords_[a].currentValue=n,l&&(r++,this.syncChildList(a,t))}0==r&&e&&setTimeout(e)}.bind(this))},lib.PreferenceManager.prototype.definePreference=function(e,t,r){var o=this.prefRecords_[e];o?this.changeDefault(e,t):o=this.prefRecords_[e]=new lib.PreferenceManager.Record(e,t),r&&o.addObserver(r)},lib.PreferenceManager.prototype.definePreferences=function(e){for(var t=0;t=0&&i.splice(a,1),!this.childLists_[e][n]){var l=this.childFactories_[e](this,n);if(!l){console.warn("Unable to restore child: "+e+": "+n);continue}l.trace=this.trace,this.childLists_[e][n]=l,r++,l.readStorage(function(){0==--r&&t&&t()})}}for(s=0;s=0;o--){var i=e[o],s=this.storage_.getItem(i);if("string"==typeof s)try{r[i]=JSON.parse(s)}catch(e){r[i]=s}else e.splice(o,1)}setTimeout(t.bind(null,r),0)},lib.Storage.Local.prototype.setItem=function(e,t,r){this.storage_.setItem(e,JSON.stringify(t)),r&&setTimeout(r,0)},lib.Storage.Local.prototype.setItems=function(e,t){for(var r in e)this.storage_.setItem(r,JSON.stringify(e[r]));t&&setTimeout(t,0)},lib.Storage.Local.prototype.removeItem=function(e,t){this.storage_.removeItem(e),t&&setTimeout(t,0)},lib.Storage.Local.prototype.removeItems=function(e,t){for(var r=0;r=0;o--){var i=e[o],s=this.storage_[i];if("string"==typeof s)try{r[i]=JSON.parse(s)}catch(e){r[i]=s}else e.splice(o,1)}setTimeout(t.bind(null,r),0)},lib.Storage.Memory.prototype.setItem=function(e,t,r){var o=this.storage_[e];this.storage_[e]=JSON.stringify(t);var i={};i[e]={oldValue:o,newValue:t},setTimeout(function(){for(var e=0;e"),lib.TestManager.TestRun.prototype.selectTest=function(e){this.testQueue_.push(e)},lib.TestManager.TestRun.prototype.selectSuite=function(e,t){for(var r=t||this.ALL_TESTS,o=0,i=e.getTestList(),s=0;s=0&&(this.passes.splice(r,1),this.failures.push(e))},lib.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.println("Maximum failure count reached, aborting test run."),this.onTestRunComplete_();var e=this.testQueue_[0],t=this.currentResult?this.currentResult.suite:null;try{t&&t instanceof e.suiteClass||(this.log.println("Initializing suite: "+e.suiteClass.suiteName),t=new e.suiteClass(this.testManager,this.cx))}catch(e){return this.log.println("Exception during setup: "+(e.stack?e.stack:e)),this.panic=!0,void this.onTestRunComplete_()}try{this.log.print("Test: "+e.fullName+" {"),this.log.pushPrefix(" "),this.currentResult=new lib.TestManager.Result(this,t,e),t.preamble(this.currentResult,this.cx),this.testQueue_.shift()}catch(e){return this.log.println("Unexpected exception during test preamble: "+(e.stack?e.stack:e)),this.log.popPrefix(),this.log.println("}"),this.panic=!0,void this.onTestRunComplete_()}try{this.currentResult.run()}catch(e){this.log.println("Unexpected exception during test run: "+(e.stack?e.stack:e)),this.panic=!0}},lib.TestManager.TestRun.prototype.run=function(){this.log.println("Running "+this.testQueue_.length+" test(s) {"),this.log.pushPrefix(" "),window.onerror=this.onUncaughtException_.bind(this),this.startDate=new Date,this.runNextTest_()},lib.TestManager.TestRun.prototype.msToSeconds_=function(e){return(e/1e3).toFixed(2)+"s"},lib.TestManager.TestRun.prototype.summarize=function(){if(this.failures.length)for(var e=0;e1?"\n"+t.join("\n"):t.join("\n")}if(e!==t){var i=r?"["+r+"]":"";this.fail("assertEQ"+i+": "+this.getCallerLocation_(1)+": "+o(e)+" !== "+o(t))}},lib.TestManager.Result.prototype.assert=function(e,t){if(!0!==e){var r=t?"["+t+"]":"";this.fail("assert"+r+": "+this.getCallerLocation_(1)+": "+String(e))}},lib.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]:"???"}},lib.TestManager.Result.prototype.println=function(e){this.testRun.log.println(e)},lib.TestManager.Result.prototype.fail=function(e){arguments.length&&this.println(e),this.completeTest_(this.FAILED,!0)},lib.TestManager.Result.prototype.pass=function(){this.completeTest_(this.PASSED,!0)},lib.UTF8Decoder=function(){this.bytesLeft=0,this.codePoint=0,this.lowerBound=0},lib.UTF8Decoder.prototype.decode=function(e){for(var t="",r=0;r1114111?t+="�":i<65536?t+=String.fromCharCode(i):(i-=65536,t+=String.fromCharCode(55296+(i>>>10&1023),56320+(1023&i)))}}else t+="�",this.bytesLeft=0,r--}return t},lib.decodeUTF8=function(e){return(new lib.UTF8Decoder).decode(e)},lib.encodeUTF8=function(e){for(var t="",r=0;r>>6),s=1):o<=65535?(t+=String.fromCharCode(224|o>>>12),s=2):(t+=String.fromCharCode(240|o>>>18),s=3);s>0;)s--,t+=String.fromCharCode(128|o>>>6*s&63)}return t},lib.wc={},lib.wc.nulWidth=0,lib.wc.controlWidth=0,lib.wc.regardCjkAmbiguous=!1,lib.wc.cjkAmbiguousWidth=2,lib.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]],lib.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]],lib.wc.isSpace=function(e){var t,r=0,o=lib.wc.combining.length-1;if(elib.wc.combining[o][1])return!1;for(;o>=r;)if(t=Math.floor((r+o)/2),e>lib.wc.combining[t][1])r=t+1;else{if(!(elib.wc.ambiguous[o][1])return!1;for(;o>=r;)if(t=Math.floor((r+o)/2),e>lib.wc.ambiguous[t][1])r=t+1;else{if(!(e=127&&e<160?lib.wc.controlWidth:e<127?1:lib.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))},lib.wc.charWidthRegardAmbiguous=function(e){return lib.wc.isCjkAmbiguous(e)?lib.wc.cjkAmbiguousWidth:lib.wc.charWidthDisregardAmbiguous(e)},lib.wc.strWidth=function(e){for(var t,r=0,o=0;ot);o++);if(void 0!=r){for(i=o,s=0;ir&&i--,e.substring(o,i)}return e.substr(o)},lib.wc.substring=function(e,t,r){return lib.wc.substr(e,t,r-t)},lib.resource.add("libdot/changelog/version","text/plain","1.9"),lib.resource.add("libdot/changelog/date","text/plain","2014-05-27"),lib.rtdep("lib.Storage");var hterm={};hterm.windowType=null,hterm.zoomWarningMessage="ZOOM != 100%",hterm.notifyCopyMessage="✂",hterm.desktopNotificationTitle="♪ %(title) ♪",hterm.testDeps=["hterm.ScrollPort.Tests","hterm.Screen.Tests","hterm.Terminal.Tests","hterm.VT.Tests","hterm.VT.CannedTests"],lib.registerInit("hterm",function(e){function t(t){hterm.windowType=t.type,setTimeout(e,0)}if(!hterm.defaultStorage){var r=navigator.userAgent.match(/\sChrome\/(\d\d)/),o=r?parseInt(r[1]):-1;window.chrome&&chrome.storage&&chrome.storage.sync&&o>21?hterm.defaultStorage=new lib.Storage.Chrome(chrome.storage.sync):hterm.defaultStorage=new lib.Storage.Local}s=!1;if(window.chrome&&chrome.runtime&&chrome.runtime.getManifest)var i=chrome.runtime.getManifest(),s=i.app&&i.app.background;s?setTimeout(t.bind(null,{type:"popup"}),0):window.chrome&&chrome.tabs?chrome.tabs.getCurrent(function(r){r&&window.chrome?chrome.windows.get(r.windowId,null,t):(hterm.windowType="normal",setTimeout(e,0))}):setTimeout(t.bind(null,{type:"normal"}),0)}),hterm.getClientSize=function(e){return e.getBoundingClientRect()},hterm.getClientWidth=function(e){return e.getBoundingClientRect().width},hterm.getClientHeight=function(e){return e.getBoundingClientRect().height},hterm.copySelectionToClipboard=function(e){try{e.execCommand("copy")}catch(e){}},hterm.pasteFromClipboard=function(e){try{e.execCommand("paste")}catch(e){}},hterm.Size=function(e,t){this.width=e,this.height=t},hterm.Size.prototype.resize=function(e,t){this.width=e,this.height=t},hterm.Size.prototype.clone=function(){return new hterm.Size(this.width,this.height)},hterm.Size.prototype.setTo=function(e){this.width=e.width,this.height=e.height},hterm.Size.prototype.equals=function(e){return this.width==e.width&&this.height==e.height},hterm.Size.prototype.toString=function(){return"[hterm.Size: "+this.width+", "+this.height+"]"},hterm.RowCol=function(e,t,r){this.row=e,this.column=t,this.overflow=!!r},hterm.RowCol.prototype.move=function(e,t,r){this.row=e,this.column=t,this.overflow=!!r},hterm.RowCol.prototype.clone=function(){return new hterm.RowCol(this.row,this.column,this.overflow)},hterm.RowCol.prototype.setTo=function(e){this.row=e.row,this.column=e.column,this.overflow=e.overflow},hterm.RowCol.prototype.equals=function(e){return this.row==e.row&&this.column==e.column&&this.overflow==e.overflow},hterm.RowCol.prototype.toString=function(){return"[hterm.RowCol: "+this.row+", "+this.column+", "+this.overflow+"]"},lib.rtdep("lib.f"),hterm.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},hterm.Frame.prototype.onMessage_=function(e){"ipc-init-ok"==e.data.name?(this.sendTerminalInfo_(),this.messageChannel_.port1.onmessage=this.onMessage.bind(this),this.onLoad()):console.log("Unknown message from frame:",e.data)},hterm.Frame.prototype.onMessage=function(){},hterm.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.messageChannel_.port2],this.url)},hterm.Frame.prototype.onLoad=function(){},hterm.Frame.prototype.sendTerminalInfo_=function(){lib.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:lib.f.getURL("/")}])}.bind(this))},hterm.Frame.prototype.onCloseClicked_=function(){this.close()},hterm.Frame.prototype.close=function(){this.container_&&this.container_.parentNode&&(this.container_.parentNode.removeChild(this.container_),this.onClose())},hterm.Frame.prototype.onClose=function(){},hterm.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})},hterm.Frame.prototype.show=function(){function e(e,r){return e in t.options?t.options[e]:r}var t=this,t=this;if(this.container_&&this.container_.parentNode)console.error("Frame already visible");else{var r=hterm.getClientSize(this.div_),o=e("width",640),i=e("height",480),s=(r.width,r.height,this.terminal_.document_),n=this.container_=s.createElement("div");n.style.cssText="position: absolute;display: -webkit-flex;-webkit-flex-direction: column;top: 10%;left: 4%;width: 90%;height: 80%;box-shadow: 0 0 2px "+this.terminal_.getForegroundColor()+";border: 2px "+this.terminal_.getForegroundColor()+" solid;";var a=s.createElement("div");a.style.cssText="display: -webkit-flex;-webkit-justify-content: flex-end;height: 16px;background-color: "+this.terminal_.getForegroundColor()+";color: "+this.terminal_.getBackgroundColor()+";font-size: 16px;font-family: "+this.terminal_.getFontFamily(),n.appendChild(a);var l=this.iframe_=s.createElement("iframe");l.onload=this.onLoad_.bind(this),l.style.cssText="display: -webkit-flex;-webkit-flex: 1;width: 100%",l.setAttribute("src",this.url),l.setAttribute("seamless",!0),n.appendChild(l),this.div_.appendChild(n)}},lib.rtdep("hterm.Keyboard.KeyMap"),hterm.Keyboard=function(e){this.terminal=e,this.keyboardElement_=null,this.handlers_=[["blur",this.onBlur_.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 hterm.Keyboard.KeyMap(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},hterm.Keyboard.KeyActions={CANCEL:new String("CANCEL"),DEFAULT:new String("DEFAULT"),PASS:new String("PASS"),STRIP:new String("STRIP")},hterm.Keyboard.prototype.encode=function(e){return"utf-8"==this.characterEncoding?this.terminal.vt.encodeUTF8(e):e},hterm.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()}},hterm.Keyboard.prototype.preventChromeAppNonShiftDefault_=function(e){window.chrome&&window.chrome.app&&window.chrome.app.window&&(e.shiftKey||e.preventDefault())},hterm.Keyboard.prototype.onBlur_=function(e){this.altKeyPressed=0},hterm.Keyboard.prototype.onKeyUp_=function(e){18==e.keyCode&&(this.altKeyPressed=this.altKeyPressed&~(1<=64&&b<=95&&(d=String.fromCharCode(b-64))),c&&"8-bit"==this.altSendsWhat&&1==d.length){var b=d.charCodeAt(0)+128;d=String.fromCharCode(b)}(c&&"escape"==this.altSendsWhat||u&&this.metaSendsEscape)&&(d=""+d)}this.terminal.onVTKeystroke(d)}else console.warn("Invalid action: "+JSON.stringify(d))}else console.warn("No definition for keyCode: "+e.keyCode)},lib.rtdep("hterm.Keyboard.KeyActions"),hterm.Keyboard.KeyMap=function(e){this.keyboard=e,this.keyDefs={},this.reset()},hterm.Keyboard.KeyMap.prototype.addKeyDef=function(e,t){e in this.keyDefs&&console.warn("Duplicate keyCode: "+e),this.keyDefs[e]=t},hterm.Keyboard.KeyMap.prototype.addKeyDefs=function(e){for(var t=0;t",u,i(d,g),u,u],[191,"/?",u,o(n("_"),n("?")),u,u],[17,"[CTRL]",g,g,g,g],[18,"[ALT]",g,g,g,g],[91,"[LAPL]",g,g,g,g],[32," ",u,n("@"),u,u],[92,"[RAPL]",g,g,g,g],[93,"[RMENU]",g,g,g,g],[42,"[PRTSCR]",g,g,g,g],[145,"[SCRLK]",g,g,g,g],[19,"[BREAK]",g,g,g,g],[45,"[INSERT]",a("onKeyInsert_"),u,u,u],[36,"[HOME]",a("onKeyHome_"),u,u,u],[33,"[PGUP]",a("onKeyPageUp_"),u,u,u],[46,"[DEL]",a("onKeyDel_"),u,u,u],[35,"[END]",a("onKeyEnd_"),u,u,u],[34,"[PGDOWN]",a("onKeyPageDown_"),u,u,u],[38,"[UP]",t("","OA"),u,u,u],[40,"[DOWN]",t("","OB"),u,u,u],[39,"[RIGHT]",t("","OC"),u,u,u],[37,"[LEFT]",t("","OD"),u,u,u],[144,"[NUMLOCK]",g,g,g,g],[96,"[KP0]",u,u,u,u],[97,"[KP1]",u,u,u,u],[98,"[KP2]",u,u,u,u],[99,"[KP3]",u,u,u,u],[100,"[KP4]",u,u,u,u],[101,"[KP5]",u,u,u,u],[102,"[KP6]",u,u,u,u],[103,"[KP7]",u,u,u,u],[104,"[KP8]",u,u,u,u],[105,"[KP9]",u,u,u,u],[107,"[KP+]",u,u,u,u],[109,"[KP-]",u,u,u,u],[106,"[KP*]",u,u,u,u],[111,"[KP/]",u,u,u,u],[110,"[KP.]",u,u,u,u],[166,"[BACK]",l(s("OP","")),u,"[23~",u],[167,"[FWD]",l(s("OQ","")),u,"[24~",u],[168,"[RELOAD]",l(s("OR","")),u,"[25~",u],[183,"[FSCR]",l(s("OS","")),u,"[26~",u],[182,"[WINS]",l("[15~"),u,"[28~",u],[216,"[BRIT-]",l("[17~"),u,"[29~",u],[217,"[BRIT+]",l("[18~"),u,"[31~",u])},hterm.Keyboard.KeyMap.prototype.onKeyInsert_=function(e){return this.keyboard.shiftInsertPaste&&e.shiftKey?hterm.Keyboard.KeyActions.PASS:"[2~"},hterm.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(),hterm.Keyboard.KeyActions.CANCEL)},hterm.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(),hterm.Keyboard.KeyActions.CANCEL)},hterm.Keyboard.KeyMap.prototype.onKeyPageUp_=function(e){return!this.keyboard.pageKeysScroll^e.shiftKey?"[5~":(this.keyboard.terminal.scrollPageUp(),hterm.Keyboard.KeyActions.CANCEL)},hterm.Keyboard.KeyMap.prototype.onKeyDel_=function(e){return this.keyboard.altBackspaceIsMetaBackspace&&this.keyboard.altKeyPressed&&!e.altKey?"":"[3~"},hterm.Keyboard.KeyMap.prototype.onKeyPageDown_=function(e){return!this.keyboard.pageKeysScroll^e.shiftKey?"[6~":(this.keyboard.terminal.scrollPageDown(),hterm.Keyboard.KeyActions.CANCEL)},hterm.Keyboard.KeyMap.prototype.onClear_=function(e,t){return this.keyboard.terminal.wipeContents(),hterm.Keyboard.KeyActions.CANCEL},hterm.Keyboard.KeyMap.prototype.onCtrlNum_=function(e,t){function r(e){return String.fromCharCode(e.charCodeAt(0)-64)}if(this.keyboard.terminal.passCtrlNumber&&!e.shiftKey)return hterm.Keyboard.KeyActions.PASS;switch(t.keyCap.substr(0,1)){case"1":return"1";case"2":return r("@");case"3":return r("[");case"4":return r("\\");case"5":return r("]");case"6":return r("^");case"7":return r("_");case"8":return"";case"9":return"9"}},hterm.Keyboard.KeyMap.prototype.onAltNum_=function(e,t){return this.keyboard.terminal.passAltNumber&&!e.shiftKey?hterm.Keyboard.KeyActions.PASS:hterm.Keyboard.KeyActions.DEFAULT},hterm.Keyboard.KeyMap.prototype.onMetaNum_=function(e,t){return this.keyboard.terminal.passMetaNumber&&!e.shiftKey?hterm.Keyboard.KeyActions.PASS:hterm.Keyboard.KeyActions.DEFAULT},hterm.Keyboard.KeyMap.prototype.onCtrlC_=function(e,t){var r=this.keyboard.terminal.getDocument().getSelection();if(!r.isCollapsed){if(this.keyboard.ctrlCCopy&&!e.shiftKey)return this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout(r.collapseToEnd.bind(r),50),this.keyboard.terminal.prefs_.get("enable-clipboard-notice")&&setTimeout(this.keyboard.terminal.showOverlay.bind(this.keyboard.terminal,hterm.notifyCopyMessage,500),200),hterm.Keyboard.KeyActions.PASS;if(!this.keyboard.ctrlCCopy&&e.shiftKey)return this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout(r.collapseToEnd.bind(r),50),this.keyboard.terminal.copySelectionToClipboard(),hterm.Keyboard.KeyActions.CANCEL}return""},hterm.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),hterm.Keyboard.KeyActions.CANCEL):""},hterm.Keyboard.KeyMap.prototype.onCtrlV_=function(e,t){return!e.shiftKey&&this.keyboard.ctrlVPaste||e.shiftKey&&!this.keyboard.ctrlVPaste?hterm.Keyboard.KeyActions.PASS:""},hterm.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),hterm.Keyboard.KeyActions.CANCEL):hterm.Keyboard.KeyActions.DEFAULT},hterm.Keyboard.KeyMap.prototype.onMetaC_=function(e,t){var r=this.keyboard.terminal.getDocument();return e.shiftKey||r.getSelection().isCollapsed?t.keyCap.substr(e.shiftKey?1:0,1):(this.keyboard.terminal.clearSelectionAfterCopy&&setTimeout(function(){r.getSelection().collapseToEnd()},50),hterm.Keyboard.KeyActions.PASS)},hterm.Keyboard.KeyMap.prototype.onMetaV_=function(e,t){return e.shiftKey?hterm.Keyboard.KeyActions.PASS:this.keyboard.passMetaV?hterm.Keyboard.KeyActions.PASS:hterm.Keyboard.KeyActions.DEFAULT},hterm.Keyboard.KeyMap.prototype.onPlusMinusZero_=function(e,t){if(!(this.keyboard.ctrlPlusMinusZeroZoom^e.shiftKey))return"-_"==t.keyCap?"":hterm.Keyboard.KeyActions.CANCEL;if(1!=this.keyboard.terminal.getZoomFactor())return hterm.Keyboard.KeyActions.PASS;var r=t.keyCap.substr(0,1);if("0"==r)this.keyboard.terminal.setFontSize(0);else{var o=this.keyboard.terminal.getFontSize();"-"==r?o-=1:o+=1,this.keyboard.terminal.setFontSize(o)}return hterm.Keyboard.KeyActions.CANCEL},hterm.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},lib.rtdep("lib.f","lib.Storage"),hterm.PreferenceManager=function(e){lib.PreferenceManager.call(this,hterm.defaultStorage,"/hterm/profiles/"+e);var t=hterm.PreferenceManager.defaultPreferences;Object.keys(t).forEach(function(e){this.definePreference(e,t[e])}.bind(this))},hterm.PreferenceManager.defaultPreferences={"alt-gr-mode":null,"alt-backspace-is-meta-backspace":!1,"alt-is-meta":!1,"alt-sends-what":"escape","audible-bell-sound":"lib-resource:hterm/audio/bell","desktop-notification-bell":!1,"background-color":"rgb(16, 16, 16)","background-image":"","background-size":"","background-position":"","backspace-sends-backspace":!1,"character-map-overrides":null,"close-on-exit":!0,"cursor-blink":!1,"cursor-blink-cycle":[1e3,500],"cursor-color":"rgba(255, 0, 0, 0.5)","color-palette-overrides":null,"copy-on-select":!0,"use-default-window-copy":!1,"clear-selection-after-copy":!0,"ctrl-plus-minus-zero-zoom":!0,"ctrl-c-copy":!1,"ctrl-v-paste":!1,"east-asian-ambiguous-as-two-column":!1,"enable-8-bit-control":!1,"enable-bold":null,"enable-bold-as-bright":!0,"enable-clipboard-notice":!0,"enable-clipboard-write":!0,"enable-dec12":!1,environment:{TERM:"xterm-256color"},"font-family":'"DejaVu Sans Mono", "Everson Mono", FreeMono, "Menlo", "Terminal", monospace',"font-size":15,"font-smoothing":"antialiased","foreground-color":"rgb(240, 240, 240)","home-keys-scroll":!1,"max-string-sequence":1e5,"media-keys-are-fkeys":!1,"meta-sends-escape":!0,"mouse-paste-button":null,"page-keys-scroll":!1,"pass-alt-number":null,"pass-ctrl-number":null,"pass-meta-number":null,"pass-meta-v":!0,"receive-encoding":"utf-8","scroll-on-keystroke":!0,"scroll-on-output":!1,"scrollbar-visible":!0,"scroll-wheel-move-multiplier":1,"send-encoding":"utf-8","shift-insert-paste":!0,"user-css":""},hterm.PreferenceManager.prototype={__proto__:lib.PreferenceManager.prototype},hterm.PubSub=function(){this.observers_={}},hterm.PubSub.addBehavior=function(e){var t=new hterm.PubSub;for(var r in hterm.PubSub.prototype)e[r]=hterm.PubSub.prototype[r].bind(t)},hterm.PubSub.prototype.subscribe=function(e,t){e in this.observers_||(this.observers_[e]=[]),this.observers_[e].push(t)},hterm.PubSub.prototype.unsubscribe=function(e,t){var r=this.observers_[e];if(!r)throw"Invalid subject: "+e;var o=r.indexOf(t);if(o<0)throw"Not subscribed: "+e;r.splice(o,1)},hterm.PubSub.prototype.publish=function(e,t,r){function o(e){e=e&&this.setCursorPosition(this.cursorPosition.row,e-1)},hterm.Screen.prototype.shiftRow=function(){return this.shiftRows(1)[0]},hterm.Screen.prototype.shiftRows=function(e){return this.rowsArray.splice(0,e)},hterm.Screen.prototype.unshiftRow=function(e){this.rowsArray.splice(0,0,e)},hterm.Screen.prototype.unshiftRows=function(e){this.rowsArray.unshift.apply(this.rowsArray,e)},hterm.Screen.prototype.popRow=function(){return this.popRows(1)[0]},hterm.Screen.prototype.popRows=function(e){return this.rowsArray.splice(this.rowsArray.length-e,e)},hterm.Screen.prototype.pushRow=function(e){this.rowsArray.push(e)},hterm.Screen.prototype.pushRows=function(e){e.push.apply(this.rowsArray,e)},hterm.Screen.prototype.insertRow=function(e,t){this.rowsArray.splice(e,0,t)},hterm.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 r=this.rowsArray[e],o=r.firstChild;o||(o=r.ownerDocument.createTextNode(""),r.appendChild(o));var i=0;for(r==this.cursorRowNode_?t>=this.cursorPosition.column-this.cursorOffset_&&(o=this.cursorNode_,i=this.cursorPosition.column-this.cursorOffset_):this.cursorRowNode_=r,this.cursorPosition.move(e,t);o;){var s=t-i,n=hterm.TextAttributes.nodeWidth(o);if(!o.nextSibling||n>s)return this.cursorNode_=o,void(this.cursorOffset_=s);i+=n,o=o.nextSibling}}else console.warn("Attempt to set cursor position on empty screen.")},hterm.Screen.prototype.syncSelectionCaret=function(e){try{e.collapse(this.cursorNode_,this.cursorOffset_)}catch(e){}},hterm.Screen.prototype.splitNode_=function(e,t){var r=e.cloneNode(!1),o=e.textContent;e.textContent=hterm.TextAttributes.nodeSubstr(e,0,t),r.textContent=lib.wc.substr(o,t),r.textContent&&e.parentNode.insertBefore(r,e.nextSibling),e.textContent||e.parentNode.removeChild(e)},hterm.Screen.prototype.maybeClipCurrentRow=function(){var e=hterm.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=hterm.TextAttributes.nodeWidth(this.cursorNode_),this.cursorOffset_hterm.TextAttributes.nodeWidth(e);){if(!e.hasAttribute("line-overflow")||!e.nextSibling)return-1;t-=hterm.TextAttributes.nodeWidth(e),e=e.nextSibling}return this.getNodeAndOffsetWithinRow_(e,t)},hterm.Screen.prototype.getNodeAndOffsetWithinRow_=function(e,t){for(var r=0;r\"'\\^!@#$%&*,;:`][^\\s\\[\\](){}<>\"'\\^]*$"),l=n.search(a);if(!(-1==l||l>o)){var h=lib.wc.substring(s,o,lib.wc.strWidth(s)),c=new RegExp("^[^\\s\\[\\](){}<>\"'\\^]*[^\\s\\[\\](){}<>\"'\\^!@#$%&*,;:~.`]"),u=h.match(c);if(u){var g=o+lib.wc.strWidth(u[0]);-1==g||gs.rowIndex)t();else if(o.focusNode==o.anchorNode)o.anchorOffset=this.lastRowCount_},hterm.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)}},hterm.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)}},hterm.ScrollPort.prototype.drawVisibleRows_=function(e,t){function r(e,t){for(;e!=t;){if(!e)throw"Did not encounter target node";if(e==o.bottomFold_)throw"Encountered bottom fold before target node";var r=e;e=e.nextSibling,r.parentNode.removeChild(r)}}for(var o=this,i=this.selection.startRow,s=this.selection.endRow,n=this.bottomFold_,a=this.topFold_.nextSibling,l=Math.min(this.visibleRowCount,this.rowProvider_.getRowCount()),h=0;h=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())},hterm.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)},hterm.ScrollPort.prototype.getTopRowIndex=function(){return lib.f.smartFloorDivide(this.screen_.scrollTop,this.characterSize.height)},hterm.ScrollPort.prototype.getBottomRowIndex=function(e){return e+this.visibleRowCount-1},hterm.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()},hterm.ScrollPort.prototype.onScrollWheel=function(e){},hterm.ScrollPort.prototype.onScrollWheel_=function(e){if(this.onScrollWheel(e),!e.defaultPrevented){var t="DOMMouseScroll"==e.type?-1*e.detail:e.wheelDeltaY;t*=this.scrollWheelMultiplier_;var r=this.screen_.scrollTop-t;r<0&&(r=0);var o=this.getScrollMax_();r>o&&(r=o),r!=this.screen_.scrollTop&&(this.screen_.scrollTop=r,e.preventDefault())}},hterm.ScrollPort.prototype.onResize_=function(e){this.syncCharacterSize(),this.resize()},hterm.ScrollPort.prototype.onCopy=function(e){},hterm.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=this.getTopRowIndex(),r=this.getBottomRowIndex(t);if(this.selection.startRow.rowIndexr){var i;i=this.selection.startRow.rowIndex>r?this.selection.startRow.rowIndex+1:this.bottomFold_.previousSibling.rowIndex+1,this.bottomSelectBag_.textContent=this.rowProvider_.getRowsText(i,this.selection.endRow.rowIndex),this.rowNodes_.insertBefore(this.bottomSelectBag_,this.selection.endRow)}}},hterm.ScrollPort.prototype.onBodyKeyDown_=function(e){if(this.ctrlVPaste){var t=String.fromCharCode(e.which).toLowerCase();(e.ctrlKey||e.metaKey)&&"v"==t&&this.pasteTarget_.focus()}},hterm.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)},hterm.ScrollPort.prototype.handlePasteTargetTextInput_=function(e){e.stopPropagation()},hterm.ScrollPort.prototype.setScrollbarVisible=function(e){this.screen_.style.overflowY=e?"scroll":"hidden"},hterm.ScrollPort.prototype.setScrollWheelMoveMultipler=function(e){this.scrollWheelMultiplier_=e},lib.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"),hterm.Terminal=function(e){this.profileId_=null,this.primaryScreen_=new hterm.Screen,this.alternateScreen_=new hterm.Screen,this.screen_=this.primaryScreen_,this.screenSize=new hterm.Size(0,0),this.scrollPort_=new hterm.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_=hterm.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.reportMouseEvents_=!1,this.bellAudio_=this.document_.createElement("audio"),this.bellAudio_.setAttribute("preload","auto"),this.bellNotificationList_=[],this.desktopNotificationBell_=!1,this.savedOptions_={},this.options_=new hterm.Options,this.timeouts_={},this.vt=new hterm.VT(this),this.keyboard=new hterm.Keyboard(this),this.io=new hterm.Terminal.IO(this),this.enableMouseDragScroll=!0,this.copyOnSelect=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))},hterm.Terminal.cursorShape={BLOCK:"BLOCK",BEAM:"BEAM",UNDERLINE:"UNDERLINE"},hterm.Terminal.prototype.onTerminalReady=function(){},hterm.Terminal.prototype.tabWidth=8,hterm.Terminal.prototype.setProfile=function(e,t){this.profileId_=e.replace(/\//g,"");var r=this;this.prefs_&&this.prefs_.deactivate(),this.prefs_=new hterm.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"),r.keyboard.altGrMode=e},"alt-backspace-is-meta-backspace":function(e){r.keyboard.altBackspaceIsMetaBackspace=e},"alt-is-meta":function(e){r.keyboard.altIsMeta=e},"alt-sends-what":function(e){/^(escape|8-bit|browser-key)$/.test(e)||(e="escape"),r.keyboard.altSendsWhat=e},"audible-bell-sound":function(e){var t=e.match(/^lib-resource:(\S+)/);t?r.bellAudio_.setAttribute("src",lib.resource.getDataUrl(t[1])):r.bellAudio_.setAttribute("src",e)},"desktop-notification-bell":function(e){e&&Notification?(r.desktopNotificationBell_="granted"===Notification.permission,r.desktopNotificationBell_||console.warn("desktop-notification-bell is true but we do not have permission to display notifications.")):r.desktopNotificationBell_=!1},"background-color":function(e){r.setBackgroundColor(e)},"background-image":function(e){r.scrollPort_.setBackgroundImage(e)},"background-size":function(e){r.scrollPort_.setBackgroundSize(e)},"background-position":function(e){r.scrollPort_.setBackgroundPosition(e)},"backspace-sends-backspace":function(e){r.keyboard.backspaceSendsBackspace=e},"character-map-overrides":function(e){if(null==e||e instanceof Object)for(var t in e){var r=hterm.VT.CharacterMap.maps[t].glmap;for(var o in e[t])r[o]=e[t][o];hterm.VT.CharacterMap.maps[t].reset(r)}else console.warn("Preference character-map-modifications is not an object: "+e)},"cursor-blink":function(e){r.setCursorBlink(!!e)},"cursor-blink-cycle":function(e){e instanceof Array&&"number"==typeof e[0]&&"number"==typeof e[1]?r.cursorBlinkCycle_=e:r.cursorBlinkCycle_="number"==typeof e?[e,e]:[100,100]},"cursor-color":function(e){r.setCursorColor(e)},"color-palette-overrides":function(e){if(null==e||e instanceof Object||e instanceof Array){if(lib.colors.colorPalette=lib.colors.stockColorPalette.concat(),e)for(var t in e){var o=parseInt(t);if(isNaN(o)||o<0||o>255)console.log("Invalid value in palette: "+t+": "+e[t]);else if(e[o]){var i=lib.colors.normalizeCSS(e[o]);i&&(lib.colors.colorPalette[o]=i)}}r.primaryScreen_.textAttributes.resetColorPalette(),r.alternateScreen_.textAttributes.resetColorPalette()}else console.warn("Preference color-palette-overrides is not an array or object: "+e)},"copy-on-select":function(e){r.copyOnSelect=!!e},"use-default-window-copy":function(e){r.useDefaultWindowCopy=!!e},"clear-selection-after-copy":function(e){r.clearSelectionAfterCopy=!!e},"ctrl-plus-minus-zero-zoom":function(e){r.keyboard.ctrlPlusMinusZeroZoom=e},"ctrl-c-copy":function(e){r.keyboard.ctrlCCopy=e},"ctrl-v-paste":function(e){r.keyboard.ctrlVPaste=e,r.scrollPort_.setCtrlVPaste(e)},"east-asian-ambiguous-as-two-column":function(e){lib.wc.regardCjkAmbiguous=e},"enable-8-bit-control":function(e){r.vt.enable8BitControl=!!e},"enable-bold":function(e){r.syncBoldSafeState()},"enable-bold-as-bright":function(e){r.primaryScreen_.textAttributes.enableBoldAsBright=!!e,r.alternateScreen_.textAttributes.enableBoldAsBright=!!e},"enable-clipboard-write":function(e){r.vt.enableClipboardWrite=!!e},"enable-dec12":function(e){r.vt.enableDec12=!!e},"font-family":function(e){r.syncFontFamily()},"font-size":function(e){r.setFontSize(e)},"font-smoothing":function(e){r.syncFontFamily()},"foreground-color":function(e){r.setForegroundColor(e)},"home-keys-scroll":function(e){r.keyboard.homeKeysScroll=e},"max-string-sequence":function(e){r.vt.maxStringSequence=e},"media-keys-are-fkeys":function(e){r.keyboard.mediaKeysAreFKeys=e},"meta-sends-escape":function(e){r.keyboard.metaSendsEscape=e},"mouse-paste-button":function(e){r.syncMousePasteButton()},"page-keys-scroll":function(e){r.keyboard.pageKeysScroll=e},"pass-alt-number":function(e){null==e&&(e=!window.navigator.userAgent.match(/Mac OS X/)&&"popup"!=hterm.windowType),r.passAltNumber=e},"pass-ctrl-number":function(e){null==e&&(e=!window.navigator.userAgent.match(/Mac OS X/)&&"popup"!=hterm.windowType),r.passCtrlNumber=e},"pass-meta-number":function(e){null==e&&(e=window.navigator.userAgent.match(/Mac OS X/)&&"popup"!=hterm.windowType),r.passMetaNumber=e},"pass-meta-v":function(e){r.keyboard.passMetaV=e},"receive-encoding":function(e){/^(utf-8|raw)$/.test(e)||(console.warn('Invalid value for "receive-encoding": '+e),e="utf-8"),r.vt.characterEncoding=e},"scroll-on-keystroke":function(e){r.scrollOnKeystroke_=e},"scroll-on-output":function(e){r.scrollOnOutput_=e},"scrollbar-visible":function(e){r.setScrollbarVisible(e)},"scroll-wheel-move-multiplier":function(e){r.setScrollWheelMoveMultipler(e)},"send-encoding":function(e){/^(utf-8|raw)$/.test(e)||(console.warn('Invalid value for "send-encoding": '+e),e="utf-8"),r.keyboard.characterEncoding=e},"shift-insert-paste":function(e){r.keyboard.shiftInsertPaste=e},"user-css":function(e){r.scrollPort_.setUserCss(e)}}),this.prefs_.readStorage(function(){this.prefs_.notifyAll(),t&&t()}.bind(this))},hterm.Terminal.prototype.getPrefs=function(){return this.prefs_},hterm.Terminal.prototype.setBracketedPaste=function(e){this.options_.bracketedPaste=e},hterm.Terminal.prototype.setCursorColor=function(e){this.cursorColor_=e,this.cursorNode_.style.backgroundColor=e,this.cursorNode_.style.borderColor=e},hterm.Terminal.prototype.getCursorColor=function(){return this.cursorColor_},hterm.Terminal.prototype.setSelectionEnabled=function(e){this.enableMouseDragScroll=e},hterm.Terminal.prototype.setBackgroundColor=function(e){this.backgroundColor_=lib.colors.normalizeCSS(e),this.primaryScreen_.textAttributes.setDefaults(this.foregroundColor_,this.backgroundColor_),this.alternateScreen_.textAttributes.setDefaults(this.foregroundColor_,this.backgroundColor_),this.scrollPort_.setBackgroundColor(e)},hterm.Terminal.prototype.getBackgroundColor=function(){return this.backgroundColor_},hterm.Terminal.prototype.setForegroundColor=function(e){this.foregroundColor_=lib.colors.normalizeCSS(e),this.primaryScreen_.textAttributes.setDefaults(this.foregroundColor_,this.backgroundColor_),this.alternateScreen_.textAttributes.setDefaults(this.foregroundColor_,this.backgroundColor_),this.scrollPort_.setForegroundColor(e)},hterm.Terminal.prototype.getForegroundColor=function(){return this.foregroundColor_},hterm.Terminal.prototype.runCommandClass=function(e,t){var r=this.prefs_.get("environment");"object"==(void 0===r?"undefined":_typeof(r))&&null!=r||(r={});var o=this;this.command=new e({argString:t||"",io:this.io.push(),environment:r,onExit:function(e){o.io.pop(),o.uninstallKeyboard(),o.prefs_.get("close-on-exit")&&window.close()}}),this.installKeyboard(),this.command.run()},hterm.Terminal.prototype.isPrimaryScreen=function(){return this.screen_==this.primaryScreen_},hterm.Terminal.prototype.installKeyboard=function(){this.keyboard.installKeyboard(this.scrollPort_.getDocument().body)},hterm.Terminal.prototype.uninstallKeyboard=function(){this.keyboard.installKeyboard(null)},hterm.Terminal.prototype.setFontSize=function(e){0===e&&(e=this.prefs_.get("font-size")),this.scrollPort_.setFontSize(e),this.wcCssRule_&&(this.wcCssRule_.style.width=2*this.scrollPort_.characterSize.width+"px")},hterm.Terminal.prototype.getFontSize=function(){return this.scrollPort_.getFontSize()},hterm.Terminal.prototype.getFontFamily=function(){return this.scrollPort_.getFontFamily()},hterm.Terminal.prototype.syncFontFamily=function(){this.scrollPort_.setFontFamily(this.prefs_.get("font-family"),this.prefs_.get("font-smoothing")),this.syncBoldSafeState()},hterm.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[2]?this.mousePasteButton=3:this.mousePasteButton=2}else this.mousePasteButton=e},hterm.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"),o=t.equals(r);o||console.warn("Bold characters disabled: Size of bold weight differs from normal. Font family is: "+this.scrollPort_.getFontFamily()),this.primaryScreen_.textAttributes.enableBold=o,this.alternateScreen_.textAttributes.enableBold=o},hterm.Terminal.prototype.saveCursor=function(){return this.screen_.cursorPosition.clone()},hterm.Terminal.prototype.getTextAttributes=function(){return this.screen_.textAttributes},hterm.Terminal.prototype.setTextAttributes=function(e){this.screen_.textAttributes=e},hterm.Terminal.prototype.getZoomFactor=function(){return this.scrollPort_.characterSize.zoomFactor},hterm.Terminal.prototype.setWindowTitle=function(e){window.document.title=e},hterm.Terminal.prototype.restoreCursor=function(e){var t=lib.f.clamp(e.row,0,this.screenSize.height-1),r=lib.f.clamp(e.column,0,this.screenSize.width-1);this.screen_.setCursorPosition(t,r),(e.column>r||e.column==r&&e.overflow)&&(this.screen_.cursorPosition.overflow=!0)},hterm.Terminal.prototype.clearCursorOverflow=function(){this.screen_.cursorPosition.overflow=!1},hterm.Terminal.prototype.setCursorShape=function(e){this.cursorShape_=e,this.restyleCursor_()},hterm.Terminal.prototype.getCursorShape=function(){return this.cursorShape_},hterm.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%"},hterm.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%"},hterm.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)},hterm.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 s=Math.min(t,this.scrollbackRows_.length),n=this.scrollbackRows_.splice(this.scrollbackRows_.length-s,s);this.screen_.unshiftRows(n),t-=s,r.row+=s}t&&this.appendRows_(t)}this.setVTScrollRegion(null,null),this.restoreCursor(r)},hterm.Terminal.prototype.scrollHome=function(){this.scrollPort_.scrollRowToTop(0)},hterm.Terminal.prototype.scrollEnd=function(){this.scrollPort_.scrollRowToBottom(this.getRowCount())},hterm.Terminal.prototype.scrollPageUp=function(){var e=this.scrollPort_.getTopRowIndex();this.scrollPort_.scrollRowToTop(e-this.screenSize.height+1)},hterm.Terminal.prototype.scrollPageDown=function(){var e=this.scrollPort_.getTopRowIndex();this.scrollPort_.scrollRowToTop(e+this.screenSize.height-1)},hterm.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()},hterm.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()},hterm.Terminal.prototype.softReset=function(){this.options_=new hterm.Options,this.options_.cursorBlink=!!this.timeouts_.cursorBlink,this.primaryScreen_.textAttributes.resetColorPalette(),this.alternateScreen_.textAttributes.resetColorPalette(),this.setVTScrollRegion(null,null),this.setCursorVisible(!0)},hterm.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},hterm.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 n=this.screen_.shiftRows(s);Array.prototype.push.apply(this.scrollbackRows_,n),this.scrollPort_.isScrolledEnd&&this.scheduleScrollDown_()}t>=this.screen_.rowsArray.length&&(t=this.screen_.rowsArray.length-1),this.setAbsoluteCursorPosition(t,0)},hterm.Terminal.prototype.moveRows_=function(e,t,r){var o=this.screen_.removeRows(e,t);this.screen_.insertRows(r,o);var i,s;e=this.screenSize.width&&(s=!0,i=this.screenSize.width-this.screen_.cursorPosition.column),s&&!this.options_.wraparound?(o=lib.wc.substr(e,t,i-1)+lib.wc.substr(e,r-1),i=r):o=lib.wc.substr(e,t,i);for(var n=hterm.TextAttributes.splitWidecharString(o),a=0;a=0;i--)this.setAbsoluteCursorPosition(t+i,0),this.screen_.clearCursorRow()},hterm.Terminal.prototype.deleteLines=function(e){var t=this.saveCursor(),r=t.row,o=this.getVTScrollBottom(),i=o-r+1,s=o-(e=Math.min(e,i))+1;e!=i&&this.moveRows_(r,e,s);for(var n=0;nt)this.cursorNode_.style.top=-this.scrollPort_.characterSize.height+"px";else{this.options_.cursorVisible&&"none"==this.cursorNode_.style.display&&(this.cursorNode_.style.display=""),this.cursorNode_.style.top=this.scrollPort_.visibleRowTopMargin+this.scrollPort_.characterSize.height*(r-e)+"px",this.cursorNode_.style.left=this.scrollPort_.characterSize.width*this.screen_.cursorPosition.column+"px",this.cursorNode_.setAttribute("title","("+this.screen_.cursorPosition.row+", "+this.screen_.cursorPosition.column+")");var o=this.document_.getSelection();o&&o.isCollapsed&&this.screen_.syncSelectionCaret(o)}},hterm.Terminal.prototype.restyleCursor_=function(){var e=this.cursorShape_;"false"==this.cursorNode_.getAttribute("focus")&&(e=hterm.Terminal.cursorShape.BLOCK);var t=this.cursorNode_.style;switch(t.width=this.scrollPort_.characterSize.width+"px",e){case hterm.Terminal.cursorShape.BEAM:t.height=this.scrollPort_.characterSize.height+"px",t.backgroundColor="transparent",t.borderBottomStyle=null,t.borderLeftStyle="solid";break;case hterm.Terminal.cursorShape.UNDERLINE:t.height=this.scrollPort_.characterSize.baseline+"px",t.backgroundColor="transparent",t.borderBottomStyle="solid",t.borderLeftStyle=null;break;default:t.height=this.scrollPort_.characterSize.height+"px",t.backgroundColor=this.cursorColor_,t.borderBottomStyle=null,t.borderLeftStyle=null}},hterm.Terminal.prototype.scheduleSyncCursorPosition_=function(){if(!this.timeouts_.syncCursor){var e=this;this.timeouts_.syncCursor=setTimeout(function(){e.syncCursorPosition_(),delete e.timeouts_.syncCursor},0)}},hterm.Terminal.prototype.showZoomWarning_=function(e){if(!this.zoomWarningNode_){if(!e)return;this.zoomWarningNode_=this.document_.createElement("div"),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_.textContent=lib.MessageManager.replaceReferences(hterm.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_)},hterm.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 r=hterm.getClientSize(this.div_),o=hterm.getClientSize(this.overlayNode_);this.overlayNode_.style.top=(r.height-o.height)/2+"px",this.overlayNode_.style.left=(r.width-o.width-this.scrollPort_.currentScrollbarWidthPx)/2+"px";var i=this;this.overlayTimeout_&&clearTimeout(this.overlayTimeout_),null!==t&&(this.overlayTimeout_=setTimeout(function(){i.overlayNode_.style.opacity="0",i.overlayTimeout_=setTimeout(function(){i.overlayNode_.parentNode&&i.overlayNode_.parentNode.removeChild(i.overlayNode_),i.overlayTimeout_=null,i.overlayNode_.style.opacity="0.75"},200)},t||1500))},hterm.Terminal.prototype.paste=function(){hterm.pasteFromClipboard(this.document_)},hterm.Terminal.prototype.copyStringToClipboard=function(e){this.prefs_.get("enable-clipboard-notice")&&setTimeout(this.showOverlay.bind(this,hterm.notifyCopyMessage,500),200);var t=this.document_.createElement("pre");t.textContent=e,t.style.cssText="-webkit-user-select: text;-moz-user-select: text;position: absolute;top: -99px",this.document_.body.appendChild(t);var r=this.document_.getSelection(),o=r.anchorNode,i=r.anchorOffset,s=r.focusNode,n=r.focusOffset;r.selectAllChildren(t),hterm.copySelectionToClipboard(this.document_),r.extend&&(r.collapse(o,i),r.extend(s,n)),t.parentNode.removeChild(t)},hterm.Terminal.prototype.getSelectionText=function(){var e=this.scrollPort_.selection;if(e.sync(),e.isCollapsed)return null;var t=e.startOffset,r=e.startNode;if("X-ROW"!=r.nodeName)for("#text"==r.nodeName&&"SPAN"==r.parentNode.nodeName&&(r=r.parentNode);r.previousSibling;)r=r.previousSibling,t+=hterm.TextAttributes.nodeWidth(r);var o=hterm.TextAttributes.nodeWidth(e.endNode)-e.endOffset;if("X-ROW"!=(r=e.endNode).nodeName)for("#text"==r.nodeName&&"SPAN"==r.parentNode.nodeName&&(r=r.parentNode);r.nextSibling;)r=r.nextSibling,o+=hterm.TextAttributes.nodeWidth(r);var i=this.getRowsText(e.startRow.rowIndex,e.endRow.rowIndex+1);return lib.wc.substring(i,t,lib.wc.strWidth(i)-o)},hterm.Terminal.prototype.copySelectionToClipboard=function(){var e=this.getSelectionText();null!=e&&this.copyStringToClipboard(e)},hterm.Terminal.prototype.overlaySize=function(){this.showOverlay(this.screenSize.width+"x"+this.screenSize.height)},hterm.Terminal.prototype.onVTKeystroke=function(e){this.scrollOnKeystroke_&&this.scrollPort_.scrollRowToBottom(this.getRowCount()),this.io.onVTKeystroke(this.keyboard.encode(e))},hterm.Terminal.prototype.onMouse_=function(e){e.processedByTerminalHandler_||(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||(this.options_.cursorVisible&&this.vt.mouseReport==this.vt.MOUSE_REPORT_DISABLED&&(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||this.vt.mouseReport==this.vt.MOUSE_REPORT_DISABLED?(this.reportMouseEvents_=!1,this.setSelectionEnabled(!0)):(this.reportMouseEvents_=!0,this.document_.getSelection().collapseToEnd(),this.setSelectionEnabled(!1),e.preventDefault())),this.reportMouseEvents_?(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)):("dblclick"==e.type&&(this.screen_.expandSelection(this.document_.getSelection()),hterm.copySelectionToClipboard(this.document_)),"mousedown"==e.type&&e.which==this.mousePasteButton&&this.paste(),"mouseup"==e.type&&1==e.which&&this.copyOnSelect&&!this.document_.getSelection().isCollapsed&&hterm.copySelectionToClipboard(this.document_),"mousemove"!=e.type&&"mouseup"!=e.type||!this.scrollBlockerNode_.engaged||(this.scrollBlockerNode_.engaged=!1,this.scrollBlockerNode_.style.top="-99px")),"mouseup"==e.type&&this.document_.getSelection().isCollapsed&&(this.reportMouseEvents_=this.vt.mouseReport!=this.vt.MOUSE_REPORT_DISABLED)))},hterm.Terminal.prototype.onMouse=function(e){},hterm.Terminal.prototype.onFocusChange_=function(e){this.cursorNode_.setAttribute("focus",e),this.restyleCursor_(),!0===e&&this.closeBellNotifications_()},hterm.Terminal.prototype.onScroll_=function(){this.scheduleSyncCursorPosition_()},hterm.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)},hterm.Terminal.prototype.onCopy_=function(e){this.useDefaultWindowCopy||(e.preventDefault(),setTimeout(this.copySelectionToClipboard.bind(this),0))},hterm.Terminal.prototype.onResize_=function(){var e=Math.floor(this.scrollPort_.getScreenWidth()/this.scrollPort_.characterSize.width),t=lib.f.smartFloorDivide(this.scrollPort_.getScreenHeight(),this.scrollPort_.characterSize.height);if(!(e<=0||t<=0)){var r=e!=this.screenSize.width||t!=this.screenSize.height;this.realizeSize_(e,t),this.showZoomWarning_(1!=this.scrollPort_.characterSize.zoomFactor),r&&this.overlaySize(),this.restyleCursor_(),this.scheduleSyncCursorPosition_()}},hterm.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},hterm.Terminal.prototype.setScrollbarVisible=function(e){this.scrollPort_.setScrollbarVisible(e)},hterm.Terminal.prototype.setScrollWheelMoveMultipler=function(e){this.scrollPort_.setScrollWheelMoveMultipler(e)},hterm.Terminal.prototype.closeBellNotifications_=function(){this.bellNotificationList_.forEach(function(e){e.close()}),this.bellNotificationList_.length=0},lib.rtdep("lib.encodeUTF8"),hterm.Terminal.IO=function(e){this.terminal_=e,this.previousIO_=null},hterm.Terminal.IO.prototype.showOverlay=function(e,t){this.terminal_.showOverlay(e,t)},hterm.Terminal.IO.prototype.createFrame=function(e,t){return new hterm.Frame(this.terminal_,e,t)},hterm.Terminal.IO.prototype.setTerminalProfile=function(e){this.terminal_.setProfile(e)},hterm.Terminal.IO.prototype.push=function(){var e=new hterm.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},hterm.Terminal.IO.prototype.pop=function(){this.terminal_.io=this.previousIO_},hterm.Terminal.IO.prototype.sendString=function(e){console.log("Unhandled sendString: "+e)},hterm.Terminal.IO.prototype.onVTKeystroke=function(e){console.log("Unobserverd VT keystroke: "+JSON.stringify(e))},hterm.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)},hterm.Terminal.IO.prototype.onTerminalResize=function(e,t){},hterm.Terminal.IO.prototype.writeUTF8=function(e){if(this.terminal_.io!=this)throw"Attempt to print from inactive IO object.";this.terminal_.interpret(e)},hterm.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")},hterm.Terminal.IO.prototype.print=hterm.Terminal.IO.prototype.writeUTF16=function(e){this.writeUTF8(lib.encodeUTF8(e))},hterm.Terminal.IO.prototype.println=hterm.Terminal.IO.prototype.writelnUTF16=function(e){this.writelnUTF8(lib.encodeUTF8(e))},lib.rtdep("lib.colors"),hterm.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.tileData=null,this.colorPalette=null,this.resetColorPalette()},hterm.TextAttributes.prototype.enableBold=!0,hterm.TextAttributes.prototype.enableBoldAsBright=!0,hterm.TextAttributes.prototype.DEFAULT_COLOR=new String(""),hterm.TextAttributes.prototype.SRC_DEFAULT="default",hterm.TextAttributes.prototype.SRC_RGB="rgb",hterm.TextAttributes.prototype.setDocument=function(e){this.document_=e},hterm.TextAttributes.prototype.clone=function(){var e=new hterm.TextAttributes(null);for(var t in this)e[t]=this[t];return e.colorPalette=this.colorPalette.concat(),e},hterm.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},hterm.TextAttributes.prototype.resetColorPalette=function(){this.colorPalette=lib.colors.colorPalette.concat(),this.syncColors()},hterm.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||null!=this.tileData)},hterm.TextAttributes.prototype.createContainer=function(e){var t=this.document_.createElement("span"),r=t.style;this.foreground!=this.DEFAULT_COLOR?r.color=this.foreground:r.color=this.defaultForeground,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&&(r.fontStyle="italic");var o="";return this.underline&&(o+=" underline",t.underline=!0),this.strikethrough&&(o+=" line-through",t.strikethrough=!0),o&&(r.textDecoration=o),this.wcNode&&(t.className="wc-node",t.wcNode=!0),null!=this.tileData&&(t.className+=" tile tile_"+this.tileData,t.tileNode=!0),e&&(t.textContent=e),t},hterm.TextAttributes.prototype.matchesContainer=function(e){return!1},hterm.TextAttributes.prototype.setDefaults=function(e,t){this.defaultForeground=e,this.defaultBackground=t,this.syncColors()},hterm.TextAttributes.prototype.syncColors=function(){var e=this.foregroundSource,t=this.backgroundSource,r=this.DEFAULT_COLOR,o=this.DEFAULT_COLOR;if(this.inverse&&(e=this.backgroundSource,t=this.foregroundSource,r=this.defaultBackground,o=this.defaultForeground),this.enableBoldAsBright&&this.bold&&e!=this.SRC_DEFAULT&&e!=this.SRC_RGB&&(e=function(e){return e<8?e+8:e}(e)),this.invisible&&(e=t,r=this.defaultBackground),e!=this.SRC_RGB&&(this.foreground=e==this.SRC_DEFAULT?r:this.colorPalette[e]),this.faint&&!this.invisible){var i=this.foreground==this.DEFAULT_COLOR?this.defaultForeground:this.foreground;this.foreground=lib.colors.mix(i,"rgb(0, 0, 0)",.3333)}t!=this.SRC_RGB&&(this.background=t==this.SRC_DEFAULT?o:this.colorPalette[t])},hterm.TextAttributes.containersMatch=function(e,t){if("string"==typeof e)return hterm.TextAttributes.containerIsDefault(t);if(e.nodeType!=t.nodeType)return!1;if(3==e.nodeType)return!0;var r=e.style,o=t.style;return r.color==o.color&&r.backgroundColor==o.backgroundColor&&r.fontWeight==o.fontWeight&&r.fontStyle==o.fontStyle&&r.textDecoration==o.textDecoration},hterm.TextAttributes.containerIsDefault=function(e){return"string"==typeof e||3==e.nodeType},hterm.TextAttributes.nodeWidth=function(e){return e.wcNode?lib.wc.strWidth(e.textContent):e.textContent.length},hterm.TextAttributes.nodeSubstr=function(e,t,r){return e.wcNode?lib.wc.substr(e.textContent,t,r):e.textContent.substr(t,r)},hterm.TextAttributes.nodeSubstring=function(e,t,r){return e.wcNode?lib.wc.substring(e.textContent,t,r):e.textContent.substring(t,r)},hterm.TextAttributes.splitWidecharString=function(e){for(var t=[],r=0,o=0,i=0;i0?0:1),s|=r,t=""+String.fromCharCode(s)+o+i,e.preventDefault();break;case"mousedown":var s=Math.min(e.which-1,2)+32;s|=r,t=""+String.fromCharCode(s)+o+i;break;case"mouseup":t="#"+o+i;break;case"mousemove":this.mouseReport==this.MOUSE_REPORT_DRAG&&e.which&&(s=32+Math.min(e.which-1,2),s+=32,s|=r,t=""+String.fromCharCode(s)+o+i);break;case"click":case"dblclick":break;default:console.error("Unknown mouse event: "+e.type,e)}t&&this.terminal.io.sendString(t)}},hterm.VT.prototype.interpret=function(e){for(this.parseState_.resetBuf(this.decode(e));!this.parseState_.isComplete();){var t=this.parseState_.func,r=this.parseState_.pos,e=this.parseState_.buf;if(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!"}},hterm.VT.prototype.decode=function(e){return"utf-8"==this.characterEncoding?this.decodeUTF8(e):e},hterm.VT.prototype.encodeUTF8=function(e){return lib.encodeUTF8(e)},hterm.VT.prototype.decodeUTF8=function(e){return this.utf8Decoder_.decode(e)},hterm.VT.prototype.parseUnknown_=function(e){function t(e){r[r.GL].GL&&(e=r[r.GL].GL(e)),r[r.GR].GR&&(e=r[r.GR].GR(e)),r.terminal.print(e)}var r=this,o=e.peekRemainingBuf(),i=o.search(this.cc1Pattern_);return 0==i?(this.dispatch("CC1",o.substr(0,1),e),void e.advance(1)):-1==i?(t(o),void e.reset()):(t(o.substr(0,i)),this.dispatch("CC1",o.substr(i,1),e),void e.advance(i+1))},hterm.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)},hterm.VT.prototype.parseUntilStringTerminator_=function(e){var t=e.peekRemainingBuf(),r=t.search(/(\x1b\\|\x07)/),o=e.args;if(o.length||(o[0]="",o[1]=new Date),-1==r){o[0]+=t;var i;return o[0].length>this.maxStringSequence&&(i="too long: "+o[0].length),-1!=o[0].indexOf("")&&(i="embedded escape: "+o[0].indexOf("")),new Date-o[1]>this.oscTimeLimit_&&(i="timeout expired: "+new Date-o[1]),i?(console.log("parseUntilStringTerminator_: aborting: "+i,o[0]),e.reset(o[0]),!1):(e.advance(t.length),!0)}return o[0].length+r>this.maxStringSequence?(e.reset(o[0]+t),!1):(o[0]+=t.substr(0,r),e.resetParseFunction(),e.advance(r+(""==t.substr(r,1)?2:1)),!0)},hterm.VT.prototype.dispatch=function(e,t,r){var o=hterm.VT[e][t];o?o!=hterm.VT.ignore?"CC1"==e&&t>""&&!this.enable8BitControl?console.warn("Ignoring 8-bit control code: 0x"+t.charCodeAt(0).toString(16)):o.apply(this,[r,t]):this.warnUnimplemented&&console.warn("Ignored "+e+" code: "+JSON.stringify(t)):this.warnUnimplemented&&console.warn("Unknown "+e+" code: "+JSON.stringify(t))},hterm.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)},hterm.VT.prototype.setDECMode=function(e,t){switch(e){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"40":this.terminal.allowColumnWidthChanges_=t;break;case"45":this.terminal.setReverseWraparound(t);break;case"67":this.terminal.keyboard.backspaceSendsBackspace=t;break;case"1000":this.mouseReport=t?this.MOUSE_REPORT_CLICK:this.MOUSE_REPORT_DISABLED;break;case"1002":this.mouseReport=t?this.MOUSE_REPORT_DRAG:this.MOUSE_REPORT_DISABLED;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)}},hterm.VT.ignore=function(){},hterm.VT.CC1={},hterm.VT.ESC={},hterm.VT.CSI={},hterm.VT.OSC={},hterm.VT.VT52={},hterm.VT.CC1["\0"]=function(){},hterm.VT.CC1[""]=hterm.VT.ignore,hterm.VT.CC1[""]=function(){this.terminal.ringBell()},hterm.VT.CC1["\b"]=function(){this.terminal.cursorLeft(1)},hterm.VT.CC1["\t"]=function(){this.terminal.forwardTabStop()},hterm.VT.CC1["\n"]=function(){this.terminal.formFeed()},hterm.VT.CC1["\v"]=hterm.VT.CC1["\n"],hterm.VT.CC1["\f"]=function(){this.terminal.formFeed()},hterm.VT.CC1["\r"]=function(){this.terminal.setCursorColumn(0)},hterm.VT.CC1[""]=function(){this.GL="G1"},hterm.VT.CC1[""]=function(){this.GL="G0"},hterm.VT.CC1[""]=hterm.VT.ignore,hterm.VT.CC1[""]=hterm.VT.ignore,hterm.VT.CC1[""]=function(e){e.resetParseFunction(),this.terminal.print("?")},hterm.VT.CC1[""]=hterm.VT.CC1[""],hterm.VT.CC1[""]=function(e){function t(e){var r=e.consumeChar();""!=r&&(this.dispatch("ESC",r,e),e.func==t&&e.resetParseFunction())}e.func=t},hterm.VT.CC1[""]=hterm.VT.ignore,hterm.VT.CC1["„"]=hterm.VT.ESC.D=function(){this.terminal.lineFeed()},hterm.VT.CC1["…"]=hterm.VT.ESC.E=function(){this.terminal.setCursorColumn(0),this.terminal.cursorDown(1)},hterm.VT.CC1["ˆ"]=hterm.VT.ESC.H=function(){this.terminal.setTabStop(this.terminal.getCursorColumn())},hterm.VT.CC1[""]=hterm.VT.ESC.M=function(){this.terminal.reverseLineFeed()},hterm.VT.CC1["Ž"]=hterm.VT.ESC.N=hterm.VT.ignore,hterm.VT.CC1[""]=hterm.VT.ESC.O=hterm.VT.ignore,hterm.VT.CC1[""]=hterm.VT.ESC.P=function(e){e.resetArguments(),e.func=this.parseUntilStringTerminator_},hterm.VT.CC1["–"]=hterm.VT.ESC.V=hterm.VT.ignore,hterm.VT.CC1["—"]=hterm.VT.ESC.W=hterm.VT.ignore,hterm.VT.CC1["˜"]=hterm.VT.ESC.X=hterm.VT.ignore,hterm.VT.CC1["š"]=hterm.VT.ESC.Z=function(){this.terminal.io.sendString("[?1;2c")},hterm.VT.CC1["›"]=hterm.VT.ESC["["]=function(e){e.resetArguments(),this.leadingModifier_="",this.trailingModifier_="",e.func=this.parseCSI_},hterm.VT.CC1["œ"]=hterm.VT.ESC["\\"]=hterm.VT.ignore,hterm.VT.CC1[""]=hterm.VT.ESC["]"]=function(e){function t(e){if(this.parseUntilStringTerminator_(e)&&e.func!=t){var r=e.args[0].match(/^(\d+);(.*)$/);r?(e.args[0]=r[2],this.dispatch("OSC",r[1],e)):console.warn("Invalid OSC: "+JSON.stringify(e.args[0]))}}e.resetArguments(),e.func=t},hterm.VT.CC1["ž"]=hterm.VT.ESC["^"]=function(e){e.resetArguments(),e.func=this.parseUntilStringTerminator_},hterm.VT.CC1["Ÿ"]=hterm.VT.ESC._=function(e){e.resetArguments(),e.func=this.parseUntilStringTerminator_},hterm.VT.ESC[" "]=function(e){e.func=function(e){var t=e.consumeChar();this.warnUnimplemented&&console.warn("Unimplemented sequence: ESC 0x20 "+t),e.resetParseFunction()}},hterm.VT.ESC["#"]=function(e){e.func=function(e){"8"==e.consumeChar()&&this.terminal.fill("E"),e.resetParseFunction()}},hterm.VT.ESC["%"]=function(e){e.func=function(e){var t=e.consumeChar();"@"!=t&&"G"!=t&&this.warnUnimplemented&&console.warn("Unknown ESC % argument: "+JSON.stringify(t)),e.resetParseFunction()}},hterm.VT.ESC["("]=hterm.VT.ESC[")"]=hterm.VT.ESC["*"]=hterm.VT.ESC["+"]=hterm.VT.ESC["-"]=hterm.VT.ESC["."]=hterm.VT.ESC["/"]=function(e,t){e.func=function(e){var r=e.consumeChar();if(""==r)return e.resetParseFunction(),void e.func();r in hterm.VT.CharacterMap.maps?"("==t?this.G0=hterm.VT.CharacterMap.maps[r]:")"==t||"-"==t?this.G1=hterm.VT.CharacterMap.maps[r]:"*"==t||"."==t?this.G2=hterm.VT.CharacterMap.maps[r]:"+"!=t&&"/"!=t||(this.G3=hterm.VT.CharacterMap.maps[r]):this.warnUnimplemented&&console.log('Invalid character set for "'+t+'": '+r),e.resetParseFunction()}},hterm.VT.ESC[6]=hterm.VT.ignore,hterm.VT.ESC[7]=function(){this.savedState_.save()},hterm.VT.ESC[8]=function(){this.savedState_.restore()},hterm.VT.ESC[9]=hterm.VT.ignore,hterm.VT.ESC["="]=function(){this.terminal.keyboard.applicationKeypad=!0},hterm.VT.ESC[">"]=function(){this.terminal.keyboard.applicationKeypad=!1},hterm.VT.ESC.F=hterm.VT.ignore,hterm.VT.ESC.c=function(){this.reset(),this.terminal.reset()},hterm.VT.ESC.l=hterm.VT.ESC.m=hterm.VT.ignore,hterm.VT.ESC.n=function(){this.GL="G2"},hterm.VT.ESC.o=function(){this.GL="G3"},hterm.VT.ESC["|"]=function(){this.GR="G3"},hterm.VT.ESC["}"]=function(){this.GR="G2"},hterm.VT.ESC["~"]=function(){this.GR="G1"},hterm.VT.OSC[0]=function(e){this.terminal.setWindowTitle(e.args[0])},hterm.VT.OSC[2]=hterm.VT.OSC[0],hterm.VT.OSC[4]=function(e){for(var t=e.args[0].split(";"),r=parseInt(t.length/2),o=this.terminal.getTextAttributes().colorPalette,i=[],s=0;s=o.length||("?"!=a?(a=lib.colors.x11ToCSS(a))&&(o[n]=a):(a=lib.colors.rgbToX11(o[n]))&&i.push(n+";"+a))}i.length&&this.terminal.io.sendString("]4;"+i.join(";")+"")},hterm.VT.OSC[50]=function(e){var t=e.args[0].match(/CursorShape=(.)/i);if(t)switch(t[1]){case"1":this.terminal.setCursorShape(hterm.Terminal.cursorShape.BEAM);break;case"2":this.terminal.setCursorShape(hterm.Terminal.cursorShape.UNDERLINE);break;default:this.terminal.setCursorShape(hterm.Terminal.cursorShape.BLOCK)}else console.warn("Could not parse OSC 50 args: "+e.args[0])},hterm.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))}},hterm.VT.CSI["@"]=function(e){this.terminal.insertSpace(e.iarg(0,1))},hterm.VT.CSI.A=function(e){this.terminal.cursorUp(e.iarg(0,1))},hterm.VT.CSI.B=function(e){this.terminal.cursorDown(e.iarg(0,1))},hterm.VT.CSI.C=function(e){this.terminal.cursorRight(e.iarg(0,1))},hterm.VT.CSI.D=function(e){this.terminal.cursorLeft(e.iarg(0,1))},hterm.VT.CSI.E=function(e){this.terminal.cursorDown(e.iarg(0,1)),this.terminal.setCursorColumn(0)},hterm.VT.CSI.F=function(e){this.terminal.cursorUp(e.iarg(0,1)),this.terminal.setCursorColumn(0)},hterm.VT.CSI.G=function(e){this.terminal.setCursorColumn(e.iarg(0,1)-1)},hterm.VT.CSI.H=function(e){this.terminal.setCursorPosition(e.iarg(0,1)-1,e.iarg(1,1)-1)},hterm.VT.CSI.I=function(e){var t=e.iarg(0,1);t=lib.f.clamp(t,1,this.terminal.screenSize.width);for(var r=0;rT"]=hterm.VT.ignore,hterm.VT.CSI.X=function(e){this.terminal.eraseToRight(e.iarg(0,1))},hterm.VT.CSI.Z=function(e){var t=e.iarg(0,1);t=lib.f.clamp(t,1,this.terminal.screenSize.width);for(var r=0;rc"]=function(e){this.terminal.io.sendString("[>0;256;0c")},hterm.VT.CSI.d=function(e){this.terminal.setAbsoluteCursorRow(e.iarg(0,1)-1)},hterm.VT.CSI.f=hterm.VT.CSI.H,hterm.VT.CSI.g=function(e){e.args[0]&&"0"!=e.args[0]?"3"==e.args[0]&&this.terminal.clearAllTabStops():this.terminal.clearTabStopAtCursor(!1)},hterm.VT.CSI.h=function(e){for(var t=0;t=o.colorPalette.length)continue;o.foregroundSource=a}else if(39==s)o.foregroundSource=o.SRC_DEFAULT;else if(s<48)o.backgroundSource=s-40;else if(48==s){var n=r(i);if(null!=n)o.backgroundSource=o.SRC_RGB,o.background=n,i+=5;else{var a=t(i);if(null==a)break;if(i+=2,a>=o.colorPalette.length)continue;o.backgroundSource=a}}else o.backgroundSource=o.SRC_DEFAULT;else s>=90&&s<=97?o.foregroundSource=s-90+8:s>=100&&s<=107&&(o.backgroundSource=s-100+8)}o.setDefaults(this.terminal.getForegroundColor(),this.terminal.getBackgroundColor())}else o.reset()},hterm.VT.CSI[">m"]=hterm.VT.ignore,hterm.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")}},hterm.VT.CSI[">n"]=hterm.VT.ignore,hterm.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")},hterm.VT.CSI[">p"]=hterm.VT.ignore,hterm.VT.CSI["!p"]=function(){this.reset(),this.terminal.softReset()},hterm.VT.CSI.$p=hterm.VT.ignore,hterm.VT.CSI["?$p"]=hterm.VT.ignore,hterm.VT.CSI['"p']=hterm.VT.ignore,hterm.VT.CSI.q=hterm.VT.ignore,hterm.VT.CSI[" q"]=function(e){var t=e.args[0];"0"==t||"1"==t?(this.terminal.setCursorShape(hterm.Terminal.cursorShape.BLOCK),this.terminal.setCursorBlink(!0)):"2"==t?(this.terminal.setCursorShape(hterm.Terminal.cursorShape.BLOCK),this.terminal.setCursorBlink(!1)):"3"==t?(this.terminal.setCursorShape(hterm.Terminal.cursorShape.UNDERLINE),this.terminal.setCursorBlink(!0)):"4"==t?(this.terminal.setCursorShape(hterm.Terminal.cursorShape.UNDERLINE),this.terminal.setCursorBlink(!1)):console.warn("Unknown cursor style: "+t)},hterm.VT.CSI['"q']=hterm.VT.ignore,hterm.VT.CSI.r=function(e){var t=e.args,r=t[0]?parseInt(t[0],10)-1:null,o=t[1]?parseInt(t[1],10)-1:null;this.terminal.setVTScrollRegion(r,o),this.terminal.setCursorPosition(0,0)},hterm.VT.CSI["?r"]=hterm.VT.ignore,hterm.VT.CSI.$r=hterm.VT.ignore,hterm.VT.CSI.s=function(){this.savedState_.save()},hterm.VT.CSI["?s"]=hterm.VT.ignore,hterm.VT.CSI.t=hterm.VT.ignore,hterm.VT.CSI.$t=hterm.VT.ignore,hterm.VT.CSI[">t"]=hterm.VT.ignore,hterm.VT.CSI[" t"]=hterm.VT.ignore,hterm.VT.CSI.u=function(){this.savedState_.restore()},hterm.VT.CSI[" u"]=hterm.VT.ignore,hterm.VT.CSI.$v=hterm.VT.ignore,hterm.VT.CSI["'w"]=hterm.VT.ignore,hterm.VT.CSI.x=hterm.VT.ignore,hterm.VT.CSI["*x"]=hterm.VT.ignore,hterm.VT.CSI.$x=hterm.VT.ignore,hterm.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)}},hterm.VT.CSI["'z"]=hterm.VT.ignore,hterm.VT.CSI.$z=hterm.VT.ignore,hterm.VT.CSI["'{"]=hterm.VT.ignore,hterm.VT.CSI["'|"]=hterm.VT.ignore,hterm.VT.CSI[" }"]=hterm.VT.ignore,hterm.VT.CSI[" ~"]=hterm.VT.ignore,lib.rtdep("lib.f"),hterm.VT.CharacterMap=function(e,t){this.name=e,this.GL=null,this.GR=null,t&&this.reset(t)},hterm.VT.CharacterMap.prototype.reset=function(e){this.glmap=e;var t=Object.keys(this.glmap).map(function(e){return"\\x"+lib.f.zpad(e.charCodeAt(0).toString(16))});this.glre=new RegExp("["+t.join("")+"]","g"),this.grmap={},t.forEach(function(e){var t=String.fromCharCode(128&e.charCodeAt(0));this.grmap[t]=this.glmap[e]}.bind(this));var r=Object.keys(this.grmap).map(function(e){return"\\x"+lib.f.zpad(e.charCodeAt(0).toString(16),2)});this.grre=new RegExp("["+r.join("")+"]","g"),this.GL=function(e){return e.replace(this.glre,function(e){return this.glmap[e]}.bind(this))}.bind(this),this.GR=function(e){return e.replace(this.grre,function(e){return this.grmap[e]}.bind(this))}.bind(this)},hterm.VT.CharacterMap.maps={},hterm.VT.CharacterMap.maps[0]=new hterm.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:"≥","{":"π","|":"≠","}":"£","~":"·"}),hterm.VT.CharacterMap.maps.A=new hterm.VT.CharacterMap("british",{"#":"£"}),hterm.VT.CharacterMap.maps.B=new hterm.VT.CharacterMap("us",null),hterm.VT.CharacterMap.maps[4]=new hterm.VT.CharacterMap("dutch",{"#":"£","@":"¾","[":"IJ","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"}),hterm.VT.CharacterMap.maps.C=hterm.VT.CharacterMap.maps[5]=new hterm.VT.CharacterMap("finnish",{"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"}),hterm.VT.CharacterMap.maps.R=new hterm.VT.CharacterMap("french",{"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"}),hterm.VT.CharacterMap.maps.Q=new hterm.VT.CharacterMap("french canadian",{"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"}),hterm.VT.CharacterMap.maps.K=new hterm.VT.CharacterMap("german",{"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"}),hterm.VT.CharacterMap.maps.Y=new hterm.VT.CharacterMap("italian",{"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"}),hterm.VT.CharacterMap.maps.E=hterm.VT.CharacterMap.maps[6]=new hterm.VT.CharacterMap("norwegian/danish",{"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"}),hterm.VT.CharacterMap.maps.Z=new hterm.VT.CharacterMap("spanish",{"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"}),hterm.VT.CharacterMap.maps[7]=hterm.VT.CharacterMap.maps.H=new hterm.VT.CharacterMap("swedish",{"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"}),hterm.VT.CharacterMap.maps["="]=new hterm.VT.CharacterMap("swiss",{"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}),lib.resource.add("hterm/audio/bell","audio/ogg;base64","T2dnUwACAAAAAAAAAADhq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56FHAuXflHo3fe2ttG9XUDeA9YmYCBQ0oPr/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="),lib.resource.add("hterm/concat/date","text/plain","Fri, 03 Apr 2015 09:02:15 +0000"),lib.resource.add("hterm/changelog/version","text/plain","1.54"),lib.resource.add("hterm/changelog/date","text/plain","2015-03-19"),lib.resource.add("hterm/git/HEAD","text/plain","5db5b0ceefff97ce8b7a97edd3f5ba6857db54cf");var socket=io(location.origin,{path:"/wetty/socket.io"}),term=void 0,buf="",Wetty=function(){function e(t){_classCallCheck(this,e),this.argv_=t,this.io=null,this.pid_=-1}return _createClass(e,[{key:"run",value:function(){this.io=this.argv_.io.push(),this.io.onVTKeystroke=this.sendString_.bind(this),this.io.sendString=this.sendString_.bind(this),this.io.onTerminalResize=this.onTerminalResize.bind(this)}},{key:"sendString_",value:function(e){socket.emit("input",e)}},{key:"onTerminalResize",value:function(e,t){socket.emit("resize",{col:e,row:t})}}]),e}();socket.on("connect",function(){document.getElementById("overlay").style.display="none",window.addEventListener("beforeunload",handler,!1),lib.init(function(){hterm.defaultStorage=new lib.Storage.Local,term=new hterm.Terminal,window.term=term,term.decorate(document.getElementById("terminal")),term.setCursorPosition(0,0),term.setCursorVisible(!0),term.prefs_.set("ctrl-c-copy",!0),term.prefs_.set("ctrl-v-paste",!0),term.prefs_.set("use-default-window-copy",!0),term.prefs_.set("send-encoding","raw"),term.prefs_.set("receive-encoding","raw"),term.prefs_.set("font-size",14),term.scrollPort_.screen_.setAttribute("spellcheck","false"),term.scrollPort_.screen_.setAttribute("autocorrect","false"),term.scrollPort_.screen_.setAttribute("autocomplete","false"),term.scrollPort_.screen_.setAttribute("contenteditable","false"),term.runCommandClass(Wetty,document.location.hash.substr(1)),socket.emit("resize",{col:term.screenSize.width,row:term.screenSize.height}),buf&&""!==buf&&(term.io.writeUTF8(buf),buf="")})}),socket.on("output",function(e){term?term.io.writeUTF8(e):buf+=e}),socket.on("logout",function(){document.getElementById("overlay").style.display="block",window.removeEventListener("beforeunload",handler,!1)}),socket.on("disconnect",function(){document.getElementById("overlay").style.display="block",window.removeEventListener("beforeunload",handler,!1)});