// jsmin()ed! Sun Feb 4 15:57:45 2024 function VT100(container) {this.themeLight=true;this.themeDark=this.themeGreen=this.themeLocal=false;this.otherOptions=false;this.logStream=false;this.writeDelay=0;if(typeof DCLinaboxTheme!='undefined') {this.themeLight=this.themeDark=this.themeGreen=this.themeLocal=false;if(DCLinaboxTheme=='light')this.themeLight=true;if(DCLinaboxTheme=='dark')this.themeDark=true;if(DCLinaboxTheme=='green')this.themeGreen=true;if(DCLinaboxTheme=='local')this.themeLocal=true;if(!(this.themeLight||this.themeDark||this.themeGreen||this.themeLocal))this.themeLight=true;} this.getUserSettings();this.initializeElements(container);this.maxScrollbackLines=1000;this.npar=0;this.par=[];this.isQuestionMark=false;this.savedX=[];this.savedY=[];this.savedAttr=[];this.savedUseGMap=0;this.savedGMap=[this.Latin1Map,this.VT100GraphicsMap,this.CodePage437Map,this.DirectToFontMap];this.savedValid=[];this.respondString='';this.statusString='';this.internalClipboard=undefined;this.reset(true);} VT100.prototype.reset=function(clearHistory) {this.isEsc=0;this.needWrap=false;this.autoWrapMode=true;this.dispCtrl=false;this.toggleMeta=false;this.insertMode=false;this.applKeyMode=false;this.cursorKeyMode=false;this.crLfMode=false;this.offsetMode=false;this.printing=false;this.mouseReporting=false;this.DECelr=0;this.DECsle=0;this.mutton=0;if(typeof this.printWin!='undefined'&&this.printWin&&!this.printWin.closed){this.printWin.close();} this.printWin=null;this.utfEnabled=this.utfPreferred;this.utfCount=0;this.utfChar=0;this.style='';this.attr=this.attrTheme=0;this.useGMap=0;this.GMap=[this.Latin1Map,this.VT100GraphicsMap,this.CodePage437Map,this.DirectToFontMap];this.translate=this.GMap[this.useGMap];this.top=0;this.bottom=this.terminalHeight;this.lastCharacter=' ';this.userTabStop=[];if(this.vmsKeysMac)this.vmsKeysPC=false;if(this.themeDark) this.toggleDarkBackground();else if(this.themeGreen) this.toggleGreenScreen();else if(this.themeLocal) this.toggleThemeLocal();else this.toggleLightBackground();if(clearHistory) {for(var i=0;i<2;i++) {while(this.crt[i].firstChild){this.crt[i].removeChild(this.crt[i].firstChild);}}} this.enableAlternateScreen(false);this.gotoXY(0,0);this.showCursor();this.isInverted=false;this.flashInverted=false;this.updateStyle();this.refreshInvertedState();this.clearRegion(0,0,this.terminalWidth,this.terminalHeight,this.color,this.style);};VT100.prototype.addListener=function(elem,event,listener) {if(elem.addEventListener){elem.addEventListener(event,listener,false);}else{elem.attachEvent('on'+event,listener);}};VT100.prototype.getUserSettings=function() {this.signature=1;this.loginPrompt=false;this.utfPreferred=false;this.audibleBell=false;this.autoprint=true;if(typeof DCLinaboxVisualBell!='undefined') {if(DCLinaboxVisualBell==true)this.visualBell=true;if(DCLinaboxVisualBell==false)this.visualBell=false;} else this.visualBell=typeof suppressAllAudio!='undefined'&&suppressAllAudio;if(this.visualBell){this.signature=Math.floor(16807*this.signature+1)%((1<<31)-1);} if(typeof userOptionList!='undefined') {for(var i=0;i=0) {settings=document.cookie.substr(settings+key.length).replace(/([0-1]*).*/,"$1");if(settings.length==numberOfSettings+ (typeof userOptionList=='undefined'?0:userOptionList.length)) {this.loginPrompt=settings.charAt(0)!='0';this.utfPreferred=settings.charAt(1)!='0';this.audibleBell=settings.charAt(2)!='0';this.visualBell=settings.charAt(3)!='0';this.autoprint=settings.charAt(4)!='0';this.vmsKeysPC=settings.charAt(5)!='0';this.vmsKeysMac=settings.charAt(6)!='0';this.themeLight=settings.charAt(7)!='0';this.themeDark=settings.charAt(8)!='0';this.themeGreen=settings.charAt(9)!='0';this.themeLocal=settings.charAt(10)!='0';}} else if(this.DCLinaboxVMSkeysMac) this.vmsKeysMac=true;else if(this.DCLinaboxVMSkeysPC) this.vmsKeysPC=true;else if(navigator.platform.indexOf('Mac')>=0) this.vmsKeysMac=true;else this.vmsKeysPC=true;this.utfEnabled=this.utfPreferred;};VT100.prototype.storeUserSettings=function() {var settings='DCLinabox='+this.signature+':'+ (this.loginPrompt?'1':'0')+ (this.utfPreferred?'1':'0')+ (this.audibleBell?'1':'0')+ (this.visualBell?'1':'0')+ (this.autoprint?'1':'0')+ (this.vmsKeysPC?'1':'0')+ (this.vmsKeysMac?'1':'0')+ (this.themeLight?'1':'0')+ (this.themeDark?'1':'0')+ (this.themeGreen?'1':'0')+ (this.themeLocal?'1':'0');var d=new Date();d.setDate(d.getDate()+3653);document.cookie=settings+' SameSite=Strict; Secure; expires='+ d.toGMTString();};VT100.prototype.initializeElements=function(container) {if(container){this.container=container;}else if(!(this.container=document.getElementById('vt100'))) {this.container=document.createElement('div');this.container.id='vt100';document.body.appendChild(this.container);} if(!this.getChildById(this.container,'menu')||!this.getChildById(this.container,'scrollable')||!this.getChildById(this.container,'crt')||!this.getChildById(this.container,'alt_crt')||!this.getChildById(this.container,'ieprobe')||!this.getChildById(this.container,'padding')||!this.getChildById(this.container,'cursor')||!this.getChildById(this.container,'lineheight')||!this.getChildById(this.container,'usercss')||!this.getChildById(this.container,'space')||!this.getChildById(this.container,'input')||!this.getChildById(this.container,'cliphelper')) {var embed='';try {if(typeof navigator.mimeTypes["audio/x-wav"].enabledPlugin.name!='undefined') {embed=(typeof suppressAllAudio!='undefined'&&suppressAllAudio)?'':'';}} catch(e) {} this.container.innerHTML=''+''+'
'+'
 
'+'
'+'
'+'
 
'+'
'+''+'
'+'
'+charsABC+'
'+'
'+'';} if(typeof suppressAllAudio!='undefined'&&suppressAllAudio) {this.beeper=undefined;} else {this.beeper=this.getChildById(this.container,'beep_embed');if(!this.beeper||!this.beeper.Play) {this.beeper=this.getChildById(this.container,'beep_bgsound');if(!this.beeper||typeof this.beeper.src=='undefined'){this.beeper=undefined;}}} this.curSizeBox=this.getChildById(this.container,'cursize');this.menu=this.getChildById(this.container,'menu');this.scrollable=this.getChildById(this.container,'scrollable');this.lineheight=this.getChildById(this.container,'lineheight');this.crt=[this.getChildById(this.container,'crt'),this.getChildById(this.container,'alt_crt')];var ieProbe=this.getChildById(this.container,'ieprobe');this.padding=this.getChildById(this.container,'padding');this.cursor=this.getChildById(this.container,'cursor');this.usercss=this.getChildById(this.container,'usercss');this.space=this.getChildById(this.container,'space');this.input=this.getChildById(this.container,'input');this.cliphelper=this.getChildById(this.container,'cliphelper');this.cursorWidth=(this.cursor.clientWidth+1)/charsABC.length;this.cursorWidth10=this.cursorWidth+(this.cursorWidth/10);this.cursorHeight=this.lineheight.clientHeight;this.isIE=ieProbe.offsetTop>1;ieProbe=undefined;this.crt.innerHTML='';var marginTop=parseInt(this.getCurrentComputedStyle(document.body,'marginTop'));var marginLeft=parseInt(this.getCurrentComputedStyle(document.body,'marginLeft'));var marginRight=parseInt(this.getCurrentComputedStyle(document.body,'marginRight'));var x=this.container.offsetLeft;var y=this.container.offsetTop;for(var parent=this.container;parent=parent.offsetParent;) {x+=parent.offsetLeft;y+=parent.offsetTop;} this.isEmbedded=marginTop!=y||marginLeft!=x||(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)- marginRight!=x+this.container.offsetWidth;if(typeof DCLinaboxVersion!='undefined')this.isEmbedded=true;if(!this.isEmbedded) {this.indicateSize=false;setTimeout(function(vt100) {return function(){vt100.indicateSize=true;};}(this),100);this.addListener(window,'resize',function(vt100) {return function() {vt100.hideContextMenu();vt100.resizer();};}(this));document.body.style.margin='0px';try{document.body.style.overflow='hidden';}catch(e){} try{document.body.oncontextmenu=function(){return false;};}catch(e){}} this.hideContextMenu();this.addListener(this.input,'blur',function(vt100){return function(){vt100.blurCursor();}}(this));this.addListener(this.input,'focus',function(vt100){return function(){vt100.focusCursor();}}(this));this.addListener(this.input,'keydown',function(vt100){return function(e) {if(!e)e=window.event;return vt100.keyDown(e);};}(this));this.addListener(this.input,'keypress',function(vt100){return function(e) {if(!e)e=window.event;return vt100.keyPressed(e);};}(this));this.addListener(this.input,'keyup',function(vt100){return function(e) {if(!e)e=window.event;return vt100.keyUp(e);};}(this));var mouseEvent=function(vt100,type){return function(e) {if(!e)e=window.event;return vt100.mouseEvent(e,type);};};this.addListener(this.scrollable,'mousedown',mouseEvent(this,0));this.addListener(this.scrollable,'mouseup',mouseEvent(this,1));this.addListener(this.scrollable,'click',mouseEvent(this,2));this.spacesBuffer='';this.currentScreen=0;this.cursorX=0;this.cursorY=0;this.numScrollbackLines=0;this.top=0;this.bottom=0x7FFFFFFF;this.resizer();this.focusCursor();this.input.focus();};VT100.prototype.getChildById=function(parent,id) {var nodeList=parent.all||parent.getElementsByTagName('*');if(typeof nodeList.namedItem=='undefined') {for(var i=0;i0?height:0)+'px';this.padding.style.height=(partial>0?partial:0)+'px';var oldTerminalHeight=this.terminalHeight;this.updateWidth();this.updateHeight();var cx=this.cursorX;var cy=this.cursorY+this.numScrollbackLines;this.updateNumScrollbackLines();while(this.currentScreen&&this.numScrollbackLines>0) {crt.removeChild(crt.firstChild);this.numScrollbackLines--;} cy-=this.numScrollbackLines;if(cx<0){cx=0;}else if(cx>this.terminalWidth){cx=this.terminalWidth-1;if(cx<0){cx=0;}} if(cy<0){cy=0;}else if(cy>this.terminalHeight){cy=this.terminalHeight-1;if(cy<0){cy=0;}} if(this.bottom>this.terminalHeight||this.bottom==oldTerminalHeight){this.bottom=this.terminalHeight;} if(this.top>=this.bottom){this.top=this.bottom-1;if(this.top<0){this.top=0;}} this.truncateLines(this.terminalWidth);this.putString(cx,cy,'',undefined,undefined);this.scrollable.scrollTop=this.numScrollbackLines*this.cursorHeight+1;var line=crt.firstChild;for(var i=0;i=this.terminalWidth) {x=this.terminalWidth-1;inside=false;} if(x<0) {x=0;inside=false;} if(y>=this.terminalHeight) {y=this.terminalHeight-1;inside=false;} if(y<0) {y=0;inside=false;} var button=type!=0?3:typeof event.pageX!='undefined'?event.button:[undefined,0,2,0,1,0,1,0][event.button];if(button!=undefined) {if(event.shiftKey){button|=0x04;} if(event.altKey||event.metaKey){button|=0x08;} if(event.ctrlKey){button|=0x10;}} if(button==0&&!event.shiftKey&&!event.metaKey&&!event.ctrlKey) this.pruneAllWhiteSpace();var bevent=0;if(type==0) {switch(event.button) {case 0:this.mutton|=0x04;bevent=2;break;case 1:this.mutton|=0x02;bevent=4;break;case 2:this.mutton|=0x01;bevent=6;break;}} else if(type==1) {switch(event.button) {case 0:this.mutton&=0x03;bevent=3;break;case 1:this.mutton&=0x05;bevent=5;break;case 2:this.mutton&=0x06;bevent=7;break;}} if(this.mouseReporting&&!selection.length&&(type!=0||!event.shiftKey)) {if(inside||type!=0) {if(button!=undefined) {if(this.DECelr==2) {this.mouseReporting=false;this.DECelr=0;} var report='\u001B[';report+=bevent.toString();report+=';';report+=this.mutton.toString();report+=';';report+=Math.floor(y+1).toString();report+=';';report+=Math.floor(x+1).toString();report+=';';report+=0;report+='&w';if(type!=2){this.keysPressed(report);} return this.cancelEvent(event);}}} if(button==2&&!event.shiftKey) {if(!this.DECelr) {if(type==0){this.showContextMenu(event.clientX-offsetX,event.clientY-offsetY);}} return this.cancelEvent(event);} if(this.mouseReporting) {try{event.shiftKey=false;}catch(e){}} return true;};VT100.prototype.replaceChar=function(s,ch,repl) {for(var i=-1;;) {i=s.indexOf(ch,i+1);if(i<0){break;} s=s.substr(0,i)+repl+s.substr(i+1);} return s;};VT100.prototype.htmlEscape=function(s) {return this.replaceChar(this.replaceChar(this.replaceChar(this.replaceChar(s,'&','&'),'<','<'),'"','"'),' ','\u00A0');};VT100.prototype.getTextContent=function(elem) {if(elem==null)return'';return elem.textContent||(typeof elem.textContent=='undefined'?elem.innerText:'');};VT100.prototype.setTextContent=function(elem,s) {if(typeof elem.textContent=='undefined'){if(elem.innerText!=s)elem.innerText=s;}else{if(elem.textContent!=s)elem.textContent=s;}};VT100.prototype.insertBlankLine=function(y,color,style) {if(!color)color=this.color;if(!style)style='';var line=document.createElement('div');var span=document.createElement('span');span.style.cssText=style;span.className=color;this.setTextContent(span,'\n');line.appendChild(span);line.style.height=this.cursorHeight+'px';var crt=this.crt[this.currentScreen];if(crt.childNodes.length>y) crt.insertBefore(line,crt.childNodes[y]);else crt.appendChild(line);};VT100.prototype.updateWidth=function() {this.terminalWidth=Math.floor(this.crt[this.currentScreen].offsetWidth/this.cursorWidth);return this.terminalWidth;};VT100.prototype.updateHeight=function() {if(this.isEmbedded){this.terminalHeight=Math.floor((this.container.clientHeight-1)/this.cursorHeight);}else{this.terminalHeight=Math.floor(((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)-1)/this.cursorHeight);} return this.terminalHeight;};VT100.prototype.updateNumScrollbackLines=function() {var scrollback=Math.floor(this.crt[this.currentScreen].offsetHeight/this.cursorHeight)- this.terminalHeight;this.numScrollbackLines=scrollback<0?0:scrollback;return this.numScrollbackLines;};VT100.prototype.pruneWhiteSpace=function(line) {var span=line.lastChild;while(span) {if(span.style.cssText.length||span.className.indexOf('invert')>0||span.className.indexOf('underline')>0)return;var s=this.getTextContent(span);for(var i=s.length;i--;) {if(s.charAt(i)==' '||s.charAt(i)=='\u00A0')continue;if(i+1!=s.length)this.setTextContent(span,s.substr(0,i+1));span=null;break;} if(span) {var sibling=span;span=span.previousSibling;line.removeChild(sibling);}} if(!line.firstChild) {var span=document.createElement('span');span.style.cssText='';span.className=this.color;this.setTextContent(span,'\n');line.appendChild(span);}};VT100.prototype.pruneAllWhiteSpace=function() {for(var line=this.crt[this.currentScreen].firstChild;line;line=line.nextSibling) this.pruneWhiteSpace(line);};VT100.prototype.truncateLines=function(width) {if(width<0)width=0;for(var line=this.crt[this.currentScreen].firstChild;line;line=line.nextSibling) {var x=0;for(var span=line.firstChild;span;span=span.nextSibling) {var s=this.getTextContent(span);var l=s.length;if(x+l>width) {this.setTextContent(span,s.substr(0,width-x));while(span.nextSibling)line.removeChild(line.lastChild);break;} x+=l;}}};VT100.prototype.findLine=function(y) {var yIdx=y+this.numScrollbackLines;var crt=this.crt[this.currentScreen];var line;while(crt.childNodes.length<=yIdx)this.insertBlankLine(yIdx);line=crt.childNodes[yIdx];return line;};VT100.prototype.putString=function(x,y,text,color,style) {if(!color) {if(this.color) color=this.color;else if(this.colorTheme) color=this.colorTheme;else color='';} if(!style)style='';var yIdx=y+this.numScrollbackLines;var line;var sibling;var s;var span;var xPos=0;var crt=this.crt[this.currentScreen];if(!text.length&&(yIdx>=crt.childNodes.length||crt.childNodes[yIdx].tagName!='DIV')) {span=null;} else {while(crt.childNodes.length<=yIdx) {this.insertBlankLine(yIdx);} line=crt.childNodes[yIdx];span=line.firstChild;if(this.getTextContent(span)=='\n') this.setTextContent(span,this.spaces(this.terminalWidth));span=line.firstChild;var len;while(span.nextSibling&&xPosx)break;xPos+=len;span=span.nextSibling;} if(text.length) {s=this.getTextContent(span);var oldColor=span.className;var oldStyle=span.style.cssText;if(xPos+s.length=s.length) {s=text;} else {sibling=document.createElement('span');line.insertBefore(sibling,span);this.setTextContent(span,s.substr(text.length));this.styleSpan(span,oldColor,oldStyle);span=sibling;s=text;}} else {var remainder=s.substr(x+text.length-xPos);this.setTextContent(span,s.substr(0,x-xPos));this.styleSpan(span,oldColor,oldStyle);xPos=x;sibling=document.createElement('span');if(span.nextSibling) {line.insertBefore(sibling,span.nextSibling);span=sibling;if(remainder.length) {sibling=document.createElement('span');this.setTextContent(sibling,remainder);this.styleSpan(sibling,oldColor,oldStyle);line.insertBefore(sibling,span.nextSibling);}} else {line.appendChild(sibling);span=sibling;if(remainder.length) {sibling=document.createElement('span');this.setTextContent(sibling,remainder);this.styleSpan(sibling,oldColor,oldStyle);line.appendChild(sibling);}} s=text;}} else {s=s.substr(0,x-xPos)+text+s.substr(x+text.length-xPos);} this.setTextContent(span,s);this.styleSpan(span,color,style);sibling=span.nextSibling;while(del>0&&sibling) {s=this.getTextContent(sibling);len=s.length;if(len<=del){line.removeChild(sibling);del-=len;sibling=span.nextSibling;}else{this.setTextContent(sibling,s.substr(del));break;}} this.mergeIntoOne(line,span,sibling);}} this.cursorX=x+text.length;if(this.cursorX>=this.terminalWidth){this.cursorX=this.terminalWidth-1;if(this.cursorX<0){this.cursorX=0;}} var pixelX=-1;var pixelY=-1;if(!this.cursor.style.visibility) {var idx=this.cursorX-xPos;if(span) {if(this.isEmbedded){pixelY=span.offsetTop;}else{pixelY=span.offsetTop+span.offsetParent.offsetTop;} s=this.getTextContent(span);var nxtIdx=idx-s.length;if(nxtIdx<0){this.setTextContent(this.cursor,s.charAt(idx));pixelX=span.offsetLeft+idx*span.offsetWidth/s.length;}else{if(nxtIdx==0){pixelX=span.offsetLeft+span.offsetWidth;} if(span.nextSibling){s=this.getTextContent(span.nextSibling);this.setTextContent(this.cursor,s.charAt(nxtIdx));if(pixelX<0){pixelX=span.nextSibling.offsetLeft+ nxtIdx*span.offsetWidth/s.length;}}else{this.setTextContent(this.cursor,' ');}}} else {this.setTextContent(this.cursor,' ');}} if(pixelX>=0){this.cursor.style.left=(pixelX+(this.isIE?1:0))+'px';}else{this.setTextContent(this.space,this.spaces(this.cursorX));this.cursor.style.left=this.space.offsetWidth+ crt.offsetLeft+'px';} this.cursorY=yIdx-this.numScrollbackLines;if(pixelY>=0){this.cursor.style.top=pixelY+'px';}else{this.cursor.style.top=yIdx*this.cursorHeight+ crt.offsetTop+'px';} if(text.length) {if((sibling=span.previousSibling)) this.mergeIntoOne(line,sibling,span);}};VT100.prototype.mergeIntoOne=function(line,one,two) {if(!two)return;if(one.className==two.className&&one.style.cssText==two.style.cssText) {var none1=(this.getTextContent(one).trim()=='');var none2=(this.getTextContent(two).trim()=='');if((none1&&none2)||(!none1&&!none2)) {this.setTextContent(one,this.getTextContent(one)+ this.getTextContent(two));line.removeChild(two);}}} VT100.prototype.styleSpan=function(span,color,style) {if(this.getTextContent(span).trim()=='') {if(this.isInverted||this.flashInverted) span.className=this.colorThemeInvert;else span.className=this.colorTheme;span.style.cssText=style;} else {span.className=color;span.style.cssText=style;}} VT100.prototype.gotoXY=function(x,y) {if(x>=this.terminalWidth){x=this.terminalWidth-1;} if(x<0){x=0;} var minY,maxY;if(this.offsetMode) {minY=this.top;maxY=this.bottom;} else {minY=0;maxY=this.terminalHeight;} if(y>=maxY){y=maxY-1;} if(y