fixed minify problem with new library #7107
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Jun 20, 2025 at 15:31 UTC
e47626a688a8b8c127530f89a42fbfcdf341e456
22 files changed
+52
-46
public/scripts/agent-rdp-0.0.1-min.js
+1
-1
@@ -1 +1 @@
1
-var CreateRDPDesktop=function(e,a){var o={m:{KeyAction:{NONE:0,DOWN:1,UP:2,SCROLL:3,EXUP:4,EXDOWN:5,DBLCLICK:6}},State:0},i=(o.canvas=Q(e),"string"==typeof(o.CanvasId=e)&&(o.CanvasId=Q(e)),o.Canvas=o.CanvasId.getContext("2d"),o.ScreenWidth=o.width=1280,o.ScreenHeight=o.height=1024,o.m.onClipboardChanged=null,!(o.onConsoleMessageChange=null)),r="default";function n(e){return(!0===o.m.SwapMouse?[2,0,1,0,0]:[1,0,2,0,0])[e]}function c(e){o.State!=e&&(o.State=e,null!=o.onStateChanged)&&o.onStateChanged(o,o.State)}function s(e){var t=o.Canvas.canvas.height/o.CanvasId.clientHeight,n=o.Canvas.canvas.width/o.CanvasId.clientWidth,s=(e=>{var t=Array(2);for(t[0]=t[1]=0;e;)t[0]+=e.offsetLeft,t[1]+=e.offsetTop,e=e.offsetParent;return t})(o.Canvas.canvas),n=(e.pageX-s[0])*n,s=(e.pageY-s[1])*t;return e.addx&&(n+=e.addx),e.addy&&(s+=e.addy),{x:n,y:s}}o.mouseCursorActive=function(e){i!=e&&(i=e,o.CanvasId.style.cursor=1==e?r:"default")},o.Start=function(e,t,n){c(1),o.nodeid=e,o.port=t;var s={savepass:(o.credentials=n).savecred,useServerCreds:n.servercred,width:n.width,height:n.height,flags:n.flags,workingDir:n.workdir,alternateShell:n.altshell};n.width&&n.height&&(s.width=o.ScreenWidth=o.width=n.width,s.height=o.ScreenHeight=o.height=n.height,delete n.width,delete n.height),o.render=new Mstsc.Canvas.create(o.canvas),o.socket=new WebSocket("wss://"+window.location.host+a+"mstscrelay.ashx"),o.socket.binaryType="arraybuffer",o.socket.onopen=function(){c(2),o.socket.send(JSON.stringify(["infos",{ip:o.nodeid,port:o.port,screen:{width:o.width,height:o.height},domain:n.domain,username:n.username,password:n.password,options:s,locale:Mstsc.locale()}]))},o.socket.onmessage=function(e){if("string"==typeof e.data){var t=JSON.parse(e.data);switch(t[0]){case"rdp-connect":c(3),o.rotation=0,o.Canvas.setTransform(1,0,0,1,0,0),o.Canvas.canvas.width=o.ScreenWidth,o.Canvas.canvas.height=o.ScreenHeight,o.Canvas.fillRect(0,0,o.ScreenWidth,o.ScreenHeight),null!=o.m.onScreenSizeChange&&o.m.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight,o.CanvasId);break;case"rdp-bitmap":null!=o.bitmapData&&((n=t[1]).data=o.bitmapData,delete o.bitmapData,o.render.update(n));break;case"rdp-pointer":var n=t[1];r=n,i&&(o.CanvasId.style.cursor=n);break;case"rdp-close":o.Stop();break;case"rdp-error":switch(o.consoleMessageTimeout=5,o.consoleMessage=t[1],delete o.consoleMessageArgs,2<t.length&&(o.consoleMessageArgs=[t[2]]),t[1]){case"NODE_RDP_PROTOCOL_X224_NEG_FAILURE":1==t[2]?o.consoleMessageId=9:2==t[2]?o.consoleMessageId=10:3==t[2]?o.consoleMessageId=11:4==t[2]?o.consoleMessageId=12:5==t[2]?o.consoleMessageId=13:6==t[2]?o.consoleMessageId=14:o.consoleMessageId=7;break;case"NODE_RDP_PROTOCOL_X224_NLA_NOT_SUPPORTED":o.consoleMessageId=8;break;default:o.consoleMessageId=null}o.onConsoleMessageChange&&o.onConsoleMessageChange(),o.Stop();break;case"rdp-clipboard":o.lastClipboardContent=t[1],o.m.onClipboardChanged&&o.m.onClipboardChanged(t[1]);break;case"ping":o.socket.send('["pong"]')}}else o.bitmapData=e.data},o.socket.onclose=function(){c(0)},c(1)},o.Stop=function(){o.Canvas.fillRect(0,0,o.ScreenWidth,o.ScreenHeight),o.socket&&o.socket.close()},o.m.setClipboard=function(e){o.socket&&o.socket.send(JSON.stringify(["clipboard",e]))},o.m.getClipboard=function(){return o.lastClipboardContent},o.m.mousemove=function(e){if(o.socket&&3==o.State){var t=s(e);if(!(t.x<0||t.y<0||t.x>o.ScreenWidth||t.y>o.ScreenHeight))return o.mouseNagleData=["mouse",t.x,t.y,0,!1],null==o.mouseNagleTimer&&(o.mouseNagleTimer=setTimeout(function(){o.socket.send(JSON.stringify(o.mouseNagleData)),o.mouseNagleTimer=null},50)),e.preventDefault(),!1}},o.m.mouseup=function(e){if(o.socket&&3==o.State){var t=s(e);if(!(t.x<0||t.y<0||t.x>o.ScreenWidth||t.y>o.ScreenHeight))return null!=o.mouseNagleTimer&&(clearTimeout(o.mouseNagleTimer),o.mouseNagleTimer=null),o.socket.send(JSON.stringify(["mouse",t.x,t.y,n(e.button),!1])),e.preventDefault(),!1}},o.m.mousedown=function(e){if(o.socket&&3==o.State){var t=s(e);if(!(t.x<0||t.y<0||t.x>o.ScreenWidth||t.y>o.ScreenHeight))return null!=o.mouseNagleTimer&&(clearTimeout(o.mouseNagleTimer),o.mouseNagleTimer=null),o.socket.send(JSON.stringify(["mouse",t.x,t.y,n(e.button),!0])),e.preventDefault(),!1}},o.m.handleKeyUp=function(e){if(o.socket&&3==o.State)return o.socket.send(JSON.stringify(["scancode",Mstsc.scancode(e),!1])),e.preventDefault(),!1},o.m.handleKeyDown=function(e){if(o.socket&&3==o.State)return o.socket.send(JSON.stringify(["scancode",Mstsc.scancode(e),!0])),e.preventDefault(),!1},o.m.mousewheel=function(e){if(o.socket&&3==o.State){var t,n=s(e);if(!(n.x<0||n.y<0||n.x>o.ScreenWidth||n.y>o.ScreenHeight))return null!=o.mouseNagleTimer&&(clearTimeout(o.mouseNagleTimer),o.mouseNagleTimer=null),t=0,e.detail?t=120*e.detail:e.wheelDelta&&(t=3*e.wheelDelta),o.m.ReverseMouseWheel&&(t*=-1),0!=t&&o.socket.send(JSON.stringify(["wheel",n.x,n.y,t,!1,!1])),e.preventDefault(),!1}},o.m.SendStringUnicode=function(e){o.socket&&3==o.State&&o.socket.send(JSON.stringify(["utype",e]))},o.m.SendKeyMsgKC=function(e,t,n){if(3==o.State)if("object"==typeof e)for(var s in e)o.m.SendKeyMsgKC(e[s][0],e[s][1],e[s][2]);else{t=d[t];null!=t&&o.socket.send(JSON.stringify(["scancode",t,0!=(1&e)]))}},o.m.mousedblclick=function(){},o.m.handleKeyPress=function(){},o.m.setRotation=function(){},o.m.sendcad=function(){o.socket.send(JSON.stringify(["scancode",29,!0])),o.socket.send(JSON.stringify(["scancode",56,!0])),o.socket.send(JSON.stringify(["scancode",57427,!0])),o.socket.send(JSON.stringify(["scancode",57427,!1])),o.socket.send(JSON.stringify(["scancode",56,!1])),o.socket.send(JSON.stringify(["scancode",29,!1]))};var d={9:15,16:42,17:29,18:56,27:1,33:57417,34:57425,35:57423,36:57415,37:57419,38:57416,39:57421,40:57424,44:57399,45:57426,46:57427,65:30,66:48,67:46,68:32,69:18,70:33,71:34,72:35,73:23,74:36,75:37,76:38,77:50,78:49,79:24,80:25,81:16,82:19,83:31,84:20,85:22,86:47,87:17,88:45,89:21,90:44,91:57435,112:59,113:60,114:61,115:62,116:63,117:64,118:65,119:66,120:67,121:68,122:87,123:88};return o}
\ No newline at end of file
1
+var CreateRDPDesktop=function(e,t){var n={m:{KeyAction:{NONE:0,DOWN:1,UP:2,SCROLL:3,EXUP:4,EXDOWN:5,DBLCLICK:6}},State:0};n.canvas=Q(e),n.CanvasId=e,"string"==typeof e&&(n.CanvasId=Q(e)),n.Canvas=n.CanvasId.getContext("2d"),n.ScreenWidth=n.width=1280,n.ScreenHeight=n.height=1024,n.m.onClipboardChanged=null,n.onConsoleMessageChange=null;var s=!0,a="default";function o(e){return!0===n.m.SwapMouse?[2,0,1,0,0][e]:[1,0,2,0,0][e]}function i(e){n.State!=e&&(n.State=e,null!=n.onStateChanged&&n.onStateChanged(n,n.State))}function r(e){var t=n.Canvas.canvas.height/n.CanvasId.clientHeight,s=n.Canvas.canvas.width/n.CanvasId.clientWidth,a=function(e){var t=Array(2);for(t[0]=t[1]=0;e;)t[0]+=e.offsetLeft,t[1]+=e.offsetTop,e=e.offsetParent;return t}(n.Canvas.canvas),o=(e.pageX-a[0])*s,i=(e.pageY-a[1])*t;return e.addx&&(o+=e.addx),e.addy&&(i+=e.addy),{x:o,y:i}}n.mouseCursorActive=function(e){s!=e&&(s=e,n.CanvasId.style.cursor=1==e?a:"default")},n.Start=function(e,o,r){i(1),n.nodeid=e,n.port=o,n.credentials=r;var c={savepass:r.savecred,useServerCreds:r.servercred,width:r.width,height:r.height,flags:r.flags,workingDir:r.workdir,alternateShell:r.altshell};r.width&&r.height&&(c.width=n.ScreenWidth=n.width=r.width,c.height=n.ScreenHeight=n.height=r.height,delete r.width,delete r.height),n.render=new Mstsc.Canvas.create(n.canvas),n.socket=new WebSocket("wss://"+window.location.host+t+"mstscrelay.ashx"),n.socket.binaryType="arraybuffer",n.socket.onopen=function(){i(2),n.socket.send(JSON.stringify(["infos",{ip:n.nodeid,port:n.port,screen:{width:n.width,height:n.height},domain:r.domain,username:r.username,password:r.password,options:c,locale:Mstsc.locale()}]))},n.socket.onmessage=function(e){if("string"==typeof e.data){var t=JSON.parse(e.data);switch(t[0]){case"rdp-connect":i(3),n.rotation=0,n.Canvas.setTransform(1,0,0,1,0,0),n.Canvas.canvas.width=n.ScreenWidth,n.Canvas.canvas.height=n.ScreenHeight,n.Canvas.fillRect(0,0,n.ScreenWidth,n.ScreenHeight),null!=n.m.onScreenSizeChange&&n.m.onScreenSizeChange(n,n.ScreenWidth,n.ScreenHeight,n.CanvasId);break;case"rdp-bitmap":if(null==n.bitmapData)break;var o=t[1];o.data=n.bitmapData,delete n.bitmapData,n.render.update(o);break;case"rdp-pointer":var r=t[1];a=r,s&&(n.CanvasId.style.cursor=r);break;case"rdp-close":n.Stop();break;case"rdp-error":switch(n.consoleMessageTimeout=5,n.consoleMessage=t[1],delete n.consoleMessageArgs,t.length>2&&(n.consoleMessageArgs=[t[2]]),t[1]){case"NODE_RDP_PROTOCOL_X224_NEG_FAILURE":1==t[2]?n.consoleMessageId=9:2==t[2]?n.consoleMessageId=10:3==t[2]?n.consoleMessageId=11:4==t[2]?n.consoleMessageId=12:5==t[2]?n.consoleMessageId=13:6==t[2]?n.consoleMessageId=14:n.consoleMessageId=7;break;case"NODE_RDP_PROTOCOL_X224_NLA_NOT_SUPPORTED":n.consoleMessageId=8;break;default:n.consoleMessageId=null}n.onConsoleMessageChange&&n.onConsoleMessageChange(),n.Stop();break;case"rdp-clipboard":n.lastClipboardContent=t[1],n.m.onClipboardChanged&&n.m.onClipboardChanged(t[1]);break;case"ping":n.socket.send('["pong"]')}}else n.bitmapData=e.data},n.socket.onclose=function(){i(0)},i(1)},n.Stop=function(){n.Canvas.fillRect(0,0,n.ScreenWidth,n.ScreenHeight),n.socket&&n.socket.close()},n.m.setClipboard=function(e){n.socket&&n.socket.send(JSON.stringify(["clipboard",e]))},n.m.getClipboard=function(){return n.lastClipboardContent},n.m.mousemove=function(e){if(n.socket&&3==n.State){var t=r(e);if(!(t.x<0||t.y<0||t.x>n.ScreenWidth||t.y>n.ScreenHeight))return n.mouseNagleData=["mouse",t.x,t.y,0,!1],null==n.mouseNagleTimer&&(n.mouseNagleTimer=setTimeout((function(){n.socket.send(JSON.stringify(n.mouseNagleData)),n.mouseNagleTimer=null}),50)),e.preventDefault(),!1}},n.m.mouseup=function(e){if(n.socket&&3==n.State){var t=r(e);if(!(t.x<0||t.y<0||t.x>n.ScreenWidth||t.y>n.ScreenHeight))return null!=n.mouseNagleTimer&&(clearTimeout(n.mouseNagleTimer),n.mouseNagleTimer=null),n.socket.send(JSON.stringify(["mouse",t.x,t.y,o(e.button),!1])),e.preventDefault(),!1}},n.m.mousedown=function(e){if(n.socket&&3==n.State){var t=r(e);if(!(t.x<0||t.y<0||t.x>n.ScreenWidth||t.y>n.ScreenHeight))return null!=n.mouseNagleTimer&&(clearTimeout(n.mouseNagleTimer),n.mouseNagleTimer=null),n.socket.send(JSON.stringify(["mouse",t.x,t.y,o(e.button),!0])),e.preventDefault(),!1}},n.m.handleKeyUp=function(e){if(n.socket&&3==n.State)return n.socket.send(JSON.stringify(["scancode",Mstsc.scancode(e),!1])),e.preventDefault(),!1},n.m.handleKeyDown=function(e){if(n.socket&&3==n.State)return n.socket.send(JSON.stringify(["scancode",Mstsc.scancode(e),!0])),e.preventDefault(),!1},n.m.mousewheel=function(e){if(n.socket&&3==n.State){var t=r(e);if(!(t.x<0||t.y<0||t.x>n.ScreenWidth||t.y>n.ScreenHeight)){null!=n.mouseNagleTimer&&(clearTimeout(n.mouseNagleTimer),n.mouseNagleTimer=null);var s=0;return e.detail?s=120*e.detail:e.wheelDelta&&(s=3*e.wheelDelta),n.m.ReverseMouseWheel&&(s*=-1),0!=s&&n.socket.send(JSON.stringify(["wheel",t.x,t.y,s,!1,!1])),e.preventDefault(),!1}}},n.m.SendStringUnicode=function(e){n.socket&&3==n.State&&n.socket.send(JSON.stringify(["utype",e]))},n.m.SendKeyMsgKC=function(e,t,s){if(3==n.State)if("object"==typeof e)for(var a in e)n.m.SendKeyMsgKC(e[a][0],e[a][1],e[a][2]);else{var o=c[t];null!=o&&n.socket.send(JSON.stringify(["scancode",o,!!(1&e)]))}},n.m.mousedblclick=function(){},n.m.handleKeyPress=function(){},n.m.setRotation=function(){},n.m.sendcad=function(){n.socket.send(JSON.stringify(["scancode",29,!0])),n.socket.send(JSON.stringify(["scancode",56,!0])),n.socket.send(JSON.stringify(["scancode",57427,!0])),n.socket.send(JSON.stringify(["scancode",57427,!1])),n.socket.send(JSON.stringify(["scancode",56,!1])),n.socket.send(JSON.stringify(["scancode",29,!1]))};var c={9:15,16:42,17:29,18:56,27:1,33:57417,34:57425,35:57423,36:57415,37:57419,38:57416,39:57421,40:57424,44:57399,45:57426,46:57427,65:30,66:48,67:46,68:32,69:18,70:33,71:34,72:35,73:23,74:36,75:37,76:38,77:50,78:49,79:24,80:25,81:16,82:19,83:31,84:20,85:22,86:47,87:17,88:45,89:21,90:44,91:57435,112:59,113:60,114:61,115:62,116:63,117:64,118:65,119:66,120:67,121:68,122:87,123:88};return n}
\ No newline at end of file
public/scripts/agent-redir-rtc-0.1.0-min.js
+1
-1
@@ -1 +1 @@
1
-var CreateKvmDataChannel=function(e,t,n){var o={},l=(((o.m=t).parent=o).webchannel=e,o.State=0,o.protocol=t.protocol,o.onStateChanged=null,o.onControlMsg=null,o.debugmode=0,o.keepalive=n,o.rtcKeepAlive=null,o.Start=function(){1==o.debugmode&&console.log("start"),o.xxStateChange(3),o.webchannel.onmessage=o.xxOnMessage,o.rtcKeepAlive=setInterval(o.xxSendRtcKeepAlive,3e4)},new FileReader),i=!1,s=[];return l.readAsBinaryString?l.onload=function(e){o.xxOnSocketData(e.target.result),0==s.length?i=!1:l.readAsBinaryString(new Blob([s.shift()]))}:l.readAsArrayBuffer&&(l.onloadend=function(e){o.xxOnSocketData(e.target.result),0==s.length?i=!1:l.readAsArrayBuffer(s.shift())}),o.xxOnMessage=function(e){if("string"==typeof e.data)null!=o.onControlMsg&&o.onControlMsg(e.data);else if("object"==typeof e.data)if(1==i)s.push(e.data);else if(l.readAsBinaryString)i=!0,l.readAsBinaryString(new Blob([e.data]));else if(f.readAsArrayBuffer)i=!0,l.readAsArrayBuffer(e.data);else{for(var t="",n=new Uint8Array(e.data),a=n.byteLength,r=0;r<a;r++)t+=String.fromCharCode(n[r]);o.xxOnSocketData(t)}else o.xxOnSocketData(e.data)},o.xxOnSocketData=function(e){if(e){if("object"==typeof e){for(var t="",n=new Uint8Array(e),a=n.byteLength,r=0;r<a;r++)t+=String.fromCharCode(n[r]);e=t}else if("string"!=typeof e)return;return o.m.ProcessData(e)}},o.sendCtrlMsg=function(e){"string"==typeof e&&(o.webchannel.send(e),null!=o.keepalive)&&o.keepalive.sendKeepAlive()},o.send=function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);e=t}o.webchannel.send(e)},o.xxStateChange=function(e){o.State!=e&&(o.State=e,o.m.xxStateChange(o.State),null!=o.onStateChanged)&&o.onStateChanged(o,o.State)},o.Stop=function(){1==o.debugmode&&console.log("stop"),null!=o.rtcKeepAlive&&(clearInterval(o.rtcKeepAlive),o.rtcKeepAlive=null),o.xxStateChange(0)},o.xxSendRtcKeepAlive=function(){o.sendCtrlMsg(JSON.stringify({action:"ping"}))},o}
\ No newline at end of file
1
+var CreateKvmDataChannel=function(e,t,n){var a={};a.m=t,t.parent=a,a.webchannel=e,a.State=0,a.protocol=t.protocol,a.onStateChanged=null,a.onControlMsg=null,a.debugmode=0,a.keepalive=n,a.rtcKeepAlive=null,a.Start=function(){1==a.debugmode&&console.log("start"),a.xxStateChange(3),a.webchannel.onmessage=a.xxOnMessage,a.rtcKeepAlive=setInterval(a.xxSendRtcKeepAlive,3e4)};var r=new FileReader,o=!1,l=[];return r.readAsBinaryString?r.onload=function(e){a.xxOnSocketData(e.target.result),0==l.length?o=!1:r.readAsBinaryString(new Blob([l.shift()]))}:r.readAsArrayBuffer&&(r.onloadend=function(e){a.xxOnSocketData(e.target.result),0==l.length?o=!1:r.readAsArrayBuffer(l.shift())}),a.xxOnMessage=function(e){if("string"!=typeof e.data)if("object"==typeof e.data){if(1==o)return void l.push(e.data);if(r.readAsBinaryString)o=!0,r.readAsBinaryString(new Blob([e.data]));else if(f.readAsArrayBuffer)o=!0,r.readAsArrayBuffer(e.data);else{for(var t="",n=new Uint8Array(e.data),i=n.byteLength,s=0;s<i;s++)t+=String.fromCharCode(n[s]);a.xxOnSocketData(t)}}else a.xxOnSocketData(e.data);else null!=a.onControlMsg&&a.onControlMsg(e.data)},a.xxOnSocketData=function(e){if(e){if("object"==typeof e){for(var t="",n=new Uint8Array(e),r=n.byteLength,o=0;o<r;o++)t+=String.fromCharCode(n[o]);e=t}else if("string"!=typeof e)return;return a.m.ProcessData(e)}},a.sendCtrlMsg=function(e){"string"==typeof e&&(a.webchannel.send(e),null!=a.keepalive&&a.keepalive.sendKeepAlive())},a.send=function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);e=t}a.webchannel.send(e)},a.xxStateChange=function(e){a.State!=e&&(a.State=e,a.m.xxStateChange(a.State),null!=a.onStateChanged&&a.onStateChanged(a,a.State))},a.Stop=function(){1==a.debugmode&&console.log("stop"),null!=a.rtcKeepAlive&&(clearInterval(a.rtcKeepAlive),a.rtcKeepAlive=null),a.xxStateChange(0)},a.xxSendRtcKeepAlive=function(){a.sendCtrlMsg(JSON.stringify({action:"ping"}))},a}
\ No newline at end of file
public/scripts/agent-redir-ws-0.1.1-min.js
+1
-1
@@ -1 +1 @@
1
-var CreateAgentRedirect=function(e,t,n,a,o,c){var l={};function s(){1==l.webSwitchOk&&1==l.webRtcActive&&(l.latency.current=-1,l.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc0"}'),l.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc1"}'),null!=l.onStateChanged)&&l.onStateChanged(l,l.State)}((l.m=t).parent=l).meshserver=e,l.authCookie=a,l.rauthCookie=o,l.State=0,l.nodeid=null,l.options=null,l.socket=null,l.connectstate=-1,l.tunnelid=Math.random().toString(36).substring(2),l.protocol=t.protocol,l.onStateChanged=null,l.ctrlMsgAllowed=!0,l.attemptWebRTC=!1,l.webRtcActive=!1,l.webrtcconfig=null,l.webSwitchOk=!1,l.webchannel=null,l.webrtc=null,l.debugmode=0,l.serverIsRecording=!1,l.urlname="meshrelay.ashx",l.latency={lastSend:null,current:-1,callback:null},null==c&&(c="/"),l.consoleMessage=null,l.onConsoleMessageChange=null,l.metadata=null,l.onMetadataChange=null,l.Start=function(e){var t=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/"+l.urlname+"?browser=1&p="+l.protocol+(e?"&nodeid="+e:"")+"&id="+l.tunnelid;null!=a&&""!=a&&(t+="&auth="+a),null!=urlargs&&null!=urlargs.slowrelay&&(t+="&slowrelay="+urlargs.slowrelay),l.nodeid=e,l.connectstate=0,l.socket=new WebSocket(t),l.socket.binaryType="arraybuffer",l.socket.onopen=l.xxOnSocketConnected,l.socket.onmessage=l.xxOnMessage,l.socket.onerror=function(e){},l.socket.onclose=l.xxOnSocketClosed,l.xxStateChange(1),null!=l.meshserver&&(t="*"+c+"meshrelay.ashx?p="+l.protocol+"&nodeid="+e+"&id="+l.tunnelid,null!=o&&""!=o&&(t+="&rauth="+o),l.meshserver.send({action:"msg",type:"tunnel",nodeid:l.nodeid,value:t,usage:l.protocol}))},l.xxOnSocketConnected=function(){1==l.debugmode&&console.log("onSocketConnected"),l.latency.lastSend||(l.latency.lastSend=setInterval(function(){-1==l.latency.current?(clearInterval(l.latency.lastSend),l.latency.lastSend=null):l.sendCtrlMsg(JSON.stringify({ctrlChannel:102938,type:"rtt",time:(new Date).getTime()}))},1e4)),l.sendCtrlMsg(JSON.stringify({ctrlChannel:102938,type:"rtt",time:(new Date).getTime()})),l.xxStateChange(2)},l.xxOnControlCommand=function(e){var t;try{t=JSON.parse(e)}catch(e){return}"102938"!=t.ctrlChannel?l.m.ProcessData?l.m.ProcessData(e):console.log(e):("undefined"!=typeof args&&args.redirtrace&&console.log("RedirRecv",t),"console"==t.type?l.setConsoleMessage(t.msg,t.msgid,t.msgargs,t.timeout):"metadata"==t.type?(l.metadata=t,l.onMetadataChange&&l.onMetadataChange(l.metadata)):"rtt"==t.type&&"number"==typeof t.time?(l.latency.current=(new Date).getTime()-t.time,null!=l.latency.callback&&l.latency.callback(l.latency.current)):null!=l.webrtc?"answer"==t.type?l.webrtc.setRemoteDescription(new RTCSessionDescription(t),function(){},l.xxCloseWebRTC):"webrtc0"==t.type?(l.webSwitchOk=!0,s()):"webrtc1"==t.type?l.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc2"}'):t.type:"ping"==t.type&&l.sendCtrlMsg('{"ctrlChannel":"102938","type":"pong"}'))},l.setConsoleMessage=function(e,t,n,a){l.consoleMessage!=e&&(l.consoleMessage=e,l.consoleMessageId=t,l.consoleMessageArgs=n,l.consoleMessageTimeout=a,l.onConsoleMessageChange)&&l.onConsoleMessageChange(l,l.consoleMessage,l.consoleMessageId)},l.sendCtrlMsg=function(e){if(1==l.ctrlMsgAllowed){"undefined"!=typeof args&&args.redirtrace&&console.log("RedirSend",typeof e,e);try{l.socket.send(e)}catch(e){}}},l.xxOnMessage=function(e){if(l.State<3&&("c"==e.data||"cr"==e.data)){if("cr"==e.data&&(l.serverIsRecording=!0),null!=l.options){delete l.options.action,l.options.type="options";try{l.sendCtrlMsg(JSON.stringify(l.options))}catch(e){}}try{l.socket.send(l.protocol)}catch(e){}l.xxStateChange(3),1==l.attemptWebRTC&&(c=l.webrtcconfig,"undefined"!=typeof RTCPeerConnection?l.webrtc=new RTCPeerConnection(c):"undefined"!=typeof webkitRTCPeerConnection&&(l.webrtc=new webkitRTCPeerConnection(c)),null!=l.webrtc)&&l.webrtc.createDataChannel&&(l.webchannel=l.webrtc.createDataChannel("DataChannel",{}),l.webchannel.binaryType="arraybuffer",l.webchannel.onmessage=l.xxOnMessage,l.webchannel.onopen=function(){l.webRtcActive=!0,s()},l.webchannel.onclose=function(e){l.webRtcActive&&l.Stop()},l.webrtc.onicecandidate=function(e){if(null==e.candidate)try{l.sendCtrlMsg(JSON.stringify(l.webrtcoffer))}catch(e){}else l.webrtcoffer.sdp+="a="+e.candidate.candidate+"\r\n"},l.webrtc.oniceconnectionstatechange=function(){null!=l.webrtc&&("disconnected"==l.webrtc.iceConnectionState?1==l.webRtcActive?l.Stop():l.xxCloseWebRTC():"failed"==l.webrtc.iceConnectionState&&l.xxCloseWebRTC())},l.webrtc.createOffer(function(e){l.webrtcoffer=e,l.webrtc.setLocalDescription(e,function(){},l.xxCloseWebRTC)},l.xxCloseWebRTC,{mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}}))}else if("string"==typeof e.data)"~"==e.data[0]?l.m.ProcessData(e.data):l.xxOnControlCommand(e.data);else if(l.m.ProcessBinaryCommand){if(!(0==g&&e.data.byteLength<4))if(0!=g){var t=new Uint8Array(e.data);if(u.push(t),g+=t.byteLength,d<=g){var n,a=new Uint8Array(g),o=0;for(n in u)a.set(u[n],o),o+=u[n].byteLength;l.m.ProcessBinaryCommand(i,d,a),g=d=i=0,u=[]}}else{var c=((t=new Uint8Array(e.data))[0]<<8)+t[1],r=(t[2]<<8)+t[3];27==c&&8==r&&(c=(t[8]<<8)+t[9],r=(t[5]<<16)+(t[6]<<8)+t[7],t=t.slice(8)),r!=t.byteLength?(i=c,d=r,g=t.byteLength,u=[t]):l.m.ProcessBinaryCommand(c,r,t)}}else l.m.ProcessBinaryData?l.m.ProcessBinaryData(new Uint8Array(e.data)):e.data.byteLength<16e3?l.m.ProcessData(String.fromCharCode.apply(null,new Uint8Array(e.data))):(c=new Blob([new Uint8Array(e.data)]),(r=new FileReader).onload=function(e){l.m.ProcessData(e.target.result)},r.readAsBinaryString(c))};var i=0,d=0,g=0,u=[];return l.sendText=function(e){"string"!=typeof e&&(e=JSON.stringify(e)),l.send(encode_utf8(e))},l.send=function(e){"undefined"!=typeof args&&args.redirtrace&&console.log("RedirSend",typeof e,e.length,"{"==e[0]?e:rstr2hex(e).substring(0,64));try{if(null!=l.socket&&l.socket.readyState==WebSocket.OPEN)if("string"==typeof e){if(1==l.debugmode)for(var t=new Uint8Array(e.length),n=[],a=0;a<e.length;++a)t[a]=e.charCodeAt(a),n.push(e.charCodeAt(a));else for(t=new Uint8Array(e.length),a=0;a<e.length;++a)t[a]=e.charCodeAt(a);(1==l.webRtcActive?l.webchannel:l.socket).send(t.buffer)}else(1==l.webRtcActive?l.webchannel:l.socket).send(e)}catch(e){}},l.xxOnSocketClosed=function(){l.Stop(1)},l.xxStateChange=function(e){l.State!=e&&(l.State=e,l.m.xxStateChange(l.State),null!=l.onStateChanged)&&l.onStateChanged(l,l.State)},l.xxCloseWebRTC=function(){if(null!=l.webchannel){try{l.webchannel.close()}catch(e){}l.webchannel=null}if(null!=l.webrtc){try{l.webrtc.close()}catch(e){}l.webrtc=null}l.webRtcActive=!1},l.Stop=function(e){if(1==l.debugmode&&console.log("stop",e),l.xxCloseWebRTC(),l.latency.current=-1,l.connectstate=-1,null!=l.socket){try{1==l.socket.readyState&&l.sendCtrlMsg('{"ctrlChannel":"102938","type":"close"}')}catch(e){}try{l.socket.readyState<=1&&l.socket.close()}catch(e){}l.socket=null}l.xxStateChange(0)},l}
\ No newline at end of file
1
+var CreateAgentRedirect=function(e,t,n,a,o,c){var r={};function l(){1==r.webSwitchOk&&1==r.webRtcActive&&(r.latency.current=-1,r.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc0"}'),r.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc1"}'),null!=r.onStateChanged&&r.onStateChanged(r,r.State))}r.m=t,t.parent=r,r.meshserver=e,r.authCookie=a,r.rauthCookie=o,r.State=0,r.nodeid=null,r.options=null,r.socket=null,r.connectstate=-1,r.tunnelid=Math.random().toString(36).substring(2),r.protocol=t.protocol,r.onStateChanged=null,r.ctrlMsgAllowed=!0,r.attemptWebRTC=!1,r.webRtcActive=!1,r.webrtcconfig=null,r.webSwitchOk=!1,r.webchannel=null,r.webrtc=null,r.debugmode=0,r.serverIsRecording=!1,r.urlname="meshrelay.ashx",r.latency={lastSend:null,current:-1,callback:null},null==c&&(c="/"),r.consoleMessage=null,r.onConsoleMessageChange=null,r.metadata=null,r.onMetadataChange=null,r.Start=function(e){var t=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/"+r.urlname+"?browser=1&p="+r.protocol+(e?"&nodeid="+e:"")+"&id="+r.tunnelid;if(null!=a&&""!=a&&(t+="&auth="+a),null!=urlargs&&null!=urlargs.slowrelay&&(t+="&slowrelay="+urlargs.slowrelay),r.nodeid=e,r.connectstate=0,r.socket=new WebSocket(t),r.socket.binaryType="arraybuffer",r.socket.onopen=r.xxOnSocketConnected,r.socket.onmessage=r.xxOnMessage,r.socket.onerror=function(e){},r.socket.onclose=r.xxOnSocketClosed,r.xxStateChange(1),null!=r.meshserver){var n="*"+c+"meshrelay.ashx?p="+r.protocol+"&nodeid="+e+"&id="+r.tunnelid;null!=o&&""!=o&&(n+="&rauth="+o),r.meshserver.send({action:"msg",type:"tunnel",nodeid:r.nodeid,value:n,usage:r.protocol})}},r.xxOnSocketConnected=function(){1==r.debugmode&&console.log("onSocketConnected"),r.latency.lastSend||(r.latency.lastSend=setInterval((function(){-1==r.latency.current?(clearInterval(r.latency.lastSend),r.latency.lastSend=null):r.sendCtrlMsg(JSON.stringify({ctrlChannel:102938,type:"rtt",time:(new Date).getTime()}))}),1e4)),r.sendCtrlMsg(JSON.stringify({ctrlChannel:102938,type:"rtt",time:(new Date).getTime()})),r.xxStateChange(2)},r.xxOnControlCommand=function(e){var t;try{t=JSON.parse(e)}catch(e){return}"102938"==t.ctrlChannel?("undefined"!=typeof args&&args.redirtrace&&console.log("RedirRecv",t),"console"==t.type?r.setConsoleMessage(t.msg,t.msgid,t.msgargs,t.timeout):"metadata"==t.type?(r.metadata=t,r.onMetadataChange&&r.onMetadataChange(r.metadata)):"rtt"==t.type&&"number"==typeof t.time?(r.latency.current=(new Date).getTime()-t.time,null!=r.latency.callback&&r.latency.callback(r.latency.current)):null!=r.webrtc?"answer"==t.type?r.webrtc.setRemoteDescription(new RTCSessionDescription(t),(function(){}),r.xxCloseWebRTC):"webrtc0"==t.type?(r.webSwitchOk=!0,l()):"webrtc1"==t.type?r.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc2"}'):t.type:"ping"==t.type&&r.sendCtrlMsg('{"ctrlChannel":"102938","type":"pong"}')):r.m.ProcessData?r.m.ProcessData(e):console.log(e)},r.setConsoleMessage=function(e,t,n,a){r.consoleMessage!=e&&(r.consoleMessage=e,r.consoleMessageId=t,r.consoleMessageArgs=n,r.consoleMessageTimeout=a,r.onConsoleMessageChange&&r.onConsoleMessageChange(r,r.consoleMessage,r.consoleMessageId))},r.sendCtrlMsg=function(e){if(1==r.ctrlMsgAllowed){"undefined"!=typeof args&&args.redirtrace&&console.log("RedirSend",typeof e,e);try{r.socket.send(e)}catch(e){}}},r.xxOnMessage=function(e){if(r.State<3&&("c"==e.data||"cr"==e.data)){if("cr"==e.data&&(r.serverIsRecording=!0),null!=r.options){delete r.options.action,r.options.type="options";try{r.sendCtrlMsg(JSON.stringify(r.options))}catch(e){}}try{r.socket.send(r.protocol)}catch(e){}if(r.xxStateChange(3),1==r.attemptWebRTC){var t=r.webrtcconfig;"undefined"!=typeof RTCPeerConnection?r.webrtc=new RTCPeerConnection(t):"undefined"!=typeof webkitRTCPeerConnection&&(r.webrtc=new webkitRTCPeerConnection(t)),null!=r.webrtc&&r.webrtc.createDataChannel&&(r.webchannel=r.webrtc.createDataChannel("DataChannel",{}),r.webchannel.binaryType="arraybuffer",r.webchannel.onmessage=r.xxOnMessage,r.webchannel.onopen=function(){r.webRtcActive=!0,l()},r.webchannel.onclose=function(e){r.webRtcActive&&r.Stop()},r.webrtc.onicecandidate=function(e){if(null==e.candidate)try{r.sendCtrlMsg(JSON.stringify(r.webrtcoffer))}catch(e){}else r.webrtcoffer.sdp+="a="+e.candidate.candidate+"\r\n"},r.webrtc.oniceconnectionstatechange=function(){null!=r.webrtc&&("disconnected"==r.webrtc.iceConnectionState?1==r.webRtcActive?r.Stop():r.xxCloseWebRTC():"failed"==r.webrtc.iceConnectionState&&r.xxCloseWebRTC())},r.webrtc.createOffer((function(e){r.webrtcoffer=e,r.webrtc.setLocalDescription(e,(function(){}),r.xxCloseWebRTC)}),r.xxCloseWebRTC,{mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}}))}}else if("string"==typeof e.data)"~"==e.data[0]?r.m.ProcessData(e.data):r.xxOnControlCommand(e.data);else if(r.m.ProcessBinaryCommand){if(0==d&&e.data.byteLength<4)return;if(0!=d){var n=new Uint8Array(e.data);if(g.push(n),d+=n.byteLength,i<=d){var a=new Uint8Array(d),o=0;for(var c in g)a.set(g[c],o),o+=g[c].byteLength;r.m.ProcessBinaryCommand(s,i,a),s=0,i=0,d=0,g=[]}}else{var u=((n=new Uint8Array(e.data))[0]<<8)+n[1],f=(n[2]<<8)+n[3];27==u&&8==f&&(u=(n[8]<<8)+n[9],f=(n[5]<<16)+(n[6]<<8)+n[7],n=n.slice(8)),f!=n.byteLength?(s=u,i=f,d=n.byteLength,g=[n]):r.m.ProcessBinaryCommand(u,f,n)}}else if(r.m.ProcessBinaryData)r.m.ProcessBinaryData(new Uint8Array(e.data));else if(e.data.byteLength<16e3)r.m.ProcessData(String.fromCharCode.apply(null,new Uint8Array(e.data)));else{var b=new Blob([new Uint8Array(e.data)]),y=new FileReader;y.onload=function(e){r.m.ProcessData(e.target.result)},y.readAsBinaryString(b)}};var s=0,i=0,d=0,g=[];return r.sendText=function(e){"string"!=typeof e&&(e=JSON.stringify(e)),r.send(encode_utf8(e))},r.send=function(e){"undefined"!=typeof args&&args.redirtrace&&console.log("RedirSend",typeof e,e.length,"{"==e[0]?e:rstr2hex(e).substring(0,64));try{if(null!=r.socket&&r.socket.readyState==WebSocket.OPEN)if("string"==typeof e)if(1==r.debugmode){for(var t=new Uint8Array(e.length),n=[],a=0;a<e.length;++a)t[a]=e.charCodeAt(a),n.push(e.charCodeAt(a));1==r.webRtcActive?r.webchannel.send(t.buffer):r.socket.send(t.buffer)}else{for(t=new Uint8Array(e.length),a=0;a<e.length;++a)t[a]=e.charCodeAt(a);1==r.webRtcActive?r.webchannel.send(t.buffer):r.socket.send(t.buffer)}else 1==r.webRtcActive?r.webchannel.send(e):r.socket.send(e)}catch(e){}},r.xxOnSocketClosed=function(){r.Stop(1)},r.xxStateChange=function(e){r.State!=e&&(r.State=e,r.m.xxStateChange(r.State),null!=r.onStateChanged&&r.onStateChanged(r,r.State))},r.xxCloseWebRTC=function(){if(null!=r.webchannel){try{r.webchannel.close()}catch(e){}r.webchannel=null}if(null!=r.webrtc){try{r.webrtc.close()}catch(e){}r.webrtc=null}r.webRtcActive=!1},r.Stop=function(e){if(1==r.debugmode&&console.log("stop",e),r.xxCloseWebRTC(),r.latency.current=-1,r.connectstate=-1,null!=r.socket){try{1==r.socket.readyState&&r.sendCtrlMsg('{"ctrlChannel":"102938","type":"close"}')}catch(e){}try{r.socket.readyState<=1&&r.socket.close()}catch(e){}r.socket=null}r.xxStateChange(0)},r}
\ No newline at end of file
public/scripts/amt-0.2.0-min.js
+1
-1
@@ -1 +1 @@
1
-function AmtStackCreateService(e){var E=new Object,t=(E.wsman=e,E.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"],E.PendingEnums=[],E.PendingBatchOperations=0,E.ActiveEnumsCount=0,E.MaxActiveEnumsCount=1,E.onProcessChanged=null,0),n=0;function A(){var e=E.GetPendingActions();t<e&&(t=e),null!=E.onProcessChanged&&n!=e&&(n=e,E.onProcessChanged(e,t)),0==e&&(t=0)}function _(e){E.ActiveEnumsCount-=e,E.ActiveEnumsCount>=E.MaxActiveEnumsCount||0==E.PendingEnums.length||(e=E.PendingEnums.shift(),E.Enum(e[0],e[1],e[2]),_(0))}function c(r){r.names.length<=r.current?r.callback(E,r.name,r.responses,200,r.tag):(E.wsman.ExecGet(E.CompleteName(r.names[r.current]),function(e,t,n,i){var o;o=r,i=i,null==(n=n)||200!=i?o.callback(E,o.name,null,i,o.tag):(o.responses[n.Header.Method]=n,c(o))},r.pri),r.current++),A()}function i(e,t,n,i,o){200!=i||"0"!=n.Body.ReturnValue?o[0](E,null,o[2]):E.AMT_MessageLog_GetRecords(n.Body.IterationIdentifier,390,C,o)}function C(e,t,n,i,o){if(200!=i||"0"!=n.Body.ReturnValue)o[0](E,null,o[2]);else{var r,c,a,s,u,d,S,A=o[2],_=new Date,l=n.Body.RecordArray;for(r in"string"==typeof l&&(n.Body.RecordArray=[n.Body.RecordArray]),l){s=null;try{s=window.atob(l[r])}catch(e){}if(null!=s&&0<(d=ReadIntX(s,0))&&d<4294967295){for(a={DeviceAddress:s.charCodeAt(4),EventSensorType:s.charCodeAt(5),EventType:s.charCodeAt(6),EventOffset:s.charCodeAt(7),EventSourceType:s.charCodeAt(8),EventSeverity:s.charCodeAt(9),SensorNumber:s.charCodeAt(10),Entity:s.charCodeAt(11),EntityInstance:s.charCodeAt(12),EventData:[],Time:new Date(1e3*(d+60*_.getTimezoneOffset()))},c=13;c<21;c++)a.EventData.push(s.charCodeAt(c));a.EntityStr=M[a.Entity],a.Desc=(d=a.EventOffset,S=a.EventData,15!=(u=a.EventSensorType)?18!=u||170!=S[0]?6==u?"Authentication failed "+(S[1]+(S[2]<<8))+" times. The system may be under attack.":30==u?"No bootable media":32==u?"Operating system lockup or power interrupt":35!=u?37==u?"System firmware started (at least one CPU is properly executing).":"Unknown Sensor Type #"+u:64==S[0]?"BIOS POST (Power On Self-Test) Watchdog Timeout.":"System boot failure":"Agent watchdog "+char2hex(S[4])+char2hex(S[3])+char2hex(S[2])+char2hex(S[1])+"-"+char2hex(S[6])+char2hex(S[5])+"-... changed to "+E.WatchdogCurrentStates[S[7]]:235==S[0]?"Invalid Data":(0==d?m:g)[S[1]]),a.EntityStr||(a.EntityStr="Unknown"),A.push(a)}}1!=n.Body.NoMoreRecords?E.AMT_MessageLog_GetRecords(n.Body.IterationIdentifier,390,C,[o[0],A,o[2]]):o[0](E,A,o[2])}}E.GetPendingActions=function(){return 2*E.PendingEnums.length+E.ActiveEnumsCount+E.wsman.comm.PendingAjax.length+E.wsman.comm.ActiveAjaxCount+E.PendingBatchOperations},E.Subscribe=function(o,e,t,r,c,n,i,a,s,u){E.wsman.ExecSubscribe(E.CompleteName(o),e,t,function(e,t,n,i){A(),r(E,o,n,i,c)},0,n,i,a,s,u),A()},E.UnSubscribe=function(o,r,c,e,t){E.wsman.ExecUnSubscribe(E.CompleteName(o),function(e,t,n,i){A(),r(E,o,n,i,c)},0,e,t),A()},E.Get=function(o,r,c,e){E.wsman.ExecGet(E.CompleteName(o),function(e,t,n,i){A(),r(E,o,n,i,c)},0,e),A()},E.Put=function(o,e,r,c,t,n){E.wsman.ExecPut(E.CompleteName(o),e,function(e,t,n,i){A(),r(E,o,n,i,c)},0,t,n),A()},E.Create=function(o,e,r,c,t){E.wsman.ExecCreate(E.CompleteName(o),e,function(e,t,n,i){A(),r(E,o,n,i,c)},0,t),A()},E.Delete=function(o,e,r,c,t){E.wsman.ExecDelete(E.CompleteName(o),e,function(e,t,n,i){A(),r(E,o,n,i,c)},0,t),A()},E.Exec=function(o,e,t,r,c,n,i){E.wsman.ExecMethod(E.CompleteName(o),e,t,function(e,t,n,i){A(),r(E,o,E.CompleteExecResponse(n),i,c)},0,n,i),A()},E.ExecWithXml=function(o,e,t,r,c,n,i){E.wsman.ExecMethodXml(E.CompleteName(o),e,execArgumentsToXml(t),function(e,t,n,i){A(),r(E,o,E.CompleteExecResponse(n),i,c)},0,n,i),A()},E.Enum=function(s,u,e,t){E.ActiveEnumsCount<E.MaxActiveEnumsCount?(E.ActiveEnumsCount++,E.wsman.ExecEnum(E.CompleteName(s),function(e,t,n,i,o){var r,c,a;A(),r=s,n=n,c=u,t=t,a=o,200!=(o=i)?(c(E,r,null,o,a),_(1)):null!=n&&"EnumerateResponse"==n.Header.Method&&n.Body.EnumerationContext?(o=n.Body.EnumerationContext,E.wsman.ExecPull(t,o,function(e,t,n,i){!function o(r,e,c,t,a,n,s,i){if(200!=n)return c(E,r,null,n,s),void _(1);if(null==e||"PullResponse"!=e.Header.Method)return c(E,r,null,604,s),void _(1);for(var u in e.Body.Items)if(e.Body.Items[u]instanceof Array)for(var d in e.Body.Items[u])a.push(e.Body.Items[u][d]);else a.push(e.Body.Items[u]);{var S;e.Body.EnumerationContext?(S=e.Body.EnumerationContext,E.wsman.ExecPull(t,S,function(e,t,n,i){o(r,n,c,t,a,i,s,1)})):(_(1),c(E,r,a,n,s),A())}}(r,n,c,t,[],i,a)})):(c(E,r,null,603,a),_(1))},e,t)):E.PendingEnums.push([s,u,e,t]),A()},E.BatchEnum=function(e,t,n,i,o,r){E.PendingBatchOperations+=2*t.length,function r(c,a,s,u,e,d,S){E.PendingBatchOperations-=2;var t=a.shift(),n=E.Enum;"*"==t[0]&&(n=E.Get,t=t.substring(1));n(t,function(e,t,n,i,o){o[2][t]={response:null==n?null:n.Body,responses:n,status:i},0==o[1].length||401==i||1!=d&&200!=i&&400!=i?(E.PendingBatchOperations-=2*a.length,A(),s(E,c,o[2],i,u)):(A(),r(c,a,s,u,o[2],S))},[c,a,e],S);A()}(e,Clone(t),n,i,{},o,r),A()},E.BatchGet=function(e,t,n,i,o){c({name:e,names:t,callback:n,current:0,responses:{},tag:i,pri:o}),A()},E.CompleteName=function(e){return 0==e.indexOf("AMT_")?E.pfx[0]+e:0==e.indexOf("CIM_")?E.pfx[1]+e:0==e.indexOf("IPS_")?E.pfx[2]+e:void 0},E.CompleteExecResponse=function(e){return e&&null!=e&&e.Body&&e.Body.ReturnValue&&(e.Body.ReturnValueStr=E.AmtStatusToStr(e.Body.ReturnValue)),e},E.RequestPowerStateChange=function(e,t){E.CIM_PowerManagementService_RequestPowerStateChange(e,'<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="CreationClassName">CIM_ComputerSystem</Selector><Selector Name="Name">ManagedSystem</Selector></SelectorSet></ReferenceParameters>',null,null,t)},E.SetBootConfigRole=function(e,t){E.CIM_BootService_SetBootConfigRole('<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSetting</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">Intel(r) AMT: Boot Configuration 0</Selector></SelectorSet></ReferenceParameters>',e,t)},E.CancelAllQueries=function(e){E.wsman.CancelAllQueries(e)},E.AMT_AgentPresenceWatchdog_RegisterAgent=function(e){E.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},e)},E.AMT_AgentPresenceWatchdog_AssertPresence=function(e,t){E.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:e},t)},E.AMT_AgentPresenceWatchdog_AssertShutdown=function(e,t){E.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:e},t)},E.AMT_AgentPresenceWatchdog_AddAction=function(e,t,n,i,o,r,c,a,s){E.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:e,NewState:t,EventOnTransition:n,ActionSd:i,ActionEac:o},r,c,a,s)},E.AMT_AgentPresenceWatchdog_DeleteAllActions=function(e,t,n,i){E.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},e,t,n,i)},E.AMT_AgentPresenceWatchdogAction_GetActionEac=function(e){E.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},e)},E.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(e){E.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},e)},E.AMT_AgentPresenceWatchdogVA_AssertPresence=function(e,t){E.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:e},t)},E.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(e,t){E.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:e},t)},E.AMT_AgentPresenceWatchdogVA_AddAction=function(e,t,n,i,o,r){E.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:e,NewState:t,EventOnTransition:n,ActionSd:i,ActionEac:o},r)},E.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(e,t){E.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:e},t)},E.AMT_AuditLog_ClearLog=function(e){E.Exec("AMT_AuditLog","ClearLog",{},e)},E.AMT_AuditLog_RequestStateChange=function(e,t,n){E.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.AMT_AuditLog_ReadRecords=function(e,t,n){E.Exec("AMT_AuditLog","ReadRecords",{StartIndex:e},t,n)},E.AMT_AuditLog_SetAuditLock=function(e,t,n,i){E.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:e,Flag:t,Handle:n},i)},E.AMT_AuditLog_ExportAuditLogSignature=function(e,t){E.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:e},t)},E.AMT_AuditLog_SetSigningKeyMaterial=function(e,t,n,i,o){E.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:e,SigningKey:t,LengthOfCertificates:n,Certificates:i},o)},E.AMT_AuditPolicyRule_SetAuditPolicy=function(e,t,n,i,o){E.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:e,AuditedAppID:t,EventID:n,PolicyType:i},o)},E.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(e,t,n,i,o){E.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:e,AuditedAppID:t,EventID:n,PolicyType:i},o)},E.AMT_AuthorizationService_AddUserAclEntryEx=function(e,t,n,i,o,r){E.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:e,DigestPassword:t,KerberosUserSid:n,AccessPermission:i,Realms:o},r)},E.AMT_AuthorizationService_EnumerateUserAclEntries=function(e,t){E.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:e},t)},E.AMT_AuthorizationService_GetUserAclEntryEx=function(e,t,n){E.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:e},t,n)},E.AMT_AuthorizationService_UpdateUserAclEntryEx=function(e,t,n,i,o,r,c){E.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:e,DigestUsername:t,DigestPassword:n,KerberosUserSid:i,AccessPermission:o,Realms:r},c)},E.AMT_AuthorizationService_RemoveUserAclEntry=function(e,t){E.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:e},t)},E.AMT_AuthorizationService_SetAdminAclEntryEx=function(e,t,n){E.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:e,DigestPassword:t},n)},E.AMT_AuthorizationService_GetAdminAclEntry=function(e){E.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},e)},E.AMT_AuthorizationService_GetAdminAclEntryStatus=function(e){E.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},e)},E.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(e){E.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},e)},E.AMT_AuthorizationService_SetAclEnabledState=function(e,t,n,i){E.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:e,Enabled:t},n,i)},E.AMT_AuthorizationService_GetAclEnabledState=function(e,t,n){E.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:e},t,n)},E.AMT_EndpointAccessControlService_RequestStateChange=function(e,t,n){E.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.AMT_EndpointAccessControlService_GetPosture=function(e,t){E.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:e},t)},E.AMT_EndpointAccessControlService_GetPostureHash=function(e,t){E.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:e},t)},E.AMT_EndpointAccessControlService_UpdatePostureState=function(e,t){E.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:e},t)},E.AMT_EndpointAccessControlService_GetEacOptions=function(e){E.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},e)},E.AMT_EndpointAccessControlService_SetEacOptions=function(e,t,n){E.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:e,PostureHashAlgorithm:t},n)},E.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(e,t){E.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:e},t)},E.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(e,t){E.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:e},t)},E.AMT_EthernetPortSettings_SetLinkPreference=function(e,t,n){E.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:e,Timeout:t},n)},E.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(e,t){E.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:e},t)},E.AMT_KerberosSettingData_GetCredentialCacheState=function(e){E.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},e)},E.AMT_KerberosSettingData_SetCredentialCacheState=function(e,t){E.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:e},t)},E.AMT_MessageLog_CancelIteration=function(e,t){E.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:e},t)},E.AMT_MessageLog_RequestStateChange=function(e,t,n){E.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.AMT_MessageLog_ClearLog=function(e){E.Exec("AMT_MessageLog","ClearLog",{},e)},E.AMT_MessageLog_GetRecords=function(e,t,n,i){E.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:e,MaxReadRecords:t},n,i)},E.AMT_MessageLog_GetRecord=function(e,t,n){E.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:e,PositionToNext:t},n)},E.AMT_MessageLog_PositionAtRecord=function(e,t,n,i){E.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:e,MoveAbsolute:t,RecordNumber:n},i)},E.AMT_MessageLog_PositionToFirstRecord=function(e,t){E.Exec("AMT_MessageLog","PositionToFirstRecord",{},e,t)},E.AMT_MessageLog_FreezeLog=function(e,t){E.Exec("AMT_MessageLog","FreezeLog",{Freeze:e},t)},E.AMT_PublicKeyManagementService_AddCRL=function(e,t,n){E.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:e,SerialNumbers:t},n)},E.AMT_PublicKeyManagementService_ResetCRLList=function(e,t){E.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:e},t)},E.AMT_PublicKeyManagementService_AddCertificate=function(e,t){E.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:e},t)},E.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(e,t){E.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:e},t)},E.AMT_PublicKeyManagementService_AddKey=function(e,t){E.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:e},t)},E.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(e,t,n,i){E.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:e,DNName:t,Usage:n},i)},E.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(e,t,n,i){E.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:e,SigningAlgorithm:t,NullSignedCertificateRequest:n},i)},E.AMT_PublicKeyManagementService_GenerateKeyPair=function(e,t,n){E.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:e,KeyLength:t},n)},E.AMT_RedirectionService_RequestStateChange=function(e,t){E.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:e},t)},E.AMT_RedirectionService_TerminateSession=function(e,t){E.Exec("AMT_RedirectionService","TerminateSession",{SessionType:e},t)},E.AMT_RemoteAccessService_AddMpServer=function(e,t,n,i,o,r,c,a,s){E.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:e,InfoFormat:t,Port:n,AuthMethod:i,Certificate:o,Username:r,Password:c,CN:a},s)},E.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(e,t,n,i,o){E.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:e,TunnelLifeTime:t,ExtendedData:n,MpServer:i},o)},E.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(e,t){E.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:e},t)},E.AMT_SetupAndConfigurationService_CommitChanges=function(e,t){E.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:e},t)},E.AMT_SetupAndConfigurationService_Unprovision=function(e,t){E.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:e},t)},E.AMT_SetupAndConfigurationService_PartialUnprovision=function(e,t){E.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:e},t)},E.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(e,t){E.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:e},t)},E.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(e,t){E.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:e},t)},E.AMT_SetupAndConfigurationService_SetMEBxPassword=function(e,t){E.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:e},t)},E.AMT_SetupAndConfigurationService_SetTLSPSK=function(e,t,n){E.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:e,PPS:t},n)},E.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(e){E.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},e)},E.AMT_SetupAndConfigurationService_GetUuid=function(e){E.Exec("AMT_SetupAndConfigurationService","GetUuid",{},e)},E.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(e){E.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},e)},E.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(e){E.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},e)},E.AMT_SystemDefensePolicy_GetTimeout=function(e){E.Exec("AMT_SystemDefensePolicy","GetTimeout",{},e)},E.AMT_SystemDefensePolicy_SetTimeout=function(e,t){E.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:e},t)},E.AMT_SystemDefensePolicy_UpdateStatistics=function(e,t,n,i,o,r){E.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:e,ResetOnRead:t},n,i,o,r)},E.AMT_SystemPowerScheme_SetPowerScheme=function(e,t,n){E.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},e,n,0,{InstanceID:t})},E.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(e,t){E.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},e,t)},E.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(e,t,n,i,o){E.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:e,Tm1:t,Tm2:n},i,o)},E.AMT_UserInitiatedConnectionService_RequestStateChange=function(e,t,n){E.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.AMT_WebUIService_RequestStateChange=function(e,t,n){E.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(e,t,n,i,o,r){E.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:e,WiFiEndpointSettingsInput:t,IEEE8021xSettingsInput:n,ClientCredential:i,CACredential:o},r)},E.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(e,t,n,i,o,r){E.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:e,WiFiEndpointSettingsInput:t,IEEE8021xSettingsInput:n,ClientCredential:i,CACredential:o},r)},E.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(e,t){E.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:e},t)},E.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(e,t){E.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:e},t)},E.CIM_Account_RequestStateChange=function(e,t,n){E.Exec("CIM_Account","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.CIM_AccountManagementService_CreateAccount=function(e,t,n){E.Exec("CIM_AccountManagementService","CreateAccount",{System:e,AccountTemplate:t},n)},E.CIM_BootConfigSetting_ChangeBootOrder=function(e,t){E.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:e},t)},E.CIM_BootService_SetBootConfigRole=function(e,t,n){E.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:e,Role:t},n,0,1)},E.CIM_Card_ConnectorPower=function(e,t,n){E.Exec("CIM_Card","ConnectorPower",{Connector:e,PoweredOn:t},n)},E.CIM_Card_IsCompatible=function(e,t){E.Exec("CIM_Card","IsCompatible",{ElementToCheck:e},t)},E.CIM_Chassis_IsCompatible=function(e,t){E.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:e},t)},E.CIM_Fan_SetSpeed=function(e,t){E.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:e},t)},E.CIM_KVMRedirectionSAP_RequestStateChange=function(e,t,n){E.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:e},n)},E.CIM_MediaAccessDevice_LockMedia=function(e,t){E.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:e},t)},E.CIM_MediaAccessDevice_SetPowerState=function(e,t,n){E.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:e,Time:t},n)},E.CIM_MediaAccessDevice_Reset=function(e){E.Exec("CIM_MediaAccessDevice","Reset",{},e)},E.CIM_MediaAccessDevice_EnableDevice=function(e,t){E.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:e},t)},E.CIM_MediaAccessDevice_OnlineDevice=function(e,t){E.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:e},t)},E.CIM_MediaAccessDevice_QuiesceDevice=function(e,t){E.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:e},t)},E.CIM_MediaAccessDevice_SaveProperties=function(e){E.Exec("CIM_MediaAccessDevice","SaveProperties",{},e)},E.CIM_MediaAccessDevice_RestoreProperties=function(e){E.Exec("CIM_MediaAccessDevice","RestoreProperties",{},e)},E.CIM_MediaAccessDevice_RequestStateChange=function(e,t,n){E.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.CIM_PhysicalFrame_IsCompatible=function(e,t){E.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:e},t)},E.CIM_PhysicalPackage_IsCompatible=function(e,t){E.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:e},t)},E.CIM_PowerManagementService_RequestPowerStateChange=function(e,t,n,i,o){E.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:e,ManagedElement:t,Time:n,TimeoutPeriod:i},o,0,1)},E.CIM_PowerSupply_SetPowerState=function(e,t,n){E.Exec("CIM_PowerSupply","SetPowerState",{PowerState:e,Time:t},n)},E.CIM_PowerSupply_Reset=function(e){E.Exec("CIM_PowerSupply","Reset",{},e)},E.CIM_PowerSupply_EnableDevice=function(e,t){E.Exec("CIM_PowerSupply","EnableDevice",{Enabled:e},t)},E.CIM_PowerSupply_OnlineDevice=function(e,t){E.Exec("CIM_PowerSupply","OnlineDevice",{Online:e},t)},E.CIM_PowerSupply_QuiesceDevice=function(e,t){E.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:e},t)},E.CIM_PowerSupply_SaveProperties=function(e){E.Exec("CIM_PowerSupply","SaveProperties",{},e)},E.CIM_PowerSupply_RestoreProperties=function(e){E.Exec("CIM_PowerSupply","RestoreProperties",{},e)},E.CIM_PowerSupply_RequestStateChange=function(e,t,n){E.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.CIM_Processor_SetPowerState=function(e,t,n){E.Exec("CIM_Processor","SetPowerState",{PowerState:e,Time:t},n)},E.CIM_Processor_Reset=function(e){E.Exec("CIM_Processor","Reset",{},e)},E.CIM_Processor_EnableDevice=function(e,t){E.Exec("CIM_Processor","EnableDevice",{Enabled:e},t)},E.CIM_Processor_OnlineDevice=function(e,t){E.Exec("CIM_Processor","OnlineDevice",{Online:e},t)},E.CIM_Processor_QuiesceDevice=function(e,t){E.Exec("CIM_Processor","QuiesceDevice",{Quiesce:e},t)},E.CIM_Processor_SaveProperties=function(e){E.Exec("CIM_Processor","SaveProperties",{},e)},E.CIM_Processor_RestoreProperties=function(e){E.Exec("CIM_Processor","RestoreProperties",{},e)},E.CIM_Processor_RequestStateChange=function(e,t,n){E.Exec("CIM_Processor","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.CIM_RecordLog_ClearLog=function(e){E.Exec("CIM_RecordLog","ClearLog",{},e)},E.CIM_RecordLog_RequestStateChange=function(e,t,n){E.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.CIM_RedirectionService_RequestStateChange=function(e,t,n){E.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.CIM_Sensor_SetPowerState=function(e,t,n){E.Exec("CIM_Sensor","SetPowerState",{PowerState:e,Time:t},n)},E.CIM_Sensor_Reset=function(e){E.Exec("CIM_Sensor","Reset",{},e)},E.CIM_Sensor_EnableDevice=function(e,t){E.Exec("CIM_Sensor","EnableDevice",{Enabled:e},t)},E.CIM_Sensor_OnlineDevice=function(e,t){E.Exec("CIM_Sensor","OnlineDevice",{Online:e},t)},E.CIM_Sensor_QuiesceDevice=function(e,t){E.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:e},t)},E.CIM_Sensor_SaveProperties=function(e){E.Exec("CIM_Sensor","SaveProperties",{},e)},E.CIM_Sensor_RestoreProperties=function(e){E.Exec("CIM_Sensor","RestoreProperties",{},e)},E.CIM_Sensor_RequestStateChange=function(e,t,n){E.Exec("CIM_Sensor","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.CIM_StatisticalData_ResetSelectedStats=function(e,t){E.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:e},t)},E.CIM_Watchdog_KeepAlive=function(e){E.Exec("CIM_Watchdog","KeepAlive",{},e)},E.CIM_Watchdog_SetPowerState=function(e,t,n){E.Exec("CIM_Watchdog","SetPowerState",{PowerState:e,Time:t},n)},E.CIM_Watchdog_Reset=function(e){E.Exec("CIM_Watchdog","Reset",{},e)},E.CIM_Watchdog_EnableDevice=function(e,t){E.Exec("CIM_Watchdog","EnableDevice",{Enabled:e},t)},E.CIM_Watchdog_OnlineDevice=function(e,t){E.Exec("CIM_Watchdog","OnlineDevice",{Online:e},t)},E.CIM_Watchdog_QuiesceDevice=function(e,t){E.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:e},t)},E.CIM_Watchdog_SaveProperties=function(e){E.Exec("CIM_Watchdog","SaveProperties",{},e)},E.CIM_Watchdog_RestoreProperties=function(e){E.Exec("CIM_Watchdog","RestoreProperties",{},e)},E.CIM_Watchdog_RequestStateChange=function(e,t,n){E.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.CIM_WiFiPort_SetPowerState=function(e,t,n){E.Exec("CIM_WiFiPort","SetPowerState",{PowerState:e,Time:t},n)},E.CIM_WiFiPort_Reset=function(e){E.Exec("CIM_WiFiPort","Reset",{},e)},E.CIM_WiFiPort_EnableDevice=function(e,t){E.Exec("CIM_WiFiPort","EnableDevice",{Enabled:e},t)},E.CIM_WiFiPort_OnlineDevice=function(e,t){E.Exec("CIM_WiFiPort","OnlineDevice",{Online:e},t)},E.CIM_WiFiPort_QuiesceDevice=function(e,t){E.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:e},t)},E.CIM_WiFiPort_SaveProperties=function(e){E.Exec("CIM_WiFiPort","SaveProperties",{},e)},E.CIM_WiFiPort_RestoreProperties=function(e){E.Exec("CIM_WiFiPort","RestoreProperties",{},e)},E.CIM_WiFiPort_RequestStateChange=function(e,t,n){E.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.IPS_HostBasedSetupService_Setup=function(e,t,n,i,o,r,c){E.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:e,NetworkAdminPassword:t,McNonce:n,Certificate:i,SigningAlgorithm:o,DigitalSignature:r},c)},E.IPS_HostBasedSetupService_AddNextCertInChain=function(e,t,n,i){E.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:e,IsLeafCertificate:t,IsRootCertificate:n},i)},E.IPS_HostBasedSetupService_AdminSetup=function(e,t,n,i,o,r){E.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:e,NetworkAdminPassword:t,McNonce:n,SigningAlgorithm:i,DigitalSignature:o},r)},E.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(e,t,n,i){E.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:e,SigningAlgorithm:t,DigitalSignature:n},i)},E.IPS_HostBasedSetupService_DisableClientControlMode=function(e,t){E.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:e},t)},E.IPS_KVMRedirectionSettingData_TerminateSession=function(e){E.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},e)},E.IPS_OptInService_StartOptIn=function(e){E.Exec("IPS_OptInService","StartOptIn",{},e)},E.IPS_OptInService_CancelOptIn=function(e){E.Exec("IPS_OptInService","CancelOptIn",{},e)},E.IPS_OptInService_SendOptInCode=function(e,t){E.Exec("IPS_OptInService","SendOptInCode",{OptInCode:e},t)},E.IPS_OptInService_StartService=function(e){E.Exec("IPS_OptInService","StartService",{},e)},E.IPS_OptInService_StopService=function(e){E.Exec("IPS_OptInService","StopService",{},e)},E.IPS_OptInService_RequestStateChange=function(e,t,n){E.Exec("IPS_OptInService","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.IPS_ProvisioningRecordLog_RequestStateChange=function(e,t,n){E.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.IPS_ProvisioningRecordLog_ClearLog=function(e,t){E.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:e},t)},E.IPS_SecIOService_RequestStateChange=function(e,t,n){E.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:e,TimeoutPeriod:t},n)},E.AmtStatusToStr=function(e){return E.AmtStatusCodes[e]||"UNKNOWN_ERROR"},E.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"},E.GetMessageLog=function(e,t){E.AMT_MessageLog_PositionToFirstRecord(i,[e,t,[]])};"Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var m="Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split("|"),g="Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|User-initiated system setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split("|"),M="Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split("|");E.RealmNames="||Redirection|PT Administration|Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split("|"),E.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var l={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",20:"Security Audit Log",21:"Network Time",22:"Network Administration",23:"Storage Administration",24:"Event Manager",25:"Circuit Breaker Manager",26:"Agent Presence Manager",27:"Wireless Configuration",28:"EAC",29:"KVM",30:"User Opt-In Events",32:"Screen Blanking",33:"Watchdog Events",1600:"Provisioning Started",1601:"Provisioning Completed",1602:"ACL Entry Added",1603:"ACL Entry Modified",1604:"ACL Entry Removed",1605:"ACL Access with Invalid Credentials",1606:"ACL Entry State",1607:"TLS State Changed",1608:"TLS Server Certificate Set",1609:"TLS Server Certificate Remove",1610:"TLS Trusted Root Certificate Added",1611:"TLS Trusted Root Certificate Removed",1612:"TLS Preshared Key Set",1613:"Kerberos Settings Modified",1614:"Kerberos Main Key Modified",1615:"Flash Wear out Counters Reset",1616:"Power Package Modified",1617:"Set Realm Authentication Mode",1618:"Upgrade Client to Admin Control Mode",1619:"Unprovisioning Started",1700:"Performed Power Up",1701:"Performed Power Down",1702:"Performed Power Cycle",1703:"Performed Reset",1704:"Set Boot Options",1800:"IDER Session Opened",1801:"IDER Session Closed",1802:"IDER Enabled",1803:"IDER Disabled",1804:"SoL Session Opened",1805:"SoL Session Closed",1806:"SoL Enabled",1807:"SoL Disabled",1808:"KVM Session Started",1809:"KVM Session Ended",1810:"KVM Enabled",1811:"KVM Disabled",1812:"VNC Password Failed 3 Times",1900:"Firmware Updated",1901:"Firmware Update Failed",2e3:"Security Audit Log Cleared",2001:"Security Audit Policy Modified",2002:"Security Audit Log Disabled",2003:"Security Audit Log Enabled",2004:"Security Audit Log Exported",2005:"Security Audit Log Recovered",2100:"Intel® ME Time Set",2200:"TCPIP Parameters Set",2201:"Host Name Set",2202:"Domain Name Set",2203:"VLAN Parameters Set",2204:"Link Policy Set",2205:"IPv6 Parameters Set",2300:"Global Storage Attributes Set",2301:"Storage EACL Modified",2302:"Storage FPACL Modified",2303:"Storage Write Operation",2400:"Alert Subscribed",2401:"Alert Unsubscribed",2402:"Event Log Cleared",2403:"Event Log Frozen",2500:"CB Filter Added",2501:"CB Filter Removed",2502:"CB Policy Added",2503:"CB Policy Removed",2504:"CB Default Policy Set",2505:"CB Heuristics Option Set",2506:"CB Heuristics State Cleared",2600:"Agent Watchdog Added",2601:"Agent Watchdog Removed",2602:"Agent Watchdog Action Set",2700:"Wireless Profile Added",2701:"Wireless Profile Removed",2702:"Wireless Profile Updated",2800:"EAC Posture Signer SET",2801:"EAC Enabled",2802:"EAC Disabled",2803:"EAC Posture State",2804:"EAC Set Options",2900:"KVM Opt-in Enabled",2901:"KVM Opt-in Disabled",2902:"KVM Password Changed",2903:"KVM Consent Succeeded",2904:"KVM Consent Failed",3e3:"Opt-In Policy Change",3001:"Send Consent Code Event",3002:"Start Opt-In Blocked Event"};function I(e,t,n,i,o){if(200!=i)o[0](E,[],i);else{var r,c,a,s=o[1],u=new Date;if(0<n.Body.RecordsReturned)for(c in n.Body.EventRecords=MakeToArray(n.Body.EventRecords),n.Body.EventRecords){a=null;try{a=window.atob(n.Body.EventRecords[c])}catch(a){console.log(a+" "+n.Body.EventRecords[c])}(S={AuditAppID:ReadShort(a,0),EventID:ReadShort(a,2),InitiatorType:a.charCodeAt(4)}).AuditApp=l[S.AuditAppID],S.Event=l[100*S.AuditAppID+S.EventID],S.Event||(S.Event="#"+S.EventID),0==S.InitiatorType&&(d=a.charCodeAt(5),S.Initiator=a.substring(6,6+d),r=6+d),1==S.InitiatorType&&(S.KerberosUserInDomain=ReadInt(a,5),d=a.charCodeAt(9),S.Initiator=GetSidString(a.substring(10,10+d)),r=10+d),2==S.InitiatorType&&(S.Initiator="<i>Local</i>",r=5),3==S.InitiatorType&&(S.Initiator="<i>KVM Default Port</i>",r=5),A=ReadInt(a,r),S.Time=new Date(1e3*(A+60*u.getTimezoneOffset())),r+=4,S.MCLocationType=a.charCodeAt(r++);var d,S,A=a.charCodeAt(r++),A=(S.NetAddress=a.substring(r,r+A),r+=A,a.charCodeAt(r++));S.Ex=a.substring(r,r+A),S.ExStr=E.GetAuditLogExtendedDataStr(100*S.AuditAppID+S.EventID,S.Ex),s.push(S)}n.Body.TotalRecordCount>s.length?E.AMT_AuditLog_ReadRecords(s.length+1,I,[o[0],s]):o[0](E,s,i)}}return E.GetAuditLogExtendedDataStr=function(e,t){var n;return 1602!=e&&1604!=e||0!=t.charCodeAt(0)?1603==e?0==t.charCodeAt(1)?t.substring(3):null:1605==e?["Invalid ME access","Invalid MEBx access"][t.charCodeAt(0)]:1606==e?(n=["Disabled","Enabled"][t.charCodeAt(0)],0==t.charCodeAt(1)&&(n+=", "+t.substring(3)),n):1607==e?"Remote "+["NoAuth","ServerAuth","MutualAuth"][t.charCodeAt(0)]+", Local "+["NoAuth","ServerAuth","MutualAuth"][t.charCodeAt(1)]:1617==e?E.RealmNames[ReadInt(t,0)]+", "+["NoAuth","Auth","Disabled"][t.charCodeAt(4)]:1619==e?["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][t.charCodeAt(0)]:1900==e?"From "+ReadShort(t,0)+"."+ReadShort(t,2)+"."+ReadShort(t,4)+"."+ReadShort(t,6)+" to "+ReadShort(t,8)+"."+ReadShort(t,10)+"."+ReadShort(t,12)+"."+ReadShort(t,14):2100==e?((n=new Date).setTime(1e3*ReadInt(t,0)+6e4*(new Date).getTimezoneOffset()),n.toLocaleString()):3e3==e?"From "+["None","KVM","All"][t.charCodeAt(0)]+" to "+["None","KVM","All"][t.charCodeAt(1)]:3001==e?["Success","Failed 3 times"][t.charCodeAt(0)]:null:t.substring(2,2+t.charCodeAt(1))},E.GetAuditLog=function(e){E.AMT_AuditLog_ReadRecords(1,I,[e,[]])},E}function hex_md5(e){return null==e&&(e=""),forge.md.md5.create().update(e).digest().toHex()}for(var md5_k=[],i=0;i<64;)md5_k[i]=0|4294967296*Math.abs(Math.sin(++i));function hex_md5(e){null==e&&(e="");for(var t,n,i,o,r=[],c=unescape(encodeURI(e)),a=c.length,s=[t=1732584193,n=-271733879,~t,~n],u=0;u<=a;)r[u>>2]|=(c.charCodeAt(u)||128)<<u++%4*8;for(r[e=16*(a+8>>6)+14]=8*a,u=0;u<e;u+=16){for(a=s,o=0;o<64;)a=[i=a[3],(t=0|a[1])+((i=a[0]+[t&(n=a[2])|~t&i,i&t|~i&n,t^n^i,n^(t|~i)][a=o>>4]+(md5_k[o]+(0|r[[o,5*o+1,3*o+5,7*o][a]%16+u])))<<(a=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*a+o++%4])|i>>>32-a),t,n];for(o=4;o;)s[--o]=s[o]+a[o]}for(e="";o<32;)e+=(s[o>>3]>>4*(1^7&o++)&15).toString(16);return e}function rstr_md5(e){return hex2rstr(hex_md5(e))}function execArgumentsToXml(e){if(null==e)return null;var t,n="";for(t in e){var i=e[t];i&&("reference"===i.__parameterType?n+=referenceToXml(t,i):n+=instanceToXml(t,i))}return n}function instanceToXml(e,t){if(null==t)return null;var n=!!t.__namespace,i=n?"<q:":"<",o=n?"</q:":"</",r="<r:"+e+(n?' xmlns:q="'+t.__namespace+'"':"")+">";if("string"==typeof t)r+=t;else for(var c in t)!t.hasOwnProperty(c)||0===c.indexOf("__")||"function"==typeof t[c]||Array.isArray(t[c])||("object"==typeof t[c]?console.error("only convert one level down..."):r+=i+c+">"+t[c].toString()+o+c+">");return r+="</r:"+e+">"}function referenceToXml(e,t){if(null==t)return null;var n,i="<r:"+e+"><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>"+t.__resourceUri+"</w:ResourceURI><w:SelectorSet>";for(n in t)!t.hasOwnProperty(n)||0===n.indexOf("__")||"function"==typeof t[n]||"object"==typeof t[n]||Array.isArray(t[n])||(i+='<w:Selector Name="'+n+'">'+t[n].toString()+"</w:Selector>");return i+="</w:SelectorSet></a:ReferenceParameters></r:"+e+">"}function GetSidString(e){for(var t="S-"+e.charCodeAt(0)+"-"+e.charCodeAt(7),n=2;n<e.length/4;n++)t+="-"+ReadIntX(e,4*n);return t}function GetSidByteArray(e){if(!e||null==e)return null;var t=e.split("-");if(t.length<4||"s"!=t[0]&&"S"!=t[0])return null;for(var n=1;n<t.length;n++){var i=parseInt(t[n]);if(i!=t[n])return null;t[n]=i}for(var o=String.fromCharCode(t[1])+String.fromCharCode(t.length-3)+ShortToStr(Math.floor(t[2]/Math.pow(2,32)))+IntToStr(65535&t[2]),n=3;n<t.length;n++)o+=IntToStrX(t[n]);return o}
\ No newline at end of file
1
+function AmtStackCreateService(e){var t=new Object;t.wsman=e,t.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"],t.PendingEnums=[],t.PendingBatchOperations=0,t.ActiveEnumsCount=0,t.MaxActiveEnumsCount=1,t.onProcessChanged=null;var n=0,i=0;function o(){var e=t.GetPendingActions();n<e&&(n=e),null!=t.onProcessChanged&&i!=e&&(i=e,t.onProcessChanged(e,n)),0==e&&(n=0)}function r(e,n,i,a,s,u,d,S){if(200!=u)return i(t,e,null,u,d),void c(1);if(null==n||"PullResponse"!=n.Header.Method)return i(t,e,null,604,d),void c(1);for(var A in n.Body.Items)if(n.Body.Items[A]instanceof Array)for(var _ in n.Body.Items[A])s.push(n.Body.Items[A][_]);else s.push(n.Body.Items[A]);if(n.Body.EnumerationContext){var l=n.Body.EnumerationContext;t.wsman.ExecPull(a,l,(function(t,n,o,c){r(e,o,i,n,s,c,d,1)}))}else c(1),i(t,e,s,u,d),o()}function c(e){if(t.ActiveEnumsCount-=e,!(t.ActiveEnumsCount>=t.MaxActiveEnumsCount||0==t.PendingEnums.length)){var n=t.PendingEnums.shift();t.Enum(n[0],n[1],n[2]),c(0)}}function a(e,n,i,r,c,s,u){t.PendingBatchOperations-=2;var d=n.shift(),S=t.Enum;"*"==d[0]&&(S=t.Get,d=d.substring(1)),S(d,(function(c,d,S,A,_){_[2][d]={response:null==S?null:S.Body,responses:S,status:A},0==_[1].length||401==A||1!=s&&200!=A&&400!=A?(t.PendingBatchOperations-=2*n.length,o(),i(t,e,_[2],A,r)):(o(),a(e,n,i,r,_[2],u))}),[e,n,c],u),o()}function s(e){e.names.length<=e.current?e.callback(t,e.name,e.responses,200,e.tag):(t.wsman.ExecGet(t.CompleteName(e.names[e.current]),(function(n,i,o,r){!function(e,n,i){null==n||200!=i?e.callback(t,e.name,null,i,e.tag):(e.responses[n.Header.Method]=n,s(e))}(e,o,r)}),e.pri),e.current++),o()}function u(e,n,i,o,r){200==o&&"0"==i.Body.ReturnValue?t.AMT_MessageLog_GetRecords(i.Body.IterationIdentifier,390,d,r):r[0](t,null,r[2])}function d(e,n,i,o,r){if(200==o&&"0"==i.Body.ReturnValue){var c,a,s,u,S,A=r[2],E=new Date,C=i.Body.RecordArray;for(c in"string"==typeof C&&(i.Body.RecordArray=[i.Body.RecordArray]),C){u=null;try{u=window.atob(C[c])}catch(e){}if(null!=u&&(S=ReadIntX(u,0))>0&&S<4294967295){for(s={DeviceAddress:u.charCodeAt(4),EventSensorType:u.charCodeAt(5),EventType:u.charCodeAt(6),EventOffset:u.charCodeAt(7),EventSourceType:u.charCodeAt(8),EventSeverity:u.charCodeAt(9),SensorNumber:u.charCodeAt(10),Entity:u.charCodeAt(11),EntityInstance:u.charCodeAt(12),EventData:[],Time:new Date(1e3*(S+60*E.getTimezoneOffset()))},a=13;a<21;a++)s.EventData.push(u.charCodeAt(a));s.EntityStr=_[s.Entity],s.Desc=l(s.EventSensorType,s.EventOffset,s.EventData,s.Entity),s.EntityStr||(s.EntityStr="Unknown"),A.push(s)}}1!=i.Body.NoMoreRecords?t.AMT_MessageLog_GetRecords(i.Body.IterationIdentifier,390,d,[r[0],A,r[2]]):r[0](t,A,r[2])}else r[0](t,null,r[2])}t.GetPendingActions=function(){return 2*t.PendingEnums.length+t.ActiveEnumsCount+t.wsman.comm.PendingAjax.length+t.wsman.comm.ActiveAjaxCount+t.PendingBatchOperations},t.Subscribe=function(e,n,i,r,c,a,s,u,d,S){t.wsman.ExecSubscribe(t.CompleteName(e),n,i,(function(n,i,a,s){o(),r(t,e,a,s,c)}),0,a,s,u,d,S),o()},t.UnSubscribe=function(e,n,i,r,c){t.wsman.ExecUnSubscribe(t.CompleteName(e),(function(r,c,a,s){o(),n(t,e,a,s,i)}),0,r,c),o()},t.Get=function(e,n,i,r){t.wsman.ExecGet(t.CompleteName(e),(function(r,c,a,s){o(),n(t,e,a,s,i)}),0,r),o()},t.Put=function(e,n,i,r,c,a){t.wsman.ExecPut(t.CompleteName(e),n,(function(n,c,a,s){o(),i(t,e,a,s,r)}),0,c,a),o()},t.Create=function(e,n,i,r,c){t.wsman.ExecCreate(t.CompleteName(e),n,(function(n,c,a,s){o(),i(t,e,a,s,r)}),0,c),o()},t.Delete=function(e,n,i,r,c){t.wsman.ExecDelete(t.CompleteName(e),n,(function(n,c,a,s){o(),i(t,e,a,s,r)}),0,c),o()},t.Exec=function(e,n,i,r,c,a,s){t.wsman.ExecMethod(t.CompleteName(e),n,i,(function(n,i,a,s){o(),r(t,e,t.CompleteExecResponse(a),s,c)}),0,a,s),o()},t.ExecWithXml=function(e,n,i,r,c,a,s){t.wsman.ExecMethodXml(t.CompleteName(e),n,execArgumentsToXml(i),(function(n,i,a,s){o(),r(t,e,t.CompleteExecResponse(a),s,c)}),0,a,s),o()},t.Enum=function(e,n,i,a){t.ActiveEnumsCount<t.MaxActiveEnumsCount?(t.ActiveEnumsCount++,t.wsman.ExecEnum(t.CompleteName(e),(function(i,a,s,u,d){o(),function(e,n,i,o,a,s,u){if(200!=a)return i(t,e,null,a,s),void c(1);if(null==n||"EnumerateResponse"!=n.Header.Method||!n.Body.EnumerationContext)return i(t,e,null,603,s),void c(1);var d=n.Body.EnumerationContext;t.wsman.ExecPull(o,d,(function(t,n,o,c){r(e,o,i,n,[],c,s,u)}))}(e,s,n,a,u,d)}),i,a)):t.PendingEnums.push([e,n,i,a]),o()},t.BatchEnum=function(e,n,i,r,c,s){t.PendingBatchOperations+=2*n.length,a(e,Clone(n),i,r,{},c,s),o()},t.BatchGet=function(e,t,n,i,r){s({name:e,names:t,callback:n,current:0,responses:{},tag:i,pri:r}),o()},t.CompleteName=function(e){return 0==e.indexOf("AMT_")?t.pfx[0]+e:0==e.indexOf("CIM_")?t.pfx[1]+e:0==e.indexOf("IPS_")?t.pfx[2]+e:void 0},t.CompleteExecResponse=function(e){return e&&null!=e&&e.Body&&e.Body.ReturnValue&&(e.Body.ReturnValueStr=t.AmtStatusToStr(e.Body.ReturnValue)),e},t.RequestPowerStateChange=function(e,n){t.CIM_PowerManagementService_RequestPowerStateChange(e,'<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="CreationClassName">CIM_ComputerSystem</Selector><Selector Name="Name">ManagedSystem</Selector></SelectorSet></ReferenceParameters>',null,null,n)},t.SetBootConfigRole=function(e,n){t.CIM_BootService_SetBootConfigRole('<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSetting</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">Intel(r) AMT: Boot Configuration 0</Selector></SelectorSet></ReferenceParameters>',e,n)},t.CancelAllQueries=function(e){t.wsman.CancelAllQueries(e)},t.AMT_AgentPresenceWatchdog_RegisterAgent=function(e){t.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},e)},t.AMT_AgentPresenceWatchdog_AssertPresence=function(e,n){t.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:e},n)},t.AMT_AgentPresenceWatchdog_AssertShutdown=function(e,n){t.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:e},n)},t.AMT_AgentPresenceWatchdog_AddAction=function(e,n,i,o,r,c,a,s,u){t.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:e,NewState:n,EventOnTransition:i,ActionSd:o,ActionEac:r},c,a,s,u)},t.AMT_AgentPresenceWatchdog_DeleteAllActions=function(e,n,i,o){t.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},e,n,i,o)},t.AMT_AgentPresenceWatchdogAction_GetActionEac=function(e){t.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},e)},t.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(e){t.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},e)},t.AMT_AgentPresenceWatchdogVA_AssertPresence=function(e,n){t.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:e},n)},t.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(e,n){t.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:e},n)},t.AMT_AgentPresenceWatchdogVA_AddAction=function(e,n,i,o,r,c){t.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:e,NewState:n,EventOnTransition:i,ActionSd:o,ActionEac:r},c)},t.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(e,n){t.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:e},n)},t.AMT_AuditLog_ClearLog=function(e){t.Exec("AMT_AuditLog","ClearLog",{},e)},t.AMT_AuditLog_RequestStateChange=function(e,n,i){t.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.AMT_AuditLog_ReadRecords=function(e,n,i){t.Exec("AMT_AuditLog","ReadRecords",{StartIndex:e},n,i)},t.AMT_AuditLog_SetAuditLock=function(e,n,i,o){t.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:e,Flag:n,Handle:i},o)},t.AMT_AuditLog_ExportAuditLogSignature=function(e,n){t.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:e},n)},t.AMT_AuditLog_SetSigningKeyMaterial=function(e,n,i,o,r){t.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:e,SigningKey:n,LengthOfCertificates:i,Certificates:o},r)},t.AMT_AuditPolicyRule_SetAuditPolicy=function(e,n,i,o,r){t.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:e,AuditedAppID:n,EventID:i,PolicyType:o},r)},t.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(e,n,i,o,r){t.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:e,AuditedAppID:n,EventID:i,PolicyType:o},r)},t.AMT_AuthorizationService_AddUserAclEntryEx=function(e,n,i,o,r,c){t.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:e,DigestPassword:n,KerberosUserSid:i,AccessPermission:o,Realms:r},c)},t.AMT_AuthorizationService_EnumerateUserAclEntries=function(e,n){t.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:e},n)},t.AMT_AuthorizationService_GetUserAclEntryEx=function(e,n,i){t.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:e},n,i)},t.AMT_AuthorizationService_UpdateUserAclEntryEx=function(e,n,i,o,r,c,a){t.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:e,DigestUsername:n,DigestPassword:i,KerberosUserSid:o,AccessPermission:r,Realms:c},a)},t.AMT_AuthorizationService_RemoveUserAclEntry=function(e,n){t.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:e},n)},t.AMT_AuthorizationService_SetAdminAclEntryEx=function(e,n,i){t.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:e,DigestPassword:n},i)},t.AMT_AuthorizationService_GetAdminAclEntry=function(e){t.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},e)},t.AMT_AuthorizationService_GetAdminAclEntryStatus=function(e){t.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},e)},t.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(e){t.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},e)},t.AMT_AuthorizationService_SetAclEnabledState=function(e,n,i,o){t.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:e,Enabled:n},i,o)},t.AMT_AuthorizationService_GetAclEnabledState=function(e,n,i){t.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:e},n,i)},t.AMT_EndpointAccessControlService_RequestStateChange=function(e,n,i){t.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.AMT_EndpointAccessControlService_GetPosture=function(e,n){t.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:e},n)},t.AMT_EndpointAccessControlService_GetPostureHash=function(e,n){t.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:e},n)},t.AMT_EndpointAccessControlService_UpdatePostureState=function(e,n){t.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:e},n)},t.AMT_EndpointAccessControlService_GetEacOptions=function(e){t.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},e)},t.AMT_EndpointAccessControlService_SetEacOptions=function(e,n,i){t.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:e,PostureHashAlgorithm:n},i)},t.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(e,n){t.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:e},n)},t.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(e,n){t.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:e},n)},t.AMT_EthernetPortSettings_SetLinkPreference=function(e,n,i){t.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:e,Timeout:n},i)},t.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(e,n){t.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:e},n)},t.AMT_KerberosSettingData_GetCredentialCacheState=function(e){t.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},e)},t.AMT_KerberosSettingData_SetCredentialCacheState=function(e,n){t.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:e},n)},t.AMT_MessageLog_CancelIteration=function(e,n){t.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:e},n)},t.AMT_MessageLog_RequestStateChange=function(e,n,i){t.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.AMT_MessageLog_ClearLog=function(e){t.Exec("AMT_MessageLog","ClearLog",{},e)},t.AMT_MessageLog_GetRecords=function(e,n,i,o){t.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:e,MaxReadRecords:n},i,o)},t.AMT_MessageLog_GetRecord=function(e,n,i){t.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:e,PositionToNext:n},i)},t.AMT_MessageLog_PositionAtRecord=function(e,n,i,o){t.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:e,MoveAbsolute:n,RecordNumber:i},o)},t.AMT_MessageLog_PositionToFirstRecord=function(e,n){t.Exec("AMT_MessageLog","PositionToFirstRecord",{},e,n)},t.AMT_MessageLog_FreezeLog=function(e,n){t.Exec("AMT_MessageLog","FreezeLog",{Freeze:e},n)},t.AMT_PublicKeyManagementService_AddCRL=function(e,n,i){t.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:e,SerialNumbers:n},i)},t.AMT_PublicKeyManagementService_ResetCRLList=function(e,n){t.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:e},n)},t.AMT_PublicKeyManagementService_AddCertificate=function(e,n){t.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:e},n)},t.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(e,n){t.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:e},n)},t.AMT_PublicKeyManagementService_AddKey=function(e,n){t.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:e},n)},t.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(e,n,i,o){t.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:e,DNName:n,Usage:i},o)},t.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(e,n,i,o){t.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:e,SigningAlgorithm:n,NullSignedCertificateRequest:i},o)},t.AMT_PublicKeyManagementService_GenerateKeyPair=function(e,n,i){t.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:e,KeyLength:n},i)},t.AMT_RedirectionService_RequestStateChange=function(e,n){t.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:e},n)},t.AMT_RedirectionService_TerminateSession=function(e,n){t.Exec("AMT_RedirectionService","TerminateSession",{SessionType:e},n)},t.AMT_RemoteAccessService_AddMpServer=function(e,n,i,o,r,c,a,s,u){t.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:e,InfoFormat:n,Port:i,AuthMethod:o,Certificate:r,Username:c,Password:a,CN:s},u)},t.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(e,n,i,o,r){t.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:e,TunnelLifeTime:n,ExtendedData:i,MpServer:o},r)},t.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(e,n){t.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:e},n)},t.AMT_SetupAndConfigurationService_CommitChanges=function(e,n){t.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:e},n)},t.AMT_SetupAndConfigurationService_Unprovision=function(e,n){t.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:e},n)},t.AMT_SetupAndConfigurationService_PartialUnprovision=function(e,n){t.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:e},n)},t.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(e,n){t.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:e},n)},t.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(e,n){t.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:e},n)},t.AMT_SetupAndConfigurationService_SetMEBxPassword=function(e,n){t.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:e},n)},t.AMT_SetupAndConfigurationService_SetTLSPSK=function(e,n,i){t.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:e,PPS:n},i)},t.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(e){t.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},e)},t.AMT_SetupAndConfigurationService_GetUuid=function(e){t.Exec("AMT_SetupAndConfigurationService","GetUuid",{},e)},t.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(e){t.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},e)},t.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(e){t.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},e)},t.AMT_SystemDefensePolicy_GetTimeout=function(e){t.Exec("AMT_SystemDefensePolicy","GetTimeout",{},e)},t.AMT_SystemDefensePolicy_SetTimeout=function(e,n){t.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:e},n)},t.AMT_SystemDefensePolicy_UpdateStatistics=function(e,n,i,o,r,c){t.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:e,ResetOnRead:n},i,o,r,c)},t.AMT_SystemPowerScheme_SetPowerScheme=function(e,n,i){t.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},e,i,0,{InstanceID:n})},t.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(e,n){t.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},e,n)},t.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(e,n,i,o,r){t.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:e,Tm1:n,Tm2:i},o,r)},t.AMT_UserInitiatedConnectionService_RequestStateChange=function(e,n,i){t.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.AMT_WebUIService_RequestStateChange=function(e,n,i){t.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(e,n,i,o,r,c){t.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:e,WiFiEndpointSettingsInput:n,IEEE8021xSettingsInput:i,ClientCredential:o,CACredential:r},c)},t.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(e,n,i,o,r,c){t.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:e,WiFiEndpointSettingsInput:n,IEEE8021xSettingsInput:i,ClientCredential:o,CACredential:r},c)},t.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(e,n){t.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:e},n)},t.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(e,n){t.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:e},n)},t.CIM_Account_RequestStateChange=function(e,n,i){t.Exec("CIM_Account","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.CIM_AccountManagementService_CreateAccount=function(e,n,i){t.Exec("CIM_AccountManagementService","CreateAccount",{System:e,AccountTemplate:n},i)},t.CIM_BootConfigSetting_ChangeBootOrder=function(e,n){t.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:e},n)},t.CIM_BootService_SetBootConfigRole=function(e,n,i){t.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:e,Role:n},i,0,1)},t.CIM_Card_ConnectorPower=function(e,n,i){t.Exec("CIM_Card","ConnectorPower",{Connector:e,PoweredOn:n},i)},t.CIM_Card_IsCompatible=function(e,n){t.Exec("CIM_Card","IsCompatible",{ElementToCheck:e},n)},t.CIM_Chassis_IsCompatible=function(e,n){t.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:e},n)},t.CIM_Fan_SetSpeed=function(e,n){t.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:e},n)},t.CIM_KVMRedirectionSAP_RequestStateChange=function(e,n,i){t.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:e},i)},t.CIM_MediaAccessDevice_LockMedia=function(e,n){t.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:e},n)},t.CIM_MediaAccessDevice_SetPowerState=function(e,n,i){t.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:e,Time:n},i)},t.CIM_MediaAccessDevice_Reset=function(e){t.Exec("CIM_MediaAccessDevice","Reset",{},e)},t.CIM_MediaAccessDevice_EnableDevice=function(e,n){t.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:e},n)},t.CIM_MediaAccessDevice_OnlineDevice=function(e,n){t.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:e},n)},t.CIM_MediaAccessDevice_QuiesceDevice=function(e,n){t.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:e},n)},t.CIM_MediaAccessDevice_SaveProperties=function(e){t.Exec("CIM_MediaAccessDevice","SaveProperties",{},e)},t.CIM_MediaAccessDevice_RestoreProperties=function(e){t.Exec("CIM_MediaAccessDevice","RestoreProperties",{},e)},t.CIM_MediaAccessDevice_RequestStateChange=function(e,n,i){t.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.CIM_PhysicalFrame_IsCompatible=function(e,n){t.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:e},n)},t.CIM_PhysicalPackage_IsCompatible=function(e,n){t.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:e},n)},t.CIM_PowerManagementService_RequestPowerStateChange=function(e,n,i,o,r){t.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:e,ManagedElement:n,Time:i,TimeoutPeriod:o},r,0,1)},t.CIM_PowerSupply_SetPowerState=function(e,n,i){t.Exec("CIM_PowerSupply","SetPowerState",{PowerState:e,Time:n},i)},t.CIM_PowerSupply_Reset=function(e){t.Exec("CIM_PowerSupply","Reset",{},e)},t.CIM_PowerSupply_EnableDevice=function(e,n){t.Exec("CIM_PowerSupply","EnableDevice",{Enabled:e},n)},t.CIM_PowerSupply_OnlineDevice=function(e,n){t.Exec("CIM_PowerSupply","OnlineDevice",{Online:e},n)},t.CIM_PowerSupply_QuiesceDevice=function(e,n){t.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:e},n)},t.CIM_PowerSupply_SaveProperties=function(e){t.Exec("CIM_PowerSupply","SaveProperties",{},e)},t.CIM_PowerSupply_RestoreProperties=function(e){t.Exec("CIM_PowerSupply","RestoreProperties",{},e)},t.CIM_PowerSupply_RequestStateChange=function(e,n,i){t.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.CIM_Processor_SetPowerState=function(e,n,i){t.Exec("CIM_Processor","SetPowerState",{PowerState:e,Time:n},i)},t.CIM_Processor_Reset=function(e){t.Exec("CIM_Processor","Reset",{},e)},t.CIM_Processor_EnableDevice=function(e,n){t.Exec("CIM_Processor","EnableDevice",{Enabled:e},n)},t.CIM_Processor_OnlineDevice=function(e,n){t.Exec("CIM_Processor","OnlineDevice",{Online:e},n)},t.CIM_Processor_QuiesceDevice=function(e,n){t.Exec("CIM_Processor","QuiesceDevice",{Quiesce:e},n)},t.CIM_Processor_SaveProperties=function(e){t.Exec("CIM_Processor","SaveProperties",{},e)},t.CIM_Processor_RestoreProperties=function(e){t.Exec("CIM_Processor","RestoreProperties",{},e)},t.CIM_Processor_RequestStateChange=function(e,n,i){t.Exec("CIM_Processor","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.CIM_RecordLog_ClearLog=function(e){t.Exec("CIM_RecordLog","ClearLog",{},e)},t.CIM_RecordLog_RequestStateChange=function(e,n,i){t.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.CIM_RedirectionService_RequestStateChange=function(e,n,i){t.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.CIM_Sensor_SetPowerState=function(e,n,i){t.Exec("CIM_Sensor","SetPowerState",{PowerState:e,Time:n},i)},t.CIM_Sensor_Reset=function(e){t.Exec("CIM_Sensor","Reset",{},e)},t.CIM_Sensor_EnableDevice=function(e,n){t.Exec("CIM_Sensor","EnableDevice",{Enabled:e},n)},t.CIM_Sensor_OnlineDevice=function(e,n){t.Exec("CIM_Sensor","OnlineDevice",{Online:e},n)},t.CIM_Sensor_QuiesceDevice=function(e,n){t.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:e},n)},t.CIM_Sensor_SaveProperties=function(e){t.Exec("CIM_Sensor","SaveProperties",{},e)},t.CIM_Sensor_RestoreProperties=function(e){t.Exec("CIM_Sensor","RestoreProperties",{},e)},t.CIM_Sensor_RequestStateChange=function(e,n,i){t.Exec("CIM_Sensor","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.CIM_StatisticalData_ResetSelectedStats=function(e,n){t.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:e},n)},t.CIM_Watchdog_KeepAlive=function(e){t.Exec("CIM_Watchdog","KeepAlive",{},e)},t.CIM_Watchdog_SetPowerState=function(e,n,i){t.Exec("CIM_Watchdog","SetPowerState",{PowerState:e,Time:n},i)},t.CIM_Watchdog_Reset=function(e){t.Exec("CIM_Watchdog","Reset",{},e)},t.CIM_Watchdog_EnableDevice=function(e,n){t.Exec("CIM_Watchdog","EnableDevice",{Enabled:e},n)},t.CIM_Watchdog_OnlineDevice=function(e,n){t.Exec("CIM_Watchdog","OnlineDevice",{Online:e},n)},t.CIM_Watchdog_QuiesceDevice=function(e,n){t.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:e},n)},t.CIM_Watchdog_SaveProperties=function(e){t.Exec("CIM_Watchdog","SaveProperties",{},e)},t.CIM_Watchdog_RestoreProperties=function(e){t.Exec("CIM_Watchdog","RestoreProperties",{},e)},t.CIM_Watchdog_RequestStateChange=function(e,n,i){t.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.CIM_WiFiPort_SetPowerState=function(e,n,i){t.Exec("CIM_WiFiPort","SetPowerState",{PowerState:e,Time:n},i)},t.CIM_WiFiPort_Reset=function(e){t.Exec("CIM_WiFiPort","Reset",{},e)},t.CIM_WiFiPort_EnableDevice=function(e,n){t.Exec("CIM_WiFiPort","EnableDevice",{Enabled:e},n)},t.CIM_WiFiPort_OnlineDevice=function(e,n){t.Exec("CIM_WiFiPort","OnlineDevice",{Online:e},n)},t.CIM_WiFiPort_QuiesceDevice=function(e,n){t.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:e},n)},t.CIM_WiFiPort_SaveProperties=function(e){t.Exec("CIM_WiFiPort","SaveProperties",{},e)},t.CIM_WiFiPort_RestoreProperties=function(e){t.Exec("CIM_WiFiPort","RestoreProperties",{},e)},t.CIM_WiFiPort_RequestStateChange=function(e,n,i){t.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.IPS_HostBasedSetupService_Setup=function(e,n,i,o,r,c,a){t.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:e,NetworkAdminPassword:n,McNonce:i,Certificate:o,SigningAlgorithm:r,DigitalSignature:c},a)},t.IPS_HostBasedSetupService_AddNextCertInChain=function(e,n,i,o){t.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:e,IsLeafCertificate:n,IsRootCertificate:i},o)},t.IPS_HostBasedSetupService_AdminSetup=function(e,n,i,o,r,c){t.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:e,NetworkAdminPassword:n,McNonce:i,SigningAlgorithm:o,DigitalSignature:r},c)},t.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(e,n,i,o){t.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:e,SigningAlgorithm:n,DigitalSignature:i},o)},t.IPS_HostBasedSetupService_DisableClientControlMode=function(e,n){t.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:e},n)},t.IPS_KVMRedirectionSettingData_TerminateSession=function(e){t.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},e)},t.IPS_OptInService_StartOptIn=function(e){t.Exec("IPS_OptInService","StartOptIn",{},e)},t.IPS_OptInService_CancelOptIn=function(e){t.Exec("IPS_OptInService","CancelOptIn",{},e)},t.IPS_OptInService_SendOptInCode=function(e,n){t.Exec("IPS_OptInService","SendOptInCode",{OptInCode:e},n)},t.IPS_OptInService_StartService=function(e){t.Exec("IPS_OptInService","StartService",{},e)},t.IPS_OptInService_StopService=function(e){t.Exec("IPS_OptInService","StopService",{},e)},t.IPS_OptInService_RequestStateChange=function(e,n,i){t.Exec("IPS_OptInService","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.IPS_ProvisioningRecordLog_RequestStateChange=function(e,n,i){t.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.IPS_ProvisioningRecordLog_ClearLog=function(e,n){t.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:e},n)},t.IPS_SecIOService_RequestStateChange=function(e,n,i){t.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:e,TimeoutPeriod:n},i)},t.AmtStatusToStr=function(e){return t.AmtStatusCodes[e]?t.AmtStatusCodes[e]:"UNKNOWN_ERROR"},t.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"},t.GetMessageLog=function(e,n){t.AMT_MessageLog_PositionToFirstRecord(u,[e,n,[]])};"Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var S="Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split("|"),A="Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|User-initiated system setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split("|"),_="Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split("|");function l(e,n,i,o){return 15==e?235==i[0]?"Invalid Data":0==n?S[i[1]]:A[i[1]]:18==e&&170==i[0]?"Agent watchdog "+char2hex(i[4])+char2hex(i[3])+char2hex(i[2])+char2hex(i[1])+"-"+char2hex(i[6])+char2hex(i[5])+"-... changed to "+t.WatchdogCurrentStates[i[7]]:6==e?"Authentication failed "+(i[1]+(i[2]<<8))+" times. The system may be under attack.":30==e?"No bootable media":32==e?"Operating system lockup or power interrupt":35==e?64==i[0]?"BIOS POST (Power On Self-Test) Watchdog Timeout.":"System boot failure":37==e?"System firmware started (at least one CPU is properly executing).":"Unknown Sensor Type #"+e}t.RealmNames="||Redirection|PT Administration|Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split("|"),t.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var E={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",20:"Security Audit Log",21:"Network Time",22:"Network Administration",23:"Storage Administration",24:"Event Manager",25:"Circuit Breaker Manager",26:"Agent Presence Manager",27:"Wireless Configuration",28:"EAC",29:"KVM",30:"User Opt-In Events",32:"Screen Blanking",33:"Watchdog Events",1600:"Provisioning Started",1601:"Provisioning Completed",1602:"ACL Entry Added",1603:"ACL Entry Modified",1604:"ACL Entry Removed",1605:"ACL Access with Invalid Credentials",1606:"ACL Entry State",1607:"TLS State Changed",1608:"TLS Server Certificate Set",1609:"TLS Server Certificate Remove",1610:"TLS Trusted Root Certificate Added",1611:"TLS Trusted Root Certificate Removed",1612:"TLS Preshared Key Set",1613:"Kerberos Settings Modified",1614:"Kerberos Main Key Modified",1615:"Flash Wear out Counters Reset",1616:"Power Package Modified",1617:"Set Realm Authentication Mode",1618:"Upgrade Client to Admin Control Mode",1619:"Unprovisioning Started",1700:"Performed Power Up",1701:"Performed Power Down",1702:"Performed Power Cycle",1703:"Performed Reset",1704:"Set Boot Options",1800:"IDER Session Opened",1801:"IDER Session Closed",1802:"IDER Enabled",1803:"IDER Disabled",1804:"SoL Session Opened",1805:"SoL Session Closed",1806:"SoL Enabled",1807:"SoL Disabled",1808:"KVM Session Started",1809:"KVM Session Ended",1810:"KVM Enabled",1811:"KVM Disabled",1812:"VNC Password Failed 3 Times",1900:"Firmware Updated",1901:"Firmware Update Failed",2e3:"Security Audit Log Cleared",2001:"Security Audit Policy Modified",2002:"Security Audit Log Disabled",2003:"Security Audit Log Enabled",2004:"Security Audit Log Exported",2005:"Security Audit Log Recovered",2100:"Intel® ME Time Set",2200:"TCPIP Parameters Set",2201:"Host Name Set",2202:"Domain Name Set",2203:"VLAN Parameters Set",2204:"Link Policy Set",2205:"IPv6 Parameters Set",2300:"Global Storage Attributes Set",2301:"Storage EACL Modified",2302:"Storage FPACL Modified",2303:"Storage Write Operation",2400:"Alert Subscribed",2401:"Alert Unsubscribed",2402:"Event Log Cleared",2403:"Event Log Frozen",2500:"CB Filter Added",2501:"CB Filter Removed",2502:"CB Policy Added",2503:"CB Policy Removed",2504:"CB Default Policy Set",2505:"CB Heuristics Option Set",2506:"CB Heuristics State Cleared",2600:"Agent Watchdog Added",2601:"Agent Watchdog Removed",2602:"Agent Watchdog Action Set",2700:"Wireless Profile Added",2701:"Wireless Profile Removed",2702:"Wireless Profile Updated",2800:"EAC Posture Signer SET",2801:"EAC Enabled",2802:"EAC Disabled",2803:"EAC Posture State",2804:"EAC Set Options",2900:"KVM Opt-in Enabled",2901:"KVM Opt-in Disabled",2902:"KVM Password Changed",2903:"KVM Consent Succeeded",2904:"KVM Consent Failed",3e3:"Opt-In Policy Change",3001:"Send Consent Code Event",3002:"Start Opt-In Blocked Event"};function C(e,n,i,o,r){if(200==o){var c,a,s,u,d,S=r[1],A=new Date;if(i.Body.RecordsReturned>0)for(a in i.Body.EventRecords=MakeToArray(i.Body.EventRecords),i.Body.EventRecords){s=null;try{s=window.atob(i.Body.EventRecords[a])}catch(s){console.log(s+" "+i.Body.EventRecords[a])}if((u={AuditAppID:ReadShort(s,0),EventID:ReadShort(s,2),InitiatorType:s.charCodeAt(4)}).AuditApp=E[u.AuditAppID],u.Event=E[100*u.AuditAppID+u.EventID],u.Event||(u.Event="#"+u.EventID),0==u.InitiatorType){var _=s.charCodeAt(5);u.Initiator=s.substring(6,6+_),c=6+_}if(1==u.InitiatorType){u.KerberosUserInDomain=ReadInt(s,5);_=s.charCodeAt(9);u.Initiator=GetSidString(s.substring(10,10+_)),c=10+_}2==u.InitiatorType&&(u.Initiator="<i>Local</i>",c=5),3==u.InitiatorType&&(u.Initiator="<i>KVM Default Port</i>",c=5),d=ReadInt(s,c),u.Time=new Date(1e3*(d+60*A.getTimezoneOffset())),c+=4,u.MCLocationType=s.charCodeAt(c++);var l=s.charCodeAt(c++);u.NetAddress=s.substring(c,c+l),c+=l;var m=s.charCodeAt(c++);u.Ex=s.substring(c,c+m),u.ExStr=t.GetAuditLogExtendedDataStr(100*u.AuditAppID+u.EventID,u.Ex),S.push(u)}i.Body.TotalRecordCount>S.length?t.AMT_AuditLog_ReadRecords(S.length+1,C,[r[0],S]):r[0](t,S,o)}else r[0](t,[],o)}return t.GetAuditLogExtendedDataStr=function(e,n){if((1602==e||1604==e)&&0==n.charCodeAt(0))return n.substring(2,2+n.charCodeAt(1));if(1603==e)return 0==n.charCodeAt(1)?n.substring(3):null;if(1605==e)return["Invalid ME access","Invalid MEBx access"][n.charCodeAt(0)];if(1606==e){var i=["Disabled","Enabled"][n.charCodeAt(0)];return 0==n.charCodeAt(1)&&(i+=", "+n.substring(3)),i}if(1607==e)return"Remote "+["NoAuth","ServerAuth","MutualAuth"][n.charCodeAt(0)]+", Local "+["NoAuth","ServerAuth","MutualAuth"][n.charCodeAt(1)];if(1617==e)return t.RealmNames[ReadInt(n,0)]+", "+["NoAuth","Auth","Disabled"][n.charCodeAt(4)];if(1619==e)return["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][n.charCodeAt(0)];if(1900==e)return"From "+ReadShort(n,0)+"."+ReadShort(n,2)+"."+ReadShort(n,4)+"."+ReadShort(n,6)+" to "+ReadShort(n,8)+"."+ReadShort(n,10)+"."+ReadShort(n,12)+"."+ReadShort(n,14);if(2100==e){var o=new Date;return o.setTime(1e3*ReadInt(n,0)+6e4*(new Date).getTimezoneOffset()),o.toLocaleString()}return 3e3==e?"From "+["None","KVM","All"][n.charCodeAt(0)]+" to "+["None","KVM","All"][n.charCodeAt(1)]:3001==e?["Success","Failed 3 times"][n.charCodeAt(0)]:null},t.GetAuditLog=function(e){t.AMT_AuditLog_ReadRecords(1,C,[e,[]])},t}function hex_md5(e){return null==e&&(e=""),forge.md.md5.create().update(e).digest().toHex()}for(var md5_k=[],i=0;i<64;)md5_k[i]=0|4294967296*Math.abs(Math.sin(++i));function hex_md5(e){null==e&&(e="");for(var t,n,i,o,r=[],c=unescape(encodeURI(e)),a=c.length,s=[t=1732584193,n=-271733879,~t,~n],u=0;u<=a;)r[u>>2]|=(c.charCodeAt(u)||128)<<u++%4*8;for(r[e=16*(a+8>>6)+14]=8*a,u=0;u<e;u+=16){for(a=s,o=0;o<64;)a=[i=a[3],(t=0|a[1])+((i=a[0]+[t&(n=a[2])|~t&i,i&t|~i&n,t^n^i,n^(t|~i)][a=o>>4]+(md5_k[o]+(0|r[[o,5*o+1,3*o+5,7*o][a]%16+u])))<<(a=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*a+o++%4])|i>>>32-a),t,n];for(o=4;o;)s[--o]=s[o]+a[o]}for(e="";o<32;)e+=(s[o>>3]>>4*(1^7&o++)&15).toString(16);return e}function rstr_md5(e){return hex2rstr(hex_md5(e))}function execArgumentsToXml(e){if(null==e)return null;var t="";for(var n in e){var i=e[n];i&&("reference"===i.__parameterType?t+=referenceToXml(n,i):t+=instanceToXml(n,i))}return t}function instanceToXml(e,t){if(null==t)return null;var n=!!t.__namespace,i=n?"<q:":"<",o=n?"</q:":"</",r="<r:"+e+(n?' xmlns:q="'+t.__namespace+'"':"")+">";if("string"==typeof t)r+=t;else for(var c in t)t.hasOwnProperty(c)&&0!==c.indexOf("__")&&("function"==typeof t[c]||Array.isArray(t[c])||("object"==typeof t[c]?console.error("only convert one level down..."):r+=i+c+">"+t[c].toString()+o+c+">"));return r+="</r:"+e+">"}function referenceToXml(e,t){if(null==t)return null;var n="<r:"+e+"><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>"+t.__resourceUri+"</w:ResourceURI><w:SelectorSet>";for(var i in t)t.hasOwnProperty(i)&&0!==i.indexOf("__")&&("function"==typeof t[i]||"object"==typeof t[i]||Array.isArray(t[i])||(n+='<w:Selector Name="'+i+'">'+t[i].toString()+"</w:Selector>"));return n+="</w:SelectorSet></a:ReferenceParameters></r:"+e+">"}function GetSidString(e){for(var t="S-"+e.charCodeAt(0)+"-"+e.charCodeAt(7),n=2;n<e.length/4;n++)t+="-"+ReadIntX(e,4*n);return t}function GetSidByteArray(e){if(!e||null==e)return null;var t=e.split("-");if(t.length<4||"s"!=t[0]&&"S"!=t[0])return null;for(var n=1;n<t.length;n++){var i=parseInt(t[n]);if(i!=t[n])return null;t[n]=i}var o=String.fromCharCode(t[1])+String.fromCharCode(t.length-3)+ShortToStr(Math.floor(t[2]/Math.pow(2,32)))+IntToStr(65535&t[2]);for(n=3;n<t.length;n++)o+=IntToStrX(t[n]);return o}
\ No newline at end of file
public/scripts/amt-desktop-0.0.2-min.js
+1
-1
@@ -1 +1 @@
1
-var CreateAmtRemoteDesktop=function(e,t){var S={};function g(e){return String.fromCharCode.apply(null,e)}function p(e,t,a,n,r,o,i){var s,c,h,d,l=e[t++],v={},u=0,m=0;if(0==l){if(2==S.bpp)for(d=0;d<i;d++)y(e[t++]+(e[t++]<<8),d);else for(d=0;d<i;d++)C(e[t++],d);w(S.spare,a,n)}else if(1==l){S.graymode?(c=e[t++],S.lowcolor&&(c<<=4),S.canvas.fillStyle="rgb("+c+","+c+","+c+")"):(c=e[t++]+(2==S.bpp?e[t++]<<8:0),S.canvas.fillStyle="rgb("+(1==S.bpp?(224&c)+","+((28&c)<<3)+","+T((3&c)<<6):(c>>8&248)+","+(c>>3&252)+","+((31&c)<<3))+")");var f=k(a);n=x(0,n),S.canvas.fillRect(a=f,n,r,o)}else if(1<l&&l<17){var g=4,p=15;if(2==S.bpp){for(d=0;d<l;d++)v[d]=e[t++]+(e[t++]<<8);for(2==l?p=g=1:l<=4&&(g=2,p=3);u<i&&t<e.byteLength;)for(c=e[t++],d=8-g;0<=d;d-=g)y(v[c>>d&p],u++)}else{for(d=0;d<l;d++)v[d]=e[t++];for(2==l?p=g=1:l<=4&&(g=2,p=3);u<i&&t<e.byteLength;)for(c=e[t++],d=8-g;0<=d;d-=g)C(v[c>>d&p],u++)}w(S.spare,a,n)}else if(128==l){if(2==S.bpp)for(;u<i&&t<e.byteLength;){for(c=e[t++]+(e[t++]<<8),m=1;m+=h=e[t++],255==h;);if(0==S.rotation)D(c,u,m),u+=m;else for(;0<=--m;)y(c,u++)}else for(;u<i&&t<e.byteLength;){for(c=e[t++],m=1;m+=h=e[t++],255==h;);if(0==S.rotation)b(c,u,m),u+=m;else for(;0<=--m;)C(c,u++)}w(S.spare,a,n)}else if(129<l){if(2==S.bpp)for(d=0;d<l-128;d++)v[d]=e[t++]+(e[t++]<<8);else for(d=0;d<l-128;d++)v[d]=e[t++];for(;u<i&&t<e.byteLength;){if(m=1,c=v[(s=e[t++])%128],127<s)for(;m+=h=e[t++],255==h;);if(0==S.rotation)(2==S.bpp?D:b)(c,u,m),u+=m;else if(2==S.bpp)for(;0<=--m;)y(c,u++);else for(;0<=--m;)C(c,u++)}w(S.spare,a,n)}}function w(e,t,a){var n,r,o;1!=S.holding&&(n=t,r=a,n=0==S.rotation?n:1==S.rotation?S.canvas.canvas.width-S.sparew2-r:2==S.rotation?S.canvas.canvas.width-S.sparew2-n:3==S.rotation?r:0,r=t,o=a,a=0==S.rotation?o:1==S.rotation?r:2==S.rotation?S.canvas.canvas.height-S.spareh2-o:3==S.rotation?S.canvas.canvas.height-S.spareh-r:0,S.canvas.putImageData(e,t=n,a))}function C(e,t){var a,n,r=t<<2;0<S.rotation&&(1==S.rotation?(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=a*S.sparew2+(S.sparew2-1-n))<<2):2==S.rotation?r=S.sparew*S.spareh*4-4-r:3==S.rotation&&(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=(S.sparew2-1-a)*S.sparew2+n)<<2)),S.graymode?(S.lowcolor&&(e<<=4),S.spare.data[r]=S.spare.data[r+1]=S.spare.data[r+2]=e):(S.spare.data[r]=224&e,S.spare.data[r+1]=(28&e)<<3,S.spare.data[r+2]=T((3&e)<<6))}function y(e,t){var a,n,r=t<<2;0<S.rotation&&(1==S.rotation?(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=a*S.sparew2+(S.sparew2-1-n))<<2):2==S.rotation?r=S.sparew*S.spareh*4-4-r:3==S.rotation&&(a=t%S.sparew,n=Math.floor(t/S.sparew),r=(t=(S.sparew2-1-a)*S.sparew2+n)<<2)),S.spare.data[r]=e>>8&248,S.spare.data[r+1]=e>>3&252,S.spare.data[r+2]=(31&e)<<3}function b(e,t,a){if(S.graymode){var n=t<<2;for(S.lowcolor&&(e<<=4);0<=--a;)S.spare.data[n]=S.spare.data[n+1]=S.spare.data[n+2]=e,n+=4}else for(var n=t<<2,r=224&e,o=(28&e)<<3,i=T((3&e)<<6);0<=--a;)S.spare.data[n]=r,S.spare.data[n+1]=o,S.spare.data[n+2]=i,n+=4}function D(e,t,a){for(var n=t<<2,r=e>>8&248,o=e>>3&252,i=(31&e)<<3;0<=--a;)S.spare.data[n]=r,S.spare.data[n+1]=o,S.spare.data[n+2]=i,n+=4}function k(e){return 0==S.rotation||1==S.rotation?e:2==S.rotation?e-S.canvas.canvas.width:3==S.rotation?e-S.canvas.canvas.height:0}function x(e,t){return 0==S.rotation?t:1==S.rotation?t-S.canvas.canvas.width:2==S.rotation?t-S.canvas.canvas.height:3==S.rotation?t:0}function T(e){return 127<e?e+32:e}function K(){var e;1!=S.holding&&(0<S.focusmode?(e=2*S.focusmode,S.send(String.fromCharCode(3,1)+ShortToStr(Math.max(Math.min(S.ox,S.mx)-S.focusmode,0))+ShortToStr(Math.max(Math.min(S.oy,S.my)-S.focusmode,0))+ShortToStr(e+Math.abs(S.ox-S.mx))+ShortToStr(e+Math.abs(S.oy-S.my))),S.ox=S.mx,S.oy=S.my):S.send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(S.rwidth)+ShortToStr(S.rheight)))}S.canvasid=e,S.CanvasId=Q(e),S.scrolldiv=t,S.canvas=Q(e).getContext("2d"),S.protocol=2,S.state=0,S.acc=null,S.ScreenWidth=960,S.ScreenHeight=700,S.width=0,S.height=0,S.rwidth=0,S.rheight=0,S.bpp=2,S.useRLE=!0,S.showmouse=!0,S.buttonmask=0,S.localKeyMap=!0,S.spare=null,S.sparew=0,S.spareh=0,S.sparew2=0,S.spareh2=0,S.sparecache={},S.onScreenSizeChange=null,S.frameRateDelay=0,S.noMouseRotate=!1,S.rotation=0,S.kvmDataSupported=!1,S.onKvmData=null,S.onKvmDataPending=[],S.onKvmDataAck=-1,S.holding=!1,S.lastKeepAlive=Date.now(),S.kvmExt={},S.kvmExtChanged=null,S.useZLib=!1,S.decimationMode=0,S.graymode=!1,S.lowcolor=!1,S.mNagleTimer=null,S.mx=0,S.my=0,S.ox=-1,S.oy=-1,S.focusmode=0,S.inflate=ZLIB.inflateInit(-15),S.xxStateChange=function(e){0==e?(S.canvas.fillStyle="#000000",S.canvas.fillRect(0,0,S.width,S.height),S.canvas.canvas.width=S.rwidth=S.width=640,S.canvas.canvas.height=S.rheight=S.height=400,QS(S.canvasid).cursor="default"):QS(S.canvasid).cursor=S.showmouse?"default":"none"},S.ProcessBinaryData=function(e){var t;for(null!=S.recordedData&&!0!==S.recordedHolding&&S.recordedData.push(I(2,1,String.fromCharCode.apply(null,new Uint8Array(e)))),null==S.acc?S.acc=new Uint8Array(e):((t=new Uint8Array(S.acc.byteLength+e.byteLength)).set(S.acc,0),t.set(new Uint8Array(e),S.acc.byteLength),S.acc=t);null!=S.acc&&0<S.acc.byteLength;){var a=0,n=new DataView(S.acc.buffer);if(0==S.state&&12<=S.acc.byteLength)a=12,S.state=1,S.parent&&delete S.parent.connectTime,S.send("RFB 003.008\n");else if(1==S.state&&1<=S.acc.byteLength)a=S.acc[0]+1,S.send(String.fromCharCode(1)),S.state=2;else if(2==S.state&&4<=S.acc.byteLength){if(a=4,0!=n.getUint32(0))return S.Stop();S.send(String.fromCharCode(1)),S.state=3,S.parent&&(S.parent.disconnectCode=5e4)}else if(3==S.state&&24<=S.acc.byteLength){S.rotation=0;var r=n.getUint32(20);if(S.acc.byteLength<24+r)return;a=24+r,S.canvas.canvas.width=S.rwidth=S.width=S.ScreenWidth=n.getUint16(0),S.canvas.canvas.height=S.rheight=S.height=S.ScreenHeight=n.getUint16(2),S.DeskRecordServerInit=String.fromCharCode.apply(null,new Uint8Array(S.acc.buffer.slice(0,24+r)));r="";S.useRLE&&(r+=IntToStr(16)),r=(r+=IntToStr(0))+IntToStr(1092),S.send(String.fromCharCode(2,0)+ShortToStr(r.length/4+1)+r+IntToStr(-223)),0==S.graymode?1==S.bpp&&S.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(7)+ShortToStr(7)+ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0)):(2==S.bpp&&(S.bpp=1),0==S.lowcolor?S.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(255)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)):S.send(String.fromCharCode(0,0,0,0,8,4,0,1)+ShortToStr(15)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0))),S.state=4,S.parent&&(S.parent.connectTime=Date.now(),S.parent.disconnectCode=0,S.parent.xxStateChange(3)),S.ox=-1,null!=S.kvmExtChanged&&(0<S.decimationMode&&S.sendKvmExtCmd(2,S.decimationMode),S.sendKvmExtCmd(4,!0===S.useZLib?1:0)),K(),null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight),S.parent&&(S.parent.disconnectCode=50001,9216e3<S.bpp*S.width*S.height)&&(S.parent.disconnectCode=50002)}else if(4==S.state)switch(S.acc[0]){case 0:if(S.acc.byteLength<4)return;S.state=100+n.getUint16(2),a=4,!0===S.recordedHolding&&(delete S.recordedHolding,S.recordedData.push(I(2,1,String.fromCharCode.apply(null,S.acc))));break;case 2:a=1;break;case 3:if(S.acc.byteLength<8)return;var o=n.getUint32(4)+8;if(S.acc.byteLength<o)return;a=((e,t)=>{if(e.byteLength<8)return 0;if(t=t.getUint32(4)+8,e.byteLength<t)return 0;if(null!=S.onKvmData){e=g(new Uint8Array(e.buffer.slice(8,t)));if(16<=e.length&&"\0KvmDataChannel"==e.substring(0,15)){0==S.kvmDataSupported&&(S.kvmDataSupported=!0),(-1==S.onKvmDataAck&&16==e.length||0!=e.charCodeAt(15))&&(S.onKvmDataAck=!0);try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-DataChannel-Recv("+(e.length-16)+"): "+e.substring(16))}catch(e){}16<=e.length&&S.onKvmData(e.substring(16)),1==S.onKvmDataAck&&0<S.onKvmDataPending.length&&S.sendKvmData(S.onKvmDataPending.shift())}else if(13<=e.length&&"\0KvmExtCmd\0"==e.substring(0,11)){var a=e.charCodeAt(11),n=e.charCodeAt(12);1==a&&(S.kvmExt.decimationMode=n,13<e.length&&(S.kvmExt.decimationState=e.charCodeAt(13)),null!=S.kvmExtChanged)&&S.kvmExtChanged(1,S.kvmExt,S.kvmExt),2==a&&S.sendKvmExtCmd(1),3==a&&(S.kvmExt.compression=n,null!=S.kvmExtChanged)&&S.kvmExtChanged(3,S.kvmExt),4==a&&S.sendKvmExtCmd(3)}else{console.log("Got KVM clipboard data:",e);try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-ClipBoard-Recv("+e.length+"): "+rstr2hex(e)+", "+e)}catch(e){}}}return t})(S.acc,n)}else if(100<S.state&&12<=S.acc.byteLength){var r=n.getUint16(0),i=n.getUint16(2),s=n.getUint16(4),c=n.getUint16(6),h=s*c,d=n.getUint32(8);if(d<17){if(s<1||64<s||c<1||64<c)return console.log("Invalid tile size ("+s+","+c+"), disconnecting."),S.Stop();if(S.sparew!=s||S.spareh!=c){S.sparew=S.sparew2=s,S.spareh=S.spareh2=c,1!=S.rotation&&3!=S.rotation||(S.sparew2=c,S.spareh2=s);var l=S.sparew2+"x"+S.spareh2;if(S.spare=S.sparecache[l],!S.spare){S.sparecache[l]=S.spare=S.canvas.createImageData(S.sparew2,S.spareh2);for(var v=S.sparew2*S.spareh2<<2,u=3;u<v;u+=4)S.spare.data[u]=255}}}if(4294967073==d)S.canvas.canvas.width=S.rwidth=S.width=s,S.canvas.canvas.height=S.rheight=S.height=c,S.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(S.width)+ShortToStr(S.height)),a=12,null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight),S.parent&&9216e3<S.bpp*S.width*S.height&&(S.parent.disconnectCode=50002);else if(0==d){var m=12,l=12+h*S.bpp;if(S.acc.byteLength<l)return;if(a=l,2==S.bpp)for(u=0;u<h;u++)y(n.getUint16(m,!0),u),m+=2;else for(u=0;u<h;u++)C(S.acc[m++],u);w(S.spare,r,i)}else{if(16!=d)return S.Stop();if(S.acc.byteLength<16)return;d=n.getUint32(12);if(S.acc.byteLength<16+d)return;var f,m=16;5<d&&0==S.acc[m]&&n.getUint16(m+1,!0)==d-5?p(S.acc,m+5,r,i,s,c,h):0<(f=S.inflate.inflate(g(new Uint8Array(S.acc.buffer.slice(m,+(m+d)))))).length?p((e=>{for(var t=new Uint8Array(e.length),a=0,n=e.length;a<n;++a)t[a]=e.charCodeAt(a);return t})(f),0,r,i,s,c,h,f.length):console.log("Invalid deflate data"),a=16+d}100==--S.state&&(S.state=4,0==S.frameRateDelay?K():setTimeout(K,S.frameRateDelay))}if(0==a)return;a!=S.acc.byteLength?S.acc=new Uint8Array(S.acc.buffer.slice(a)):S.acc=null}},S.hold=function(e){S.holding!=e&&(S.holding=e,S.canvas.fillStyle="#000000",S.canvas.fillRect(0,0,S.width,S.height),0==S.holding?(S.canvas.canvas.width==S.width&&S.canvas.canvas.height==S.height||(S.canvas.canvas.width=S.width,S.canvas.canvas.height=S.height,null!=S.onScreenSizeChange&&S.onScreenSizeChange(S,S.ScreenWidth,S.ScreenHeight)),S.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(S.width)+ShortToStr(S.height))):(S.UnGrabMouseInput(),S.UnGrabKeyInput()))},S.tcanvas=null,S.setRotation=function(e){for(;e<0;)e+=4;var t,a,n,r=e%4;if(1!=S.holding)return r!=S.rotation&&(t=S.canvas.canvas.width,a=S.canvas.canvas.height,1!=S.rotation&&3!=S.rotation||(t=S.canvas.canvas.height,a=S.canvas.canvas.width),null==S.tcanvas&&(S.tcanvas=document.createElement("canvas")),(n=S.tcanvas.getContext("2d")).setTransform(1,0,0,1,0,0),n.canvas.width=t,n.canvas.height=a,n.rotate(-90*S.rotation*Math.PI/180),0==S.rotation&&n.drawImage(S.canvas.canvas,0,0),1==S.rotation&&n.drawImage(S.canvas.canvas,-S.canvas.canvas.width,0),2==S.rotation&&n.drawImage(S.canvas.canvas,-S.canvas.canvas.width,-S.canvas.canvas.height),3==S.rotation&&n.drawImage(S.canvas.canvas,0,-S.canvas.canvas.height),0!=S.rotation&&2!=S.rotation||(S.canvas.canvas.height=t,S.canvas.canvas.width=a),1!=S.rotation&&3!=S.rotation||(S.canvas.canvas.height=a,S.canvas.canvas.width=t),S.canvas.setTransform(1,0,0,1,0,0),S.canvas.rotate(90*r*Math.PI/180),S.rotation=r,S.canvas.drawImage(S.tcanvas,k(0),x(0,0)),S.width=S.canvas.canvas.width,S.height=S.canvas.canvas.height,null!=S.onScreenResize)&&S.onScreenResize(S,S.width,S.height,S.CanvasId),!0;S.rotation=r},S.Start=function(){for(var e in S.state=0,S.acc=null,S.inflate.inflateReset(),S.onKvmDataPending=[],S.onKvmDataAck=-1,S.kvmDataSupported=!1,S.kvmExt={},S.sparecache)delete S.sparecache[e]},S.Stop=function(){S.UnGrabMouseInput(),S.UnGrabKeyInput(),S.parent&&S.parent.Stop()},S.send=function(e){S.parent&&S.parent.send(e)};var r={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,MetaRight:65512};function a(e,t){var a,n;return(t=t||window.event).code&&0==S.localKeyMap?null!=(n=(n=t).code.startsWith("Key")&&4==n.code.length?n.code.charCodeAt(3)+(0==n.shiftKey?32:0):n.code.startsWith("Digit")&&6==n.code.length?n.code.charCodeAt(5):n.code.startsWith("Numpad")&&7==n.code.length?n.code.charCodeAt(6):r[n.code])&&S.sendkey(n,e):(a=n=t.keyCode,0==t.shiftKey&&65<=n&&n<=90&&(a=n+32),112<=n&&n<=124&&(a=n+65358),8==n&&(a=65288),9==n&&(a=65289),13==n&&(a=65293),16==n&&(a=65505),17==n&&(a=65507),18==n&&(a=65513),27==n&&(a=65307),33==n&&(a=65365),34==n&&(a=65366),35==n&&(a=65367),36==n&&(a=65360),37==n&&(a=65361),38==n&&(a=65362),39==n&&(a=65363),40==n&&(a=65364),45==n&&(a=65379),46==n&&(a=65535),96<=n&&n<=105&&(a=n-48),106==n&&(a=42),107==n&&(a=43),109==n&&(a=45),110==n&&(a=46),111==n&&(a=47),186==n&&(a=59),187==n&&(a=61),188==n&&(a=44),189==n&&(a=45),190==n&&(a=46),191==n&&(a=47),192==n&&(a=96),219==n&&(a=91),220==n&&(a=92),221==n&&(a=93),S.sendkey(a=222==n?39:a,e)),S.haltEvent(t)}S.sendkey=function(e,t){if("object"==typeof e){var a,n="";for(a in e)n+=String.fromCharCode(4,e[a][1],0,0)+IntToStr(e[a][0]);S.send(n)}else S.send(String.fromCharCode(4,t,0,0)+IntToStr(e))},S.sendKvmExtCmd=function(e,t){e="\0KvmExtCmd\0"+String.fromCharCode(e)+(null!=t?String.fromCharCode(t):"");S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e)},S.sendKvmData=function(e){if(!0!==S.onKvmDataAck)S.onKvmDataPending.push(e);else{try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-DataChannel-Send("+e.length+"): "+e)}catch(e){}e="\0KvmDataChannel\0"+e,S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e),S.onKvmDataAck=!1}},S.sendKeepAlive=function(){S.lastKeepAlive<Date.now()-5e3&&(S.lastKeepAlive=Date.now(),S.send(String.fromCharCode(6,0,0,0)+IntToStr(16)+"\0KvmDataChannel\0"))},S.sendClipboardData=function(e){try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-ClipBoard-Send("+e.length+"): "+rstr2hex(e)+", "+e)}catch(e){}S.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e)},S.SendCtrlAltDelMsg=function(){S.sendcad()};var n=!(S.sendcad=function(){S.sendkey([[65507,1],[65513,1],[65535,1],[65535,0],[65513,0],[65507,0]])}),o=!1;function I(e,t,a){var n=Date.now();return"number"==typeof a?(S.recordedSize+=a,ShortToStr(e)+ShortToStr(t)+IntToStr(a)+IntToStr(n>>32)+IntToStr(32&n)):(S.recordedSize+=a.length,ShortToStr(e)+ShortToStr(t)+IntToStr(a.length)+IntToStr(n>>32)+IntToStr(32&n)+a)}return S.GrabMouseInput=function(){var e;1!=n&&((e=S.canvas.canvas).onmouseup=S.mouseup,e.onmousedown=S.mousedown,e.onmousemove=S.mousemove,e.onwheel=S.mousewheel,n=!0)},S.UnGrabMouseInput=function(){var e;0!=n&&((e=S.canvas.canvas).onmousemove=null,e.onmouseup=null,e.onmousedown=null,e.onwheel=null,n=!1)},S.GrabKeyInput=function(){1!=o&&(document.onkeyup=S.handleKeyUp,document.onkeydown=S.handleKeyDown,document.onkeypress=S.handleKeys,o=!0)},S.UnGrabKeyInput=function(){0!=o&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,o=!1)},S.handleKeys=function(e){return S.haltEvent(e)},S.handleKeyUp=function(e){return a(0,e)},S.handleKeyDown=function(e){return a(1,e)},S.haltEvent=function(e){return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1},S.mousedblclick=function(e){},S.mousewheel=function(e){var t,a=0;if("number"==typeof e.deltaY?a=-1*e.deltaY:"number"==typeof e.detail?a=-1*e.detail:"number"==typeof e.wheelDelta&&(a=e.wheelDelta),0!=a)return S.ReverseMouseWheel&&(a*=-1),t=S.buttonmask,S.buttonmask|=1<<(0<a?3:4),S.mousemove(e,1),S.buttonmask=t,S.mousemove(e,1)},S.mousedown=function(e){return S.buttonmask|=1<<e.button,S.mousemove(e,1)},S.mouseup=function(e){return S.buttonmask&=65535-(1<<e.button),S.mousemove(e,1)},S.mousemove=function(e,t){var a,n,r,o,i,s;return S.state<4||(r=S.canvas.canvas.height/Q(S.canvasid).offsetHeight,n=S.canvas.canvas.width/Q(S.canvasid).offsetWidth,a=S.getPositionOfControl(Q(S.canvasid)),S.mx=(event.pageX-a[0])*n,S.my=(event.pageY-a[1])*r,event.addx&&(S.mx+=event.addx),event.addy&&(S.my+=event.addy),1!=S.rotation&&3!=S.rotation||(S.mx=S.mx*S.rwidth/S.width,S.my=S.my*S.rheight/S.height),1!=S.noMouseRotate&&(n=S.mx,a=S.my,r=0==S.rotation?n:1==S.rotation?a:2==S.rotation?S.canvas.canvas.width-n:3==S.rotation?S.canvas.canvas.height-a:0,S.my=(n=S.mx,a=S.my,0==S.rotation?a:1==S.rotation?S.canvas.canvas.width-n:2==S.rotation?S.canvas.canvas.height-a:3==S.rotation?n:0),S.mx=r),1==t?(S.send(String.fromCharCode(5,S.buttonmask)+ShortToStr(S.mx)+ShortToStr(S.my)),null!=S.mNagleTimer&&(clearTimeout(S.mNagleTimer),S.mNagleTimer=null)):null==S.mNagleTimer&&(S.mNagleTimer=setTimeout(function(){S.send(String.fromCharCode(5,S.buttonmask)+ShortToStr(S.mx)+ShortToStr(S.my)),S.mNagleTimer=null},50)),QV("DeskFocus",S.focusmode),0!=S.focusmode&&(a=Math.min(S.mx,S.canvas.canvas.width-S.focusmode),n=Math.min(S.my,S.canvas.canvas.height-S.focusmode),r=2*S.focusmode,o=(t=Q(S.canvasid)).offsetHeight/S.canvas.canvas.height,t=t.offsetWidth/S.canvas.canvas.width,i=QS("DeskFocus"),s=S.getPositionOfControl(Q(S.canvasid).parentElement),i.left=Math.max((a-S.focusmode)*o,0)+(pos[0]-s[0])+"px",i.top=Math.max((n-S.focusmode)*t,0)+(pos[1]-s[1])+"px",i.width=r*o-6+"px",i.height=r*o-6+"px"),S.haltEvent(e))},S.getPositionOfControl=function(e){var t=Array(2);for(t[0]=t[1]=0;e;)t[0]+=e.offsetLeft,t[1]+=e.offsetTop,e=e.offsetParent;return t},S.StartRecording=function(){return(null==S.recordedData||null==S.DeskRecordServerInit)&&(S.recordedHolding=!0,S.recordedData=[],S.recordedStart=Date.now(),S.recordedSize=0,S.recordedData.push(I(1,0,JSON.stringify({magic:"MeshCentralRelaySession",ver:1,time:(new Date).toLocaleString(),protocol:102,bpp:S.bpp,graymode:S.graymode,lowcolor:S.lowcolor,screenSize:[S.width,S.height]}))),S.DeskRecordServerInit=String.fromCharCode(S.width>>8,255&S.width,S.height>>8,255&S.height)+S.DeskRecordServerInit.substring(4),S.recordedData.push(I(2,1,S.DeskRecordServerInit)),S.recordedData.push(I(3,0,atob(S.CanvasId.toDataURL("image/png").split(",")[1]))),!0)},S.StopRecording=function(){var e;if(null!=S.recordedData)return(e=S.recordedData).push(I(3,0,"MeshCentralMCREC")),delete S.recordedData,delete S.recordedStart,delete S.recordedSize,e},S}
\ No newline at end of file
1
+var CreateAmtRemoteDesktop=function(e,t){var a={};function n(e){return String.fromCharCode.apply(null,e)}function r(e){for(var t=new Uint8Array(e.length),a=0,n=e.length;a<n;++a)t[a]=e.charCodeAt(a);return t}function o(e,t,n,r,o,f,m,g){var p,S,w,C,y=e[t++],b={},D=0,k=0;if(0==y){if(2==a.bpp)for(C=0;C<m;C++)c(e[t++]+(e[t++]<<8),C);else for(C=0;C<m;C++)s(e[t++],C);i(a.spare,n,r)}else if(1==y){a.graymode?(S=e[t++],a.lowcolor&&(S<<=4),a.canvas.fillStyle="rgb("+S+","+S+","+S+")"):(S=e[t++]+(2==a.bpp?e[t++]<<8:0),a.canvas.fillStyle="rgb("+(1==a.bpp?(224&S)+","+((28&S)<<3)+","+u((3&S)<<6):(S>>8&248)+","+(S>>3&252)+","+((31&S)<<3))+")");var x=l(n,r);r=v(n,r),n=x,a.canvas.fillRect(n,r,o,f)}else if(y>1&&y<17){var T=4,K=15;if(2==a.bpp){for(C=0;C<y;C++)b[C]=e[t++]+(e[t++]<<8);for(2==y?(T=1,K=1):y<=4&&(T=2,K=3);D<m&&t<e.byteLength;)for(S=e[t++],C=8-T;C>=0;C-=T)c(b[S>>C&K],D++)}else{for(C=0;C<y;C++)b[C]=e[t++];for(2==y?(T=1,K=1):y<=4&&(T=2,K=3);D<m&&t<e.byteLength;)for(S=e[t++],C=8-T;C>=0;C-=T)s(b[S>>C&K],D++)}i(a.spare,n,r)}else if(128==y){if(2==a.bpp)for(;D<m&&t<e.byteLength;){S=e[t++]+(e[t++]<<8),k=1;do{k+=w=e[t++]}while(255==w);if(0==a.rotation)d(S,D,k),D+=k;else for(;--k>=0;)c(S,D++)}else for(;D<m&&t<e.byteLength;){S=e[t++],k=1;do{k+=w=e[t++]}while(255==w);if(0==a.rotation)h(S,D,k),D+=k;else for(;--k>=0;)s(S,D++)}i(a.spare,n,r)}else if(y>129){if(2==a.bpp)for(C=0;C<y-128;C++)b[C]=e[t++]+(e[t++]<<8);else for(C=0;C<y-128;C++)b[C]=e[t++];for(;D<m&&t<e.byteLength;){if(k=1,S=b[(p=e[t++])%128],p>127)do{k+=w=e[t++]}while(255==w);if(0==a.rotation)2==a.bpp?(d(S,D,k),D+=k):(h(S,D,k),D+=k);else if(2==a.bpp)for(;--k>=0;)c(S,D++);else for(;--k>=0;)s(S,D++)}i(a.spare,n,r)}}function i(e,t,n){if(1!=a.holding){var r=function(e,t){return 0==a.rotation?e:1==a.rotation?a.canvas.canvas.width-a.sparew2-t:2==a.rotation?a.canvas.canvas.width-a.sparew2-e:3==a.rotation?t:0}(t,n);n=function(e,t){return 0==a.rotation?t:1==a.rotation?e:2==a.rotation?a.canvas.canvas.height-a.spareh2-t:3==a.rotation?a.canvas.canvas.height-a.spareh-e:0}(t,n),t=r,a.canvas.putImageData(e,t,n)}}function s(e,t){var n=t<<2;if(a.rotation>0)if(1==a.rotation){var r=t%a.sparew,o=Math.floor(t/a.sparew);n=(t=r*a.sparew2+(a.sparew2-1-o))<<2}else if(2==a.rotation)n=a.sparew*a.spareh*4-4-n;else if(3==a.rotation){r=t%a.sparew,o=Math.floor(t/a.sparew);n=(t=(a.sparew2-1-r)*a.sparew2+o)<<2}a.graymode?(a.lowcolor&&(e<<=4),a.spare.data[n]=a.spare.data[n+1]=a.spare.data[n+2]=e):(a.spare.data[n]=224&e,a.spare.data[n+1]=(28&e)<<3,a.spare.data[n+2]=u((3&e)<<6))}function c(e,t){var n=t<<2;if(a.rotation>0)if(1==a.rotation){var r=t%a.sparew,o=Math.floor(t/a.sparew);n=(t=r*a.sparew2+(a.sparew2-1-o))<<2}else if(2==a.rotation)n=a.sparew*a.spareh*4-4-n;else if(3==a.rotation){r=t%a.sparew,o=Math.floor(t/a.sparew);n=(t=(a.sparew2-1-r)*a.sparew2+o)<<2}a.spare.data[n]=e>>8&248,a.spare.data[n+1]=e>>3&252,a.spare.data[n+2]=(31&e)<<3}function h(e,t,n){if(a.graymode){var r=t<<2;for(a.lowcolor&&(e<<=4);--n>=0;)a.spare.data[r]=a.spare.data[r+1]=a.spare.data[r+2]=e,r+=4}else{r=t<<2;for(var o=224&e,i=(28&e)<<3,s=u((3&e)<<6);--n>=0;)a.spare.data[r]=o,a.spare.data[r+1]=i,a.spare.data[r+2]=s,r+=4}}function d(e,t,n){for(var r=t<<2,o=e>>8&248,i=e>>3&252,s=(31&e)<<3;--n>=0;)a.spare.data[r]=o,a.spare.data[r+1]=i,a.spare.data[r+2]=s,r+=4}function l(e,t){return 0==a.rotation||1==a.rotation?e:2==a.rotation?e-a.canvas.canvas.width:3==a.rotation?e-a.canvas.canvas.height:0}function v(e,t){return 0==a.rotation?t:1==a.rotation?t-a.canvas.canvas.width:2==a.rotation?t-a.canvas.canvas.height:3==a.rotation?t:0}function u(e){return e>127?e+32:e}function f(){if(1!=a.holding)if(a.focusmode>0){var e=2*a.focusmode;a.send(String.fromCharCode(3,1)+ShortToStr(Math.max(Math.min(a.ox,a.mx)-a.focusmode,0))+ShortToStr(Math.max(Math.min(a.oy,a.my)-a.focusmode,0))+ShortToStr(e+Math.abs(a.ox-a.mx))+ShortToStr(e+Math.abs(a.oy-a.my))),a.ox=a.mx,a.oy=a.my}else a.send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(a.rwidth)+ShortToStr(a.rheight))}a.canvasid=e,a.CanvasId=Q(e),a.scrolldiv=t,a.canvas=Q(e).getContext("2d"),a.protocol=2,a.state=0,a.acc=null,a.ScreenWidth=960,a.ScreenHeight=700,a.width=0,a.height=0,a.rwidth=0,a.rheight=0,a.bpp=2,a.useRLE=!0,a.showmouse=!0,a.buttonmask=0,a.localKeyMap=!0,a.spare=null,a.sparew=0,a.spareh=0,a.sparew2=0,a.spareh2=0,a.sparecache={},a.onScreenSizeChange=null,a.frameRateDelay=0,a.noMouseRotate=!1,a.rotation=0,a.kvmDataSupported=!1,a.onKvmData=null,a.onKvmDataPending=[],a.onKvmDataAck=-1,a.holding=!1,a.lastKeepAlive=Date.now(),a.kvmExt={},a.kvmExtChanged=null,a.useZLib=!1,a.decimationMode=0,a.graymode=!1,a.lowcolor=!1,a.mNagleTimer=null,a.mx=0,a.my=0,a.ox=-1,a.oy=-1,a.focusmode=0,a.inflate=ZLIB.inflateInit(-15),a.xxStateChange=function(e){0==e?(a.canvas.fillStyle="#000000",a.canvas.fillRect(0,0,a.width,a.height),a.canvas.canvas.width=a.rwidth=a.width=640,a.canvas.canvas.height=a.rheight=a.height=400,QS(a.canvasid).cursor="default"):QS(a.canvasid).cursor=a.showmouse?"default":"none"},a.ProcessBinaryData=function(e){if(null!=a.recordedData&&!0!==a.recordedHolding&&a.recordedData.push(C(2,1,String.fromCharCode.apply(null,new Uint8Array(e)))),null==a.acc)a.acc=new Uint8Array(e);else{var t=new Uint8Array(a.acc.byteLength+e.byteLength);t.set(a.acc,0),t.set(new Uint8Array(e),a.acc.byteLength),a.acc=t}for(;null!=a.acc&&a.acc.byteLength>0;){var h=0,d=new DataView(a.acc.buffer);if(0==a.state&&a.acc.byteLength>=12)h=12,a.state=1,a.parent&&delete a.parent.connectTime,a.send("RFB 003.008\n");else if(1==a.state&&a.acc.byteLength>=1)h=a.acc[0]+1,a.send(String.fromCharCode(1)),a.state=2;else if(2==a.state&&a.acc.byteLength>=4){if(h=4,0!=d.getUint32(0))return a.Stop();a.send(String.fromCharCode(1)),a.state=3,a.parent&&(a.parent.disconnectCode=5e4)}else if(3==a.state&&a.acc.byteLength>=24){a.rotation=0;var l=d.getUint32(20);if(a.acc.byteLength<24+l)return;h=24+l,a.canvas.canvas.width=a.rwidth=a.width=a.ScreenWidth=d.getUint16(0),a.canvas.canvas.height=a.rheight=a.height=a.ScreenHeight=d.getUint16(2),a.DeskRecordServerInit=String.fromCharCode.apply(null,new Uint8Array(a.acc.buffer.slice(0,24+l)));var v="";a.useRLE&&(v+=IntToStr(16)),v+=IntToStr(0),v+=IntToStr(1092),a.send(String.fromCharCode(2,0)+ShortToStr(v.length/4+1)+v+IntToStr(-223)),0==a.graymode?1==a.bpp&&a.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(7)+ShortToStr(7)+ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0)):(2==a.bpp&&(a.bpp=1),0==a.lowcolor?a.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(255)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)):a.send(String.fromCharCode(0,0,0,0,8,4,0,1)+ShortToStr(15)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0))),a.state=4,a.parent&&(a.parent.connectTime=Date.now(),a.parent.disconnectCode=0,a.parent.xxStateChange(3)),a.ox=-1,null!=a.kvmExtChanged&&(a.decimationMode>0&&a.sendKvmExtCmd(2,a.decimationMode),a.sendKvmExtCmd(4,!0===a.useZLib?1:0)),f(),null!=a.onScreenSizeChange&&a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight),a.parent&&(a.parent.disconnectCode=50001,a.bpp*a.width*a.height>9216e3&&(a.parent.disconnectCode=50002))}else if(4==a.state)switch(a.acc[0]){case 0:if(a.acc.byteLength<4)return;a.state=100+d.getUint16(2),h=4,!0===a.recordedHolding&&(delete a.recordedHolding,a.recordedData.push(C(2,1,String.fromCharCode.apply(null,a.acc))));break;case 2:h=1;break;case 3:if(a.acc.byteLength<8)return;var u=d.getUint32(4)+8;if(a.acc.byteLength<u)return;h=p(a.acc,d)}else if(a.state>100&&a.acc.byteLength>=12){var m=d.getUint16(0),g=d.getUint16(2),S=d.getUint16(4),w=d.getUint16(6),y=S*w,b=d.getUint32(8);if(b<17){if(S<1||S>64||w<1||w>64)return console.log("Invalid tile size ("+S+","+w+"), disconnecting."),a.Stop();if(a.sparew!=S||a.spareh!=w){a.sparew=a.sparew2=S,a.spareh=a.spareh2=w,1!=a.rotation&&3!=a.rotation||(a.sparew2=w,a.spareh2=S);var D=a.sparew2+"x"+a.spareh2;if(a.spare=a.sparecache[D],!a.spare){a.sparecache[D]=a.spare=a.canvas.createImageData(a.sparew2,a.spareh2);for(var k=a.sparew2*a.spareh2<<2,x=3;x<k;x+=4)a.spare.data[x]=255}}}if(4294967073==b)a.canvas.canvas.width=a.rwidth=a.width=S,a.canvas.canvas.height=a.rheight=a.height=w,a.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(a.width)+ShortToStr(a.height)),h=12,null!=a.onScreenSizeChange&&a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight),a.parent&&a.bpp*a.width*a.height>9216e3&&(a.parent.disconnectCode=50002);else if(0==b){var T=12,K=12+y*a.bpp;if(a.acc.byteLength<K)return;if(h=K,2==a.bpp)for(x=0;x<y;x++)c(d.getUint16(T,!0),x),T+=2;else for(x=0;x<y;x++)s(a.acc[T++],x);i(a.spare,m,g)}else{if(16!=b)return a.Stop();if(a.acc.byteLength<16)return;var I=d.getUint32(12);if(a.acc.byteLength<16+I)return;T=16;if(I>5&&0==a.acc[T]&&d.getUint16(T+1,!0)==I-5)o(a.acc,T+5,m,g,S,w,y,I);else{var M=a.inflate.inflate(n(new Uint8Array(a.acc.buffer.slice(T,T+I-0))));M.length>0?o(r(M),0,m,g,S,w,y,M.length):console.log("Invalid deflate data")}h=16+I}100==--a.state&&(a.state=4,0==a.frameRateDelay?f():setTimeout(f,a.frameRateDelay))}if(0==h)return;h!=a.acc.byteLength?a.acc=new Uint8Array(a.acc.buffer.slice(h)):a.acc=null}},a.hold=function(e){a.holding!=e&&(a.holding=e,a.canvas.fillStyle="#000000",a.canvas.fillRect(0,0,a.width,a.height),0==a.holding?(a.canvas.canvas.width==a.width&&a.canvas.canvas.height==a.height||(a.canvas.canvas.width=a.width,a.canvas.canvas.height=a.height,null!=a.onScreenSizeChange&&a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight)),a.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(a.width)+ShortToStr(a.height))):(a.UnGrabMouseInput(),a.UnGrabKeyInput()))},a.tcanvas=null,a.setRotation=function(e){for(;e<0;)e+=4;var t=e%4;if(1!=a.holding){if(t==a.rotation)return!0;var n=a.canvas.canvas.width,r=a.canvas.canvas.height;1!=a.rotation&&3!=a.rotation||(n=a.canvas.canvas.height,r=a.canvas.canvas.width),null==a.tcanvas&&(a.tcanvas=document.createElement("canvas"));var o=a.tcanvas.getContext("2d");return o.setTransform(1,0,0,1,0,0),o.canvas.width=n,o.canvas.height=r,o.rotate(-90*a.rotation*Math.PI/180),0==a.rotation&&o.drawImage(a.canvas.canvas,0,0),1==a.rotation&&o.drawImage(a.canvas.canvas,-a.canvas.canvas.width,0),2==a.rotation&&o.drawImage(a.canvas.canvas,-a.canvas.canvas.width,-a.canvas.canvas.height),3==a.rotation&&o.drawImage(a.canvas.canvas,0,-a.canvas.canvas.height),0!=a.rotation&&2!=a.rotation||(a.canvas.canvas.height=n,a.canvas.canvas.width=r),1!=a.rotation&&3!=a.rotation||(a.canvas.canvas.height=r,a.canvas.canvas.width=n),a.canvas.setTransform(1,0,0,1,0,0),a.canvas.rotate(90*t*Math.PI/180),a.rotation=t,a.canvas.drawImage(a.tcanvas,l(0),v(0,0)),a.width=a.canvas.canvas.width,a.height=a.canvas.canvas.height,null!=a.onScreenResize&&a.onScreenResize(a,a.width,a.height,a.CanvasId),!0}a.rotation=t},a.Start=function(){for(var e in a.state=0,a.acc=null,a.inflate.inflateReset(),a.onKvmDataPending=[],a.onKvmDataAck=-1,a.kvmDataSupported=!1,a.kvmExt={},a.sparecache)delete a.sparecache[e]},a.Stop=function(){a.UnGrabMouseInput(),a.UnGrabKeyInput(),a.parent&&a.parent.Stop()},a.send=function(e){a.parent&&a.parent.send(e)};var m={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,MetaRight:65512};function g(e,t){if(t||(t=window.event),t.code&&0==a.localKeyMap){var n=function(e){return e.code.startsWith("Key")&&4==e.code.length?e.code.charCodeAt(3)+(0==e.shiftKey?32:0):e.code.startsWith("Digit")&&6==e.code.length?e.code.charCodeAt(5):e.code.startsWith("Numpad")&&7==e.code.length?e.code.charCodeAt(6):m[e.code]}(t);null!=n&&a.sendkey(n,e)}else{var r=n=t.keyCode;0==t.shiftKey&&n>=65&&n<=90&&(r=n+32),n>=112&&n<=124&&(r=n+65358),8==n&&(r=65288),9==n&&(r=65289),13==n&&(r=65293),16==n&&(r=65505),17==n&&(r=65507),18==n&&(r=65513),27==n&&(r=65307),33==n&&(r=65365),34==n&&(r=65366),35==n&&(r=65367),36==n&&(r=65360),37==n&&(r=65361),38==n&&(r=65362),39==n&&(r=65363),40==n&&(r=65364),45==n&&(r=65379),46==n&&(r=65535),n>=96&&n<=105&&(r=n-48),106==n&&(r=42),107==n&&(r=43),109==n&&(r=45),110==n&&(r=46),111==n&&(r=47),186==n&&(r=59),187==n&&(r=61),188==n&&(r=44),189==n&&(r=45),190==n&&(r=46),191==n&&(r=47),192==n&&(r=96),219==n&&(r=91),220==n&&(r=92),221==n&&(r=93),222==n&&(r=39),a.sendkey(r,e)}return a.haltEvent(t)}function p(e,t){if(e.byteLength<8)return 0;var r=t.getUint32(4)+8;if(e.byteLength<r)return 0;if(null!=a.onKvmData){var o=n(new Uint8Array(e.buffer.slice(8,r)));if(o.length>=16&&"\0KvmDataChannel"==o.substring(0,15)){0==a.kvmDataSupported&&(a.kvmDataSupported=!0),(-1==a.onKvmDataAck&&16==o.length||0!=o.charCodeAt(15))&&(a.onKvmDataAck=!0);try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-DataChannel-Recv("+(o.length-16)+"): "+o.substring(16))}catch(e){}o.length>=16&&a.onKvmData(o.substring(16)),1==a.onKvmDataAck&&a.onKvmDataPending.length>0&&a.sendKvmData(a.onKvmDataPending.shift())}else if(o.length>=13&&"\0KvmExtCmd\0"==o.substring(0,11)){var i=o.charCodeAt(11),s=o.charCodeAt(12);1==i&&(a.kvmExt.decimationMode=s,o.length>13&&(a.kvmExt.decimationState=o.charCodeAt(13)),null!=a.kvmExtChanged&&a.kvmExtChanged(1,a.kvmExt,a.kvmExt)),2==i&&a.sendKvmExtCmd(1),3==i&&(a.kvmExt.compression=s,null!=a.kvmExtChanged&&a.kvmExtChanged(3,a.kvmExt)),4==i&&a.sendKvmExtCmd(3)}else{console.log("Got KVM clipboard data:",o);try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-ClipBoard-Recv("+o.length+"): "+rstr2hex(o)+", "+o)}catch(e){}}}return r}a.sendkey=function(e,t){if("object"==typeof e){var n="";for(var r in e)n+=String.fromCharCode(4,e[r][1],0,0)+IntToStr(e[r][0]);a.send(n)}else a.send(String.fromCharCode(4,t,0,0)+IntToStr(e))},a.sendKvmExtCmd=function(e,t){var n="\0KvmExtCmd\0"+String.fromCharCode(e)+(null!=t?String.fromCharCode(t):"");a.send(String.fromCharCode(6,0,0,0)+IntToStr(n.length)+n)},a.sendKvmData=function(e){if(!0!==a.onKvmDataAck)a.onKvmDataPending.push(e);else{try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-DataChannel-Send("+e.length+"): "+e)}catch(e){}e="\0KvmDataChannel\0"+e,a.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e),a.onKvmDataAck=!1}},a.sendKeepAlive=function(){a.lastKeepAlive<Date.now()-5e3&&(a.lastKeepAlive=Date.now(),a.send(String.fromCharCode(6,0,0,0)+IntToStr(16)+"\0KvmDataChannel\0"))},a.sendClipboardData=function(e){try{urlvars&&urlvars.kvmdatatrace&&console.log("KVM-ClipBoard-Send("+e.length+"): "+rstr2hex(e)+", "+e)}catch(e){}a.send(String.fromCharCode(6,0,0,0)+IntToStr(e.length)+e)},a.SendCtrlAltDelMsg=function(){a.sendcad()},a.sendcad=function(){a.sendkey([[65507,1],[65513,1],[65535,1],[65535,0],[65513,0],[65507,0]])};var S=!1,w=!1;function C(e,t,n){var r=Date.now();return"number"==typeof n?(a.recordedSize+=n,ShortToStr(e)+ShortToStr(t)+IntToStr(n)+IntToStr(r>>32)+IntToStr(32&r)):(a.recordedSize+=n.length,ShortToStr(e)+ShortToStr(t)+IntToStr(n.length)+IntToStr(r>>32)+IntToStr(32&r)+n)}return a.GrabMouseInput=function(){if(1!=S){var e=a.canvas.canvas;e.onmouseup=a.mouseup,e.onmousedown=a.mousedown,e.onmousemove=a.mousemove,e.onwheel=a.mousewheel,S=!0}},a.UnGrabMouseInput=function(){if(0!=S){var e=a.canvas.canvas;e.onmousemove=null,e.onmouseup=null,e.onmousedown=null,e.onwheel=null,S=!1}},a.GrabKeyInput=function(){1!=w&&(document.onkeyup=a.handleKeyUp,document.onkeydown=a.handleKeyDown,document.onkeypress=a.handleKeys,w=!0)},a.UnGrabKeyInput=function(){0!=w&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,w=!1)},a.handleKeys=function(e){return a.haltEvent(e)},a.handleKeyUp=function(e){return g(0,e)},a.handleKeyDown=function(e){return g(1,e)},a.haltEvent=function(e){return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1},a.mousedblclick=function(e){},a.mousewheel=function(e){var t=0;if("number"==typeof e.deltaY?t=-1*e.deltaY:"number"==typeof e.detail?t=-1*e.detail:"number"==typeof e.wheelDelta&&(t=e.wheelDelta),0!=t){a.ReverseMouseWheel&&(t*=-1);var n=a.buttonmask;return a.buttonmask|=1<<(t>0?3:4),a.mousemove(e,1),a.buttonmask=n,a.mousemove(e,1)}},a.mousedown=function(e){return a.buttonmask|=1<<e.button,a.mousemove(e,1)},a.mouseup=function(e){return a.buttonmask&=65535-(1<<e.button),a.mousemove(e,1)},a.mousemove=function(e,t){if(a.state<4)return!0;var n=a.canvas.canvas.height/Q(a.canvasid).offsetHeight,r=a.canvas.canvas.width/Q(a.canvasid).offsetWidth,o=a.getPositionOfControl(Q(a.canvasid));if(a.mx=(event.pageX-o[0])*r,a.my=(event.pageY-o[1])*n,event.addx&&(a.mx+=event.addx),event.addy&&(a.my+=event.addy),1!=a.rotation&&3!=a.rotation||(a.mx=a.mx*a.rwidth/a.width,a.my=a.my*a.rheight/a.height),1!=a.noMouseRotate){var i=function(e,t){return 0==a.rotation?e:1==a.rotation?t:2==a.rotation?a.canvas.canvas.width-e:3==a.rotation?a.canvas.canvas.height-t:0}(a.mx,a.my);a.my=function(e,t){return 0==a.rotation?t:1==a.rotation?a.canvas.canvas.width-e:2==a.rotation?a.canvas.canvas.height-t:3==a.rotation?e:0}(a.mx,a.my),a.mx=i}if(1==t?(a.send(String.fromCharCode(5,a.buttonmask)+ShortToStr(a.mx)+ShortToStr(a.my)),null!=a.mNagleTimer&&(clearTimeout(a.mNagleTimer),a.mNagleTimer=null)):null==a.mNagleTimer&&(a.mNagleTimer=setTimeout((function(){a.send(String.fromCharCode(5,a.buttonmask)+ShortToStr(a.mx)+ShortToStr(a.my)),a.mNagleTimer=null}),50)),QV("DeskFocus",a.focusmode),0!=a.focusmode){var s=Math.min(a.mx,a.canvas.canvas.width-a.focusmode),c=Math.min(a.my,a.canvas.canvas.height-a.focusmode),h=2*a.focusmode,d=Q(a.canvasid),l=d.offsetHeight/a.canvas.canvas.height,v=d.offsetWidth/a.canvas.canvas.width,u=QS("DeskFocus"),f=a.getPositionOfControl(Q(a.canvasid).parentElement);u.left=Math.max((s-a.focusmode)*l,0)+(pos[0]-f[0])+"px",u.top=Math.max((c-a.focusmode)*v,0)+(pos[1]-f[1])+"px",u.width=h*l-6+"px",u.height=h*l-6+"px"}return a.haltEvent(e)},a.getPositionOfControl=function(e){var t=Array(2);for(t[0]=t[1]=0;e;)t[0]+=e.offsetLeft,t[1]+=e.offsetTop,e=e.offsetParent;return t},a.StartRecording=function(){return(null==a.recordedData||null==a.DeskRecordServerInit)&&(a.recordedHolding=!0,a.recordedData=[],a.recordedStart=Date.now(),a.recordedSize=0,a.recordedData.push(C(1,0,JSON.stringify({magic:"MeshCentralRelaySession",ver:1,time:(new Date).toLocaleString(),protocol:102,bpp:a.bpp,graymode:a.graymode,lowcolor:a.lowcolor,screenSize:[a.width,a.height]}))),a.DeskRecordServerInit=String.fromCharCode(a.width>>8,255&a.width,a.height>>8,255&a.height)+a.DeskRecordServerInit.substring(4),a.recordedData.push(C(2,1,a.DeskRecordServerInit)),a.recordedData.push(C(3,0,atob(a.CanvasId.toDataURL("image/png").split(",")[1]))),!0)},a.StopRecording=function(){if(null!=a.recordedData){var e=a.recordedData;return e.push(C(3,0,"MeshCentralMCREC")),delete a.recordedData,delete a.recordedStart,delete a.recordedSize,e}},a}
\ No newline at end of file
public/scripts/amt-ider-ws-0.0.1-min.js
+1
-1
@@ -1 +1 @@
1
-var CreateAmtRemoteIder=function(){var m={};function l(){urlvars&&urlvars.idertrace&&console.log(...arguments)}m.protocol=3,m.bytesToAmt=0,m.bytesFromAmt=0,m.rx_timeout=3e4,m.tx_timeout=0,m.heartbeat=2e4,m.version=1,m.acc="",m.inSequence=0,m.outSequence=0,m.iderinfo=null,m.enabled=!1,m.iderStart=0,m.floppy=null,m.cdrom=null,m.floppyReady=!1,m.cdromReady=!1,m.pingTimer=null;var f=String.fromCharCode(0,38,49,128,0,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),u=String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),h=String.fromCharCode(0,38,36,128,0,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),p=String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),R=String.fromCharCode(0,18,1,128,0,0,0,0,26,10,0,0,0,0,0,0,0,0,0,0),E=String.fromCharCode(0,18,1,128,0,0,0,0,29,10,0,0,0,0,0,0,0,0,0,0),I=String.fromCharCode(0,32,1,128,0,0,0,0,42,24,0,0,0,0,32,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),g=String.fromCharCode(0,40,1,128,0,0,0,0,1,6,0,255,0,0,0,0,42,24,0,0,0,0,2,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),b=(String.fromCharCode(0,0,0,40,0,0,0,8),String.fromCharCode(0,0,3,4,0,8,1,0)),A=String.fromCharCode(0,1,3,4,0,0,0,2),T=String.fromCharCode(0,2,3,4,0,0,0,0),D=String.fromCharCode(0,3,3,4,41,0,0,2),y=String.fromCharCode(0,16,1,8,0,0,8,0,0,1,0,0),_=String.fromCharCode(0,30,3,0),k=String.fromCharCode(1,0,3,0),v=String.fromCharCode(1,5,3,0),O=String.fromCharCode(0,18,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),X=String.fromCharCode(0,18,49,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),w=String.fromCharCode(0,14,1,128,0,0,0,0,1,6,0,255,0,0,0,0);function F(e,r,n,a){var o=null,t=0;160==e&&(o=m.floppy,null!=m.floppy)&&(t=m.floppy.size>>9),176==e&&(o=m.cdrom,null!=m.cdrom)&&(t=m.cdrom.size>>11),n<0||t<r+n?m.SendCommandEndResponse(1,5,e,33,0):0==n?m.SendCommandEndResponse(1,0,e,0,0):null!=o&&(160==e?(r<<=9,n<<=9):(r<<=11,n<<=11),null!==s?(console.log("IDERERROR: Read while performing read"),m.Stop()):(s=o,d=e,S=r,c=n,function e(r){var n=c,a=S;c>m.iderinfo.readbfr&&(n=m.iderinfo.readbfr);c-=n;S+=n;var o=new FileReader;o.onload=function(){m.SendDataToHost(d,0==c,this.result,1&r),0<c&&0==C?e(r):(s=null,C&&(m.SendCommand(71),C=!1))};o.readAsBinaryString(s.slice(a,a+n))}(a)))}m.xxStateChange=function(e){l("IDER-StateChange",e),0==e&&m.Stop(),3==e&&m.Start()},m.Start=function(){l("IDER-Start"),l(m.floppy,m.cdrom),m.bytesToAmt=0,m.bytesFromAmt=0,m.inSequence=0,m.outSequence=0,m.SendCommand(64,ShortToStrX(m.rx_timeout)+ShortToStrX(m.tx_timeout)+ShortToStrX(m.heartbeat)+IntToStrX(m.version))},m.Stop=function(){l("IDER-Stop"),m.pingTimer&&(clearInterval(m.pingTimer),m.pingTimer=null),m.parent.Stop()},m.ProcessData=function(e){for(m.bytesFromAmt+=e.length,m.acc+=e,l("IDER-ProcessData",m.acc.length,rstr2hex(m.acc));;){var r=m.ProcessDataEx();if(0==r)return;if(m.inSequence!=ReadIntX(m.acc,4))return l("ERROR: Out of sequence",m.inSequence,ReadIntX(m.acc,4)),void m.Stop();m.inSequence++,m.acc=m.acc.substring(r)}},m.SendCommand=function(e,r,n,a){null==r&&(r="");n=50<e&&1==n?2:0,a&&(n+=1),a=String.fromCharCode(e,0,0,n)+IntToStrX(m.outSequence++)+r;m.parent.xxSend(a),m.bytesToAmt+=a.length,75!=e&&l("IDER-SendData",a.length,rstr2hex(a))},m.SendCommandEndResponse=function(e,r,n,a,o){e?m.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,197,0,3,0,0,0,n,80,0,0,0),!0):m.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,r<<4,3,0,0,0,n,81,r,a,o),!0)},m.SendDataToHost=function(e,r,n,a){var o=a?0:n.length;1==r?m.SendCommand(84,String.fromCharCode(0,255&n.length,n.length>>8,0,a?180:181,0,2,0,255&o,o>>8,e,88,133,0,3,0,0,0,e,80,0,0,0,0,0,0)+n,r,a):m.SendCommand(84,String.fromCharCode(0,255&n.length,n.length>>8,0,a?180:181,0,2,0,255&o,o>>8,e,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0)+n,r,a)},m.SendGetDataFromHost=function(e,r){m.SendCommand(82,String.fromCharCode(0,255&r,r>>8,0,181,0,0,0,255&r,r>>8,e,88,0,0,0,0,0,0,0,0,0,0,0),!1)},m.SendDisableEnableFeatures=function(e,r){null==r&&(r=""),m.SendCommand(72,String.fromCharCode(e)+r)};var d,S,c,C=!(m.ProcessDataEx=function(){if(!(m.acc.length<8))switch(m.acc.charCodeAt(0)){case 65:return m.acc.length<30?0:(t=m.acc.charCodeAt(29),m.acc.length<30+t?0:(m.iderinfo={},m.iderinfo.major=m.acc.charCodeAt(8),m.iderinfo.minor=m.acc.charCodeAt(9),m.iderinfo.fwmajor=m.acc.charCodeAt(10),m.iderinfo.fwminor=m.acc.charCodeAt(11),m.iderinfo.readbfr=ReadShortX(m.acc,16),m.iderinfo.writebfr=ReadShortX(m.acc,18),m.iderinfo.proto=m.acc.charCodeAt(21),m.iderinfo.iana=ReadIntX(m.acc,25),l(m.iderinfo),0!=m.iderinfo.proto&&(l("Unknown proto",m.iderinfo.proto),m.Stop()),8192<m.iderinfo.readbfr&&(l("Illegal read buffer size",m.iderinfo.readbfr),m.Stop()),8192<m.iderinfo.writebfr&&(l("Illegal write buffer size",m.iderinfo.writebfr),m.Stop()),0==m.iderStart?m.SendDisableEnableFeatures(3,IntToStrX(9)):1==m.iderStart?m.SendDisableEnableFeatures(3,IntToStrX(17)):2==m.iderStart&&m.SendDisableEnableFeatures(3,IntToStrX(25)),30+t));case 67:return l("CLOSE"),m.Stop(),8;case 68:return m.SendCommand(69),8;case 69:return l("PONG"),8;case 70:return m.acc.length<9?0:(e=m.acc.charCodeAt(8),null===s?(m.SendCommand(71),l("RESETOCCURED1",e)):(C=!0,l("RESETOCCURED2",e)),9);case 73:if(m.acc.length<13)return 0;var e=m.acc.charCodeAt(8),r=ReadIntX(m.acc,9);switch(l("STATUS_DATA",e,r),e){case 1:1&r&&(0==m.iderStart?m.SendDisableEnableFeatures(3,IntToStrX(9)):1==m.iderStart?m.SendDisableEnableFeatures(3,IntToStrX(17)):2==m.iderStart&&m.SendDisableEnableFeatures(3,IntToStrX(25)));break;case 2:m.enabled=!!(2&r),l("IDER Status: "+m.enabled);break;case 3:1!=r&&l("Register toggle failure")}return 13;case 74:return m.acc.length<11?0:(l("IDER: ABORT",m.acc.charCodeAt(8)),11);case 75:return 8;case 80:var n,a,o;return m.acc.length<28?0:(e=16&m.acc.charCodeAt(14)?176:160,n=m.acc.charCodeAt(14),a=m.acc.substring(16,28),o=m.acc.charCodeAt(9),l("SCSI_CMD",e,rstr2hex(a),o,n),((e,r,n,a)=>{switch(r.charCodeAt(0)){case 0:switch(l("SCSI: TEST_UNIT_READY",e),e){case 160:if(null==m.floppy)return m.SendCommandEndResponse(1,2,e,58,0);if(0==m.floppyReady)return m.floppyReady=!0,m.SendCommandEndResponse(1,6,e,40,0);break;case 176:if(null==m.cdrom)return m.SendCommandEndResponse(1,2,e,58,0);if(0==m.cdromReady)return m.cdromReady=!0,m.SendCommandEndResponse(1,6,e,40,0);break;default:return l("SCSI Internal error 3",e)}m.SendCommandEndResponse(1,0,e,0,0);break;case 8:c=((31&r.charCodeAt(1))<<16)+(r.charCodeAt(2)<<8)+r.charCodeAt(3),S=r.charCodeAt(4),l("SCSI: READ_6",e,c,S=0==S?256:S),F(e,c,S,n);break;case 10:return c=((31&r.charCodeAt(1))<<16)+(r.charCodeAt(2)<<8)+r.charCodeAt(3),S=r.charCodeAt(4),l("SCSI: WRITE_6",e,c,S=0==S?256:S),m.SendCommandEndResponse(1,2,e,58,0);case 26:if(l("SCSI: MODE_SENSE_6",e),63==r.charCodeAt(2)&&0==r.charCodeAt(3)){var o=0,t=0;switch(e){case 160:if(null==m.floppy)return m.SendCommandEndResponse(1,2,e,58,0);o=0,t=128;break;case 176:if(null==m.cdrom)return m.SendCommandEndResponse(1,2,e,58,0);o=5,t=128;break;default:return l("SCSI Internal error 6",e)}return m.SendDataToHost(e,!0,String.fromCharCode(0,o,t,0),1&n)}m.SendCommandEndResponse(1,5,e,36,0);break;case 27:m.SendCommandEndResponse(1,0,e);break;case 30:if(l("SCSI: ALLOW_MEDIUM_REMOVAL",e),160==e&&null==m.floppy)return m.SendCommandEndResponse(1,2,e,58,0);if(176==e&&null==m.cdrom)return m.SendCommandEndResponse(1,2,e,58,0);m.SendCommandEndResponse(1,0,e,0,0);break;case 35:l("SCSI: READ_FORMAT_CAPACITIES",e);var d=ReadShort(r,7);switch(e){case 160:if(null==m.floppy||0==m.floppy.size)return m.SendCommandEndResponse(0,5,e,36,0);m.floppy.size;break;case 176:if(null==m.cdrom||0==m.cdrom.size)return m.SendCommandEndResponse(0,5,e,36,0);m.cdrom.size;break;default:return l("SCSI Internal error 4",e)}m.SendDataToHost(e,!0,IntToStr(8)+String.fromCharCode(0,0,11,64,2,0,2,0),1&n);break;case 37:l("SCSI: READ_CAPACITY",e);var S=0;switch(e){case 160:if(null==m.floppy||0==m.floppy.size)return m.SendCommandEndResponse(0,2,e,58,0);l("DEV_FLOPPY",S=null!=m.floppy?(m.floppy.size>>9)-1:S);break;case 176:if(null==m.floppy||0==m.floppy.size)return m.SendCommandEndResponse(0,2,e,58,0);l("DEV_CDDVD",S=null!=m.cdrom?(m.cdrom.size>>11)-1:S);break;default:return l("SCSI Internal error 4",e)}l("SCSI: READ_CAPACITY2",e,a),m.SendDataToHost(a,!0,IntToStr(S)+String.fromCharCode(0,0,176==e?8:2,0),1&n);break;case 40:c=ReadInt(r,2),S=ReadShort(r,7),l("SCSI: READ_10",e,c,S),F(e,c,S,n);break;case 42:case 46:c=ReadInt(r,2),S=ReadShort(r,7),l("SCSI: WRITE_10",e,c,S),m.SendGetDataFromHost(e,512*S);break;case 67:var d=ReadShort(r,7),c=2&r.charCodeAt(1),C=7&r.charCodeAt(2);switch(0==C&&(C=r.charCodeAt(9)>>6),l("SCSI: READ_TOC, dev="+e+", buflen="+d+", msf="+c+", format="+C),e){case 160:return m.SendCommandEndResponse(1,5,e,32,0);case 176:break;default:return l("SCSI Internal error 9",e)}1==C?m.SendDataToHost(e,!0,String.fromCharCode(0,10,1,1,0,20,1,0,0,0,0,0),1&n):0==C&&(c?m.SendDataToHost(e,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19),1&n):m.SendDataToHost(e,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0),1&n));break;case 70:C=2!=r.charCodeAt(1),c=ReadShort(r,2),d=ReadShort(r,7);return l("SCSI: GET_CONFIGURATION",e,C,c,d),0==d?m.SendDataToHost(e,!0,IntToStr(60)+IntToStr(8),1&n):(s=IntToStr(8),0==c&&(s+=b),(1==c||C&&c<1)&&(s+=A),(2==c||C&&c<2)&&(s+=T),(3==c||C&&c<3)&&(s+=D),(16==c||C&&c<16)&&(s+=y),(30==c||C&&c<30)&&(s+=_),(256==c||C&&c<256)&&(s+=k),(261==c||C&&c<261)&&(s+=v),(s=IntToStr(s.length)+s).length>d&&(s=s.substring(0,d)),m.SendDataToHost(e,!0,s,1&n));case 74:l("SCSI: GET_EVENT_STATUS_NOTIFICATION",e,r.charCodeAt(1),r.charCodeAt(4),r.charCodeAt(9)),1!=r.charCodeAt(1)&&16!=r.charCodeAt(4)?(l("SCSI ERROR"),m.SendCommandEndResponse(1,5,e,38,1)):(C=0,(160==e&&null!=m.floppy||176==e&&null!=m.cdrom)&&(C=2),m.SendDataToHost(e,!0,String.fromCharCode(0,C,128,0),1&n));break;case 76:m.SendCommand(81,IntToStrX(0)+IntToStrX(0)+IntToStrX(0)+String.fromCharCode(135,80,3,0,0,0,176,81,5,32,0),!0);break;case 81:return l("SCSI READ_DISC_INFO",e),m.SendCommandEndResponse(0,5,e,32,0);case 85:return l("SCSI ERROR: MODE_SELECT_10",e),m.SendCommandEndResponse(1,5,e,32,0);case 90:l("SCSI: MODE_SENSE_10",e,63&r.charCodeAt(2));var d=ReadShort(r,7),s=null;if(0==d)return m.SendDataToHost(e,!0,IntToStr(60)+IntToStr(8),1&n);var i=0;switch(160==e?null!=m.floppy&&(i=m.floppy.size>>9):null!=m.cdrom&&(i=m.cdrom.size>>11),63&r.charCodeAt(2)){case 1:s=160==e?i<=2880?O:X:w;break;case 5:160==e&&(s=i<=2880?h:f);break;case 63:s=160==e?i<=2880?p:u:g;break;case 26:176==e&&(s=R);break;case 29:176==e&&(s=E);break;case 42:176==e&&(s=I)}null==s?m.SendCommandEndResponse(0,5,e,32,0):m.SendDataToHost(e,!0,s,1&n);break;default:return l("IDER: Unknown SCSI command",r.charCodeAt(0)),m.SendCommandEndResponse(0,5,e,32,0)}})(e,a,o,n),28);case 83:var t;return m.acc.length<14?0:(t=ReadShortX(m.acc,9),m.acc.length<14+t?0:(l("SCSI_WRITE, len = "+(14+t)),m.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,112,3,0,0,0,160,81,7,39,0),!0),14+t));default:l("Unknown IDER command",m.acc[0]),m.Stop()}return 0}),s=null;return m}
\ No newline at end of file
1
+var CreateAmtRemoteIder=function(){var e={};function r(){urlvars&&urlvars.idertrace&&console.log(...arguments)}e.protocol=3,e.bytesToAmt=0,e.bytesFromAmt=0,e.rx_timeout=3e4,e.tx_timeout=0,e.heartbeat=2e4,e.version=1,e.acc="",e.inSequence=0,e.outSequence=0,e.iderinfo=null,e.enabled=!1,e.iderStart=0,e.floppy=null,e.cdrom=null,e.floppyReady=!1,e.cdromReady=!1,e.pingTimer=null;var n=String.fromCharCode(0,38,49,128,0,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),a=String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),o=String.fromCharCode(0,38,36,128,0,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),t=String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),d=String.fromCharCode(0,18,1,128,0,0,0,0,26,10,0,0,0,0,0,0,0,0,0,0),S=String.fromCharCode(0,18,1,128,0,0,0,0,29,10,0,0,0,0,0,0,0,0,0,0),c=String.fromCharCode(0,32,1,128,0,0,0,0,42,24,0,0,0,0,32,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),i=String.fromCharCode(0,40,1,128,0,0,0,0,1,6,0,255,0,0,0,0,42,24,0,0,0,0,2,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),C=(String.fromCharCode(0,0,0,40,0,0,0,8),String.fromCharCode(0,0,3,4,0,8,1,0)),s=String.fromCharCode(0,1,3,4,0,0,0,2),m=String.fromCharCode(0,2,3,4,0,0,0,0),l=String.fromCharCode(0,3,3,4,41,0,0,2),f=String.fromCharCode(0,16,1,8,0,0,8,0,0,1,0,0),u=String.fromCharCode(0,30,3,0),h=String.fromCharCode(1,0,3,0),p=String.fromCharCode(1,5,3,0),R=String.fromCharCode(0,18,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),E=String.fromCharCode(0,18,49,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),I=String.fromCharCode(0,14,1,128,0,0,0,0,1,6,0,255,0,0,0,0);function g(r,n,a,o){var t=null,d=0;return 160==r&&(t=e.floppy,null!=e.floppy&&(d=e.floppy.size>>9)),176==r&&(t=e.cdrom,null!=e.cdrom&&(d=e.cdrom.size>>11)),a<0||n+a>d?(e.SendCommandEndResponse(1,5,r,33,0),0):0==a?(e.SendCommandEndResponse(1,0,r,0,0),0):void(null!=t&&(160==r?(n<<=9,a<<=9):(n<<=11,a<<=11),null!==y?(console.log("IDERERROR: Read while performing read"),e.Stop()):(y=t,b=r,A=n,T=a,_(o))))}e.xxStateChange=function(n){r("IDER-StateChange",n),0==n&&e.Stop(),3==n&&e.Start()},e.Start=function(){r("IDER-Start"),r(e.floppy,e.cdrom),e.bytesToAmt=0,e.bytesFromAmt=0,e.inSequence=0,e.outSequence=0,e.SendCommand(64,ShortToStrX(e.rx_timeout)+ShortToStrX(e.tx_timeout)+ShortToStrX(e.heartbeat)+IntToStrX(e.version))},e.Stop=function(){r("IDER-Stop"),e.pingTimer&&(clearInterval(e.pingTimer),e.pingTimer=null),e.parent.Stop()},e.ProcessData=function(n){for(e.bytesFromAmt+=n.length,e.acc+=n,r("IDER-ProcessData",e.acc.length,rstr2hex(e.acc));;){var a=e.ProcessDataEx();if(0==a)return;if(e.inSequence!=ReadIntX(e.acc,4))return r("ERROR: Out of sequence",e.inSequence,ReadIntX(e.acc,4)),void e.Stop();e.inSequence++,e.acc=e.acc.substring(a)}},e.SendCommand=function(n,a,o,t){null==a&&(a="");var d=n>50&&1==o?2:0;t&&(d+=1);var S=String.fromCharCode(n,0,0,d)+IntToStrX(e.outSequence++)+a;e.parent.xxSend(S),e.bytesToAmt+=S.length,75!=n&&r("IDER-SendData",S.length,rstr2hex(S))},e.SendCommandEndResponse=function(r,n,a,o,t){r?e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,197,0,3,0,0,0,a,80,0,0,0),!0):e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,n<<4,3,0,0,0,a,81,n,o,t),!0)},e.SendDataToHost=function(r,n,a,o){var t=o?0:a.length;1==n?e.SendCommand(84,String.fromCharCode(0,255&a.length,a.length>>8,0,o?180:181,0,2,0,255&t,t>>8,r,88,133,0,3,0,0,0,r,80,0,0,0,0,0,0)+a,n,o):e.SendCommand(84,String.fromCharCode(0,255&a.length,a.length>>8,0,o?180:181,0,2,0,255&t,t>>8,r,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0)+a,n,o)},e.SendGetDataFromHost=function(r,n){e.SendCommand(82,String.fromCharCode(0,255&n,n>>8,0,181,0,0,0,255&n,n>>8,r,88,0,0,0,0,0,0,0,0,0,0,0),!1)},e.SendDisableEnableFeatures=function(r,n){null==n&&(n=""),e.SendCommand(72,String.fromCharCode(r)+n)},e.ProcessDataEx=function(){if(e.acc.length<8)return 0;switch(e.acc.charCodeAt(0)){case 65:if(e.acc.length<30)return 0;var b=e.acc.charCodeAt(29);return e.acc.length<30+b?0:(e.iderinfo={},e.iderinfo.major=e.acc.charCodeAt(8),e.iderinfo.minor=e.acc.charCodeAt(9),e.iderinfo.fwmajor=e.acc.charCodeAt(10),e.iderinfo.fwminor=e.acc.charCodeAt(11),e.iderinfo.readbfr=ReadShortX(e.acc,16),e.iderinfo.writebfr=ReadShortX(e.acc,18),e.iderinfo.proto=e.acc.charCodeAt(21),e.iderinfo.iana=ReadIntX(e.acc,25),r(e.iderinfo),0!=e.iderinfo.proto&&(r("Unknown proto",e.iderinfo.proto),e.Stop()),e.iderinfo.readbfr>8192&&(r("Illegal read buffer size",e.iderinfo.readbfr),e.Stop()),e.iderinfo.writebfr>8192&&(r("Illegal write buffer size",e.iderinfo.writebfr),e.Stop()),0==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(9)):1==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(17)):2==e.iderStart&&e.SendDisableEnableFeatures(3,IntToStrX(25)),30+b);case 67:return r("CLOSE"),e.Stop(),8;case 68:return e.SendCommand(69),8;case 69:return r("PONG"),8;case 70:if(e.acc.length<9)return 0;var A=e.acc.charCodeAt(8);return null===y?(e.SendCommand(71),r("RESETOCCURED1",A)):(D=!0,r("RESETOCCURED2",A)),9;case 73:if(e.acc.length<13)return 0;var T=e.acc.charCodeAt(8),_=ReadIntX(e.acc,9);switch(r("STATUS_DATA",T,_),T){case 1:1&_&&(0==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(9)):1==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(17)):2==e.iderStart&&e.SendDisableEnableFeatures(3,IntToStrX(25)));break;case 2:e.enabled=!!(2&_),r("IDER Status: "+e.enabled);break;case 3:1!=_&&r("Register toggle failure")}return 13;case 74:return e.acc.length<11?0:(r("IDER: ABORT",e.acc.charCodeAt(8)),11);case 75:return 8;case 80:if(e.acc.length<28)return 0;var k=16&e.acc.charCodeAt(14)?176:160,v=e.acc.charCodeAt(14),O=e.acc.substring(16,28),X=e.acc.charCodeAt(9);return r("SCSI_CMD",k,rstr2hex(O),X,v),function(b,A,T,D){var y;switch(A.charCodeAt(0)){case 0:switch(r("SCSI: TEST_UNIT_READY",b),b){case 160:if(null==e.floppy)return e.SendCommandEndResponse(1,2,b,58,0),-1;if(0==e.floppyReady)return e.floppyReady=!0,e.SendCommandEndResponse(1,6,b,40,0),-1;break;case 176:if(null==e.cdrom)return e.SendCommandEndResponse(1,2,b,58,0),-1;if(0==e.cdromReady)return e.cdromReady=!0,e.SendCommandEndResponse(1,6,b,40,0),-1;break;default:return r("SCSI Internal error 3",b),-1}e.SendCommandEndResponse(1,0,b,0,0);break;case 8:y=((31&A.charCodeAt(1))<<16)+(A.charCodeAt(2)<<8)+A.charCodeAt(3),0==(v=A.charCodeAt(4))&&(v=256),r("SCSI: READ_6",b,y,v),g(b,y,v,T);break;case 10:return y=((31&A.charCodeAt(1))<<16)+(A.charCodeAt(2)<<8)+A.charCodeAt(3),0==(v=A.charCodeAt(4))&&(v=256),r("SCSI: WRITE_6",b,y,v),e.SendCommandEndResponse(1,2,b,58,0),-1;case 26:if(r("SCSI: MODE_SENSE_6",b),63==A.charCodeAt(2)&&0==A.charCodeAt(3)){var _=0,k=0;switch(b){case 160:if(null==e.floppy)return e.SendCommandEndResponse(1,2,b,58,0),-1;_=0,k=128;break;case 176:if(null==e.cdrom)return e.SendCommandEndResponse(1,2,b,58,0),-1;_=5,k=128;break;default:return r("SCSI Internal error 6",b),-1}return void e.SendDataToHost(b,!0,String.fromCharCode(0,_,k,0),1&T)}e.SendCommandEndResponse(1,5,b,36,0);break;case 27:e.SendCommandEndResponse(1,0,b);break;case 30:if(r("SCSI: ALLOW_MEDIUM_REMOVAL",b),160==b&&null==e.floppy)return e.SendCommandEndResponse(1,2,b,58,0),-1;if(176==b&&null==e.cdrom)return e.SendCommandEndResponse(1,2,b,58,0),-1;e.SendCommandEndResponse(1,0,b,0,0);break;case 35:r("SCSI: READ_FORMAT_CAPACITIES",b);O=ReadShort(A,7);switch(b){case 160:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,5,b,36,0),-1;(e.floppy.size>>9)-1;break;case 176:if(null==e.cdrom||0==e.cdrom.size)return e.SendCommandEndResponse(0,5,b,36,0),-1;(e.cdrom.size>>11)-1;break;default:return r("SCSI Internal error 4",b),-1}e.SendDataToHost(b,!0,IntToStr(8)+String.fromCharCode(0,0,11,64,2,0,2,0),1&T);break;case 37:r("SCSI: READ_CAPACITY",b);var v=0;switch(b){case 160:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,2,b,58,0),-1;null!=e.floppy&&(v=(e.floppy.size>>9)-1),r("DEV_FLOPPY",v);break;case 176:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,2,b,58,0),-1;null!=e.cdrom&&(v=(e.cdrom.size>>11)-1),r("DEV_CDDVD",v);break;default:return r("SCSI Internal error 4",b),-1}r("SCSI: READ_CAPACITY2",b,D),e.SendDataToHost(D,!0,IntToStr(v)+String.fromCharCode(0,0,176==b?8:2,0),1&T);break;case 40:r("SCSI: READ_10",b,y=ReadInt(A,2),v=ReadShort(A,7)),g(b,y,v,T);break;case 42:case 46:r("SCSI: WRITE_10",b,y=ReadInt(A,2),v=ReadShort(A,7)),e.SendGetDataFromHost(b,512*v);break;case 67:var O=ReadShort(A,7),X=2&A.charCodeAt(1),w=7&A.charCodeAt(2);switch(0==w&&(w=A.charCodeAt(9)>>6),r("SCSI: READ_TOC, dev="+b+", buflen="+O+", msf="+X+", format="+w),b){case 160:return e.SendCommandEndResponse(1,5,b,32,0),-1;case 176:break;default:return r("SCSI Internal error 9",b),-1}1==w?e.SendDataToHost(b,!0,String.fromCharCode(0,10,1,1,0,20,1,0,0,0,0,0),1&T):0==w&&(X?e.SendDataToHost(b,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19),1&T):e.SendDataToHost(b,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0),1&T));break;case 70:var F=2!=A.charCodeAt(1),H=ReadShort(A,2);if(r("SCSI: GET_CONFIGURATION",b,F,H,O=ReadShort(A,7)),0==O)return e.SendDataToHost(b,!0,IntToStr(60)+IntToStr(8),1&T),-1;var z=IntToStr(8);return 0==H&&(z+=C),(1==H||F&&H<1)&&(z+=s),(2==H||F&&H<2)&&(z+=m),(3==H||F&&H<3)&&(z+=l),(16==H||F&&H<16)&&(z+=f),(30==H||F&&H<30)&&(z+=u),(256==H||F&&H<256)&&(z+=h),(261==H||F&&H<261)&&(z+=p),(z=IntToStr(z.length)+z).length>O&&(z=z.substring(0,O)),e.SendDataToHost(b,!0,z,1&T),-1;case 74:if(r("SCSI: GET_EVENT_STATUS_NOTIFICATION",b,A.charCodeAt(1),A.charCodeAt(4),A.charCodeAt(9)),1!=A.charCodeAt(1)&&16!=A.charCodeAt(4)){r("SCSI ERROR"),e.SendCommandEndResponse(1,5,b,38,1);break}var x=0;(160==b&&null!=e.floppy||176==b&&null!=e.cdrom)&&(x=2),e.SendDataToHost(b,!0,String.fromCharCode(0,x,128,0),1&T);break;case 76:e.SendCommand(81,IntToStrX(0)+IntToStrX(0)+IntToStrX(0)+String.fromCharCode(135,80,3,0,0,0,176,81,5,32,0),!0);break;case 81:return r("SCSI READ_DISC_INFO",b),e.SendCommandEndResponse(0,5,b,32,0),-1;case 85:return r("SCSI ERROR: MODE_SELECT_10",b),e.SendCommandEndResponse(1,5,b,32,0),-1;case 90:r("SCSI: MODE_SENSE_10",b,63&A.charCodeAt(2));z=null;if(0==(O=ReadShort(A,7)))return e.SendDataToHost(b,!0,IntToStr(60)+IntToStr(8),1&T),-1;var N=0;switch(160==b?null!=e.floppy&&(N=e.floppy.size>>9):null!=e.cdrom&&(N=e.cdrom.size>>11),63&A.charCodeAt(2)){case 1:z=160==b?N<=2880?R:E:I;break;case 5:160==b&&(z=N<=2880?o:n);break;case 63:z=160==b?N<=2880?t:a:i;break;case 26:176==b&&(z=d);break;case 29:176==b&&(z=S);break;case 42:176==b&&(z=c)}null==z?e.SendCommandEndResponse(0,5,b,32,0):e.SendDataToHost(b,!0,z,1&T);break;default:return r("IDER: Unknown SCSI command",A.charCodeAt(0)),e.SendCommandEndResponse(0,5,b,32,0),-1}}(k,O,X,v),28;case 83:if(e.acc.length<14)return 0;b=ReadShortX(e.acc,9);return e.acc.length<14+b?0:(r("SCSI_WRITE, len = "+(14+b)),e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,112,3,0,0,0,160,81,7,39,0),!0),14+b);default:r("Unknown IDER command",e.acc[0]),e.Stop()}return 0};var b,A,T,D=!1,y=null;function _(r){var n=T,a=A;T>e.iderinfo.readbfr&&(n=e.iderinfo.readbfr),T-=n,A+=n;var o=new FileReader;o.onload=function(){e.SendDataToHost(b,0==T,this.result,1&r),T>0&&0==D?_(r):(y=null,D&&(e.SendCommand(71),D=!1))},o.readAsBinaryString(y.slice(a,a+n))}return e}
\ No newline at end of file
public/scripts/amt-redir-ws-0.1.0-min.js
+1
-1
@@ -1 +1 @@
1
-var CreateAmtRedirect=function(e,o){var y={};function x(e){return String.fromCharCode.apply(null,e)}return((y.m=e).parent=y).authCookie=o,y.State=0,y.socket=null,y.host=null,y.port=0,y.user=null,y.pass=null,y.authuri="/RedirectionService",y.tlsv1only=0,y.inDataCount=0,y.connectstate=0,y.protocol=e.protocol,y.acc=null,y.amtsequence=1,y.amtkeepalivetimer=null,y.onStateChanged=null,y.Start=function(e,t,n,r,a){y.host=e,y.port=t,y.user=n,y.pass=r,y.tls=a,y.connectstate=0,y.inDataCount=0;e=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+e+"&port="+t+"&tls="+a+("*"==n?"&serverauth=1":"")+(void 0===r?"&serverauth=1&user="+n:"");null!=o&&""!=o&&(e+="&auth="+o),y.socket=new WebSocket(e),y.socket.binaryType="arraybuffer",y.socket.onopen=y.xxOnSocketConnected,y.socket.onmessage=y.xxOnMessage,y.socket.onclose=y.xxOnSocketClosed,y.xxStateChange(1)},y.xxOnSocketConnected=function(){y.xxStateChange(2),1==y.protocol&&y.directSend(new Uint8Array([16,0,0,0,83,79,76,32])),2==y.protocol&&y.directSend(new Uint8Array([16,1,0,0,75,86,77,82])),3==y.protocol&&y.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))},y.xxOnMessage=function(e){if(e.data&&-1!=y.connectstate){if(y.inDataCount++,1==y.connectstate&&(2==y.protocol||3==y.protocol))return y.m.ProcessBinaryData?y.m.ProcessBinaryData(e.data):y.m.ProcessData(x(e.data));var t;for(null==y.acc?y.acc=e.data:((t=new Uint8Array(y.acc.byteLength+e.data.byteLength)).set(new Uint8Array(y.acc),0),t.set(new Uint8Array(e.data),y.acc.byteLength),y.acc=t.buffer);null!=y.acc&&1<=y.acc.byteLength;){var n=0,r=new Uint8Array(y.acc);switch(r[0]){case 17:if(r.byteLength<4)return;var a=r[1];if(0===a){if(r.byteLength<13)return;a=r[12];if(r.byteLength<13+a)return;y.directSend(new Uint8Array([19,0,0,0,0,0,0,0,0])),n=13+a}else y.Stop(1);break;case 20:if(r.byteLength<9)return;var o=new DataView(y.acc).getUint32(5,!0);if(r.byteLength<9+o)return;var a=r[1],c=r[4],s=[];for(i=0;i<o;i++)s.push(r[9+i]);var l=new Uint8Array(y.acc.slice(9,9+o)),n=9+o;if(0==c)0<=s.indexOf(4)?y.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(y.user.length+y.authuri.length+8)+String.fromCharCode(y.user.length)+y.user+String.fromCharCode(0,0)+String.fromCharCode(y.authuri.length)+y.authuri+String.fromCharCode(0,0,0,0)):y.Stop(2);else if(3!=c&&4!=c||1!=a)if(0==a)switch(y.protocol){case 1:y.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(y.amtsequence++)+ShortToStrX(1e4)+ShortToStrX(100)+ShortToStrX(0)+ShortToStrX(1e4)+ShortToStrX(100)+ShortToStrX(0)+IntToStrX(0));break;case 2:y.directSend(new Uint8Array([64,0,0,0,0,0,0,0]));break;case 3:y.connectstate=1,y.xxStateChange(3)}else y.Stop(3);else{var h=0,u=l[0],S=x(new Uint8Array(l.buffer.slice(1,1+u))),u=l[h+=u+1],d=x(new Uint8Array(l.buffer.slice(h+1,h+1+u))),u=(h+=u+1,null),g=(e=>{for(var t="",n=0;n<e;n++)t+="abcdef0123456789".charAt(Math.floor(16*Math.random()));return t})(32),f="00000002",C="",l=(4==c&&(m=l[h],u=x(new Uint8Array(l.buffer.slice(h+1,h+1+m))),C=f+":"+g+":"+u+":"),hex_md5(hex_md5(y.user+":"+S+":"+y.pass)+":"+d+":"+C+hex_md5("POST:"+y.authuri))),h=y.user.length+S.length+d.length+y.authuri.length+g.length+f.length+l.length+7,m=(4==c&&(h+=u.length+1),String.fromCharCode(19,0,0,0,c)+IntToStrX(h)+String.fromCharCode(y.user.length)+y.user+String.fromCharCode(S.length)+S+String.fromCharCode(d.length)+d+String.fromCharCode(y.authuri.length)+y.authuri+String.fromCharCode(g.length)+g+String.fromCharCode(f.length)+f+String.fromCharCode(l.length)+l);4==c&&(m+=String.fromCharCode(u.length)+u),y.xxSend(m)}break;case 33:r.byteLength<23||(n=23,y.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(y.amtsequence++)+String.fromCharCode(0,0,27,0,0,0)),1==y.protocol&&(y.amtkeepalivetimer=setInterval(y.xxSendAmtKeepAlive,2e3)),y.connectstate=1,y.xxStateChange(3));break;case 41:r.byteLength<10||(n=10);break;case 42:r.byteLength<10||(C=10+(r[9]<<8)+r[8],r.byteLength<C)||(y.m.ProcessBinaryData?y.m.ProcessBinaryData(new Uint8Array(r.buffer.slice(10,C))):y.m.ProcessData(x(new Uint8Array(r.buffer.slice(10,C)))),n=C);break;case 43:r.byteLength<8||(n=8);break;case 65:r.byteLength<8||(y.connectstate=1,y.m.Start(),8<r.byteLength&&(y.m.ProcessBinaryData?y.m.ProcessBinaryData(new Uint8Array(r.buffer.slice(8))):y.m.ProcessData(x(new Uint8Array(r.buffer.slice(8))))),n=r.byteLength);break;case 240:y.serverIsRecording=!0,n=1;break;default:return console.log("Unknown Intel AMT command: "+r[0]+" acclen="+r.byteLength),void y.Stop(4)}if(0==n)return;n!=y.acc.byteLength?y.acc=y.acc.slice(n):y.acc=null}}},y.directSend=function(e){try{y.socket.send(e.buffer)}catch(e){}},y.xxSend=function(e){if(null!=y.socket&&y.socket.readyState==WebSocket.OPEN){for(var t=new Uint8Array(e.length),n=0;n<e.length;++n)t[n]=e.charCodeAt(n);try{y.socket.send(t.buffer)}catch(e){}}},y.Send=y.send=function(e){null!=y.socket&&1==y.connectstate&&y.xxSend(1==y.protocol?String.fromCharCode(40,0,0,0)+IntToStrX(y.amtsequence++)+ShortToStrX(e.length)+e:e)},y.xxSendAmtKeepAlive=function(){null!=y.socket&&y.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(y.amtsequence++))},y.xxOnSocketClosed=function(){0==y.inDataCount&&0==y.tlsv1only?(y.tlsv1only=1,y.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+y.host+"&port="+y.port+"&tls="+y.tls+"&tls1only=1"+("*"==y.user?"&serverauth=1":"")+("undefined"==typeof pass?"&serverauth=1&user="+y.user:"")),y.socket.binaryType="arraybuffer",y.socket.onopen=y.xxOnSocketConnected,y.socket.onmessage=y.xxOnMessage,y.socket.onclose=y.xxOnSocketClosed):y.Stop(5)},y.xxStateChange=function(e){y.State!=e&&(y.State=e,y.m.xxStateChange(y.State),null!=y.onStateChanged)&&y.onStateChanged(y,y.State)},y.Stop=function(e){y.xxStateChange(0),y.connectstate=-1,(y.acc=null)!=y.socket&&(y.socket.close(),y.socket=null),null!=y.amtkeepalivetimer&&(clearInterval(y.amtkeepalivetimer),y.amtkeepalivetimer=null)},y}
\ No newline at end of file
1
+var CreateAmtRedirect=function(e,t){var n={};function r(e){return String.fromCharCode.apply(null,e)}function a(e){for(var t="",n=0;n<e;n++)t+="abcdef0123456789".charAt(Math.floor(16*Math.random()));return t}return n.m=e,e.parent=n,n.authCookie=t,n.State=0,n.socket=null,n.host=null,n.port=0,n.user=null,n.pass=null,n.authuri="/RedirectionService",n.tlsv1only=0,n.inDataCount=0,n.connectstate=0,n.protocol=e.protocol,n.acc=null,n.amtsequence=1,n.amtkeepalivetimer=null,n.onStateChanged=null,n.Start=function(e,r,a,o,c){n.host=e,n.port=r,n.user=a,n.pass=o,n.tls=c,n.connectstate=0,n.inDataCount=0;var s=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+e+"&port="+r+"&tls="+c+("*"==a?"&serverauth=1":"")+(void 0===o?"&serverauth=1&user="+a:"");null!=t&&""!=t&&(s+="&auth="+t),n.socket=new WebSocket(s),n.socket.binaryType="arraybuffer",n.socket.onopen=n.xxOnSocketConnected,n.socket.onmessage=n.xxOnMessage,n.socket.onclose=n.xxOnSocketClosed,n.xxStateChange(1)},n.xxOnSocketConnected=function(){n.xxStateChange(2),1==n.protocol&&n.directSend(new Uint8Array([16,0,0,0,83,79,76,32])),2==n.protocol&&n.directSend(new Uint8Array([16,1,0,0,75,86,77,82])),3==n.protocol&&n.directSend(new Uint8Array([16,0,0,0,73,68,69,82]))},n.xxOnMessage=function(e){if(e.data&&-1!=n.connectstate){if(n.inDataCount++,1==n.connectstate&&(2==n.protocol||3==n.protocol))return n.m.ProcessBinaryData?n.m.ProcessBinaryData(e.data):n.m.ProcessData(r(e.data));if(null==n.acc)n.acc=e.data;else{var t=new Uint8Array(n.acc.byteLength+e.data.byteLength);t.set(new Uint8Array(n.acc),0),t.set(new Uint8Array(e.data),n.acc.byteLength),n.acc=t.buffer}for(;null!=n.acc&&n.acc.byteLength>=1;){var o=0,c=new Uint8Array(n.acc);switch(c[0]){case 17:if(c.byteLength<4)return;if(0===c[1]){if(c.byteLength<13)return;var s=c[12];if(c.byteLength<13+s)return;n.directSend(new Uint8Array([19,0,0,0,0,0,0,0,0])),o=13+s}else n.Stop(1);break;case 20:if(c.byteLength<9)return;var l=new DataView(n.acc).getUint32(5,!0);if(c.byteLength<9+l)return;var h=c[1],u=c[4],S=[];for(i=0;i<l;i++)S.push(c[9+i]);var f=new Uint8Array(n.acc.slice(9,9+l));if(o=9+l,0==u)S.indexOf(4)>=0?n.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(n.user.length+n.authuri.length+8)+String.fromCharCode(n.user.length)+n.user+String.fromCharCode(0,0)+String.fromCharCode(n.authuri.length)+n.authuri+String.fromCharCode(0,0,0,0)):n.Stop(2);else if(3!=u&&4!=u||1!=h)if(0==h)switch(n.protocol){case 1:n.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(n.amtsequence++)+ShortToStrX(1e4)+ShortToStrX(100)+ShortToStrX(0)+ShortToStrX(1e4)+ShortToStrX(100)+ShortToStrX(0)+IntToStrX(0));break;case 2:n.directSend(new Uint8Array([64,0,0,0,0,0,0,0]));break;case 3:n.connectstate=1,n.xxStateChange(3)}else n.Stop(3);else{var d=0,g=f[d],C=r(new Uint8Array(f.buffer.slice(d+1,d+1+g))),m=f[d+=g+1],x=r(new Uint8Array(f.buffer.slice(d+1,d+1+m)));d+=m+1;var y=0,b=null,p=a(32),k="00000002",w="";4==u&&(y=f[d],b=r(new Uint8Array(f.buffer.slice(d+1,d+1+y))),d+=y+1,w=k+":"+p+":"+b+":");var v=hex_md5(hex_md5(n.user+":"+C+":"+n.pass)+":"+x+":"+w+hex_md5("POST:"+n.authuri)),A=n.user.length+C.length+x.length+n.authuri.length+p.length+8+v.length+7;4==u&&(A+=b.length+1);var U=String.fromCharCode(19,0,0,0,u)+IntToStrX(A)+String.fromCharCode(n.user.length)+n.user+String.fromCharCode(C.length)+C+String.fromCharCode(x.length)+x+String.fromCharCode(n.authuri.length)+n.authuri+String.fromCharCode(p.length)+p+String.fromCharCode(8)+k+String.fromCharCode(v.length)+v;4==u&&(U+=String.fromCharCode(b.length)+b),n.xxSend(U)}break;case 33:if(c.byteLength<23)break;o=23,n.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(n.amtsequence++)+String.fromCharCode(0,0,27,0,0,0)),1==n.protocol&&(n.amtkeepalivetimer=setInterval(n.xxSendAmtKeepAlive,2e3)),n.connectstate=1,n.xxStateChange(3);break;case 41:if(c.byteLength<10)break;o=10;break;case 42:if(c.byteLength<10)break;var L=10+(c[9]<<8)+c[8];if(c.byteLength<L)break;n.m.ProcessBinaryData?n.m.ProcessBinaryData(new Uint8Array(c.buffer.slice(10,L))):n.m.ProcessData(r(new Uint8Array(c.buffer.slice(10,L)))),o=L;break;case 43:if(c.byteLength<8)break;o=8;break;case 65:if(c.byteLength<8)break;n.connectstate=1,n.m.Start(),c.byteLength>8&&(n.m.ProcessBinaryData?n.m.ProcessBinaryData(new Uint8Array(c.buffer.slice(8))):n.m.ProcessData(r(new Uint8Array(c.buffer.slice(8))))),o=c.byteLength;break;case 240:n.serverIsRecording=!0,o=1;break;default:return console.log("Unknown Intel AMT command: "+c[0]+" acclen="+c.byteLength),void n.Stop(4)}if(0==o)return;o!=n.acc.byteLength?n.acc=n.acc.slice(o):n.acc=null}}},n.directSend=function(e){try{n.socket.send(e.buffer)}catch(e){}},n.xxSend=function(e){if(null!=n.socket&&n.socket.readyState==WebSocket.OPEN){for(var t=new Uint8Array(e.length),r=0;r<e.length;++r)t[r]=e.charCodeAt(r);try{n.socket.send(t.buffer)}catch(e){}}},n.Send=n.send=function(e){null!=n.socket&&1==n.connectstate&&(1==n.protocol?n.xxSend(String.fromCharCode(40,0,0,0)+IntToStrX(n.amtsequence++)+ShortToStrX(e.length)+e):n.xxSend(e))},n.xxSendAmtKeepAlive=function(){null!=n.socket&&n.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(n.amtsequence++))},n.xxOnSocketClosed=function(){0==n.inDataCount&&0==n.tlsv1only?(n.tlsv1only=1,n.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+n.host+"&port="+n.port+"&tls="+n.tls+"&tls1only=1"+("*"==n.user?"&serverauth=1":"")+("undefined"==typeof pass?"&serverauth=1&user="+n.user:"")),n.socket.binaryType="arraybuffer",n.socket.onopen=n.xxOnSocketConnected,n.socket.onmessage=n.xxOnMessage,n.socket.onclose=n.xxOnSocketClosed):n.Stop(5)},n.xxStateChange=function(e){n.State!=e&&(n.State=e,n.m.xxStateChange(n.State),null!=n.onStateChanged&&n.onStateChanged(n,n.State))},n.Stop=function(e){n.xxStateChange(0),n.connectstate=-1,n.acc=null,null!=n.socket&&(n.socket.close(),n.socket=null),null!=n.amtkeepalivetimer&&(clearInterval(n.amtkeepalivetimer),n.amtkeepalivetimer=null)},n}
\ No newline at end of file
public/scripts/amt-script-0.2.0-min.js
+1
-1
@@ -1 +1 @@
1
-function script_setup(e,t){var d={startvars:t};return e.length<6?(console.error("Invalid script length"),null):612182341!=ReadInt(e,0)?(console.error("Invalid binary script"),null):1<ReadShort(e,4)?(console.error("Unsupported script version"),null):(d.script=e.substring(6),d.reset=function(e){d.stop(),d.ip=0,d.variables=t,d.state=1},d.start=function(e){d.stop(),0<(d.stepspeed=e)&&(d.timer=setInterval(function(){d.step()},e))},d.stop=function(){null!=d.timer&&clearInterval(d.timer),d.timer=null,d.stepspeed=0},d.getVar=function(e){if(null!=e)return d.getVarEx(e.split("."),d.variables)},d.getVarEx=function(e,t){try{if(null!=e)return 0==e.length?t:d.getVarEx(e.slice(1),t[e[0]])}catch(e){return null}},d.setVar=function(e,t){d.setVarEx(e.split("."),d.variables,t)},d.setVarEx=function(e,t,r){1==e.length?t[e[0]]=r:d.setVarEx(e.slice(1),t[e[0]],r)},d.step=function(){if(1==d.state){if(d.ip<d.script.length){var e=ReadShort(d.script,d.ip),t=ReadShort(d.script,d.ip+2),r=ReadShort(d.script,d.ip+4),n=d.ip+6,a=[];for(s in d.variables)s.startsWith("__")&&delete d.variables[s];for(var s=0;s<r;s++){var o=ReadShort(d.script,n),i=(c=d.script.substring(n+2,n+2+o)).charCodeAt(0);if(c=c.substring(1),i<2){for(;1<c.split("{").length;)var l=c.split("{").pop().split("}").shift(),c=c.replace("{"+l+"}",d.getVar(l));1==i&&(d.variables["__"+s]=decodeURI(c),c="__"+s),a.push(c)}2!=i&&3!=i||(d.variables["__"+s]=ReadSInt(c,0),a.push("__"+s)),n+=2+o}d.ip+=t;for(var u,p=[],s=0;s<10;s++)p.push(d.getVar(a[s]));try{if(e<1e4)switch(e){case 0:break;case 1:(!p[2]||"<"==p[2]&&p[1]<p[3]||"<="==p[2]&&p[1]<=p[3]||"!="==p[2]&&p[1]!=p[3]||"="==p[2]&&p[1]==p[3]||">="==p[2]&&p[3]<=p[1]||">"==p[2]&&p[3]<p[1])&&(d.ip=p[0]);break;case 2:null==a[1]?delete d.variables[a[0]]:d.setVar(a[0],p[1]);break;case 3:d.onConsole?d.onConsole(d.toString(p[0]),d):console.log(d.toString(p[0]));break;case 4:d.state=2,d.dialog=!0,setDialogMode(11,p[0],p[2],d.xxStepDialogOk,p[1],d);break;case 5:for(var s in p[1])p[1][s][p[2]]==p[3]&&(u=s);break;case 6:u=p[1].substr(p[2],p[3]);break;case 7:u=p[1].indexOf(p[2]);break;case 8:u=p[1].split(p[2]);break;case 9:u=p[1].join(p[2]);break;case 10:u=p[1].length;break;case 11:u=JSON.parse(p[1]);break;case 12:u=JSON.stringify(p[1]);break;case 13:u=p[1]+p[2];break;case 14:u=p[1]-p[2];break;case 15:u=parseInt(p[1]);break;case 16:d.state=2,d.amtstack.BatchEnum(p[0],p[1],d.xxWsmanReturn,d);break;case 17:d.state=2,d.amtstack.Put(p[0],p[1],d.xxWsmanReturn,d);break;case 18:d.state=2,d.amtstack.Create(p[0],p[1],d.xxWsmanReturn,d);break;case 19:d.state=2,d.amtstack.Delete(p[0],p[1],d.xxWsmanReturn,d);break;case 20:d.state=2,d.amtstack.Exec(p[0],p[1],p[2],d.xxWsmanReturn,d,0,p[3]);break;case 21:d.stepspeed=p[0],null!=d.timer&&(clearInterval(d.timer),d.timer=setInterval(function(){d.step()},d.stepspeed));break;case 22:d.state=2,d.amtstack.Subscribe(p[0],p[1],p[2],d.xxWsmanReturn,d,0,p[3],p[4],p[5],p[6]);break;case 23:d.state=2,d.amtstack.UnSubscribe(p[0],d.xxWsmanReturn,d,0,p[1]);break;case 24:console.log(p[1],p[2],p[1].charCodeAt(p[2])),u=p[1].charCodeAt(p[2]);break;case 25:d.state=2,amtcert_signWithCaKey(p[0],null,p[1],{CN:"Untrusted Root Certificate"},d.xxSignWithDummyCaReturn);break;default:d.state=9,console.error("Script Error, unknown command: "+e)}else e<2e4?u=script_functionTableX2[e-1e4](p[1],p[2],p[3],p[4],p[5],p[6]):script_functionTableX3&&script_functionTableX3[e-2e4]&&(u=script_functionTableX3[e-2e4](d,p[1],p[2],p[3],p[4],p[5],p[6]));null!=u&&d.setVar(a[0],u)}catch(e){"object"==typeof e&&(e=e.message),d.setVar("_exception",e)}}return 1==d.state&&d.ip>=d.script.length&&(d.state=0,d.stop()),d.onStep&&d.onStep(d),d}},d.xxStepDialogOk=function(e){d.variables.DialogSelect=e,d.state=1,d.dialog=!1,d.onStep&&d.onStep(d)},d.xxWsmanReturnFix=function(e){e&&null!=e&&(e.Header&&(e.Header=e.Header,delete e.Header),e.Body&&(e.Body=e.Body,delete e.Body),e.Responses&&(e.Responses=e.Responses,delete e.Responses),e.Response&&(e.Response=e.Response,delete e.Response),e.ReturnValueStr)&&(e.ReturnValueStr=e.ReturnValueStr,delete e.ReturnValueStr)},d.xxWsmanReturn=function(e,t,r,n){if(r)for(var a in d.xxWsmanReturnFix(r),r)for(var s in d.xxWsmanReturnFix(r[a]),r[a])d.xxWsmanReturnFix(r[a][s]);d.setVar(t,r),d.setVar("wsman_result",n),d.setVar("wsman_result_str",httpErrorTable[n]||"Error #"+n),d.state=1,d.onStep&&d.onStep(d)},d.xxSignWithDummyCaReturn=function(e){d.setVar("signed_cert",btoa(_arrayBufferToString(e))),d.state=1,d.onStep&&d.onStep(d)},d.toString=function(e){return"object"==typeof e?JSON.stringify(e):e},d.reset(),d)}function script_compile(e,t){var r,n="",a=e.split("\n"),s={},o=[],i=[];for(r in a){var l=a[r];if(l.startsWith("##SWAP ")&&3==(c=l.split(" ")).length&&(i[c[1]]=c[2]),"#"!=l[0]&&0!=l.length){for(var c in i)l=l.split(c).join(i[c]);var u=l.match(/"[^"]*"|[^\s"]+/g);if(0!=u.length)if(":"==l[0])s[u[0].toUpperCase()]=n.length;else{var p=script_functionTable1.indexOf(u[0].toLowerCase());if(-1==p&&0<=(p=script_functionTable2.indexOf(u[0].toLowerCase()))&&(p+=1e4),-1==p&&0<=(p=script_functionTable3.indexOf(u[0].toLowerCase()))&&(p+=2e4),-1==p)return t&&t("Unabled to compile, unknown command: "+u[0]),"";var d,h,b=ShortToStr(u.length-1);for(d in u)0!=d&&(":"==u[d][0]?(o.push([u[d],n.length+b.length+7]),b+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295)):(h=parseInt(u[d]))==u[d]?b+=ShortToStr(5)+String.fromCharCode(2)+IntToStr(h):'"'==u[d][0]&&'"'==u[d][u[d].length-1]?b+=ShortToStr(u[d].length-1)+String.fromCharCode(1)+u[d].substring(1,u[d].length-1):b+=ShortToStr(u[d].length+1)+String.fromCharCode(0)+u[d]);n+=b=ShortToStr(p)+ShortToStr(b.length+4)+b}}}for(r in o){var f=o[r][0].toUpperCase(),g=o[r][1],S=s[f];if(null==S)return t&&t("Unabled to compile, unknown label: "+f),"";n=n.substr(0,g)+IntToStr(S)+n.substr(g+4)}return IntToStr(612182341)+ShortToStr(1)+n}function script_decompile(e,t){var r="",n=6,a={};if(0<=t)n=t;else{if(e.length<6)return"# Invalid script length";var s=ReadInt(e,0),o=ReadShort(e,4);if(612182341!=s)return"# Invalid binary script: "+s;if(1!=o)return"# Invalid script version"}for(;n<e.length;){var i=ReadShort(e,n),l=ReadShort(e,n+2),c=ReadShort(e,n+4),u=n+6,p="";0<=t||(r+=":label"+(n-6)+"\n");for(var d=0;d<c;d++){var h=ReadShort(e,u),b=e.substring(u+2,u+2+h),f=b.charCodeAt(0);0==f?p+=" "+b.substring(1):1==f?p+=' "'+b.substring(1)+'"':2==f?p+=" "+ReadInt(b,1):3==f&&((b=a[f=ReadInt(b,1)])||(a[b=":label"+f]=f),p+=" "+b),u+=2+h}if(r+=i<1e4?script_functionTable1[i]+p+"\n":2e4<=i?script_functionTable3[i-2e4]+p+"\n":script_functionTable2[i-1e4]+p+"\n",n+=l,0<=t)return r}var g=r.split("\n"),r="";for(d in g){var S=g[d];(":"!=S[0]||a[S])&&(r+=S+"\n")}return r}script_functionTable1=["nop","jump","set","print","dialog","getitem","substr","indexof","split","join","length","jsonparse","jsonstr","add","substract","parseint","wsbatchenum","wsput","wscreate","wsdelete","wsexec","scriptspeed","wssubscribe","wsunsubscribe","readchar","signwithdummyca"],script_functionTable2=["encodeuri","decodeuri","passwordcheck","atob","btoa","hex2str","str2hex","random","md5","maketoarray","readshort","readshortx","readint","readsint","readintx","shorttostr","shorttostrx","inttostr","inttostrx"],script_functionTableX2=[encodeURI,decodeURI,passwordcheck,window.atob.bind(window),window.btoa.bind(window),hex2rstr,rstr2hex,random,rstr_md5,MakeToArray,ReadShort,ReadShortX,ReadInt,ReadSInt,ReadIntX,ShortToStr,ShortToStrX,IntToStr,IntToStrX],script_functionTable3=["pullsystemstatus","pulleventlog","pullauditlog","pullcertificates","pullwatchdog","pullsystemdefense","pullhardware","pulluserinfo","pullremoteaccess","highlightblock","disconnect","getsidstring","getsidbytearray"],script_functionTableX3=[PullSystemStatus,PullEventLog,PullAuditLog,PullCertificates,PullWatchdog,PullSystemDefense,PullHardware,PullUserInfo,PullRemoteAccess,script_HighlightBlock,disconnect,function(e,t){return GetSidString(t)},function(e,t){return GetSidByteArray(t)}]
\ No newline at end of file
1
+function script_setup(e,t){var r={startvars:t};return e.length<6?(console.error("Invalid script length"),null):612182341!=ReadInt(e,0)?(console.error("Invalid binary script"),null):ReadShort(e,4)>1?(console.error("Unsupported script version"),null):(r.script=e.substring(6),r.reset=function(e){r.stop(),r.ip=0,r.variables=t,r.state=1},r.start=function(e){r.stop(),r.stepspeed=e,e>0&&(r.timer=setInterval((function(){r.step()}),e))},r.stop=function(){null!=r.timer&&clearInterval(r.timer),r.timer=null,r.stepspeed=0},r.getVar=function(e){if(null!=e)return r.getVarEx(e.split("."),r.variables)},r.getVarEx=function(e,t){try{if(null==e)return;return 0==e.length?t:r.getVarEx(e.slice(1),t[e[0]])}catch(e){return null}},r.setVar=function(e,t){r.setVarEx(e.split("."),r.variables,t)},r.setVarEx=function(e,t,a){1==e.length?t[e[0]]=a:r.setVarEx(e.slice(1),t[e[0]],a)},r.step=function(){if(1==r.state){if(r.ip<r.script.length){var e=ReadShort(r.script,r.ip),t=ReadShort(r.script,r.ip+2),a=ReadShort(r.script,r.ip+4),n=r.ip+6,s=[];for(var i in r.variables)i.startsWith("__")&&delete r.variables[i];for(i=0;i<a;i++){var o=ReadShort(r.script,n),l=r.script.substring(n+2,n+2+o),c=l.charCodeAt(0);if(l=l.substring(1),c<2){for(;l.split("{").length>1;){var u=l.split("{").pop().split("}").shift();l=l.replace("{"+u+"}",r.getVar(u))}1==c&&(r.variables["__"+i]=decodeURI(l),l="__"+i),s.push(l)}2!=c&&3!=c||(r.variables["__"+i]=ReadSInt(l,0),s.push("__"+i)),n+=2+o}r.ip+=t;var p,d=[];for(i=0;i<10;i++)d.push(r.getVar(s[i]));try{if(e<1e4)switch(e){case 0:break;case 1:d[2]?("<"==d[2]&&d[1]<d[3]||"<="==d[2]&&d[1]<=d[3]||"!="==d[2]&&d[1]!=d[3]||"="==d[2]&&d[1]==d[3]||">="==d[2]&&d[1]>=d[3]||">"==d[2]&&d[1]>d[3])&&(r.ip=d[0]):r.ip=d[0];break;case 2:null==s[1]?delete r.variables[s[0]]:r.setVar(s[0],d[1]);break;case 3:r.onConsole?r.onConsole(r.toString(d[0]),r):console.log(r.toString(d[0]));break;case 4:r.state=2,r.dialog=!0,setDialogMode(11,d[0],d[2],r.xxStepDialogOk,d[1],r);break;case 5:for(var i in d[1])d[1][i][d[2]]==d[3]&&(p=i);break;case 6:p=d[1].substr(d[2],d[3]);break;case 7:p=d[1].indexOf(d[2]);break;case 8:p=d[1].split(d[2]);break;case 9:p=d[1].join(d[2]);break;case 10:p=d[1].length;break;case 11:p=JSON.parse(d[1]);break;case 12:p=JSON.stringify(d[1]);break;case 13:p=d[1]+d[2];break;case 14:p=d[1]-d[2];break;case 15:p=parseInt(d[1]);break;case 16:r.state=2,r.amtstack.BatchEnum(d[0],d[1],r.xxWsmanReturn,r);break;case 17:r.state=2,r.amtstack.Put(d[0],d[1],r.xxWsmanReturn,r);break;case 18:r.state=2,r.amtstack.Create(d[0],d[1],r.xxWsmanReturn,r);break;case 19:r.state=2,r.amtstack.Delete(d[0],d[1],r.xxWsmanReturn,r);break;case 20:r.state=2,r.amtstack.Exec(d[0],d[1],d[2],r.xxWsmanReturn,r,0,d[3]);break;case 21:r.stepspeed=d[0],null!=r.timer&&(clearInterval(r.timer),r.timer=setInterval((function(){r.step()}),r.stepspeed));break;case 22:r.state=2,r.amtstack.Subscribe(d[0],d[1],d[2],r.xxWsmanReturn,r,0,d[3],d[4],d[5],d[6]);break;case 23:r.state=2,r.amtstack.UnSubscribe(d[0],r.xxWsmanReturn,r,0,d[1]);break;case 24:console.log(d[1],d[2],d[1].charCodeAt(d[2])),p=d[1].charCodeAt(d[2]);break;case 25:r.state=2,amtcert_signWithCaKey(d[0],null,d[1],{CN:"Untrusted Root Certificate"},r.xxSignWithDummyCaReturn);break;default:r.state=9,console.error("Script Error, unknown command: "+e)}else e<2e4?p=script_functionTableX2[e-1e4](d[1],d[2],d[3],d[4],d[5],d[6]):script_functionTableX3&&script_functionTableX3[e-2e4]&&(p=script_functionTableX3[e-2e4](r,d[1],d[2],d[3],d[4],d[5],d[6]));null!=p&&r.setVar(s[0],p)}catch(e){"object"==typeof e&&(e=e.message),r.setVar("_exception",e)}}return 1==r.state&&r.ip>=r.script.length&&(r.state=0,r.stop()),r.onStep&&r.onStep(r),r}},r.xxStepDialogOk=function(e){r.variables.DialogSelect=e,r.state=1,r.dialog=!1,r.onStep&&r.onStep(r)},r.xxWsmanReturnFix=function(e){e&&null!=e&&(e.Header&&(e.Header=e.Header,delete e.Header),e.Body&&(e.Body=e.Body,delete e.Body),e.Responses&&(e.Responses=e.Responses,delete e.Responses),e.Response&&(e.Response=e.Response,delete e.Response),e.ReturnValueStr&&(e.ReturnValueStr=e.ReturnValueStr,delete e.ReturnValueStr))},r.xxWsmanReturn=function(e,t,a,n){if(a)for(var s in r.xxWsmanReturnFix(a),a)for(var i in r.xxWsmanReturnFix(a[s]),a[s])r.xxWsmanReturnFix(a[s][i]);r.setVar(t,a),r.setVar("wsman_result",n),r.setVar("wsman_result_str",httpErrorTable[n]?httpErrorTable[n]:"Error #"+n),r.state=1,r.onStep&&r.onStep(r)},r.xxSignWithDummyCaReturn=function(e){r.setVar("signed_cert",btoa(_arrayBufferToString(e))),r.state=1,r.onStep&&r.onStep(r)},r.toString=function(e){return"object"==typeof e?JSON.stringify(e):e},r.reset(),r)}function script_compile(e,t){var r="",a=e.split("\n"),n={},s=[],i=[];for(var o in a){var l=a[o];if(l.startsWith("##SWAP "))3==(c=l.split(" ")).length&&(i[c[1]]=c[2]);if("#"!=l[0]&&0!=l.length){for(var c in i)l=l.split(c).join(i[c]);var u=l.match(/"[^"]*"|[^\s"]+/g);if(0!=u.length)if(":"!=l[0]){var p=script_functionTable1.indexOf(u[0].toLowerCase());if(-1==p&&(p=script_functionTable2.indexOf(u[0].toLowerCase()))>=0&&(p+=1e4),-1==p&&(p=script_functionTable3.indexOf(u[0].toLowerCase()))>=0&&(p+=2e4),-1==p)return t&&t("Unabled to compile, unknown command: "+u[0]),"";var d=ShortToStr(u.length-1);for(var f in u)if(0!=f)if(":"==u[f][0])s.push([u[f],r.length+d.length+7]),d+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295);else{var h=parseInt(u[f]);h==u[f]?d+=ShortToStr(5)+String.fromCharCode(2)+IntToStr(h):'"'==u[f][0]&&'"'==u[f][u[f].length-1]?d+=ShortToStr(u[f].length-1)+String.fromCharCode(1)+u[f].substring(1,u[f].length-1):d+=ShortToStr(u[f].length+1)+String.fromCharCode(0)+u[f]}r+=d=ShortToStr(p)+ShortToStr(d.length+4)+d}else n[u[0].toUpperCase()]=r.length}}for(o in s){var b=s[o][0].toUpperCase(),g=s[o][1],S=n[b];if(null==S)return t&&t("Unabled to compile, unknown label: "+b),"";r=r.substr(0,g)+IntToStr(S)+r.substr(g+4)}return IntToStr(612182341)+ShortToStr(1)+r}function script_decompile(e,t){var r="",a=6,n={};if(t>=0)a=t;else{if(e.length<6)return"# Invalid script length";var s=ReadInt(e,0),i=ReadShort(e,4);if(612182341!=s)return"# Invalid binary script: "+s;if(1!=i)return"# Invalid script version"}for(;a<e.length;){var o=ReadShort(e,a),l=ReadShort(e,a+2),c=ReadShort(e,a+4),u=a+6,p="";t>=0||(r+=":label"+(a-6)+"\n");for(var d=0;d<c;d++){var f=ReadShort(e,u),h=e.substring(u+2,u+2+f),b=h.charCodeAt(0);if(0==b)p+=" "+h.substring(1);else if(1==b)p+=' "'+h.substring(1)+'"';else if(2==b)p+=" "+ReadInt(h,1);else if(3==b){var g=ReadInt(h,1),S=n[g];S||(n[S=":label"+g]=g),p+=" "+S}u+=2+f}if(r+=o<1e4?script_functionTable1[o]+p+"\n":o>=2e4?script_functionTable3[o-2e4]+p+"\n":script_functionTable2[o-1e4]+p+"\n",a+=l,t>=0)return r}var m=r.split("\n");for(var d in r="",m){var x=m[d];(":"!=x[0]||n[x])&&(r+=x+"\n")}return r}script_functionTable1=["nop","jump","set","print","dialog","getitem","substr","indexof","split","join","length","jsonparse","jsonstr","add","substract","parseint","wsbatchenum","wsput","wscreate","wsdelete","wsexec","scriptspeed","wssubscribe","wsunsubscribe","readchar","signwithdummyca"],script_functionTable2=["encodeuri","decodeuri","passwordcheck","atob","btoa","hex2str","str2hex","random","md5","maketoarray","readshort","readshortx","readint","readsint","readintx","shorttostr","shorttostrx","inttostr","inttostrx"],script_functionTableX2=[encodeURI,decodeURI,passwordcheck,window.atob.bind(window),window.btoa.bind(window),hex2rstr,rstr2hex,random,rstr_md5,MakeToArray,ReadShort,ReadShortX,ReadInt,ReadSInt,ReadIntX,ShortToStr,ShortToStrX,IntToStr,IntToStrX],script_functionTable3=["pullsystemstatus","pulleventlog","pullauditlog","pullcertificates","pullwatchdog","pullsystemdefense","pullhardware","pulluserinfo","pullremoteaccess","highlightblock","disconnect","getsidstring","getsidbytearray"],script_functionTableX3=[PullSystemStatus,PullEventLog,PullAuditLog,PullCertificates,PullWatchdog,PullSystemDefense,PullHardware,PullUserInfo,PullRemoteAccess,script_HighlightBlock,disconnect,function(e,t){return GetSidString(t)},function(e,t){return GetSidByteArray(t)}]
\ No newline at end of file
public/scripts/amt-setupbin-0.1.0-min.js
+1
-1
@@ -1 +1 @@
1
-var AmtSetupBinSetupGuids=["µûqËùJ´AÊ{85xù","²XÏkrL¡^Q.Ä","§÷öÆÄöGíâå\r¥","ª©4Rá)©DM\b¹cS"],AmtSetupBinVarIds={1:{1:[0,"Current MEBx Password"],2:[0,"New MEBx Password"],3:[1,"Manageability Feature Selection"],4:[1,"Firmware Local Update",{0:"Disabled",1:"Enabled",2:"Password Protected"}],5:[1,"Firmware Update Qualifier",{0:"Always",1:"Never",2:"Restricted"}],6:[0,"Power Package"]},2:{1:[0,"Provisioning Preshared Key ID (PID)"],2:[0,"Provisioning Preshared Key (PPS)"],3:[0,"PKI DNS Suffix"],4:[0,"Configuration Server FQDN"],5:[1,"Remote Configuration Enabled (RCFG)",{0:"Off",1:"On"}],6:[1,"Pre-Installed Certificates Enabled",{0:"Off",1:"On"}],7:[1,"User Defined Certificate Configuration",{0:"Disabled",1:"Enabled",2:"Delete"}],8:[0,"User Defined Certificate Addition"],10:[1,"SOL/IDER Redirection Configuration"],11:[0,"Hostname"],12:[0,"Domain Name"],13:[0,"DHCP"],14:[1,"Secure Firmware Update (SFWU)",{0:"Disabled",1:"Enabled"}],15:[0,"ITO"],16:[1,"Provisioning Mode (PM)",{0:"Enterprise",1:"Small Buisness"}],17:[0,"Provisioning Server Address"],18:[2,"Provision Server Port Number (PSPO)"],19:[0,"Static PV4 Parameters"],20:[0,"VLAN"],21:[0,"PASS Policy Flag"],22:[0,"IPv6"],23:[1,"Shared/Dedicated FQDN",{0:"Dedicated",1:"Shared"}],24:[1,"Dynamic DNS Update",{0:"Disabled",1:"Enabled"}],25:[1,"Remote Desktop (KVM) State",{0:"Disabled",1:"Enabled"}],26:[1,"Opt-in User Consent Option",{0:"Disabled",1:"KVM",255:"All"}],27:[1,"Opt-in Remote IT Consent Policy",{0:"Disabled",1:"Enabled"}],28:[1,"ME Provision Halt Active",{0:"Stop",1:"Start"}],29:[1,"Manual Setup and Configuration",{0:"Automated",1:"Manual"}],30:[3,"Support Channel Identifier"],31:[0,"Support Channel Description"],32:[0,"Service Account Number"],33:[0,"Enrollement Passcode"],34:[3,"Service Type"],35:[0,"Service Provider Identifier"]}},AmtSetupBinCreate=function(e,r){var t={};return t.fileType=e,t.recordChunkCount=0,t.recordHeaderByteCount=0,t.recordNumber=0,t.majorVersion=e,t.minorVersion=0,t.flags=r,t.dataRecordsConsumed=0,t.dataRecordChunkCount=0,t.records=[],t},AmtSetupBinDecode=function(e){var r,t={},o=e.substring(0,16);for(r in t.fileType=0,AmtSetupBinSetupGuids)o==AmtSetupBinSetupGuids[r]&&(t.fileType=+r+1);if(0!=t.fileType){t.recordChunkCount=ReadShortX(e,16),t.recordHeaderByteCount=ReadShortX(e,18),t.recordNumber=ReadIntX(e,20),t.majorVersion=e.charCodeAt(24),t.minorVersion=e.charCodeAt(25),t.flags=ReadShortX(e,26);for(var a=ReadIntX(e,28),n=(t.dataRecordsConsumed=ReadIntX(e,32),t.dataRecordChunkCount=ReadShortX(e,36),t.records=[],512);n+512<=e.length;){var i={},d=(i.typeIdentifier=ReadIntX(e,n),i.flags=ReadIntX(e,n+4),i.chunkCount=ReadShortX(e,n+8),i.headerByteCount=ReadShortX(e,n+10),i.number=ReadIntX(e,n+12),i.variables=[],0),u=e.substring(n+24,n+512);for(0!=(2&i.flags)&&(u=AmtSetupBinDescrambleRecordData(u));;){var s={};if(s.moduleid=ReadShortX(u,d),s.varid=ReadShortX(u,d+2),0==s.moduleid||0==s.varid)break;AmtSetupBinVarIds[s.moduleid][s.varid]&&(s.length=ReadShortX(u,d+4),s.type=AmtSetupBinVarIds[s.moduleid][s.varid][0],s.desc=AmtSetupBinVarIds[s.moduleid][s.varid][1],s.value=u.substring(d+8,d+8+s.length),1==s.type&&1==s.length?s.value=s.value.charCodeAt(0):2==s.type&&2==s.length?s.value=ReadShortX(s.value,0):3==s.type&&4==s.length&&(s.value=ReadIntX(s.value,0)),i.variables.push(s)),d+=8+4*Math.floor((s.length+3)/4)}i.variables.sort(AmtSetupBinVariableCompare),t.records.push(i),n+=512}if(a==t.records.length)return t}},AmtSetupBinEncode=function(e){if(e.fileType<1&&e.fileType>AmtSetupBinSetupGuids.length)return null;for(var r,t=[],o=AmtSetupBinSetupGuids[e.fileType-1],a=0,o=(o=(o=(o=(o=(o=(o=(o+=ShortToStrX(e.recordChunkCount))+ShortToStrX(e.recordHeaderByteCount))+IntToStrX(e.recordNumber))+String.fromCharCode(e.majorVersion,e.minorVersion))+ShortToStrX(e.flags))+IntToStrX(e.records.length))+IntToStrX(e.dataRecordsConsumed))+ShortToStrX(e.dataRecordChunkCount);o.length<512;)o+="\0";for(r in t.push(o),e.records){var n,i="",d=e.records[r],i=(i=(i=(i=(i=(i=(i+=IntToStrX(d.typeIdentifier))+IntToStrX(d.flags))+IntToStrX(0))+IntToStrX(0))+ShortToStrX(1))+ShortToStrX(24))+IntToStrX(++a);for(n in d.variables.sort(AmtSetupBinVariableCompare),d.variables){var u="",s=d.variables[n],l=s.value;for(s.type=AmtSetupBinVarIds[s.moduleid][s.varid][0],0<s.type&&(l=parseInt(l),1==s.type&&(l=String.fromCharCode(l)),2==s.type&&(l=ShortToStrX(l)),3==s.type)&&(l=IntToStrX(l)),u=(u=(u=(u+=ShortToStrX(s.moduleid))+ShortToStrX(s.varid))+ShortToStrX(l.length))+ShortToStrX(0)+l;u.length%4!=0;)u+="\0";i+=u}for(;i.length<512;)i+="\0";0!=(2&d.flags)&&(i=i.substring(0,24)+AmtSetupBinScrambleRecordData(i.substring(24))),t.push(i)}return t.join("")};function AmtSetupBinVariableCompare(e,r){return e.moduleid>r.moduleid?1:e.moduleid<r.moduleid?-1:r.varid<e.varid?1:e.varid<r.varid?-1:0}function AmtSetupBinScrambleRecordData(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)+17&255);return r}function AmtSetupBinDescrambleRecordData(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)+239&255);return r}
\ No newline at end of file
1
+var AmtSetupBinSetupGuids=["µûqËùJ´AÊ{85xù","²XÏkrL¡^Q.Ä","§÷öÆÄöGíâå\r¥","ª©4Rá)©DM\b¹cS"],AmtSetupBinVarIds={1:{1:[0,"Current MEBx Password"],2:[0,"New MEBx Password"],3:[1,"Manageability Feature Selection"],4:[1,"Firmware Local Update",{0:"Disabled",1:"Enabled",2:"Password Protected"}],5:[1,"Firmware Update Qualifier",{0:"Always",1:"Never",2:"Restricted"}],6:[0,"Power Package"]},2:{1:[0,"Provisioning Preshared Key ID (PID)"],2:[0,"Provisioning Preshared Key (PPS)"],3:[0,"PKI DNS Suffix"],4:[0,"Configuration Server FQDN"],5:[1,"Remote Configuration Enabled (RCFG)",{0:"Off",1:"On"}],6:[1,"Pre-Installed Certificates Enabled",{0:"Off",1:"On"}],7:[1,"User Defined Certificate Configuration",{0:"Disabled",1:"Enabled",2:"Delete"}],8:[0,"User Defined Certificate Addition"],10:[1,"SOL/IDER Redirection Configuration"],11:[0,"Hostname"],12:[0,"Domain Name"],13:[0,"DHCP"],14:[1,"Secure Firmware Update (SFWU)",{0:"Disabled",1:"Enabled"}],15:[0,"ITO"],16:[1,"Provisioning Mode (PM)",{0:"Enterprise",1:"Small Buisness"}],17:[0,"Provisioning Server Address"],18:[2,"Provision Server Port Number (PSPO)"],19:[0,"Static PV4 Parameters"],20:[0,"VLAN"],21:[0,"PASS Policy Flag"],22:[0,"IPv6"],23:[1,"Shared/Dedicated FQDN",{0:"Dedicated",1:"Shared"}],24:[1,"Dynamic DNS Update",{0:"Disabled",1:"Enabled"}],25:[1,"Remote Desktop (KVM) State",{0:"Disabled",1:"Enabled"}],26:[1,"Opt-in User Consent Option",{0:"Disabled",1:"KVM",255:"All"}],27:[1,"Opt-in Remote IT Consent Policy",{0:"Disabled",1:"Enabled"}],28:[1,"ME Provision Halt Active",{0:"Stop",1:"Start"}],29:[1,"Manual Setup and Configuration",{0:"Automated",1:"Manual"}],30:[3,"Support Channel Identifier"],31:[0,"Support Channel Description"],32:[0,"Service Account Number"],33:[0,"Enrollement Passcode"],34:[3,"Service Type"],35:[0,"Service Provider Identifier"]}},AmtSetupBinCreate=function(e,r){var t={};return t.fileType=e,t.recordChunkCount=0,t.recordHeaderByteCount=0,t.recordNumber=0,t.majorVersion=e,t.minorVersion=0,t.flags=r,t.dataRecordsConsumed=0,t.dataRecordChunkCount=0,t.records=[],t},AmtSetupBinDecode=function(e){var r={},t=e.substring(0,16);for(var a in r.fileType=0,AmtSetupBinSetupGuids)t==AmtSetupBinSetupGuids[a]&&(r.fileType=+a+1);if(0!=r.fileType){r.recordChunkCount=ReadShortX(e,16),r.recordHeaderByteCount=ReadShortX(e,18),r.recordNumber=ReadIntX(e,20),r.majorVersion=e.charCodeAt(24),r.minorVersion=e.charCodeAt(25),r.flags=ReadShortX(e,26);var o=ReadIntX(e,28);r.dataRecordsConsumed=ReadIntX(e,32),r.dataRecordChunkCount=ReadShortX(e,36),r.records=[];for(var n=512;n+512<=e.length;){var i={};i.typeIdentifier=ReadIntX(e,n),i.flags=ReadIntX(e,n+4),i.chunkCount=ReadShortX(e,n+8),i.headerByteCount=ReadShortX(e,n+10),i.number=ReadIntX(e,n+12),i.variables=[];var d=0,u=e.substring(n+24,n+512);for(2&i.flags&&(u=AmtSetupBinDescrambleRecordData(u));;){var s={};if(s.moduleid=ReadShortX(u,d),s.varid=ReadShortX(u,d+2),0==s.moduleid||0==s.varid)break;AmtSetupBinVarIds[s.moduleid][s.varid]&&(s.length=ReadShortX(u,d+4),s.type=AmtSetupBinVarIds[s.moduleid][s.varid][0],s.desc=AmtSetupBinVarIds[s.moduleid][s.varid][1],s.value=u.substring(d+8,d+8+s.length),1==s.type&&1==s.length?s.value=s.value.charCodeAt(0):2==s.type&&2==s.length?s.value=ReadShortX(s.value,0):3==s.type&&4==s.length&&(s.value=ReadIntX(s.value,0)),i.variables.push(s)),d+=8+4*Math.floor((s.length+3)/4)}i.variables.sort(AmtSetupBinVariableCompare),r.records.push(i),n+=512}if(o==r.records.length)return r}},AmtSetupBinEncode=function(e){if(e.fileType<1&&e.fileType>AmtSetupBinSetupGuids.length)return null;var r=[],t=AmtSetupBinSetupGuids[e.fileType-1],a=0;for(t+=ShortToStrX(e.recordChunkCount),t+=ShortToStrX(e.recordHeaderByteCount),t+=IntToStrX(e.recordNumber),t+=String.fromCharCode(e.majorVersion,e.minorVersion),t+=ShortToStrX(e.flags),t+=IntToStrX(e.records.length),t+=IntToStrX(e.dataRecordsConsumed),t+=ShortToStrX(e.dataRecordChunkCount);t.length<512;)t+="\0";for(var o in r.push(t),e.records){var n="",i=e.records[o];for(var d in n+=IntToStrX(i.typeIdentifier),n+=IntToStrX(i.flags),n+=IntToStrX(0),n+=IntToStrX(0),n+=ShortToStrX(1),n+=ShortToStrX(24),n+=IntToStrX(++a),i.variables.sort(AmtSetupBinVariableCompare),i.variables){var u="",s=i.variables[d],l=s.value;for(s.type=AmtSetupBinVarIds[s.moduleid][s.varid][0],s.type>0&&(l=parseInt(l),1==s.type&&(l=String.fromCharCode(l)),2==s.type&&(l=ShortToStrX(l)),3==s.type&&(l=IntToStrX(l))),u+=ShortToStrX(s.moduleid),u+=ShortToStrX(s.varid),u+=ShortToStrX(l.length),u+=ShortToStrX(0),u+=l;u.length%4!=0;)u+="\0";n+=u}for(;n.length<512;)n+="\0";2&i.flags&&(n=n.substring(0,24)+AmtSetupBinScrambleRecordData(n.substring(24))),r.push(n)}return r.join("")};function AmtSetupBinVariableCompare(e,r){return e.moduleid>r.moduleid?1:e.moduleid<r.moduleid?-1:e.varid>r.varid?1:e.varid<r.varid?-1:0}function AmtSetupBinScrambleRecordData(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)+17&255);return r}function AmtSetupBinDescrambleRecordData(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)+239&255);return r}
\ No newline at end of file
public/scripts/amt-terminal-0.0.2-min.js
+1
-1
@@ -1 +1 @@
1
-var CreateAmtRemoteTerminal=function(e,r){var l,m={},f=(m.DivId=e,m.DivElement=document.getElementById(e),m.protocol=1,r.protocol&&(m.protocol=r.protocol),m.terminalEmulation=1,m.fxEmulation=0,m.lineFeed="\r\n",m.debugmode=0,m.width=80,m.height=25,m.heightLock=0,["000000","BB0000","00BB00","BBBB00","0000BB","BB00BB","00BBBB","BBBBBB","555555","FF5555","55FF55","FFFF55","5555FF","FF55FF","55FFFF","FFFFFF"]),g=0,w=7,u=0,C=!0,S=0,T=0,c=0,s=0,d=0,b=[],k=0,v=0,p=[],y=[],n=!1,K=!0,D=!1,B=[],F="";m.title=null,m.onTitleChange=null,m.Start=function(){},m.Init=function(e,r){m.width=e||80,m.height=r||25;for(var t=0;t<m.height;t++){y[t]=[],p[t]=[];for(var i=0;i<m.width;i++)y[t][i]=" ",p[t][i]=448}m.TermInit(),m.TermDraw()},m.xxStateChange=function(e){},m.ProcessData=function(r){if(2==m.debugmode&&console.log("TRecv("+r.length+"): "+rstr2hex(r)),0==m.terminalEmulation)try{r=decode_utf8(F+r)}catch(e){return void(F+=r)}F="",null!=m.capture&&(m.capture+=r);for(var e=r,t=0;t<e.length;t++){o=a=h=n=i=void 0;var i=String.fromCharCode(e.charCodeAt(t)),n=e.charCodeAt(t);switch(d){case 0:27===n?(d=1,b=[],v=k=0):E(i);break;case 1:switch(i){case"[":d=2;break;case"(":d=4;break;case")":d=5;break;case"]":d=6;break;case"=":D=!0,d=0;break;case">":D=!1,d=0;break;case"7":c=S,s=T,d=0;break;case"8":S=c,T=s,d=0;break;case"M":for(var h=l[1];h>=l[0]+1;h--)for(var a=0;a<m.width;a++)y[h][a]=y[h-1][a],p[h][a]=p[h-1][a];for(h=l[0]+1-1;h>l[0]-1;h--)for(a=0;a<m.width;a++)y[h][a]=" ",p[h][a]=448;d=0;break;default:console.log("unknown terminal short code",i),d=0}break;case 2:"0"<=i&&i<="9"?b[k]?b[k]=10*b[k]+(i-"0"):b[k]=i-"0":";"==i?k++:"?"==i?v=1:(b[0]||(b[0]=0),((e,r,t,i)=>{if(1==i)switch(e){case"l":25==r[0]&&(K=!1);break;case"h":25==r[0]&&(K=!0)}else if(0==i){var n,h;switch(e){case"c":m.TermResetScreen();break;case"A":1==t&&(0==r[0]?T--:T-=r[0],T<0)&&(T=0);break;case"B":1==t&&(0==r[0]?T++:T+=r[0],T>m.height)&&(T=m.height);break;case"C":1==t&&(0==r[0]?S++:S+=r[0],S>m.width)&&(S=m.width);break;case"D":1==t&&(0==r[0]?S--:S-=r[0],S<0)&&(S=0);break;case"d":1==t&&(T=(T=r[0]-1)>m.height?m.height:T)<0&&(T=0);break;case"G":1==t&&(S=(S=r[0]-1)<0?0:S)>m.width-1&&(S=m.width-1);break;case"P":var a=1;for(1==t&&(a=r[0]),n=S;n<m.width-a;n++)y[T][n]=y[T][n+a],p[T][n]=p[T][n+a];for(n=m.width-a;n<m.width;n++)y[T][n]=" ",p[T][n]=448;break;case"L":var o=1;for(0==(o=1==t?r[0]:o)&&(o=1),c=l[1];T+o<=c;c--)y[c]=y[c-o],p[c]=p[c-o];for(c=T;c<T+o;c++)for(y[c]=[],p[c]=[],a=0;a<m.width;a++)y[c][a]=" ",p[c][a]=448;break;case"J":if(1==t&&2==r[0])m.TermClear((u<<12)+(w<<6)),T=S=0,B=[];else if(0==t||1==t&&0==r[0])for(L(),n=T+1;n<m.height;n++)P(n);else if(1==t&&1==r[0])for(L(),n=0;n<T-1;n++)P(n);break;case"H":S=2==t?(r[0]<1&&(r[0]=1),r[1]<1&&(r[1]=1),r[0]>m.height&&(r[0]=m.height),r[1]>m.width&&(r[1]=m.width),T=r[0]-1,r[1]-1):T=0;break;case"m":for(n=0;n<t;n++)r[n]&&0!=r[n]?1==r[n]?w<8&&(w+=8):2==r[n]||22==r[n]?8<=w&&(w-=8):7==r[n]?g=2:27==r[n]?g=0:30<=r[n]&&r[n]<=37?(h=8<=w,w=r[n]-30,h&&w<=8&&(w+=8)):40<=r[n]&&r[n]<=47?u=r[n]-40:90<=r[n]&&r[n]<=99?w=r[n]-82:100<=r[n]&&r[n]<=109&&(u=r[n]-92):(w=7,g=u=0);break;case"K":0!=t&&(1!=t||r[0]&&0!=r[0])?1==t&&(1==r[0]?(()=>{for(var e=(w<<6)+(u<<12)+g,r=0;r<S;r++)y[T][r]=" ",p[T][r]=e})():2==r[0]&&P(T)):L();break;case"h":C=!0;break;case"l":C=!1;break;case"r":(l=2==t?[r[0]-1,r[1]-1]:l)[0]<0&&(l[0]=0),l[0]>m.height-1&&(l[0]=m.height-1),l[1]<0&&(l[1]=0),l[1]>m.height-1&&(l[1]=m.height-1),l[0]>l[1]&&(l[0]=l[1]);break;case"S":a=1;1==t&&(a=r[0]);for(var c=l[0];c<=l[1]-a;c++)for(var f=0;f<m.width;f++)y[c][f]=y[c+a][f],p[c][f]=p[c+a][f];for(c=l[1]-a+1;c<l[1];c++)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"M":a=1;1==t&&(a=r[0]);for(c=T;c<=l[1]-a;c++)for(f=0;f<m.width;f++)y[c][f]=y[c+a][f],p[c][f]=p[c+a][f];for(c=l[1]-a+1;c<l[1];c++)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"T":a=1;1==t&&(a=r[0]);for(c=l[1];c>l[0]+a;c--)for(f=0;f<m.width;f++)y[c][f]=y[c-a][f],p[c][f]=p[c-a][f];for(c=l[0]+a;c>l[0];c--)for(f=0;f<m.width;f++)y[c][f]=" ",p[c][f]=448;break;case"X":var a=1,s=S,d=T;for(1==t&&(a=r[0]);0<a&&d<m.height;)y[d][s]=" ",a--,++s>=m.width&&(s=0,d++);break;default:console.log("Unknown terminal code",e,r,i)}}})(i,b,k+1,v),d=0);break;case 4:case 5:d=0;break;case 6:var o=i.charCodeAt(0);";"==i?k++:7==o?((e=>{var r;0!=e.length&&(0==(r=parseInt(e[0]))||2==r)&&1<e.length&&"?"!=e[1]&&m.onTitleChange&&m.onTitleChange(m,m.title=e[1])})(b),d=0):b[k]?b[k]+=i:b[k]=i}}m.TermDraw()},m.ProcessVt100String=function(e){for(var r=0;r<e.length;r++)E(String.fromCharCode(e.charCodeAt(r)))};var h=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],a=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],h=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],a=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160];function E(e){if("\0"!=e&&7!=e.charCodeAt()){var r=e.charCodeAt();switch(1==m.terminalEmulation?0!=(128&r)&&(e=String.fromCharCode(h[127&r])):2==m.terminalEmulation&&0!=(128&r)&&(e=String.fromCharCode(a[127&r])),r){case 16:e=" ";break;case 24:e="↑";break;case 25:e="↓"}switch(S>m.width&&(S=m.width),T>m.height-1&&(T=m.height-1),e){case"\b":0<S&&(S--,n)&&o(" ");break;case"\t":for(var t=8-S%8,i=0;i<t;i++)E(" ");break;case"\n":++T>l[1]&&(m.recordLineTobackBuffer(0),x(1),T=l[1]),m.lineFeed="\r",S=0;break;case"\r":S=0;break;default:S>=m.width&&(S=0,C&&T++,T>=m.height-1)&&(x(1),T=m.height-1),o(e),S++}}}function o(e){y[T][S]=e,p[T][S]=(w<<6)+(u<<12)+g}function L(){for(var e=(w<<6)+(u<<12)+g,r=S;r<m.width;r++)y[T][r]=" ",p[T][r]=e}function P(e){for(var r=(w<<6)+(u<<12)+g,t=0;t<m.width;t++)y[e][t]=" ",p[e][t]=r}function x(e){for(var r,t=l[0];t<=l[1]-e;t++)y[t]=y[t+e],p[t]=p[t+e];for(t=l[1]-e+1;t<=l[1];t++)for(y[t]=[],p[t]=[],r=0;r<m.width;r++)y[t][r]=" ",p[t][r]=448}return m.TermClear=function(e){for(var r=0;r<m.height;r++)for(var t=0;t<m.width;t++)y[r][t]=" ",p[r][t]=e;B=[]},m.TermResetScreen=function(){C=K=!(u=g=0),S=T=0,n=!(w=7),l=[0,m.height-1],D=!1,m.TermClear(448),F=""},m.TermSendKeys=function(e){2==m.debugmode&&console.log("TSend("+e.length+"): "+rstr2hex(e),e),m.parent.send(e)},m.TermSendKey=function(e){2==m.debugmode&&console.log("TSend(1): "+rstr2hex(String.fromCharCode(e)),e),m.parent.send(String.fromCharCode(e))},m.TermHandleKeys=function(e){if(!e.ctrlKey)return 127==e.which?m.TermSendKey(8):13==e.which?m.TermSendKeys(m.lineFeed):0!=e.which&&m.TermSendKey(e.which),!1;e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},m.TermHandleKeyUp=function(e){return 8!=e.which&&32!=e.which&&9!=e.which||(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1)},m.TermHandleKeyDown=function(e){if(!(65<=e.which&&e.which<=90&&1==e.ctrlKey)){if(27==e.which)return m.TermSendKeys(String.fromCharCode(27)),!0;if(1==D){if(37==e.which)return m.TermSendKeys(String.fromCharCode(27,79,68)),!0;if(38==e.which)return m.TermSendKeys(String.fromCharCode(27,79,65)),!0;if(39==e.which)return m.TermSendKeys(String.fromCharCode(27,79,67)),!0;if(40==e.which)return m.TermSendKeys(String.fromCharCode(27,79,66)),!0}else{if(37==e.which)return m.TermSendKeys(String.fromCharCode(27,91,68)),!0;if(38==e.which)return m.TermSendKeys(String.fromCharCode(27,91,65)),!0;if(39==e.which)return m.TermSendKeys(String.fromCharCode(27,91,67)),!0;if(40==e.which)return m.TermSendKeys(String.fromCharCode(27,91,66)),!0}if(33==e.which)return m.TermSendKeys(String.fromCharCode(27,91,53,126)),!0;if(34==e.which)return m.TermSendKeys(String.fromCharCode(27,91,54,126)),!0;if(35==e.which)return m.TermSendKeys(String.fromCharCode(27,91,70)),!0;if(36==e.which)return m.TermSendKeys(String.fromCharCode(27,91,72)),!0;if(45==e.which)return m.TermSendKeys(String.fromCharCode(27,91,50,126)),!0;if(46==e.which)return m.TermSendKeys(String.fromCharCode(27,91,51,126)),!0;if(9==e.which)return m.TermSendKeys("\t"),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!0;var r=[80,81,119,120,116,117,113,114,112,77],t=[49,50,51,52,53,54,55,56,57,48,33,64],i=[80,81,82,83,84,85,86,87,88,89,90,91];if(111<e.which&e.which<124&&0==e.repeat){if(0==m.fxEmulation&&e.which<122)return m.TermSendKeys(String.fromCharCode(27,91,79,r[e.which-112])),!0;if(1==m.fxEmulation)return m.TermSendKeys(String.fromCharCode(27,t[e.which-112])),!0;if(2==m.fxEmulation)return m.TermSendKeys(String.fromCharCode(27,79,i[e.which-112])),!0}r=[80,81,119,120,116,117,113,114,112,77];return 111<e.which&e.which<122&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,91,79,r[e.which-112])),!0):(t=[49,50,51,52,53,54,55,56,57,48,33,64],111<e.which&e.which<124&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,t[e.which-112])),!0):(i=[80,81,82,83,84,85,86,87,88,89,90,91],111<e.which&e.which<124&&0==e.repeat?(m.TermSendKeys(String.fromCharCode(27,79,i[e.which-112])),!0):8!=e.which&&32!=e.which&&9!=e.which||(m.TermSendKey(e.which),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1)))}m.TermSendKey(e.which-64),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},m.recordLineTobackBuffer=function(e){var e=m.TermDrawLine("",e,""),r=e[0];B.push(r+e[1]+"<br>")},m.TermDrawLine=function(e,r,t){for(var i,n,h,a,o=1,c=0;c<m.width;++c)switch(i=p[r][c],S==c&&T==r&&K&&(i|=2),i!=o&&(h=6,a=12,2&i&&(h=12,a=6),e=e+t+'<span style="color:#'+f[i>>h&63]+";background-color:#"+f[i>>a&63],1&i&&(e+=";text-decoration:underline"),e+=';">',t="</span>"+(t=""),o=i),n=y[r][c]){case"&":e+="&";break;case"<":e+="<";break;case">":e+=">";break;case" ":e+=" ";break;default:e+=n}return[e,t]},m.TermDraw=function(){for(var e="",r="",t=0;t<m.height;++t){var i=m.TermDrawLine(r,t,e),r=i[0],e=i[1];t!=m.height-1&&(r+="<br>")}var n=(B=800<B.length?B.slice(B.length-800):B).join("");m.DivElement.innerHTML="<font size='4'><b>"+n+r+e+"</b></font>",m.DivElement.scrollTop=m.DivElement.scrollHeight,0==m.heightLock&&setTimeout(m.TermLockHeight,10)},m.TermLockHeight=function(){m.heightLock=m.DivElement.clientHeight,m.DivElement.style.height=m.DivElement.parentNode.style.height=m.heightLock+"px",m.DivElement.style["overflow-y"]="scroll"},m.TermInit=function(){m.TermResetScreen()},m.heightLock=0,m.DivElement.style.height="",null!=r&&null!=r.cols&&null!=r.rows?m.Init(r.cols,r.rows):m.Init(),m}
\ No newline at end of file
1
+var CreateAmtRemoteTerminal=function(e,r){var t={};t.DivId=e,t.DivElement=document.getElementById(e),t.protocol=1,r.protocol&&(t.protocol=r.protocol),t.terminalEmulation=1,t.fxEmulation=0,t.lineFeed="\r\n",t.debugmode=0,t.width=80,t.height=25,t.heightLock=0;var i,n=["000000","BB0000","00BB00","BBBB00","0000BB","BB00BB","00BBBB","BBBBBB","555555","FF5555","55FF55","FFFF55","5555FF","FF55FF","55FFFF","FFFFFF"],a=0,h=7,o=0,c=!0,f=0,s=0,d=0,l=0,m=0,u=[],g=0,w=0,C=[],S=[],T=!1,b=!0,k=!1,v=[],p="";function y(e,r){switch(m){case 0:if(27===r)m=1,u=[],g=0,w=0;else B(e);break;case 1:switch(e){case"[":m=2;break;case"(":m=4;break;case")":m=5;break;case"]":m=6;break;case"=":k=!0,m=0;break;case">":k=!1,m=0;break;case"7":d=f,l=s,m=0;break;case"8":f=d,s=l,m=0;break;case"M":for(var n=i[1];n>=i[0]+1;n--)for(var T=0;T<t.width;T++)S[n][T]=S[n-1][T],C[n][T]=C[n-1][T];for(n=i[0]+1-1;n>i[0]-1;n--)for(T=0;T<t.width;T++)S[n][T]=" ",C[n][T]=448;m=0;break;default:console.log("unknown terminal short code",e),m=0}break;case 2:if(e>="0"&&e<="9"){u[g]?u[g]=10*u[g]+(e-"0"):u[g]=e-"0";break}if(";"==e){g++;break}if("?"==e){w=1;break}u[0]||(u[0]=0),function(e,r,n,d){if(1==d)switch(e){case"l":25==r[0]&&(b=!1);break;case"h":25==r[0]&&(b=!0)}else if(0==d){var l;switch(e){case"c":t.TermResetScreen();break;case"A":1==n&&(0==r[0]?s--:s-=r[0],s<0&&(s=0));break;case"B":1==n&&(0==r[0]?s++:s+=r[0],s>t.height&&(s=t.height));break;case"C":1==n&&(0==r[0]?f++:f+=r[0],f>t.width&&(f=t.width));break;case"D":1==n&&(0==r[0]?f--:f-=r[0],f<0&&(f=0));break;case"d":1==n&&((s=r[0]-1)>t.height&&(s=t.height),s<0&&(s=0));break;case"G":1==n&&((f=r[0]-1)<0&&(f=0),f>t.width-1&&(f=t.width-1));break;case"P":var m=1;for(1==n&&(m=r[0]),l=f;l<t.width-m;l++)S[s][l]=S[s][l+m],C[s][l]=C[s][l+m];for(l=t.width-m;l<t.width;l++)S[s][l]=" ",C[s][l]=448;break;case"L":var u=1;for(1==n&&(u=r[0]),0==u&&(u=1),w=i[1];w>=s+u;w--)S[w]=S[w-u],C[w]=C[w-u];for(w=s;w<s+u;w++)for(S[w]=[],C[w]=[],m=0;m<t.width;m++)S[w][m]=" ",C[w][m]=448;break;case"J":if(1==n&&2==r[0])t.TermClear((o<<12)+(h<<6)),f=0,s=0,v=[];else if(0==n||1==n&&0==r[0])for(E(),l=s+1;l<t.height;l++)L(l);else if(1==n&&1==r[0])for(E(),l=0;l<s-1;l++)L(l);break;case"H":2==n?(r[0]<1&&(r[0]=1),r[1]<1&&(r[1]=1),r[0]>t.height&&(r[0]=t.height),r[1]>t.width&&(r[1]=t.width),s=r[0]-1,f=r[1]-1):(s=0,f=0);break;case"m":for(l=0;l<n;l++)if(r[l]&&0!=r[l])if(1==r[l])h<8&&(h+=8);else if(2==r[l]||22==r[l])h>=8&&(h-=8);else if(7==r[l])a=2;else if(27==r[l])a=0;else if(r[l]>=30&&r[l]<=37){var g=h>=8;h=r[l]-30,g&&h<=8&&(h+=8)}else r[l]>=40&&r[l]<=47?o=r[l]-40:r[l]>=90&&r[l]<=99?h=r[l]-82:r[l]>=100&&r[l]<=109&&(o=r[l]-92);else o=0,h=7,a=0;break;case"K":0!=n&&(1!=n||r[0]&&0!=r[0])?1==n&&(1==r[0]?function(){for(var e=(h<<6)+(o<<12)+a,r=0;r<f;r++)S[s][r]=" ",C[s][r]=e}():2==r[0]&&L(s)):E();break;case"h":c=!0;break;case"l":c=!1;break;case"r":2==n&&(i=[r[0]-1,r[1]-1]),i[0]<0&&(i[0]=0),i[0]>t.height-1&&(i[0]=t.height-1),i[1]<0&&(i[1]=0),i[1]>t.height-1&&(i[1]=t.height-1),i[0]>i[1]&&(i[0]=i[1]);break;case"S":m=1;1==n&&(m=r[0]);for(var w=i[0];w<=i[1]-m;w++)for(var T=0;T<t.width;T++)S[w][T]=S[w+m][T],C[w][T]=C[w+m][T];for(w=i[1]-m+1;w<i[1];w++)for(T=0;T<t.width;T++)S[w][T]=" ",C[w][T]=448;break;case"M":m=1;1==n&&(m=r[0]);for(w=s;w<=i[1]-m;w++)for(T=0;T<t.width;T++)S[w][T]=S[w+m][T],C[w][T]=C[w+m][T];for(w=i[1]-m+1;w<i[1];w++)for(T=0;T<t.width;T++)S[w][T]=" ",C[w][T]=448;break;case"T":m=1;1==n&&(m=r[0]);for(w=i[1];w>i[0]+m;w--)for(T=0;T<t.width;T++)S[w][T]=S[w-m][T],C[w][T]=C[w-m][T];for(w=i[0]+m;w>i[0];w--)for(T=0;T<t.width;T++)S[w][T]=" ",C[w][T]=448;break;case"X":m=1;var k=f,p=s;for(1==n&&(m=r[0]);m>0&&p<t.height;)S[p][k]=" ",m--,++k>=t.width&&(k=0,p++);break;default:console.log("Unknown terminal code",e,r,d)}}}(e,u,g+1,w),m=0;break;case 4:case 5:m=0;break;case 6:var p=e.charCodeAt(0);";"==e?g++:7==p?(!function(e){if(0==e.length)return;var r=parseInt(e[0]);(0==r||2==r)&&e.length>1&&"?"!=e[1]&&t.onTitleChange&&t.onTitleChange(t,t.title=e[1])}(u),m=0):u[g]?u[g]+=e:u[g]=e}}t.title=null,t.onTitleChange=null,t.Start=function(){},t.Init=function(e,r){t.width=e||80,t.height=r||25;for(var i=0;i<t.height;i++){S[i]=[],C[i]=[];for(var n=0;n<t.width;n++)S[i][n]=" ",C[i][n]=448}t.TermInit(),t.TermDraw()},t.xxStateChange=function(e){},t.ProcessData=function(e){if(2==t.debugmode&&console.log("TRecv("+e.length+"): "+rstr2hex(e)),0==t.terminalEmulation)try{e=decode_utf8(p+e)}catch(r){return void(p+=e)}p="",null!=t.capture&&(t.capture+=e),function(e){for(var r=0;r<e.length;r++)y(String.fromCharCode(e.charCodeAt(r)),e.charCodeAt(r))}(e),t.TermDraw()},t.ProcessVt100String=function(e){for(var r=0;r<e.length;r++)B(String.fromCharCode(e.charCodeAt(r)))};var K=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],D=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160];K=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],D=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160];function B(e){if("\0"!=e&&7!=e.charCodeAt()){var r=e.charCodeAt();switch(1==t.terminalEmulation?128&r&&(e=String.fromCharCode(K[127&r])):2==t.terminalEmulation&&128&r&&(e=String.fromCharCode(D[127&r])),r){case 16:e=" ";break;case 24:e="↑";break;case 25:e="↓"}switch(f>t.width&&(f=t.width),s>t.height-1&&(s=t.height-1),e){case"\b":f>0&&(f--,T&&F(" "));break;case"\t":for(var n=8-f%8,a=0;a<n;a++)B(" ");break;case"\n":++s>i[1]&&(t.recordLineTobackBuffer(0),P(1),s=i[1]),(t.lineFeed="\r")&&(f=0);break;case"\r":f=0;break;default:f>=t.width&&(f=0,c&&s++,s>=t.height-1&&(P(1),s=t.height-1)),F(e),f++}}}function F(e){S[s][f]=e,C[s][f]=(h<<6)+(o<<12)+a}function E(){for(var e=(h<<6)+(o<<12)+a,r=f;r<t.width;r++)S[s][r]=" ",C[s][r]=e}function L(e){for(var r=(h<<6)+(o<<12)+a,i=0;i<t.width;i++)S[e][i]=" ",C[e][i]=r}function P(e){var r,n;for(n=i[0];n<=i[1]-e;n++)S[n]=S[n+e],C[n]=C[n+e];for(n=i[1]-e+1;n<=i[1];n++)for(S[n]=[],C[n]=[],r=0;r<t.width;r++)S[n][r]=" ",C[n][r]=448}return t.TermClear=function(e){for(var r=0;r<t.height;r++)for(var i=0;i<t.width;i++)S[r][i]=" ",C[r][i]=e;v=[]},t.TermResetScreen=function(){a=0,h=7,o=0,c=b=!0,f=s=0,T=!1,i=[0,t.height-1],k=!1,t.TermClear(448),p=""},t.TermSendKeys=function(e){2==t.debugmode&&console.log("TSend("+e.length+"): "+rstr2hex(e),e),t.parent.send(e)},t.TermSendKey=function(e){2==t.debugmode&&console.log("TSend(1): "+rstr2hex(String.fromCharCode(e)),e),t.parent.send(String.fromCharCode(e))},t.TermHandleKeys=function(e){if(!e.ctrlKey)return 127==e.which?t.TermSendKey(8):13==e.which?t.TermSendKeys(t.lineFeed):0!=e.which&&t.TermSendKey(e.which),!1;e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},t.TermHandleKeyUp=function(e){return 8!=e.which&&32!=e.which&&9!=e.which||(e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1)},t.TermHandleKeyDown=function(e){if(e.which>=65&&e.which<=90&&1==e.ctrlKey)return t.TermSendKey(e.which-64),e.preventDefault&&e.preventDefault(),void(e.stopPropagation&&e.stopPropagation());if(27==e.which)return t.TermSendKeys(String.fromCharCode(27)),!0;if(1==k){if(37==e.which)return t.TermSendKeys(String.fromCharCode(27,79,68)),!0;if(38==e.which)return t.TermSendKeys(String.fromCharCode(27,79,65)),!0;if(39==e.which)return t.TermSendKeys(String.fromCharCode(27,79,67)),!0;if(40==e.which)return t.TermSendKeys(String.fromCharCode(27,79,66)),!0}else{if(37==e.which)return t.TermSendKeys(String.fromCharCode(27,91,68)),!0;if(38==e.which)return t.TermSendKeys(String.fromCharCode(27,91,65)),!0;if(39==e.which)return t.TermSendKeys(String.fromCharCode(27,91,67)),!0;if(40==e.which)return t.TermSendKeys(String.fromCharCode(27,91,66)),!0}if(33==e.which)return t.TermSendKeys(String.fromCharCode(27,91,53,126)),!0;if(34==e.which)return t.TermSendKeys(String.fromCharCode(27,91,54,126)),!0;if(35==e.which)return t.TermSendKeys(String.fromCharCode(27,91,70)),!0;if(36==e.which)return t.TermSendKeys(String.fromCharCode(27,91,72)),!0;if(45==e.which)return t.TermSendKeys(String.fromCharCode(27,91,50,126)),!0;if(46==e.which)return t.TermSendKeys(String.fromCharCode(27,91,51,126)),!0;if(9==e.which)return t.TermSendKeys("\t"),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!0;var r=[80,81,119,120,116,117,113,114,112,77],i=[49,50,51,52,53,54,55,56,57,48,33,64],n=[80,81,82,83,84,85,86,87,88,89,90,91];if(e.which>111&e.which<124&&0==e.repeat){if(0==t.fxEmulation&&e.which<122)return t.TermSendKeys(String.fromCharCode(27,91,79,r[e.which-112])),!0;if(1==t.fxEmulation)return t.TermSendKeys(String.fromCharCode(27,i[e.which-112])),!0;if(2==t.fxEmulation)return t.TermSendKeys(String.fromCharCode(27,79,n[e.which-112])),!0}r=[80,81,119,120,116,117,113,114,112,77];if(e.which>111&e.which<122&&0==e.repeat)return t.TermSendKeys(String.fromCharCode(27,91,79,r[e.which-112])),!0;i=[49,50,51,52,53,54,55,56,57,48,33,64];if(e.which>111&e.which<124&&0==e.repeat)return t.TermSendKeys(String.fromCharCode(27,i[e.which-112])),!0;n=[80,81,82,83,84,85,86,87,88,89,90,91];return e.which>111&e.which<124&&0==e.repeat?(t.TermSendKeys(String.fromCharCode(27,79,n[e.which-112])),!0):8!=e.which&&32!=e.which&&9!=e.which||(t.TermSendKey(e.which),e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),!1)},t.recordLineTobackBuffer=function(e){var r="",i="",n=t.TermDrawLine(i,e,r);i=n[0],r=n[1],v.push(i+r+"<br>")},t.TermDrawLine=function(e,r,i){for(var a,h,o,c,d=1,l=0;l<t.width;++l)switch(a=C[r][l],f==l&&s==r&&b&&(a|=2),a!=d&&(e+=i,o=6,c=12,2&a&&(o=12,c=6),e+='<span style="color:#'+n[a>>o&63]+";background-color:#"+n[a>>c&63],1&a&&(e+=";text-decoration:underline"),e+=';">',i="</span>"+(i=""),d=a),h=S[r][l]){case"&":e+="&";break;case"<":e+="<";break;case">":e+=">";break;case" ":e+=" ";break;default:e+=h}return[e,i]},t.TermDraw=function(){for(var e="",r="",i=0;i<t.height;++i){var n=t.TermDrawLine(r,i,e);r=n[0],e=n[1],i!=t.height-1&&(r+="<br>")}v.length>800&&(v=v.slice(v.length-800));var a=v.join("");t.DivElement.innerHTML="<font size='4'><b>"+a+r+e+"</b></font>",t.DivElement.scrollTop=t.DivElement.scrollHeight,0==t.heightLock&&setTimeout(t.TermLockHeight,10)},t.TermLockHeight=function(){t.heightLock=t.DivElement.clientHeight,t.DivElement.style.height=t.DivElement.parentNode.style.height=t.heightLock+"px",t.DivElement.style["overflow-y"]="scroll"},t.TermInit=function(){t.TermResetScreen()},t.heightLock=0,t.DivElement.style.height="",null!=r&&null!=r.cols&&null!=r.rows?t.Init(r.cols,r.rows):t.Init(),t}
\ No newline at end of file
public/scripts/amt-wsman-0.2.0-min.js
+1
-1
@@ -1 +1 @@
1
-var WsmanStackCreateService=function(e,s,r,a,o,t){var u={};function l(e){if(!e)return"";var s,r=" ";for(s in e)e.hasOwnProperty(s)&&0===s.indexOf("@")&&(r+=s.substring(1)+'="'+e[s]+'" ');return r}function p(e){if(!e)return"";if("string"==typeof e)return e;if(e.InstanceID)return'<w:SelectorSet><w:Selector Name="InstanceID">'+e.InstanceID+"</w:Selector></w:SelectorSet>";var s,r="<w:SelectorSet>";for(s in e)if(e.hasOwnProperty(s)){if(r+='<w:Selector Name="'+s+'">',e[s].ReferenceParameters){var r=(r+="<a:EndpointReference>")+("<a:Address>"+e[s].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+e[s].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>"),a=e[s].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(a))for(var o=0;o<a.length;o++)r+="<w:Selector"+l(a[o])+">"+a[o].Value+"</w:Selector>";else r+="<w:Selector"+l(a)+">"+a.Value+"</w:Selector>";r+="</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>"}else r+=e[s];r+="</w:Selector>"}return r+="</w:SelectorSet>"}return u.NextMessageId=1,u.Address="/wsman",u.comm=CreateWsmanComm(e,s,r,a,o,t),u.PerformAjax=function(e,a,s,r,o){u.comm.PerformAjax('<?xml version=\"1.0\" encoding=\"utf-8\"?><Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns="http://www.w3.org/2003/05/soap-envelope" '+(o=null==o?"":o)+"><Header><a:Action>"+e,function(e,s,r){200!=s?a(u,null,{Header:{HttpError:s}},s,r):(e=u.ParseWsman(e))&&null!=e?a(u,e.Header.ResourceURI,e,200,r):a(u,null,{Header:{HttpError:s}},601,r)},s,r)},u.CancelAllQueries=function(e){u.comm.CancelAllQueries(e)},u.GetNameFromUrl=function(e){var s=e.lastIndexOf("/");return-1==s?e:e.substring(s+1)},u.ExecSubscribe=function(e,s,r,a,o,t,n,l,d,c){var m="",i="",d=(null!=d&&null!=c&&(m="<t:IssuedTokens><t:RequestSecurityTokenResponse><t:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken</t:TokenType><t:RequestedSecurityToken><se:UsernameToken><se:Username>"+d+'</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">'+c+"</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>",i='<Auth Profile="http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryModes/secprofile/http/digest"/>'),l=null!=l?"<a:ReferenceParameters>"+l+"</a:ReferenceParameters>":"","http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+p(n)+m+'</Header><Body><e:Subscribe><e:Delivery Mode="http://schemas.dmtf.org/wbem/wsman/1/wsman/'+s+'"><e:NotifyTo><a:Address>'+r+"</a:Address></e:NotifyTo>"+i+"</e:Delivery><e:Expires>PT0.000000S</e:Expires></e:Subscribe>");u.PerformAjax(d+"</Body></Envelope>",a,o,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:se="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:m="http://x.com"')},u.ExecUnSubscribe=function(e,s,r,a,o){e="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+p(o)+"</Header><Body><e:Unsubscribe/>";u.PerformAjax(e+"</Body></Envelope>",s,r,a,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')},u.ExecPut=function(e,s,r,a,o,t){t="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60.000S</w:OperationTimeout>"+p(t)+"</Header><Body>"+((e,s)=>{if(!e||null==s)return"";var r,a=u.GetNameFromUrl(e),o="<r:"+a+' xmlns:r="'+e+'">';for(r in s)if(s.hasOwnProperty(r)&&0!==r.indexOf("__")&&0!==r.indexOf("@")&&null!=s[r]&&"function"!=typeof s[r])if("object"==typeof s[r]&&s[r].ReferenceParameters){o+="<r:"+r+"><a:Address>"+s[r].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+s[r].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>";var t=s[r].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(t))for(var n=0;n<t.length;n++)o+="<w:Selector"+l(t[n])+">"+t[n].Value+"</w:Selector>";else o+="<w:Selector"+l(t)+">"+t.Value+"</w:Selector>";o+="</w:SelectorSet></a:ReferenceParameters></r:"+r+">"}else if(Array.isArray(s[r]))for(n=0;n<s[r].length;n++)o+="<r:"+r+">"+s[r][n].toString()+"</r:"+r+">";else o+="<r:"+r+">"+s[r].toString()+"</r:"+r+">";return o+="</r:"+a+">"})(e,s);u.PerformAjax(t+"</Body></Envelope>",r,a,o)},u.ExecCreate=function(e,s,r,a,o,t){var n,l=u.GetNameFromUrl(e),d="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+p(t)+"</Header><Body><g:"+l+' xmlns:g="'+e+'">';for(n in s)d+="<g:"+n+">"+s[n]+"</g:"+n+">";u.PerformAjax(d+"</g:"+l+"></Body></Envelope>",r,a,o)},u.ExecCreateXml=function(e,s,r,a,o){var t=u.GetNameFromUrl(e);u.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60.000S</w:OperationTimeout></Header><Body><r:"+t+' xmlns:r="'+e+'">'+s+"</r:"+t+"></Body></Envelope>",r,a,o)},u.ExecDelete=function(e,s,r,a,o){e="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+p(s)+"</Header><Body /></Envelope>";u.PerformAjax(e,r,a,o)},u.ExecGet=function(e,s,r,a){u.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body /></Envelope>",s,r,a)},u.ExecMethod=function(e,s,r,a,o,t,n){var l,d="";for(l in r)if(null!=r[l])if(Array.isArray(r[l]))for(var c in r[l])d+="<r:"+l+">"+r[l][c]+"</r:"+l+">";else d+="<r:"+l+">"+r[l]+"</r:"+l+">";u.ExecMethodXml(e,s,d,a,o,t,n)},u.ExecMethodXml=function(e,s,r,a,o,t,n){u.PerformAjax(e+"/"+s+"</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+p(n)+"</Header><Body><r:"+s+'_INPUT xmlns:r="'+e+'">'+r+"</r:"+s+"_INPUT></Body></Envelope>",a,o,t)},u.ExecEnum=function(e,s,r,a){u.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++'</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>',s,r,a)},u.ExecPull=function(e,s,r,a,o){u.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>"+u.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+u.NextMessageId+++'</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>'+s+"</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>",r,a,o)},u.ParseWsman=function(s){try{s.childNodes||(s=(e=>{var s;return window.DOMParser?(new DOMParser).parseFromString(e,"text/xml"):((s=new ActiveXObject("Microsoft.XMLDOM")).async=!1,s.loadXML(e),s)})(s));var e={Header:{}},r=s.getElementsByTagName("Header")[0];if(!(r=r||s.getElementsByTagName("a:Header")[0]))return null;for(var a=0;a<r.childNodes.length;a++){var o=r.childNodes[a];e.Header[o.localName]=o.textContent}var t,n,l=s.getElementsByTagName("Body")[0];return(l=l||s.getElementsByTagName("a:Body")[0])?(0<l.childNodes.length&&(-1!=(n=(t=l.childNodes[0].localName).indexOf("_OUTPUT"))&&n==t.length-7&&(t=t.substring(0,t.length-7)),e.Header.Method=t,e.Body=function e(s){var r,a={};for(var o=0;o<s.childNodes.length;o++){var t=s.childNodes[o],n=r="false"==(r="true"==(r=0==t.childElementCount?t.textContent:e(t))?!0:r)?!1:r;if(0<t.attributes.length){n={Value:r};for(var l=0;l<t.attributes.length;l++)n["@"+t.attributes[l].name]=t.attributes[l].value}a[t.localName]instanceof Array?a[t.localName].push(n):null==a[t.localName]?a[t.localName]=n:a[t.localName]=[a[t.localName],n]}return a}(l.childNodes[0])),e):null}catch(e){return console.log("Unable to parse XML: "+s),null}},u}
\ No newline at end of file
1
+var WsmanStackCreateService=function(e,s,r,a,o,t){var n={};function l(e){for(var s,r={},a=0;a<e.childNodes.length;a++){var o=e.childNodes[a];"true"==(s=0==o.childElementCount?o.textContent:l(o))&&(s=!0),"false"==s&&(s=!1);var t=s;if(o.attributes.length>0){t={Value:s};for(var n=0;n<o.attributes.length;n++)t["@"+o.attributes[n].name]=o.attributes[n].value}r[o.localName]instanceof Array?r[o.localName].push(t):null==r[o.localName]?r[o.localName]=t:r[o.localName]=[r[o.localName],t]}return r}function c(e){if(!e)return"";var s=" ";for(var r in e)e.hasOwnProperty(r)&&0===r.indexOf("@")&&(s+=r.substring(1)+'="'+e[r]+'" ');return s}function d(e){if(!e)return"";if("string"==typeof e)return e;if(e.InstanceID)return'<w:SelectorSet><w:Selector Name="InstanceID">'+e.InstanceID+"</w:Selector></w:SelectorSet>";var s="<w:SelectorSet>";for(var r in e)if(e.hasOwnProperty(r)){if(s+='<w:Selector Name="'+r+'">',e[r].ReferenceParameters){s+="<a:EndpointReference>",s+="<a:Address>"+e[r].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+e[r].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>";var a=e[r].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(a))for(var o=0;o<a.length;o++)s+="<w:Selector"+c(a[o])+">"+a[o].Value+"</w:Selector>";else s+="<w:Selector"+c(a)+">"+a.Value+"</w:Selector>";s+="</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>"}else s+=e[r];s+="</w:Selector>"}return s+="</w:SelectorSet>"}return n.NextMessageId=1,n.Address="/wsman",n.comm=CreateWsmanComm(e,s,r,a,o,t),n.PerformAjax=function(e,s,r,a,o){null==o&&(o=""),n.comm.PerformAjax('<?xml version=\"1.0\" encoding=\"utf-8\"?><Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns="http://www.w3.org/2003/05/soap-envelope" '+o+"><Header><a:Action>"+e,(function(e,r,a){if(200==r){var o=n.ParseWsman(e);o&&null!=o?s(n,o.Header.ResourceURI,o,200,a):s(n,null,{Header:{HttpError:r}},601,a)}else s(n,null,{Header:{HttpError:r}},r,a)}),r,a)},n.CancelAllQueries=function(e){n.comm.CancelAllQueries(e)},n.GetNameFromUrl=function(e){var s=e.lastIndexOf("/");return-1==s?e:e.substring(s+1)},n.ExecSubscribe=function(e,s,r,a,o,t,l,c,m,i){var u="",p="";null!=m&&null!=i&&(u="<t:IssuedTokens><t:RequestSecurityTokenResponse><t:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken</t:TokenType><t:RequestedSecurityToken><se:UsernameToken><se:Username>"+m+'</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">'+i+"</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>",p='<Auth Profile="http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryModes/secprofile/http/digest"/>'),c=null!=c&&null!=c?"<a:ReferenceParameters>"+c+"</a:ReferenceParameters>":"";var w="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+d(l)+u+'</Header><Body><e:Subscribe><e:Delivery Mode="http://schemas.dmtf.org/wbem/wsman/1/wsman/'+s+'"><e:NotifyTo><a:Address>'+r+"</a:Address></e:NotifyTo>"+p+"</e:Delivery><e:Expires>PT0.000000S</e:Expires></e:Subscribe>";n.PerformAjax(w+"</Body></Envelope>",a,o,t,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:se="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:m="http://x.com"')},n.ExecUnSubscribe=function(e,s,r,a,o){var t="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+d(o)+"</Header><Body><e:Unsubscribe/>";n.PerformAjax(t+"</Body></Envelope>",s,r,a,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')},n.ExecPut=function(e,s,r,a,o,t){var l="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60.000S</w:OperationTimeout>"+d(t)+"</Header><Body>"+function(e,s){if(!e||null==s)return"";var r=n.GetNameFromUrl(e),a="<r:"+r+' xmlns:r="'+e+'">';for(var o in s)if(s.hasOwnProperty(o)&&0!==o.indexOf("__")&&0!==o.indexOf("@")&&void 0!==s[o]&&null!==s[o]&&"function"!=typeof s[o])if("object"==typeof s[o]&&s[o].ReferenceParameters){a+="<r:"+o+"><a:Address>"+s[o].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+s[o].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>";var t=s[o].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(t))for(var l=0;l<t.length;l++)a+="<w:Selector"+c(t[l])+">"+t[l].Value+"</w:Selector>";else a+="<w:Selector"+c(t)+">"+t.Value+"</w:Selector>";a+="</w:SelectorSet></a:ReferenceParameters></r:"+o+">"}else if(Array.isArray(s[o]))for(l=0;l<s[o].length;l++)a+="<r:"+o+">"+s[o][l].toString()+"</r:"+o+">";else a+="<r:"+o+">"+s[o].toString()+"</r:"+o+">";return a+="</r:"+r+">"}(e,s);n.PerformAjax(l+"</Body></Envelope>",r,a,o)},n.ExecCreate=function(e,s,r,a,o,t){var l=n.GetNameFromUrl(e),c="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+d(t)+"</Header><Body><g:"+l+' xmlns:g="'+e+'">';for(var m in s)c+="<g:"+m+">"+s[m]+"</g:"+m+">";n.PerformAjax(c+"</g:"+l+"></Body></Envelope>",r,a,o)},n.ExecCreateXml=function(e,s,r,a,o){var t=n.GetNameFromUrl(e);n.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60.000S</w:OperationTimeout></Header><Body><r:"+t+' xmlns:r="'+e+'">'+s+"</r:"+t+"></Body></Envelope>",r,a,o)},n.ExecDelete=function(e,s,r,a,o){var t="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+d(s)+"</Header><Body /></Envelope>";n.PerformAjax(t,r,a,o)},n.ExecGet=function(e,s,r,a){n.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body /></Envelope>",s,r,a)},n.ExecMethod=function(e,s,r,a,o,t,l){var c="";for(var d in r)if(null!=r[d])if(Array.isArray(r[d]))for(var m in r[d])c+="<r:"+d+">"+r[d][m]+"</r:"+d+">";else c+="<r:"+d+">"+r[d]+"</r:"+d+">";n.ExecMethodXml(e,s,c,a,o,t,l)},n.ExecMethodXml=function(e,s,r,a,o,t,l){n.PerformAjax(e+"/"+s+"</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+d(l)+"</Header><Body><r:"+s+'_INPUT xmlns:r="'+e+'">'+r+"</r:"+s+"_INPUT></Body></Envelope>",a,o,t)},n.ExecEnum=function(e,s,r,a){n.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++'</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>',s,r,a)},n.ExecPull=function(e,s,r,a,o){n.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>"+n.Address+"</a:To><w:ResourceURI>"+e+"</w:ResourceURI><a:MessageID>"+n.NextMessageId+++'</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>'+s+"</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>",r,a,o)},n.ParseWsman=function(e){try{e.childNodes||(e=function(e){if(window.DOMParser)return(new DOMParser).parseFromString(e,"text/xml");var s=new ActiveXObject("Microsoft.XMLDOM");return s.async=!1,s.loadXML(e),s}(e));var s,r={Header:{}},a=e.getElementsByTagName("Header")[0];if(a||(a=e.getElementsByTagName("a:Header")[0]),!a)return null;for(var o=0;o<a.childNodes.length;o++){var t=a.childNodes[o];r.Header[t.localName]=t.textContent}var n=e.getElementsByTagName("Body")[0];if(n||(n=e.getElementsByTagName("a:Body")[0]),!n)return null;if(n.childNodes.length>0){var c=(s=n.childNodes[0].localName).indexOf("_OUTPUT");-1!=c&&c==s.length-7&&(s=s.substring(0,s.length-7)),r.Header.Method=s,r.Body=l(n.childNodes[0])}return r}catch(s){return console.log("Unable to parse XML: "+e),null}},n}
\ No newline at end of file
public/scripts/amt-wsman-ws-0.2.0-min.js
+1
-1
@@ -1 +1 @@
1
-var CreateWsmanComm=function(e,t,n,r,o){var u={};function c(e){e="00000000"+e.toString(16);return e.substring(e.length-8)}function a(){for(i in u.socketState=2,u.pendingAjaxCall)u.sendRequest(u.pendingAjaxCall[i][0],u.pendingAjaxCall[i][3],u.pendingAjaxCall[i][4])}function s(e){for(u.socketAccumulator+=(e=new Uint8Array(e.data),String.fromCharCode.apply(null,e));;){if(0==u.socketParseState){var t,n=u.socketAccumulator.indexOf("\r\n\r\n");if(n<0)return;if(u.socketHeader=u.socketAccumulator.substring(0,n).split("\r\n"),null==u.amtVersion)for(var r in u.socketHeader)0==u.socketHeader[r].indexOf("Server: Intel(R) Active Management Technology ")&&(u.amtVersion=u.socketHeader[r].substring(46));for(r in u.socketAccumulator=u.socketAccumulator.substring(n+4),u.socketParseState=1,u.socketData="",u.socketXHeader={Directive:u.socketHeader[0].split(" ")},u.socketHeader)0!=r&&(t=u.socketHeader[r].indexOf(":"),u.socketXHeader[u.socketHeader[r].substring(0,t).toLowerCase()]=u.socketHeader[r].substring(t+2))}if(1==u.socketParseState){n=-1;if(null==u.socketXHeader.connection||"close"!=u.socketXHeader.connection.toLowerCase()||null!=u.socketXHeader["transfer-encoding"]&&"chunked"==u.socketXHeader["transfer-encoding"].toLowerCase())if(null!=u.socketXHeader["content-length"]){if(n=parseInt(u.socketXHeader["content-length"]),u.socketAccumulator.length<n)return;var o=u.socketAccumulator.substring(0,n);u.socketAccumulator=u.socketAccumulator.substring(n),u.socketData=o,n=0}else{var a=u.socketAccumulator.indexOf("\r\n");if(a<0)return;if(n=parseInt(u.socketAccumulator.substring(0,a),16),isNaN(n))return void(u.websocket&&u.websocket.close());if(u.socketAccumulator.length<a+2+n+2)return;o=u.socketAccumulator.substring(a+2,a+2+n);u.socketAccumulator=u.socketAccumulator.substring(a+2+n+2),u.socketData+=o}else n=0;if(0==n){l=i=c=s=a=void 0;var a=u.socketXHeader,s=u.socketData,c=parseInt(a.Directive[1]);if(401==(c=isNaN(c)?602:c)&&++u.authcounter<3){if(u.challengeParams=u.parseDigest(a["www-authenticate"]),null!=u.challengeParams.qop){var l,i=u.challengeParams.qop.split(",");for(l in i)i[l]=i[l].trim();0<=i.indexOf("auth-int")?u.challengeParams.qop="auth-int":u.challengeParams.qop="auth"}}else{a=u.pendingAjaxCall.shift();u.authcounter=0,u.ActiveAjaxCount--,u.gotNextMessages(s,"success",{status:c},a),u.PerformNextAjax()}u.socketParseState=0,u.socketHeader=null}}}}function l(e){var t,n;u.socketState=0,null!=u.socket&&(u.socket.close(),u.socket=null),0<u.pendingAjaxCall.length&&(n=(t=u.pendingAjaxCall.shift())[5],u.PerformAjaxExNodeJS2(t[0],t[1],t[2],t[3],t[4],--n))}return u.PendingAjax=[],u.ActiveAjaxCount=0,u.MaxActiveAjaxCount=1,u.FailAllError=0,u.challengeParams=null,u.noncecounter=1,u.authcounter=0,u.socket=null,u.socketState=0,u.host=e,u.port=t,u.user=n,u.pass=r,u.tls=o,u.tlsv1only=1,u.cnonce=Math.random().toString(36).substring(7),u.PerformAjax=function(e,t,n,r,o,a){u.ActiveAjaxCount<u.MaxActiveAjaxCount&&0==u.PendingAjax.length?u.PerformAjaxEx(e,t,n,o,a):1==r?u.PendingAjax.unshift([e,t,n,o,a]):u.PendingAjax.push([e,t,n,o,a])},u.PerformNextAjax=function(){var e;u.ActiveAjaxCount>=u.MaxActiveAjaxCount||0==u.PendingAjax.length||(e=u.PendingAjax.shift(),u.PerformAjaxEx(e[0],e[1],e[2],e[3],e[4]),u.PerformNextAjax())},u.PerformAjaxEx=function(e,t,n,r,o){if(0==u.FailAllError)return e=e||"",u.ActiveAjaxCount++,u.PerformAjaxExNodeJS(e,t,n,r,o);u.gotNextMessagesError({status:u.FailAllError},"error",null,[e,t,n,r,o])},u.pendingAjaxCall=[],u.PerformAjaxExNodeJS=function(e,t,n,r,o){u.PerformAjaxExNodeJS2(e,t,n,r,o,3)},u.PerformAjaxExNodeJS2=function(e,t,n,r,o,a){a<=0||0!=u.FailAllError?(u.ActiveAjaxCount--,999!=u.FailAllError&&u.gotNextMessages(null,"error",{status:0==u.FailAllError?408:u.FailAllError},[e,t,n,r,o]),u.PerformNextAjax()):(u.pendingAjaxCall.push([e,t,n,r,o,a]),0==u.socketState?u.xxConnectHttpSocket():2==u.socketState&&u.sendRequest(e,r,o))},u.sendRequest=function(e,t,n){var r=(n=n||"POST")+" "+(t=t||"/wsman")+" HTTP/1.1\r\n",o=(null!=u.challengeParams&&(n=hex_md5(hex_md5(u.user+":"+u.challengeParams.realm+":"+u.pass)+":"+u.challengeParams.nonce+":"+c(u.noncecounter)+":"+u.cnonce+":"+u.challengeParams.qop+":"+hex_md5(n+":"+t+("auth-int"==u.challengeParams.qop?":"+hex_md5(e):""))),r+="Authorization: "+u.renderDigest({username:u.user,realm:u.challengeParams.realm,nonce:u.challengeParams.nonce,uri:t,qop:u.challengeParams.qop,response:n,nc:c(u.noncecounter++),cnonce:u.cnonce})+"\r\n"),r+="Host: "+u.host+":"+u.port+"\r\nTransfer-Encoding: chunked\r\n\r\n"+e.length.toString(16).toUpperCase()+"\r\n"+e+"\r\n0\r\n\r\n");if(2==u.socketState&&null!=u.socket&&u.socket.readyState==WebSocket.OPEN){for(var a=new Uint8Array(o.length),s=0;s<o.length;++s)a[s]=o.charCodeAt(s);try{u.socket.send(a.buffer)}catch(e){}}},u.parseDigest=function(e){return e.substring(7).split(",").reduce(function(e,t){return e.ic?e.st[e.st.length-1]+=","+t:e.st.push(t),t.split('"').length%2==0&&(e.ic=!e.ic),e},{st:[],ic:!1}).st.reduce(function(e,t){t=t.trim().split("=");return e[t[0]]=t[1].replace(new RegExp('"',"g"),""),e},{})},u.renderDigest=function(n){var e=[];for(i in n)e.push(i);return"Digest "+e.reduce(function(e,t){return e+","+("nc"==t||"qop"==t?t+"="+n[t]:t+'="'+n[t]+'"')},"").substring(1)},u.xxConnectHttpSocket=function(){u.socketParseState=0,u.socketAccumulator="",u.socketHeader=null,u.socketData="",u.socketState=1,u.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=1&host="+u.host+"&port="+u.port+"&tls="+u.tls+"&tlsv1only="+u.tlsv1only+("*"==n?"&serverauth=1":"")+(void 0===r?"&serverauth=1&user="+n:"")),u.socket.binaryType="arraybuffer",u.socket.onopen=a,u.socket.onmessage=s,u.socket.onclose=l},u.gotNextMessages=function(e,t,n,r){999!=u.FailAllError&&(0!=u.FailAllError?r[1](null,u.FailAllError,r[2]):200!=n.status?r[1](null,n.status,r[2]):r[1](e,200,r[2]))},u.gotNextMessagesError=function(e,t,n,r){999!=u.FailAllError&&(0!=u.FailAllError?r[1](null,u.FailAllError,r[2]):r[1](u,null,{Header:{HttpError:e.status}},e.status,r[2]))},u.CancelAllQueries=function(e){for(;0<u.PendingAjax.length;){var t=u.PendingAjax.shift();t[1](null,e,t[2])}null!=u.websocket&&(u.websocket.close(),u.websocket=null,u.socketState=0)},u}
\ No newline at end of file
1
+var CreateWsmanComm=function(e,t,r,n,a){var o={};function s(e){var t="00000000"+e.toString(16);return t.substring(t.length-8)}function c(){for(i in o.socketState=2,o.pendingAjaxCall)o.sendRequest(o.pendingAjaxCall[i][0],o.pendingAjaxCall[i][3],o.pendingAjaxCall[i][4])}function l(e){var t;for(o.socketAccumulator+=(t=new Uint8Array(e.data),String.fromCharCode.apply(null,t));;){if(0==o.socketParseState){var r=o.socketAccumulator.indexOf("\r\n\r\n");if(r<0)return;if(o.socketHeader=o.socketAccumulator.substring(0,r).split("\r\n"),null==o.amtVersion)for(var n in o.socketHeader)0==o.socketHeader[n].indexOf("Server: Intel(R) Active Management Technology ")&&(o.amtVersion=o.socketHeader[n].substring(46));for(n in o.socketAccumulator=o.socketAccumulator.substring(r+4),o.socketParseState=1,o.socketData="",o.socketXHeader={Directive:o.socketHeader[0].split(" ")},o.socketHeader)if(0!=n){var a=o.socketHeader[n].indexOf(":");o.socketXHeader[o.socketHeader[n].substring(0,a).toLowerCase()]=o.socketHeader[n].substring(a+2)}}if(1==o.socketParseState){var s=-1;if(null==o.socketXHeader.connection||"close"!=o.socketXHeader.connection.toLowerCase()||null!=o.socketXHeader["transfer-encoding"]&&"chunked"==o.socketXHeader["transfer-encoding"].toLowerCase())if(null!=o.socketXHeader["content-length"]){if(s=parseInt(o.socketXHeader["content-length"]),o.socketAccumulator.length<s)return;var c=o.socketAccumulator.substring(0,s);o.socketAccumulator=o.socketAccumulator.substring(s),o.socketData=c,s=0}else{var l=o.socketAccumulator.indexOf("\r\n");if(l<0)return;if(s=parseInt(o.socketAccumulator.substring(0,l),16),isNaN(s))return void(o.websocket&&o.websocket.close());if(o.socketAccumulator.length<l+2+s+2)return;c=o.socketAccumulator.substring(l+2,l+2+s);o.socketAccumulator=o.socketAccumulator.substring(l+2+s+2),o.socketData+=c}else s=0;0==s&&(u(o.socketXHeader,o.socketData),o.socketParseState=0,o.socketHeader=null)}}}function u(e,t){var r=parseInt(e.Directive[1]);if(isNaN(r)&&(r=602),401==r&&++o.authcounter<3){if(o.challengeParams=o.parseDigest(e["www-authenticate"]),null!=o.challengeParams.qop){var n=o.challengeParams.qop.split(",");for(var a in n)n[a]=n[a].trim();n.indexOf("auth-int")>=0?o.challengeParams.qop="auth-int":o.challengeParams.qop="auth"}}else{var s=o.pendingAjaxCall.shift();o.authcounter=0,o.ActiveAjaxCount--,o.gotNextMessages(t,"success",{status:r},s),o.PerformNextAjax()}}function g(e){if(o.socketState=0,null!=o.socket&&(o.socket.close(),o.socket=null),o.pendingAjaxCall.length>0){var t=o.pendingAjaxCall.shift(),r=t[5];o.PerformAjaxExNodeJS2(t[0],t[1],t[2],t[3],t[4],--r)}}return o.PendingAjax=[],o.ActiveAjaxCount=0,o.MaxActiveAjaxCount=1,o.FailAllError=0,o.challengeParams=null,o.noncecounter=1,o.authcounter=0,o.socket=null,o.socketState=0,o.host=e,o.port=t,o.user=r,o.pass=n,o.tls=a,o.tlsv1only=1,o.cnonce=Math.random().toString(36).substring(7),o.PerformAjax=function(e,t,r,n,a,s){o.ActiveAjaxCount<o.MaxActiveAjaxCount&&0==o.PendingAjax.length?o.PerformAjaxEx(e,t,r,a,s):1==n?o.PendingAjax.unshift([e,t,r,a,s]):o.PendingAjax.push([e,t,r,a,s])},o.PerformNextAjax=function(){if(!(o.ActiveAjaxCount>=o.MaxActiveAjaxCount||0==o.PendingAjax.length)){var e=o.PendingAjax.shift();o.PerformAjaxEx(e[0],e[1],e[2],e[3],e[4]),o.PerformNextAjax()}},o.PerformAjaxEx=function(e,t,r,n,a){if(0==o.FailAllError)return e||(e=""),o.ActiveAjaxCount++,o.PerformAjaxExNodeJS(e,t,r,n,a);o.gotNextMessagesError({status:o.FailAllError},"error",null,[e,t,r,n,a])},o.pendingAjaxCall=[],o.PerformAjaxExNodeJS=function(e,t,r,n,a){o.PerformAjaxExNodeJS2(e,t,r,n,a,3)},o.PerformAjaxExNodeJS2=function(e,t,r,n,a,s){if(s<=0||0!=o.FailAllError)return o.ActiveAjaxCount--,999!=o.FailAllError&&o.gotNextMessages(null,"error",{status:0==o.FailAllError?408:o.FailAllError},[e,t,r,n,a]),void o.PerformNextAjax();o.pendingAjaxCall.push([e,t,r,n,a,s]),0==o.socketState?o.xxConnectHttpSocket():2==o.socketState&&o.sendRequest(e,n,a)},o.sendRequest=function(e,t,r){var n=(r=r||"POST")+" "+(t=t||"/wsman")+" HTTP/1.1\r\n";if(null!=o.challengeParams){var a=hex_md5(hex_md5(o.user+":"+o.challengeParams.realm+":"+o.pass)+":"+o.challengeParams.nonce+":"+s(o.noncecounter)+":"+o.cnonce+":"+o.challengeParams.qop+":"+hex_md5(r+":"+t+("auth-int"==o.challengeParams.qop?":"+hex_md5(e):"")));n+="Authorization: "+o.renderDigest({username:o.user,realm:o.challengeParams.realm,nonce:o.challengeParams.nonce,uri:t,qop:o.challengeParams.qop,response:a,nc:s(o.noncecounter++),cnonce:o.cnonce})+"\r\n"}!function(e){if(2==o.socketState&&null!=o.socket&&o.socket.readyState==WebSocket.OPEN){for(var t=new Uint8Array(e.length),r=0;r<e.length;++r)t[r]=e.charCodeAt(r);try{o.socket.send(t.buffer)}catch(e){}}}(n+="Host: "+o.host+":"+o.port+"\r\nTransfer-Encoding: chunked\r\n\r\n"+e.length.toString(16).toUpperCase()+"\r\n"+e+"\r\n0\r\n\r\n")},o.parseDigest=function(e){return(t=e.substring(7),t.split(",").reduce((function(e,t){return e.ic?e.st[e.st.length-1]+=","+t:e.st.push(t),t.split('"').length%2==0&&(e.ic=!e.ic),e}),{st:[],ic:!1}).st).reduce((function(e,t){var r=t.trim().split("=");return e[r[0]]=r[1].replace(new RegExp('"',"g"),""),e}),{});var t},o.renderDigest=function(e){var t=[];for(i in e)t.push(i);return"Digest "+t.reduce((function(t,r){return t+","+("nc"==r||"qop"==r?r+"="+e[r]:r+'="'+e[r]+'"')}),"").substring(1)},o.xxConnectHttpSocket=function(){o.socketParseState=0,o.socketAccumulator="",o.socketHeader=null,o.socketData="",o.socketState=1,o.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=1&host="+o.host+"&port="+o.port+"&tls="+o.tls+"&tlsv1only="+o.tlsv1only+("*"==r?"&serverauth=1":"")+(void 0===n?"&serverauth=1&user="+r:"")),o.socket.binaryType="arraybuffer",o.socket.onopen=c,o.socket.onmessage=l,o.socket.onclose=g},o.gotNextMessages=function(e,t,r,n){999!=o.FailAllError&&(0==o.FailAllError?200==r.status?n[1](e,200,n[2]):n[1](null,r.status,n[2]):n[1](null,o.FailAllError,n[2]))},o.gotNextMessagesError=function(e,t,r,n){999!=o.FailAllError&&(0==o.FailAllError?n[1](o,null,{Header:{HttpError:e.status}},e.status,n[2]):n[1](null,o.FailAllError,n[2]))},o.CancelAllQueries=function(e){for(;o.PendingAjax.length>0;){var t=o.PendingAjax.shift();t[1](null,e,t[2])}null!=o.websocket&&(o.websocket.close(),o.websocket=null,o.socketState=0)},o}
\ No newline at end of file
public/scripts/common-0.0.1-min.js
+1
-1
@@ -1 +1 @@
1
-function Q(n){return document.getElementById(n)}function QS(n){try{return Q(n).style}catch(n){}}function QE(n,t){try{Q(n).disabled=!t}catch(n){}}function QV(n,t){try{QS(n).display=t?"":"none"}catch(n){}}function QA(n,t){Q(n).innerHTML+=t}function QH(n,t){Q(n).innerHTML=t}function QC(n){try{return Q(n).classList}catch(n){}}function QVH(n,t){try{t?Q(n).classList.remove("visually-hidden"):Q(n).classList.add("visually-hidden")}catch(n){}}function inputBoxFocus(n){Q(n).focus();var t=Q(n).value;Q(n).value="",Q(n).value=t}function ReadShort(n,t){return(n.charCodeAt(t)<<8)+n.charCodeAt(t+1)}function ReadShortX(n,t){return(n.charCodeAt(t+1)<<8)+n.charCodeAt(t)}function ReadInt(n,t){return 16777216*n.charCodeAt(t)+(n.charCodeAt(t+1)<<16)+(n.charCodeAt(t+2)<<8)+n.charCodeAt(t+3)}function ReadSInt(n,t){return(n.charCodeAt(t)<<24)+(n.charCodeAt(t+1)<<16)+(n.charCodeAt(t+2)<<8)+n.charCodeAt(t+3)}function ReadIntX(n,t){return 16777216*n.charCodeAt(t+3)+(n.charCodeAt(t+2)<<16)+(n.charCodeAt(t+1)<<8)+n.charCodeAt(t)}function ShortToStr(n){return String.fromCharCode(n>>8&255,255&n)}function ShortToStrX(n){return String.fromCharCode(255&n,n>>8&255)}function IntToStr(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,255&n)}function IntToStrX(n){return String.fromCharCode(255&n,n>>8&255,n>>16&255,n>>24&255)}function MakeToArray(n){return n&&null!=n&&"object"!=typeof n?[n]:n}function SplitArray(n){return n.split(",")}function Clone(n){return JSON.parse(JSON.stringify(n))}function EscapeHtml(n){return"string"==typeof n?n.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'"):"boolean"==typeof n||"number"==typeof n?n:void 0}function EscapeHtmlBreaks(n){return"string"==typeof n?n.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'").replace(/\r/g,"<br />").replace(/\n/g,"").replace(/\t/g," "):"boolean"==typeof n||"number"==typeof n?n:void 0}function ArrayElementMove(n,t,e){n.splice(e,0,n.splice(t,1)[0])}function ObjectToStringEx(n,t){var e="";if(0!=n&&(!n||null==n))return"(Null)";if(n instanceof Array)for(var r in n)e+="<br />"+gap(t)+"Item #"+r+": "+ObjectToStringEx(n[r],t+1);else if(n instanceof Object)for(var r in n)e+="<br />"+gap(t)+r+" = "+ObjectToStringEx(n[r],t+1);else e+=EscapeHtml(n);return e}function ObjectToStringEx2(n,t){var e="";if(0!=n&&(!n||null==n))return"(Null)";if(n instanceof Array)for(var r in n)e+="\r\n"+gap2(t)+"Item #"+r+": "+ObjectToStringEx2(n[r],t+1);else if(n instanceof Object)for(var r in n)e+="\r\n"+gap2(t)+r+" = "+ObjectToStringEx2(n[r],t+1);else e+=EscapeHtml(n);return e}function gap(n){for(var t="",e=0;e<4*n;e++)t+=" ";return t}function gap2(n){for(var t="",e=0;e<4*n;e++)t+=" ";return t}function ObjectToString(n){return ObjectToStringEx(n,0)}function ObjectToString2(n){return ObjectToStringEx2(n,0)}function hex2rstr(n){if("string"!=typeof n||0==n.length)return"";for(var t,e="",r=(""+n).match(/../g);t=r.shift();)e+=String.fromCharCode("0x"+t);return e}function char2hex(n){return(n+256).toString(16).substr(-2).toUpperCase()}function rstr2hex(n){for(var t="",e=0;e<n.length;e++)t+=char2hex(n.charCodeAt(e));return t}function encode_utf8(n){return unescape(encodeURIComponent(n))}function decode_utf8(n){return decodeURIComponent(escape(n))}function data2blob(n){for(var t=new Array(n.length),e=0;e<n.length;e++)t[e]=n.charCodeAt(e);return new Blob([new Uint8Array(t)])}function utf2blob(n){for(var t=[],e=unescape(encodeURIComponent(n)),r=0;r<e.length;r++)t.push(e.charCodeAt(r));return new Blob([new Uint8Array(t)])}function random(n){return Math.floor(Math.random()*n)}function trademarks(n){return n.replace(/\(R\)/g,"®").replace(/\(TM\)/g,"™")}function zeroPad(n,t){n="00000000"+n;return n.substr(n.length-(t=null==t?2:t))}function isAlphaNumeric(n){return"number"==typeof n||null!=n.match(/^[A-Za-z0-9]+$/)}function isSafeString(n){return"string"==typeof n&&-1==n.indexOf("<")&&-1==n.indexOf(">")&&-1==n.indexOf("&")&&-1==n.indexOf('"')&&-1==n.indexOf("'")&&-1==n.indexOf("+")&&-1==n.indexOf("(")&&-1==n.indexOf(")")&&-1==n.indexOf("#")&&-1==n.indexOf("%")&&-1==n.indexOf(":")}function isSafeString2(n){return"string"==typeof n&&-1==n.indexOf("<")&&-1==n.indexOf(">")&&-1==n.indexOf("&")&&-1==n.indexOf('"')&&-1==n.indexOf("'")&&-1==n.indexOf("+")&&-1==n.indexOf("(")&&-1==n.indexOf(")")&&-1==n.indexOf("#")&&-1==n.indexOf("%")}function parseUriArgs(n){var t,e=window.document.location.href,r={},o=(e=e.endsWith("#")?e.substring(0,e.length-1):e).split(/[\?&|]/);for(t in o.splice(0,1),o){var i,a=o[t],c=a.indexOf("=");r[i=a.substring(0,c)]=a.substring(c+1),n&&(r[i]=decodeURIComponent(a.substring(c+1))),isSafeString2(r[i])?(a=parseInt(r[i]))==r[i]&&(r[i]=a):delete r[i]}return r}function check_webp_feature(t,e){var r=new Image;r.onload=function(){var n=0<r.width&&0<r.height;e(t,n)},r.onerror=function(){e(t,!1)},r.src="data:image/webp;base64,"+{lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}[t]}function jsonToCamel(n){var t,e,r,o;if(n instanceof Array)return n.map(function(n){return n="object"==typeof n?jsonToCamel(n):n});for(e in t={},n)n.hasOwnProperty(e)&&(r=(e.charAt(0).toLowerCase()+e.slice(1)||e).toString(),((o=n[e])instanceof Array||null!==o&&o.constructor===Object)&&(o=jsonToCamel(o)),t[r]=o);return t}String.prototype.startsWith||(String.prototype.startsWith=function(n){return 0===this.lastIndexOf(n,0)}),String.prototype.endsWith||(String.prototype.endsWith=function(n){return-1!==this.indexOf(n,this.length-n.length)})
\ No newline at end of file
1
+function Q(n){return document.getElementById(n)}function QS(n){try{return Q(n).style}catch(n){}}function QE(n,t){try{Q(n).disabled=!t}catch(n){}}function QV(n,t){try{QS(n).display=t?"":"none"}catch(n){}}function QA(n,t){Q(n).innerHTML+=t}function QH(n,t){Q(n).innerHTML=t}function QC(n){try{return Q(n).classList}catch(n){}}function QVH(n,t){try{t?Q(n).classList.remove("visually-hidden"):Q(n).classList.add("visually-hidden")}catch(n){}}function inputBoxFocus(n){Q(n).focus();var t=Q(n).value;Q(n).value="",Q(n).value=t}function ReadShort(n,t){return(n.charCodeAt(t)<<8)+n.charCodeAt(t+1)}function ReadShortX(n,t){return(n.charCodeAt(t+1)<<8)+n.charCodeAt(t)}function ReadInt(n,t){return 16777216*n.charCodeAt(t)+(n.charCodeAt(t+1)<<16)+(n.charCodeAt(t+2)<<8)+n.charCodeAt(t+3)}function ReadSInt(n,t){return(n.charCodeAt(t)<<24)+(n.charCodeAt(t+1)<<16)+(n.charCodeAt(t+2)<<8)+n.charCodeAt(t+3)}function ReadIntX(n,t){return 16777216*n.charCodeAt(t+3)+(n.charCodeAt(t+2)<<16)+(n.charCodeAt(t+1)<<8)+n.charCodeAt(t)}function ShortToStr(n){return String.fromCharCode(n>>8&255,255&n)}function ShortToStrX(n){return String.fromCharCode(255&n,n>>8&255)}function IntToStr(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,255&n)}function IntToStrX(n){return String.fromCharCode(255&n,n>>8&255,n>>16&255,n>>24&255)}function MakeToArray(n){return n&&null!=n&&"object"!=typeof n?[n]:n}function SplitArray(n){return n.split(",")}function Clone(n){return JSON.parse(JSON.stringify(n))}function EscapeHtml(n){return"string"==typeof n?n.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'"):"boolean"==typeof n||"number"==typeof n?n:void 0}function EscapeHtmlBreaks(n){return"string"==typeof n?n.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'").replace(/\r/g,"<br />").replace(/\n/g,"").replace(/\t/g," "):"boolean"==typeof n||"number"==typeof n?n:void 0}function ArrayElementMove(n,t,e){n.splice(e,0,n.splice(t,1)[0])}function ObjectToStringEx(n,t){var e="";if(0!=n&&(!n||null==n))return"(Null)";if(n instanceof Array)for(var r in n)e+="<br />"+gap(t)+"Item #"+r+": "+ObjectToStringEx(n[r],t+1);else if(n instanceof Object)for(var r in n)e+="<br />"+gap(t)+r+" = "+ObjectToStringEx(n[r],t+1);else e+=EscapeHtml(n);return e}function ObjectToStringEx2(n,t){var e="";if(0!=n&&(!n||null==n))return"(Null)";if(n instanceof Array)for(var r in n)e+="\r\n"+gap2(t)+"Item #"+r+": "+ObjectToStringEx2(n[r],t+1);else if(n instanceof Object)for(var r in n)e+="\r\n"+gap2(t)+r+" = "+ObjectToStringEx2(n[r],t+1);else e+=EscapeHtml(n);return e}function gap(n){for(var t="",e=0;e<4*n;e++)t+=" ";return t}function gap2(n){for(var t="",e=0;e<4*n;e++)t+=" ";return t}function ObjectToString(n){return ObjectToStringEx(n,0)}function ObjectToString2(n){return ObjectToStringEx2(n,0)}function hex2rstr(n){if("string"!=typeof n||0==n.length)return"";for(var t,e="",r=(""+n).match(/../g);t=r.shift();)e+=String.fromCharCode("0x"+t);return e}function char2hex(n){return(n+256).toString(16).substr(-2).toUpperCase()}function rstr2hex(n){var t,e="";for(t=0;t<n.length;t++)e+=char2hex(n.charCodeAt(t));return e}function encode_utf8(n){return unescape(encodeURIComponent(n))}function decode_utf8(n){return decodeURIComponent(escape(n))}function data2blob(n){for(var t=new Array(n.length),e=0;e<n.length;e++)t[e]=n.charCodeAt(e);return new Blob([new Uint8Array(t)])}function utf2blob(n){for(var t=[],e=unescape(encodeURIComponent(n)),r=0;r<e.length;r++)t.push(e.charCodeAt(r));return new Blob([new Uint8Array(t)])}function random(n){return Math.floor(Math.random()*n)}function trademarks(n){return n.replace(/\(R\)/g,"®").replace(/\(TM\)/g,"™")}function zeroPad(n,t){null==t&&(t=2);var e="00000000"+n;return e.substr(e.length-t)}function isAlphaNumeric(n){return"number"==typeof n||null!=n.match(/^[A-Za-z0-9]+$/)}function isSafeString(n){return"string"==typeof n&&-1==n.indexOf("<")&&-1==n.indexOf(">")&&-1==n.indexOf("&")&&-1==n.indexOf('"')&&-1==n.indexOf("'")&&-1==n.indexOf("+")&&-1==n.indexOf("(")&&-1==n.indexOf(")")&&-1==n.indexOf("#")&&-1==n.indexOf("%")&&-1==n.indexOf(":")}function isSafeString2(n){return"string"==typeof n&&-1==n.indexOf("<")&&-1==n.indexOf(">")&&-1==n.indexOf("&")&&-1==n.indexOf('"')&&-1==n.indexOf("'")&&-1==n.indexOf("+")&&-1==n.indexOf("(")&&-1==n.indexOf(")")&&-1==n.indexOf("#")&&-1==n.indexOf("%")}function parseUriArgs(n){var t=window.document.location.href;t.endsWith("#")&&(t=t.substring(0,t.length-1));var e,r={},o=t.split(/[\?&|]/);for(var i in o.splice(0,1),o){var a=o[i],c=a.indexOf("=");if(r[e=a.substring(0,c)]=a.substring(c+1),n&&(r[e]=decodeURIComponent(a.substring(c+1))),isSafeString2(r[e])){var u=parseInt(r[e]);u==r[e]&&(r[e]=u)}else delete r[e]}return r}function check_webp_feature(n,t){var e=new Image;e.onload=function(){var r=e.width>0&&e.height>0;t(n,r)},e.onerror=function(){t(n,!1)},e.src="data:image/webp;base64,"+{lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}[n]}function jsonToCamel(n){var t,e,r,o;if(n instanceof Array)return n.map((function(n){return"object"==typeof n&&(n=jsonToCamel(n)),n}));for(e in t={},n)n.hasOwnProperty(e)&&(r=(e.charAt(0).toLowerCase()+e.slice(1)||e).toString(),((o=n[e])instanceof Array||null!==o&&o.constructor===Object)&&(o=jsonToCamel(o)),t[r]=o);return t}String.prototype.startsWith||(String.prototype.startsWith=function(n){return 0===this.lastIndexOf(n,0)}),String.prototype.endsWith||(String.prototype.endsWith=function(n){return-1!==this.indexOf(n,this.length-n.length)})
\ No newline at end of file
public/scripts/meshcentral-min.js
+1
-1
@@ -1 +1 @@
1
-var MeshServerCreateControl=function(t,e){var o={State:0,connectstate:0,pingTimer:null};return o.authCookie=e,o.xxStateChange=function(e,t){var n;o.State!=e&&(n=o.State,o.State=e,o.onStateChanged)&&o.onStateChanged(o,o.State,n,t)},o.Start=function(){var e;0==o.connectstate&&(o.connectstate=0,e=window.location.protocol.replace("http","ws")+"//"+window.location.host+t+"control.ashx"+(urlargs.key?"?key="+urlargs.key:""),o.authCookie&&""!=o.authCookie&&(e+="?moreargs=1"),o.socket=new WebSocket(e),o.socket.onopen=function(e){o.connectstate=1,o.authCookie&&""!=o.authCookie&&o.send({action:"urlargs",args:{auth:o.authCookie}})},o.socket.onmessage=o.xxOnMessage,o.socket.onclose=function(e){o.Stop(e.code)},o.xxStateChange(1,0),null!=o.pingTimer&&clearInterval(o.pingTimer),o.pingTimer=setInterval(function(){o.send({action:"ping"})},29e3))},o.Stop=function(e){o.connectstate=0,o.socket&&(o.socket.close(),delete o.socket),null!=o.pingTimer&&(clearInterval(o.pingTimer),o.pingTimer=null),o.xxStateChange(0,e)},o.xxOnMessage=function(e){var t;1==o.State&&o.xxStateChange(2);try{t=JSON.parse(e.data)}catch(e){return}"object"==typeof t&&"pong"!=t.action&&("ping"==t.action&&o.send({action:"pong"}),"close"==t.action?(t.msg&&console.log(t.msg),o.Stop(t.cause)):(1==o.trace?console.log("RECV",t):2==o.trace&&console.log("RECV",JSON.stringify(t)),o.onMessage&&o.onMessage(o,t)))},o.send=function(e){null!=o.socket&&1==o.connectstate&&("ping"!=e.action&&(1==o.trace?console.log("SEND",e):2==o.trace&&console.log("SEND",JSON.stringify(e))),o.socket.send(JSON.stringify(e)))},o}
\ No newline at end of file
1
+var MeshServerCreateControl=function(e,t){var n={State:0,connectstate:0,pingTimer:null};return n.authCookie=t,n.xxStateChange=function(e,t){if(n.State!=e){var o=n.State;n.State=e,n.onStateChanged&&n.onStateChanged(n,n.State,o,t)}},n.Start=function(){if(0==n.connectstate){n.connectstate=0;var t=window.location.protocol.replace("http","ws")+"//"+window.location.host+e+"control.ashx"+(urlargs.key?"?key="+urlargs.key:"");n.authCookie&&""!=n.authCookie&&(t+="?moreargs=1"),n.socket=new WebSocket(t),n.socket.onopen=function(e){n.connectstate=1,n.authCookie&&""!=n.authCookie&&n.send({action:"urlargs",args:{auth:n.authCookie}})},n.socket.onmessage=n.xxOnMessage,n.socket.onclose=function(e){n.Stop(e.code)},n.xxStateChange(1,0),null!=n.pingTimer&&clearInterval(n.pingTimer),n.pingTimer=setInterval((function(){n.send({action:"ping"})}),29e3)}},n.Stop=function(e){n.connectstate=0,n.socket&&(n.socket.close(),delete n.socket),null!=n.pingTimer&&(clearInterval(n.pingTimer),n.pingTimer=null),n.xxStateChange(0,e)},n.xxOnMessage=function(e){var t;1==n.State&&n.xxStateChange(2);try{t=JSON.parse(e.data)}catch(e){return}if("object"==typeof t&&"pong"!=t.action){if("ping"==t.action&&n.send({action:"pong"}),"close"==t.action)return t.msg&&console.log(t.msg),void n.Stop(t.cause);1==n.trace?console.log("RECV",t):2==n.trace&&console.log("RECV",JSON.stringify(t)),n.onMessage&&n.onMessage(n,t)}},n.send=function(e){null!=n.socket&&1==n.connectstate&&("ping"!=e.action&&(1==n.trace?console.log("SEND",e):2==n.trace&&console.log("SEND",JSON.stringify(e))),n.socket.send(JSON.stringify(e)))},n}
\ No newline at end of file
public/scripts/ol3-contextmenu-min.js
+8
-1
@@ -1 +1,8 @@
1
-((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ContextMenu=e()})(this,function(){function e(t){return this.Base=t,this.map=void 0,this.viewport=void 0,this.coordinateClicked=void 0,this.pixelClicked=void 0,this.lineHeight=0,this.items={},this.opened=!1,this.submenu={left:t.options.width-15+"px",lastLeft:""},this.eventHandler=this.handleEvent.bind(this),this}function n(t){return this.Base=t,this.Base.container=this.container=this.createContainer(),this}var i,t="ol-ctx-menu",s="beforeopen",o="open",a="close",r="contextmenu",l={container:t+"-container",separator:t+"-separator",submenu:t+"-submenu",hidden:t+"-hidden",icon:t+"-icon",zoomIn:t+"-zoom-in",zoomOut:t+"-zoom-out",OL_unselectable:"ol-unselectable"},c={width:150,scrollAt:4,eventType:r,defaultItems:!0},h=[{text:"Zoom In",classname:[l.zoomIn,l.icon].join(" "),callback:function(t,e){e=e.getView();e.animate({zoom:+e.getZoom()+1,duration:700,center:t.coordinate})}},{text:"Zoom Out",classname:[l.zoomOut,l.icon].join(" "),callback:function(t,e){e=e.getView();e.animate({zoom:+e.getZoom()-1,duration:700,center:t.coordinate})}}],d={isNumeric:function(t){return/^\d+$/.test(t)},classRegex:function(t){return new RegExp("(^|\\s+) "+t+" (\\s+|$)")},addClass:function(t,e,n){var i=this;if(Array.isArray(t))t.forEach(function(t){i.addClass(t,e)});else for(var s=Array.isArray(e)?e:e.split(/\s+/),o=s.length;o--;)i.hasClass(t,s[o])||i._addClass(t,s[o],n)},_addClass:function(t,e,n){var i=this;t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim(),n&&this.isNumeric(n)&&window.setTimeout(function(){i._removeClass(t,e)},n)},removeClass:function(t,e,n){var i=this;if(Array.isArray(t))t.forEach(function(t){i.removeClass(t,e,n)});else for(var s=Array.isArray(e)?e:e.split(/\s+/),o=s.length;o--;)i.hasClass(t,s[o])&&i._removeClass(t,s[o],n)},_removeClass:function(t,e,n){var i=this;t.classList?t.classList.remove(e):t.className=t.className.replace(this.classRegex(e)," ").trim(),n&&this.isNumeric(n)&&window.setTimeout(function(){i._addClass(t,e)},n)},hasClass:function(t,e){return t.classList?t.classList.contains(e):this.classRegex(e).test(t.className)},toggleClass:function(t,e){var n=this;return Array.isArray(t)?void t.forEach(function(t){n.toggleClass(t,e)}):void(t.classList?t.classList.toggle(e):this.hasClass(t,e)?this._removeClass(t,e):this._addClass(t,e))},$:function(t){return t="#"===t[0]?t.substr(1,t.length):t,document.getElementById(t)},isElement:function(t){return"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&"object"==typeof t&&1===t.nodeType&&!!t.nodeName},find:function(t,e,n){void 0===e&&(e=window.document);var i=Array.prototype.slice,s=[];if(/^(#?[\w-]+|\.[\w-.]+)$/.test(t))switch(t[0]){case"#":s=[this.$(t.substr(1))];break;case".":s=i.call(e.getElementsByClassName(t.substr(1).replace(/\./g," ")));break;default:s=i.call(e.getElementsByTagName(t))}else s=i.call(e.querySelectorAll(t));return n?s:s[0]},offset:function(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+window.pageXOffset-n.clientLeft,top:e.top+window.pageYOffset-n.clientTop,width:t.offsetWidth,height:t.offsetHeight}},getViewportSize:function(){return{w:window.innerWidth||document.documentElement.clientWidth,h:window.innerHeight||document.documentElement.clientHeight}},getAllChildren:function(t,e){return[].slice.call(t.getElementsByTagName(e))},isEmpty:function(t){return!t||0===t.length},emptyArray:function(t){for(;t.length;)t.pop()},removeAllChildren:function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},mergeOptions:function(t,e){var n,i,s={};for(n in t)s[n]=t[n];for(i in e)s[i]=e[i];return s},createFragment:function(t){var e=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild);return e},contains:function(t,e){return!!~e.indexOf(t)},getUniqueId:function(){return"_"+Math.random().toString(36).substr(2,9)},isDefAndNotNull:function(t){return null!=t},assertEqual:function(t,e,n){if(t!==e)throw new Error(n+" mismatch: "+t+" != "+e)},assert:function(t,e){if(void 0===e&&(e="Assertion failed"),!t){if("undefined"!=typeof Error)throw new Error(e);throw e}}};e.prototype.init=function(t){this.map=t,this.viewport=t.getViewport(),this.setListeners(),this.Base.Html.createMenu(),this.lineHeight=0<this.getItemsLength()?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()},e.prototype.getItemsLength=function(){var e=this,n=0;return Object.keys(this.items).forEach(function(t){e.items[t].submenu||e.items[t].separator||n++}),n},e.prototype.getPixelClicked=function(){return this.pixelClicked},e.prototype.getCoordinateClicked=function(){return this.coordinateClicked},e.prototype.positionContainer=function(t){var s=this,e=this.map.getSize(),n=e[0],o=e[1]-t[1],e=n-t[0],n=this.Base.container.offsetWidth,i=Math.round(this.lineHeight*this.getItemsLength()),a=d.find("li."+l.submenu+"> div",this.Base.container,!0);n<=e?(this.Base.container.style.right="auto",this.Base.container.style.left=t[0]+5+"px"):(this.Base.container.style.left="auto",this.Base.container.style.right="15px"),i<=o?(this.Base.container.style.bottom="auto",this.Base.container.style.top=t[1]-10+"px"):(this.Base.container.style.top="auto",this.Base.container.style.bottom=0),d.removeClass(this.Base.container,l.hidden),a.length&&(this.submenu.lastLeft=e<2*n?"-"+n+"px":this.submenu.left,a.forEach(function(t){var e=d.getViewportSize(),n=d.offset(t),i=n.height;o-i<0&&(i=i-(e.h-n.top),t.style.top="-"+i+"px"),t.style.left=s.submenu.lastLeft}))},e.prototype.openMenu=function(t,e){this.Base.dispatchEvent({type:o,pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)},e.prototype.closeMenu=function(){this.opened=!1,d.addClass(this.Base.container,l.hidden),this.Base.dispatchEvent({type:a})},e.prototype.setListeners=function(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1)},e.prototype.removeListeners=function(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1)},e.prototype.handleEvent=function(e){var n=this;this.coordinateClicked=this.map.getEventCoordinate(e),this.pixelClicked=this.map.getEventPixel(e),this.Base.dispatchEvent({type:s,pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===r&&(e.stopPropagation(),e.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),e.target.addEventListener("mousedown",{handleEvent:function(t){n.closeMenu(),e.target.removeEventListener(t.type,this,!1)}},!1))},e.prototype.setItemListener=function(t,e){var n,i=this;t&&"function"==typeof this.items[e].callback&&(n=this.items[e].callback,t.addEventListener("click",function(t){t.preventDefault();t={coordinate:i.getCoordinateClicked(),data:i.items[e].data||null};i.closeMenu(),n(t,i.map)},!1))};function u(t){d.assert("object"==typeof(t=void 0===t?{}:t),"@param `opt_options` should be object type!"),"default_items"in t&&(c.defaultItems=t.default_items),this.options=d.mergeOptions(c,t),this.disabled=!1,this.Internal=new e(this),this.Html=new n(this),i.call(this,{element:this.container})}return n.prototype.createContainer=function(t){var e=document.createElement("div"),n=document.createElement("ul"),i=[l.container,l.OL_unselectable];return t&&i.push(l.hidden),e.className=i.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(n),e},n.prototype.createMenu=function(){var t=[];return"items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(h):this.Base.options.items:this.Base.options.defaultItems&&(t=h),0!==t.length&&void t.forEach(this.addMenuEntry,this)},n.prototype.addMenuEntry=function(t){var e,n,i=this;t.items&&Array.isArray(t.items)?(t.classname=t.classname||"",d.contains(l.submenu,t.classname)||(t.classname=t.classname.length?" "+l.submenu:l.submenu),e=this.generateHtmlAndPublish(this.container,t),(n=this.createContainer()).style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,e.appendChild(n),t.items.forEach(function(t){i.generateHtmlAndPublish(n,t,!0)})):this.generateHtmlAndPublish(this.container,t)},n.prototype.generateHtmlAndPublish=function(t,e,n){var i,s,o,a=!1,r=d.getUniqueId();return"string"==typeof e&&"-"===e.trim()?(i=['<li id="',r,'" class="',l.separator,'">',"<hr></li>"].join(""),s=d.createFragment(i),o=[].slice.call(s.childNodes,0)[0],t.firstChild.appendChild(s),a=!0):(e.classname=e.classname||"",s=d.createFragment(i="<span>"+e.text+"</span>"),o=document.createElement("li"),e.icon&&(""===e.classname?e.classname=l.icon:-1===e.classname.indexOf(l.icon)&&(e.classname+=" "+l.icon),o.setAttribute("style","background-image:url("+e.icon+")")),o.id=r,o.className=e.classname,o.appendChild(s),t.firstChild.appendChild(o)),this.Base.Internal.items[r]={id:r,submenu:n||0,separator:a,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(o,r),o},n.prototype.removeMenuEntry=function(t){var e=d.find("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]},n.prototype.cloneAndGetLineHeight=function(){var t=this.container.cloneNode(),e=d.createFragment("<span>Foo</span>"),n=d.createFragment("<span>Foo</span>"),i=document.createElement("li"),s=document.createElement("li"),e=(i.appendChild(e),s.appendChild(n),t.appendChild(i),t.appendChild(s),this.container.parentNode.appendChild(t),t.offsetHeight/2);return this.container.parentNode.removeChild(t),e},(i=ol.control.Control)&&(u.__proto__=i),((u.prototype=Object.create(i&&i.prototype)).constructor=u).prototype.clear=function(){var e=this;Object.keys(this.Internal.items).forEach(function(t){e.Html.removeMenuEntry(t)})},u.prototype.close=function(){this.Internal.closeMenu()},u.prototype.enable=function(){this.disabled=!1},u.prototype.disable=function(){this.disabled=!0},u.prototype.getDefaultItems=function(){return h},u.prototype.extend=function(t){d.assert(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)},u.prototype.isOpened=function(){return this.isOpen()},u.prototype.isOpen=function(){return this.Internal.opened},u.prototype.updatePosition=function(t){d.assert(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)},u.prototype.pop=function(){var t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])},u.prototype.push=function(t){d.assert(d.isDefAndNotNull(t),"@param `item` must be informed."),this.Html.addMenuEntry(t)},u.prototype.shift=function(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])},u.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t),t?this.Internal.init(t,this):this.Internal.removeListeners()},u})
\ No newline at end of file
1
+/*!
2
+ * ol3-contextmenu - v2.5.0
3
+ * Custom Context Menu for Openlayers
4
+ * https://github.com/jonataswalker/ol3-contextmenu
5
+ * Built: Fri Feb 24 2017 15:11:20 GMT-0300 (BRT)
6
+ */
7
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ContextMenu=e()}(this,function(){"use strict";var t="ol-ctx-menu",e="-container",n="-separator",i="-submenu",s="-hidden",o="-icon",a="-zoom-in",r="-zoom-out",l="ol-unselectable",c={BEFOREOPEN:"beforeopen",OPEN:"open",CLOSE:"close",ADD_MENU_ENTRY:"add-menu-entry",CONTEXTMENU:"contextmenu",HOVER:"mouseover"},h={container:t+e,separator:t+n,submenu:t+i,hidden:t+s,icon:t+o,zoomIn:t+a,zoomOut:t+r,OL_unselectable:l},u={width:150,scrollAt:4,eventType:c.CONTEXTMENU,defaultItems:!0},d=[{text:"Zoom In",classname:[h.zoomIn,h.icon].join(" "),callback:function(t,e){var n=e.getView();n.animate({zoom:+n.getZoom()+1,duration:700,center:t.coordinate})}},{text:"Zoom Out",classname:[h.zoomOut,h.icon].join(" "),callback:function(t,e){var n=e.getView();n.animate({zoom:+n.getZoom()-1,duration:700,center:t.coordinate})}}],p={isNumeric:function(t){return/^\d+$/.test(t)},classRegex:function(t){return new RegExp("(^|\\s+) "+t+" (\\s+|$)")},addClass:function(t,e,n){var i=this;if(Array.isArray(t))return void t.forEach(function(t){i.addClass(t,e)});for(var s=Array.isArray(e)?e:e.split(/\s+/),o=s.length;o--;)i.hasClass(t,s[o])||i._addClass(t,s[o],n)},_addClass:function(t,e,n){var i=this;t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim(),n&&this.isNumeric(n)&&window.setTimeout(function(){i._removeClass(t,e)},n)},removeClass:function(t,e,n){var i=this;if(Array.isArray(t))return void t.forEach(function(t){i.removeClass(t,e,n)});for(var s=Array.isArray(e)?e:e.split(/\s+/),o=s.length;o--;)i.hasClass(t,s[o])&&i._removeClass(t,s[o],n)},_removeClass:function(t,e,n){var i=this;t.classList?t.classList.remove(e):t.className=t.className.replace(this.classRegex(e)," ").trim(),n&&this.isNumeric(n)&&window.setTimeout(function(){i._addClass(t,e)},n)},hasClass:function(t,e){return t.classList?t.classList.contains(e):this.classRegex(e).test(t.className)},toggleClass:function(t,e){var n=this;return Array.isArray(t)?void t.forEach(function(t){n.toggleClass(t,e)}):void(t.classList?t.classList.toggle(e):this.hasClass(t,e)?this._removeClass(t,e):this._addClass(t,e))},$:function(t){return t="#"===t[0]?t.substr(1,t.length):t,document.getElementById(t)},isElement:function(t){return"HTMLElement"in window?!!t&&t instanceof HTMLElement:!!t&&"object"==typeof t&&1===t.nodeType&&!!t.nodeName},find:function(t,e,n){void 0===e&&(e=window.document);var i=/^(#?[\w-]+|\.[\w-.]+)$/,s=/\./g,o=Array.prototype.slice,a=[];if(i.test(t))switch(t[0]){case"#":a=[this.$(t.substr(1))];break;case".":a=o.call(e.getElementsByClassName(t.substr(1).replace(s," ")));break;default:a=o.call(e.getElementsByTagName(t))}else a=o.call(e.querySelectorAll(t));return n?a:a[0]},offset:function(t){var e=t.getBoundingClientRect(),n=document.documentElement;return{left:e.left+window.pageXOffset-n.clientLeft,top:e.top+window.pageYOffset-n.clientTop,width:t.offsetWidth,height:t.offsetHeight}},getViewportSize:function(){return{w:window.innerWidth||document.documentElement.clientWidth,h:window.innerHeight||document.documentElement.clientHeight}},getAllChildren:function(t,e){return[].slice.call(t.getElementsByTagName(e))},isEmpty:function(t){return!t||0===t.length},emptyArray:function(t){for(;t.length;)t.pop()},removeAllChildren:function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},mergeOptions:function(t,e){var n={};for(var i in t)n[i]=t[i];for(var s in e)n[s]=e[s];return n},createFragment:function(t){var e=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild);return e},contains:function(t,e){return!!~e.indexOf(t)},getUniqueId:function(){return"_"+Math.random().toString(36).substr(2,9)},isDefAndNotNull:function(t){return null!=t},assertEqual:function(t,e,n){if(t!==e)throw new Error(n+" mismatch: "+t+" != "+e)},assert:function(t,e){if(void 0===e&&(e="Assertion failed"),!t){if("undefined"!=typeof Error)throw new Error(e);throw e}}},m=function(t){return this.Base=t,this.map=void 0,this.viewport=void 0,this.coordinateClicked=void 0,this.pixelClicked=void 0,this.lineHeight=0,this.items={},this.opened=!1,this.submenu={left:t.options.width-15+"px",lastLeft:""},this.eventHandler=this.handleEvent.bind(this),this};m.prototype.init=function(t){this.map=t,this.viewport=t.getViewport(),this.setListeners(),this.Base.Html.createMenu(),this.lineHeight=this.getItemsLength()>0?this.Base.container.offsetHeight/this.getItemsLength():this.Base.Html.cloneAndGetLineHeight()},m.prototype.getItemsLength=function(){var t=this,e=0;return Object.keys(this.items).forEach(function(n){t.items[n].submenu||t.items[n].separator||e++}),e},m.prototype.getPixelClicked=function(){return this.pixelClicked},m.prototype.getCoordinateClicked=function(){return this.coordinateClicked},m.prototype.positionContainer=function(t){var e=this,n=this.map.getSize(),i=n[0],s=n[1],o=s-t[1],a=i-t[0],r={w:this.Base.container.offsetWidth,h:Math.round(this.lineHeight*this.getItemsLength())},l=p.find("li."+h.submenu+"> div",this.Base.container,!0);a>=r.w?(this.Base.container.style.right="auto",this.Base.container.style.left=t[0]+5+"px"):(this.Base.container.style.left="auto",this.Base.container.style.right="15px"),o>=r.h?(this.Base.container.style.bottom="auto",this.Base.container.style.top=t[1]-10+"px"):(this.Base.container.style.top="auto",this.Base.container.style.bottom=0),p.removeClass(this.Base.container,h.hidden),l.length&&(a<2*r.w?this.submenu.lastLeft="-"+r.w+"px":this.submenu.lastLeft=this.submenu.left,l.forEach(function(t){var n=p.getViewportSize(),i=p.offset(t),s=i.height,a=o-s;a<0&&(a=s-(n.h-i.top),t.style.top="-"+a+"px"),t.style.left=e.submenu.lastLeft}))},m.prototype.openMenu=function(t,e){this.Base.dispatchEvent({type:c.OPEN,pixel:t,coordinate:e}),this.opened=!0,this.positionContainer(t)},m.prototype.closeMenu=function(){this.opened=!1,p.addClass(this.Base.container,h.hidden),this.Base.dispatchEvent({type:c.CLOSE})},m.prototype.setListeners=function(){this.viewport.addEventListener(this.Base.options.eventType,this.eventHandler,!1)},m.prototype.removeListeners=function(){this.viewport.removeEventListener(this.Base.options.eventType,this.eventHandler,!1)},m.prototype.handleEvent=function(t){var e=this;this.coordinateClicked=this.map.getEventCoordinate(t),this.pixelClicked=this.map.getEventPixel(t),this.Base.dispatchEvent({type:c.BEFOREOPEN,pixel:this.pixelClicked,coordinate:this.coordinateClicked}),this.Base.disabled||(this.Base.options.eventType===c.CONTEXTMENU&&(t.stopPropagation(),t.preventDefault()),this.openMenu(this.pixelClicked,this.coordinateClicked),t.target.addEventListener("mousedown",{handleEvent:function(n){e.closeMenu(),t.target.removeEventListener(n.type,this,!1)}},!1))},m.prototype.setItemListener=function(t,e){var n=this;t&&"function"==typeof this.items[e].callback&&!function(i){t.addEventListener("click",function(t){t.preventDefault();var s={coordinate:n.getCoordinateClicked(),data:n.items[e].data||null};n.closeMenu(),i(s,n.map)},!1)}(this.items[e].callback)};var f=function(t){return this.Base=t,this.Base.container=this.container=this.createContainer(),this};f.prototype.createContainer=function(t){var e=document.createElement("div"),n=document.createElement("ul"),i=[h.container,h.OL_unselectable];return t&&i.push(h.hidden),e.className=i.join(" "),e.style.width=parseInt(this.Base.options.width,10)+"px",e.appendChild(n),e},f.prototype.createMenu=function(){var t=[];return"items"in this.Base.options?t=this.Base.options.defaultItems?this.Base.options.items.concat(d):this.Base.options.items:this.Base.options.defaultItems&&(t=d),0!==t.length&&void t.forEach(this.addMenuEntry,this)},f.prototype.addMenuEntry=function(t){var e=this;if(t.items&&Array.isArray(t.items)){t.classname=t.classname||"",p.contains(h.submenu,t.classname)||(t.classname=t.classname.length?" "+h.submenu:h.submenu);var n=this.generateHtmlAndPublish(this.container,t),i=this.createContainer();i.style.left=this.Base.Internal.submenu.lastLeft||this.Base.Internal.submenu.left,n.appendChild(i),t.items.forEach(function(t){e.generateHtmlAndPublish(i,t,!0)})}else this.generateHtmlAndPublish(this.container,t)},f.prototype.generateHtmlAndPublish=function(t,e,n){var i,s,o,a=!1,r=p.getUniqueId();return"string"==typeof e&&"-"===e.trim()?(i=['<li id="',r,'" class="',h.separator,'">',"<hr></li>"].join(""),s=p.createFragment(i),o=[].slice.call(s.childNodes,0)[0],t.firstChild.appendChild(s),a=!0):(e.classname=e.classname||"",i="<span>"+e.text+"</span>",s=p.createFragment(i),o=document.createElement("li"),e.icon&&(""===e.classname?e.classname=h.icon:e.classname.indexOf(h.icon)===-1&&(e.classname+=" "+h.icon),o.setAttribute("style","background-image:url("+e.icon+")")),o.id=r,o.className=e.classname,o.appendChild(s),t.firstChild.appendChild(o)),this.Base.Internal.items[r]={id:r,submenu:n||0,separator:a,callback:e.callback,data:e.data||null},this.Base.Internal.setItemListener(o,r),o},f.prototype.removeMenuEntry=function(t){var e=p.find("#"+t,this.container.firstChild);e&&this.container.firstChild.removeChild(e),delete this.Base.Internal.items[t]},f.prototype.cloneAndGetLineHeight=function(){var t=this.container.cloneNode(),e=p.createFragment("<span>Foo</span>"),n=p.createFragment("<span>Foo</span>"),i=document.createElement("li"),s=document.createElement("li");i.appendChild(e),s.appendChild(n),t.appendChild(i),t.appendChild(s),this.container.parentNode.appendChild(t);var o=t.offsetHeight/2;return this.container.parentNode.removeChild(t),o};var y=function(t){function e(e){void 0===e&&(e={}),p.assert("object"==typeof e,"@param `opt_options` should be object type!"),"default_items"in e&&(u.defaultItems=e.default_items),this.options=p.mergeOptions(u,e),this.disabled=!1,this.Internal=new m(this),this.Html=new f(this),t.call(this,{element:this.container})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clear=function(){var t=this;Object.keys(this.Internal.items).forEach(function(e){t.Html.removeMenuEntry(e)})},e.prototype.close=function(){this.Internal.closeMenu()},e.prototype.enable=function(){this.disabled=!1},e.prototype.disable=function(){this.disabled=!0},e.prototype.getDefaultItems=function(){return d},e.prototype.extend=function(t){p.assert(Array.isArray(t),"@param `arr` should be an Array."),t.forEach(this.push,this)},e.prototype.isOpened=function(){return this.isOpen()},e.prototype.isOpen=function(){return this.Internal.opened},e.prototype.updatePosition=function(t){p.assert(Array.isArray(t),"@param `pixel` should be an Array."),this.isOpen()&&this.Internal.positionContainer(t)},e.prototype.pop=function(){var t=Object.keys(this.Internal.items);this.Html.removeMenuEntry(t[t.length-1])},e.prototype.push=function(t){p.assert(p.isDefAndNotNull(t),"@param `item` must be informed."),this.Html.addMenuEntry(t)},e.prototype.shift=function(){this.Html.removeMenuEntry(Object.keys(this.Internal.items)[0])},e.prototype.setMap=function(t){ol.control.Control.prototype.setMap.call(this,t),t?this.Internal.init(t,this):this.Internal.removeListeners()},e}(ol.control.Control);return y});
8
+///# sourceMappingURL=ol3-contextmenu.js.map
\ No newline at end of file
public/scripts/u2f-api-min.js
+1
-1
@@ -1 +1 @@
1
-var u2f,js_api_version;window.u2f||((u2f=u2f||{}).EXTENSION_ID="kmendfapggjehodndflmmgagdbamhnfd",u2f.MessageTypes={U2F_REGISTER_REQUEST:"u2f_register_request",U2F_REGISTER_RESPONSE:"u2f_register_response",U2F_SIGN_REQUEST:"u2f_sign_request",U2F_SIGN_RESPONSE:"u2f_sign_response",U2F_GET_API_VERSION_REQUEST:"u2f_get_api_version_request",U2F_GET_API_VERSION_RESPONSE:"u2f_get_api_version_response"},u2f.ErrorCodes={OK:0,OTHER_ERROR:1,BAD_REQUEST:2,CONFIGURATION_UNSUPPORTED:3,DEVICE_INELIGIBLE:4,TIMEOUT:5},u2f.getMessagePort=function(e){var t;"undefined"!=typeof chrome&&chrome.runtime?(t={type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:[]},chrome.runtime.sendMessage(u2f.EXTENSION_ID,t,function(){chrome.runtime.lastError?u2f.getIframePort_(e):u2f.getChromeRuntimePort_(e)})):u2f.isAndroidChrome_()?u2f.getAuthenticatorPort_(e):u2f.isIosChrome_()?u2f.getIosPort_(e):u2f.getIframePort_(e)},u2f.isAndroidChrome_=function(){var e=navigator.userAgent;return-1!=e.indexOf("Chrome")&&-1!=e.indexOf("Android")},u2f.isIosChrome_=function(){var e,t=["iPhone","iPad","iPod"];for(e in t)if(navigator.platform==t[e])return!0;return!1},u2f.getChromeRuntimePort_=function(e){var t=chrome.runtime.connect(u2f.EXTENSION_ID,{includeTlsChannelId:!0});setTimeout(function(){e(new u2f.WrappedChromeRuntimePort_(t))},0)},u2f.getAuthenticatorPort_=function(e){setTimeout(function(){e(new u2f.WrappedAuthenticatorPort_)},0)},u2f.getIosPort_=function(e){setTimeout(function(){e(new u2f.WrappedIosPort_)},0)},u2f.WrappedChromeRuntimePort_=function(e){this.port_=e},u2f.formatSignRequest_=function(e,t,o,r,n){if(void 0===js_api_version||js_api_version<1.1){for(var s=[],u=0;u<o.length;u++)s[u]={version:o[u].version,challenge:t,keyHandle:o[u].keyHandle,appId:e};return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:s,timeoutSeconds:r,requestId:n}}return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,appId:e,challenge:t,registeredKeys:o,timeoutSeconds:r,requestId:n}},u2f.formatRegisterRequest_=function(e,t,o,r,n){if(void 0===js_api_version||js_api_version<1.1){for(var s=0;s<o.length;s++)o[s].appId=e;for(var u=[],s=0;s<t.length;s++)u[s]={version:t[s].version,challenge:o[0],keyHandle:t[s].keyHandle,appId:e};return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,signRequests:u,registerRequests:o,timeoutSeconds:r,requestId:n}}return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,appId:e,registerRequests:o,registeredKeys:t,timeoutSeconds:r,requestId:n}},u2f.WrappedChromeRuntimePort_.prototype.postMessage=function(e){this.port_.postMessage(e)},u2f.WrappedChromeRuntimePort_.prototype.addEventListener=function(e,t){e=e.toLowerCase();"message"==e||"onmessage"==e?this.port_.onMessage.addListener(function(e){t({data:e})}):console.error("WrappedChromeRuntimePort only supports onMessage")},u2f.WrappedAuthenticatorPort_=function(){this.requestId_=-1,this.requestObject_=null},u2f.WrappedAuthenticatorPort_.prototype.postMessage=function(e){e=u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_+";S.request="+encodeURIComponent(JSON.stringify(e))+";end";document.location=e},u2f.WrappedAuthenticatorPort_.prototype.getPortType=function(){return"WrappedAuthenticatorPort_"},u2f.WrappedAuthenticatorPort_.prototype.addEventListener=function(e,t){"message"==e.toLowerCase()?window.addEventListener("message",this.onRequestUpdate_.bind(this,t),!1):console.error("WrappedAuthenticatorPort only supports message")},u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_=function(e,t){var t=JSON.parse(t.data),o=(t.intentURL,null);e({data:o=t.hasOwnProperty("data")?JSON.parse(t.data):o})},u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_="intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE",u2f.WrappedIosPort_=function(){},u2f.WrappedIosPort_.prototype.postMessage=function(e){e=JSON.stringify(e),e="u2f://auth?"+encodeURI(e);location.replace(e)},u2f.WrappedIosPort_.prototype.getPortType=function(){return"WrappedIosPort_"},u2f.WrappedIosPort_.prototype.addEventListener=function(e,t){"message"!==e.toLowerCase()&&console.error("WrappedIosPort only supports message")},u2f.getIframePort_=function(t){function o(e){"ready"==e.data?(n.port1.removeEventListener("message",o),t(n.port1)):console.error('First event on iframe port was not "ready"')}var e="chrome-extension://"+u2f.EXTENSION_ID,r=document.createElement("iframe"),n=(r.src=e+"/u2f-comms.html",r.setAttribute("style","display:none"),document.body.appendChild(r),new MessageChannel);n.port1.addEventListener("message",o),n.port1.start(),r.addEventListener("load",function(){r.contentWindow.postMessage("init",e,[n.port2])})},u2f.EXTENSION_TIMEOUT_SEC=30,u2f.port_=null,u2f.waitingForPort_=[],u2f.reqCounter_=0,u2f.callbackMap_={},u2f.getPortSingleton_=function(e){u2f.port_?e(u2f.port_):(0==u2f.waitingForPort_.length&&u2f.getMessagePort(function(e){for(u2f.port_=e,u2f.port_.addEventListener("message",u2f.responseHandler_);u2f.waitingForPort_.length;)u2f.waitingForPort_.shift()(u2f.port_)}),u2f.waitingForPort_.push(e))},u2f.responseHandler_=function(e){var t,e=e.data,o=e.requestId;o&&u2f.callbackMap_[o]?(t=u2f.callbackMap_[o],delete u2f.callbackMap_[o],t(e.responseData)):console.error("Unknown or missing requestId in response.")},u2f.sign=function(t,o,r,n,s){void 0===js_api_version?u2f.getApiVersion(function(e){js_api_version=void 0===e.js_api_version?0:e.js_api_version,u2f.sendSignRequest(t,o,r,n,s)}):u2f.sendSignRequest(t,o,r,n,s)},u2f.sendSignRequest=function(r,n,s,u,i){u2f.getPortSingleton_(function(e){var t=++u2f.reqCounter_,o=(u2f.callbackMap_[t]=u,void 0!==i?i:u2f.EXTENSION_TIMEOUT_SEC),o=u2f.formatSignRequest_(r,n,s,o,t);e.postMessage(o)})},u2f.register=function(t,o,r,n,s){void 0===js_api_version?u2f.getApiVersion(function(e){js_api_version=void 0===e.js_api_version?0:e.js_api_version,u2f.sendRegisterRequest(t,o,r,n,s)}):u2f.sendRegisterRequest(t,o,r,n,s)},u2f.sendRegisterRequest=function(r,n,s,u,i){u2f.getPortSingleton_(function(e){var t=++u2f.reqCounter_,o=(u2f.callbackMap_[t]=u,void 0!==i?i:u2f.EXTENSION_TIMEOUT_SEC),o=u2f.formatRegisterRequest_(r,s,n,o,t);e.postMessage(o)})},u2f.getApiVersion=function(r,n){u2f.getPortSingleton_(function(e){if(e.getPortType){var t;switch(e.getPortType()){case"WrappedIosPort_":case"WrappedAuthenticatorPort_":t=1.1;break;default:t=0}r({js_api_version:t})}else{var o=++u2f.reqCounter_,o=(u2f.callbackMap_[o]=r,{type:u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST,timeoutSeconds:void 0!==n?n:u2f.EXTENSION_TIMEOUT_SEC,requestId:o});e.postMessage(o)}})})
\ No newline at end of file
1
+"use strict";if(!window.u2f){var js_api_version,u2f=u2f||{};u2f.EXTENSION_ID="kmendfapggjehodndflmmgagdbamhnfd",u2f.MessageTypes={U2F_REGISTER_REQUEST:"u2f_register_request",U2F_REGISTER_RESPONSE:"u2f_register_response",U2F_SIGN_REQUEST:"u2f_sign_request",U2F_SIGN_RESPONSE:"u2f_sign_response",U2F_GET_API_VERSION_REQUEST:"u2f_get_api_version_request",U2F_GET_API_VERSION_RESPONSE:"u2f_get_api_version_response"},u2f.ErrorCodes={OK:0,OTHER_ERROR:1,BAD_REQUEST:2,CONFIGURATION_UNSUPPORTED:3,DEVICE_INELIGIBLE:4,TIMEOUT:5},u2f.U2fRequest,u2f.U2fResponse,u2f.Error,u2f.Transport,u2f.Transports,u2f.SignRequest,u2f.SignResponse,u2f.RegisterRequest,u2f.RegisterResponse,u2f.RegisteredKey,u2f.GetJsApiVersionResponse,u2f.getMessagePort=function(e){if("undefined"!=typeof chrome&&chrome.runtime){var t={type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:[]};chrome.runtime.sendMessage(u2f.EXTENSION_ID,t,(function(){chrome.runtime.lastError?u2f.getIframePort_(e):u2f.getChromeRuntimePort_(e)}))}else u2f.isAndroidChrome_()?u2f.getAuthenticatorPort_(e):u2f.isIosChrome_()?u2f.getIosPort_(e):u2f.getIframePort_(e)},u2f.isAndroidChrome_=function(){var e=navigator.userAgent;return-1!=e.indexOf("Chrome")&&-1!=e.indexOf("Android")},u2f.isIosChrome_=function(){var e=["iPhone","iPad","iPod"];for(var t in e)if(navigator.platform==e[t])return!0;return!1},u2f.getChromeRuntimePort_=function(e){var t=chrome.runtime.connect(u2f.EXTENSION_ID,{includeTlsChannelId:!0});setTimeout((function(){e(new u2f.WrappedChromeRuntimePort_(t))}),0)},u2f.getAuthenticatorPort_=function(e){setTimeout((function(){e(new u2f.WrappedAuthenticatorPort_)}),0)},u2f.getIosPort_=function(e){setTimeout((function(){e(new u2f.WrappedIosPort_)}),0)},u2f.WrappedChromeRuntimePort_=function(e){this.port_=e},u2f.formatSignRequest_=function(e,t,r,o,n){if(void 0===js_api_version||js_api_version<1.1){for(var s=[],u=0;u<r.length;u++)s[u]={version:r[u].version,challenge:t,keyHandle:r[u].keyHandle,appId:e};return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:s,timeoutSeconds:o,requestId:n}}return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,appId:e,challenge:t,registeredKeys:r,timeoutSeconds:o,requestId:n}},u2f.formatRegisterRequest_=function(e,t,r,o,n){if(void 0===js_api_version||js_api_version<1.1){for(var s=0;s<r.length;s++)r[s].appId=e;var u=[];for(s=0;s<t.length;s++)u[s]={version:t[s].version,challenge:r[0],keyHandle:t[s].keyHandle,appId:e};return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,signRequests:u,registerRequests:r,timeoutSeconds:o,requestId:n}}return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,appId:e,registerRequests:r,registeredKeys:t,timeoutSeconds:o,requestId:n}},u2f.WrappedChromeRuntimePort_.prototype.postMessage=function(e){this.port_.postMessage(e)},u2f.WrappedChromeRuntimePort_.prototype.addEventListener=function(e,t){var r=e.toLowerCase();"message"==r||"onmessage"==r?this.port_.onMessage.addListener((function(e){t({data:e})})):console.error("WrappedChromeRuntimePort only supports onMessage")},u2f.WrappedAuthenticatorPort_=function(){this.requestId_=-1,this.requestObject_=null},u2f.WrappedAuthenticatorPort_.prototype.postMessage=function(e){var t=u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_+";S.request="+encodeURIComponent(JSON.stringify(e))+";end";document.location=t},u2f.WrappedAuthenticatorPort_.prototype.getPortType=function(){return"WrappedAuthenticatorPort_"},u2f.WrappedAuthenticatorPort_.prototype.addEventListener=function(e,t){if("message"==e.toLowerCase()){window.addEventListener("message",this.onRequestUpdate_.bind(this,t),!1)}else console.error("WrappedAuthenticatorPort only supports message")},u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_=function(e,t){var r=JSON.parse(t.data),o=(r.intentURL,r.errorCode,null);r.hasOwnProperty("data")&&(o=JSON.parse(r.data)),e({data:o})},u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_="intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE",u2f.WrappedIosPort_=function(){},u2f.WrappedIosPort_.prototype.postMessage=function(e){var t=JSON.stringify(e),r="u2f://auth?"+encodeURI(t);location.replace(r)},u2f.WrappedIosPort_.prototype.getPortType=function(){return"WrappedIosPort_"},u2f.WrappedIosPort_.prototype.addEventListener=function(e,t){"message"!==e.toLowerCase()&&console.error("WrappedIosPort only supports message")},u2f.getIframePort_=function(e){var t="chrome-extension://"+u2f.EXTENSION_ID,r=document.createElement("iframe");r.src=t+"/u2f-comms.html",r.setAttribute("style","display:none"),document.body.appendChild(r);var o=new MessageChannel,n=function(t){"ready"==t.data?(o.port1.removeEventListener("message",n),e(o.port1)):console.error('First event on iframe port was not "ready"')};o.port1.addEventListener("message",n),o.port1.start(),r.addEventListener("load",(function(){r.contentWindow.postMessage("init",t,[o.port2])}))},u2f.EXTENSION_TIMEOUT_SEC=30,u2f.port_=null,u2f.waitingForPort_=[],u2f.reqCounter_=0,u2f.callbackMap_={},u2f.getPortSingleton_=function(e){u2f.port_?e(u2f.port_):(0==u2f.waitingForPort_.length&&u2f.getMessagePort((function(e){for(u2f.port_=e,u2f.port_.addEventListener("message",u2f.responseHandler_);u2f.waitingForPort_.length;)u2f.waitingForPort_.shift()(u2f.port_)})),u2f.waitingForPort_.push(e))},u2f.responseHandler_=function(e){var t=e.data,r=t.requestId;if(r&&u2f.callbackMap_[r]){var o=u2f.callbackMap_[r];delete u2f.callbackMap_[r],o(t.responseData)}else console.error("Unknown or missing requestId in response.")},u2f.sign=function(e,t,r,o,n){void 0===js_api_version?u2f.getApiVersion((function(s){js_api_version=void 0===s.js_api_version?0:s.js_api_version,u2f.sendSignRequest(e,t,r,o,n)})):u2f.sendSignRequest(e,t,r,o,n)},u2f.sendSignRequest=function(e,t,r,o,n){u2f.getPortSingleton_((function(s){var u=++u2f.reqCounter_;u2f.callbackMap_[u]=o;var i=void 0!==n?n:u2f.EXTENSION_TIMEOUT_SEC,a=u2f.formatSignRequest_(e,t,r,i,u);s.postMessage(a)}))},u2f.register=function(e,t,r,o,n){void 0===js_api_version?u2f.getApiVersion((function(s){js_api_version=void 0===s.js_api_version?0:s.js_api_version,u2f.sendRegisterRequest(e,t,r,o,n)})):u2f.sendRegisterRequest(e,t,r,o,n)},u2f.sendRegisterRequest=function(e,t,r,o,n){u2f.getPortSingleton_((function(s){var u=++u2f.reqCounter_;u2f.callbackMap_[u]=o;var i=void 0!==n?n:u2f.EXTENSION_TIMEOUT_SEC,a=u2f.formatRegisterRequest_(e,r,t,i,u);s.postMessage(a)}))},u2f.getApiVersion=function(e,t){u2f.getPortSingleton_((function(r){if(r.getPortType){var o;switch(r.getPortType()){case"WrappedIosPort_":case"WrappedAuthenticatorPort_":o=1.1;break;default:o=0}e({js_api_version:o})}else{var n=++u2f.reqCounter_;u2f.callbackMap_[n]=e;var s={type:u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST,timeoutSeconds:void 0!==t?t:u2f.EXTENSION_TIMEOUT_SEC,requestId:n};r.postMessage(s)}}))}}
\ No newline at end of file
public/scripts/xterm-addon-fit-min.js
+1
-1
@@ -1 +1 @@
1
-((e,t)=>{"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()})(window,function(){return r=[function(e,t,r){function n(){}Object.defineProperty(t,"__esModule",{value:!0}),n.prototype.activate=function(e){this._terminal=e},n.prototype.dispose=function(){},n.prototype.fit=function(){var e,t=this.proposeDimensions();t&&this._terminal&&(e=this._terminal._core,this._terminal.rows===t.rows&&this._terminal.cols===t.cols||(e._renderService.clear(),this._terminal.resize(t.cols,t.rows)))},n.prototype.proposeDimensions=function(){var e,t,r,n;if(this._terminal&&this._terminal.element&&this._terminal.element.parentElement)return e=this._terminal._core,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue("height")),n=Math.max(0,parseInt(n.getPropertyValue("width"))),t=window.getComputedStyle(this._terminal.element),r=r-(parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom"))),n=n-(parseInt(t.getPropertyValue("padding-right"))+parseInt(t.getPropertyValue("padding-left")))-e.viewport.scrollBarWidth,{cols:Math.max(2,Math.floor(n/e._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(r/e._renderService.dimensions.actualCellHeight))}},t.FitAddon=n}],n={},o.m=r,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0);function o(e){var t;return(n[e]||(t=n[e]={i:e,l:!1,exports:{}},r[e].call(t.exports,t,t.exports,o),t.l=!0,t)).exports}var r,n})
\ No newline at end of file
1
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.activate=function(e){this._terminal=e},e.prototype.dispose=function(){},e.prototype.fit=function(){var e=this.proposeDimensions();if(e&&this._terminal){var t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}},e.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element&&this._terminal.element.parentElement){var e=this._terminal._core,t=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(t.getPropertyValue("height")),n=Math.max(0,parseInt(t.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),i=r-(parseInt(o.getPropertyValue("padding-top"))+parseInt(o.getPropertyValue("padding-bottom"))),a=n-(parseInt(o.getPropertyValue("padding-right"))+parseInt(o.getPropertyValue("padding-left")))-e.viewport.scrollBarWidth;return{cols:Math.max(2,Math.floor(a/e._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(i/e._renderService.dimensions.actualCellHeight))}}},e}();t.FitAddon=n}])}))
\ No newline at end of file
public/scripts/xterm-min.js
+1
-1
@@ -1 +1 @@
1
-((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i,r=t();for(i in r)("object"==typeof exports?exports:e)[i]=r[i]}})(self,function(){var i={4567:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;let r=i(9042),s=i(6114),n=i(9924),o=i(3656),a=i(844),h=i(5596),l=i(9631);class c extends a.Disposable{constructor(e,t){super(),this._terminal=e,this._renderService=t,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityTreeRoot=document.createElement("div"),this._accessibilityTreeRoot.classList.add("xterm-accessibility"),this._accessibilityTreeRoot.tabIndex=0,this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._onBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._onBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityTreeRoot.appendChild(this._rowContainer),this._renderRowsDebouncer=new n.TimeBasedDebouncer(this._renderRows.bind(this)),this._refreshRows(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityTreeRoot.appendChild(this._liveRegion),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityTreeRoot),this.register(this._renderRowsDebouncer),this.register(this._terminal.onResize(e=>this._onResize(e.rows))),this.register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(e=>this._onChar(e))),this.register(this._terminal.onLineFeed(()=>this._onChar("\n"))),this.register(this._terminal.onA11yTab(e=>this._onTab(e))),this.register(this._terminal.onKey(e=>this._onKey(e.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new h.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,o.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions()))}dispose(){super.dispose(),(0,l.removeElementFromParent)(this._accessibilityTreeRoot),this._rowElements.length=0}_onBoundaryFocus(i,r){var s=i.target,e=this._rowElements[0===r?1:this._rowElements.length-2];if(s.getAttribute("aria-posinset")!==(0===r?"1":""+this._terminal.buffer.lines.length)&&i.relatedTarget===e){let e,t;if(0===r?(e=s,t=this._rowElements.pop(),this._rowContainer.removeChild(t)):(e=this._rowElements.shift(),t=s,this._rowContainer.removeChild(e)),e.removeEventListener("focus",this._topBoundaryFocusListener),t.removeEventListener("focus",this._bottomBoundaryFocusListener),0===r){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===r?-1:1),this._rowElements[0===r?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}}_onResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_onTab(t){for(let e=0;e<t;e++)this._onChar(" ")}_onChar(e){this._liveRegionLineCount<21&&(0<this._charsToConsume.length&&this._charsToConsume.shift()===e||(this._charsToAnnounce+=e),"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount)&&(this._liveRegion.textContent+=r.tooMuchOutput),s.isMac)&&this._liveRegion.textContent&&0<this._liveRegion.textContent.length&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityTreeRoot.appendChild(this._liveRegion)},0)}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,s.isMac&&(0,l.removeElementFromParent)(this._liveRegion)}_onKey(e){this._clearLiveRegion(),this._charsToConsume.push(e)}_refreshRows(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){var s=this._terminal.buffer,n=s.lines.length.toString();for(let r=e;r<=t;r++){let e=s.translateBufferLineToString(s.ydisp+r,!0),t=(s.ydisp+r+1).toString(),i=this._rowElements[r];i&&(0===e.length?i.innerText=" ":i.textContent=e,i.setAttribute("aria-posinset",t),i.setAttribute("aria-setsize",n))}this._announceCharacters()}_refreshRowsDimensions(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=this._renderService.dimensions.actualCellHeight+"px"}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}}t.AccessibilityManager=c},3614:(e,t)=>{function r(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function n(e,t,i){e=s(e=r(e),i.decPrivateModes.bracketedPasteMode),i.triggerDataEvent(e,!0),t.value=""}function o(e,t,i){var i=i.getBoundingClientRect(),r=e.clientX-i.left-10,e=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=r+"px",t.style.top=e+"px",t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=r,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i){e.stopPropagation(),e.clipboardData&&n(e.clipboardData.getData("text/plain"),t,i)},t.paste=n,t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,i,r,s){o(e,t,i),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;let r=i(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},5680:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorManager=r.DEFAULT_ANSI_COLORS=void 0;let h=t(8055),i=t(7239),s=h.css.toColor("#ffffff"),n=h.css.toColor("#000000"),o=h.css.toColor("#ffffff"),a=h.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{var t=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],i=[0,95,135,175,215,255];for(let e=0;e<216;e++){var r=i[e/36%6|0],s=i[e/6%6|0],n=i[e%6];t.push({css:h.channels.toCss(r,s,n),rgba:h.channels.toRgba(r,s,n)})}for(let e=0;e<24;e++){var o=8+10*e;t.push({css:h.channels.toCss(o,o,o),rgba:h.channels.toRgba(o,o,o)})}return t})()),r.ColorManager=class{constructor(e,t){this.allowTransparency=t;t=e.createElement("canvas"),t.width=1,t.height=1,e=t.getContext("2d");if(!e)throw new Error("Could not get rendering context");this._ctx=e,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new i.ColorContrastCache,this.colors={foreground:s,background:n,cursor:o,cursorAccent:a,selectionForeground:void 0,selectionBackgroundTransparent:l,selectionBackgroundOpaque:h.color.blend(n,l),selectionInactiveBackgroundTransparent:l,selectionInactiveBackgroundOpaque:h.color.blend(n,l),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}onOptionsChange(e,t){switch(e){case"minimumContrastRatio":this._contrastCache.clear();break;case"allowTransparency":this.allowTransparency=t}}setTheme(i={}){this.colors.foreground=this._parseColor(i.foreground,s),this.colors.background=this._parseColor(i.background,n),this.colors.cursor=this._parseColor(i.cursor,o,!0),this.colors.cursorAccent=this._parseColor(i.cursorAccent,a,!0),this.colors.selectionBackgroundTransparent=this._parseColor(i.selectionBackground,l,!0),this.colors.selectionBackgroundOpaque=h.color.blend(this.colors.background,this.colors.selectionBackgroundTransparent),this.colors.selectionInactiveBackgroundTransparent=this._parseColor(i.selectionInactiveBackground,this.colors.selectionBackgroundTransparent,!0),this.colors.selectionInactiveBackgroundOpaque=h.color.blend(this.colors.background,this.colors.selectionInactiveBackgroundTransparent);let e={css:"",rgba:0};if(this.colors.selectionForeground=i.selectionForeground?this._parseColor(i.selectionForeground,e):void 0,this.colors.selectionForeground===e&&(this.colors.selectionForeground=void 0),h.color.isOpaque(this.colors.selectionBackgroundTransparent))this.colors.selectionBackgroundTransparent=h.color.opacity(this.colors.selectionBackgroundTransparent,.3);if(h.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent))this.colors.selectionInactiveBackgroundTransparent=h.color.opacity(this.colors.selectionInactiveBackgroundTransparent,.3);if(this.colors.ansi=r.DEFAULT_ANSI_COLORS.slice(),this.colors.ansi[0]=this._parseColor(i.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(i.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(i.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(i.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(i.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(i.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(i.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(i.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(i.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(i.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(i.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(i.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(i.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(i.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(i.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(i.brightWhite,r.DEFAULT_ANSI_COLORS[15]),i.extendedAnsi){let t=Math.min(this.colors.ansi.length-16,i.extendedAnsi.length);for(let e=0;e<t;e++)this.colors.ansi[e+16]=this._parseColor(i.extendedAnsi[e],r.DEFAULT_ANSI_COLORS[e+16])}this._contrastCache.clear(),this._updateRestoreColors()}restoreColor(e){if(void 0!==e)switch(e){case 256:this.colors.foreground=this._restoreColors.foreground;break;case 257:this.colors.background=this._restoreColors.background;break;case 258:this.colors.cursor=this._restoreColors.cursor;break;default:this.colors.ansi[e]=this._restoreColors.ansi[e]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this.colors.ansi[e]=this._restoreColors.ansi[e]}_updateRestoreColors(){this._restoreColors={foreground:this.colors.foreground,background:this.colors.background,cursor:this.colors.cursor,ansi:this.colors.ansi.slice()}}_parseColor(n,o,a=this.allowTransparency){if(void 0===n)return o;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=n,"string"!=typeof this._ctx.fillStyle)return console.warn(`Color: ${n} is invalid using fallback `+o.css),o;this._ctx.fillRect(0,0,1,1);let e=this._ctx.getImageData(0,0,1,1).data;if(255===e[3])return{css:this._ctx.fillStyle,rgba:h.channels.toRgba(e[0],e[1],e[2],e[3])};{if(!a)return console.warn(`Color: ${n} is using transparency, but allowTransparency is false. Using fallback ${o.css}.`),o;let[e,t,i,r]=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(e=>Number(e)),s=Math.round(255*r);return{rgba:h.channels.toRgba(e,t,i,s),css:n}}}}},9631:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(...e){var t,i;for(i of e)null!=(t=null==i?void 0:i.parentElement)&&t.removeChild(i)}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,r){e.addEventListener(t,i,r);let s=!1;return{dispose:()=>{s||(s=!0,e.removeEventListener(t,i,r))}}}},6465:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;let n=i(2585),o=i(8460),a=i(844),h=i(3656);i=class extends a.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this._onHideLinkUnderline=this.register(new o.EventEmitter),this.register((0,a.getDisposeArrayDisposable)(this._linkCacheDisposables))}get currentLink(){return this._currentLink}get onShowLinkUnderline(){return this._onShowLinkUnderline.event}get onHideLinkUnderline(){return this._onHideLinkUnderline.event}dispose(){super.dispose(),this._lastMouseEvent=void 0}registerLinkProvider(t){return this._linkProviders.push(t),{dispose:()=>{var e=this._linkProviders.indexOf(t);-1!==e&&this._linkProviders.splice(e,1)}}}attachToDom(e,t,i){this._element=e,this._mouseService=t,this._renderService=i,this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_onMouseMove(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(e){this._isMouseOut=!1;var i=t.composedPath();for(let t=0;t<i.length;t++){let e=i[t];if(e.classList.contains("xterm"))break;if(e.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._onHover(e),this._lastBufferCell=e)}}}_onHover(e){this._activeLine!==e.y?(this._clearCurrentLink(),this._askForLink(e,!1)):this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(r,t){var e,s;this._activeProviderReplies&&t||(null!=(e=this._activeProviderReplies)&&e.forEach(e=>{null!=e&&e.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=r.y);let n=!1;for(let[i,e]of this._linkProviders.entries())t?null!=(s=this._activeProviderReplies)&&s.get(i)&&(n=this._checkLinkProviderResult(i,r,n)):e.provideLinks(r.y,e=>{var t;this._isMouseOut||(e=null==e?void 0:e.map(e=>({link:e})),null!=(t=this._activeProviderReplies)&&t.set(i,e),n=this._checkLinkProviderResult(i,r,n),(null==(t=this._activeProviderReplies)?void 0:t.size)===this._linkProviders.length&&this._removeIntersectingLinks(r.y,this._activeProviderReplies))})}_removeIntersectingLinks(i,t){var r=new Set;for(let e=0;e<t.size;e++){var s=t.get(e);if(s)for(let t=0;t<s.length;t++){var n=s[t],o=n.link.range.start.y<i?0:n.link.range.start.x,a=n.link.range.end.y>i?this._bufferService.cols:n.link.range.end.x;for(let e=o;e<=a;e++){if(r.has(e)){s.splice(t--,1);break}r.add(e)}}}}_checkLinkProviderResult(r,s,n){var o;if(this._activeProviderReplies){let t=this._activeProviderReplies.get(r),i=!1;for(let e=0;e<r;e++)this._activeProviderReplies.has(e)&&!this._activeProviderReplies.get(e)||(i=!0);if(!i&&t){let e=t.find(e=>this._linkAtPosition(e.link,s));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!n)for(let t=0;t<this._activeProviderReplies.size;t++){let e=null==(o=this._activeProviderReplies.get(t))?void 0:o.find(e=>this._linkAtPosition(e.link,s));if(e){n=!0,this._handleNewLink(e);break}}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){var t;this._element&&this._mouseService&&this._currentLink&&(t=this._positionFromMouseEvent(e,this._element,this._mouseService))&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),(this._currentLink=void 0,a.disposeArray)(this._linkCacheDisposables))}_handleNewLink(i){var e;this._element&&this._lastMouseEvent&&this._mouseService&&(e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService))&&this._linkAtPosition(i.link,e)&&(this._currentLink=i,this._currentLink.state={decorations:{underline:void 0===i.link.decorations||i.link.decorations.underline,pointerCursor:void 0===i.link.decorations||i.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,i.link,this._lastMouseEvent),i.link.decorations={},Object.defineProperties(i.link.decorations,{pointerCursor:{get:()=>{var e;return null==(e=null==(e=this._currentLink)?void 0:e.state)?void 0:e.decorations.pointerCursor},set:e=>{var t;null!=(t=this._currentLink)&&t.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered)&&(null!=(t=this._element)&&t.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>{var e;return null==(e=null==(e=this._currentLink)?void 0:e.state)?void 0:e.decorations.underline},set:e=>{var t;null!=(t=this._currentLink)&&t.state&&(null==(t=null==(t=this._currentLink)?void 0:t.state)?void 0:t.decorations.underline)!==e&&(this._currentLink.state.decorations.underline=e,this._currentLink.state.isHovered)&&this._fireUnderlineEvent(i.link,e)}}}),this._renderService)&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{var t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp;this._clearCurrentLink(t,e.end+1+this._bufferService.buffer.ydisp)}))}_linkHover(e,t,i){var r;null!=(r=this._currentLink)&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor)&&e.classList.add("xterm-cursor-pointer"),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){var e=e.range,i=this._bufferService.buffer.ydisp,e=this._createLinkUnderlineEvent(e.start.x-1,e.start.y-i-1,e.end.x,e.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(e)}_linkLeave(e,t,i){var r;null!=(r=this._currentLink)&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor)&&e.classList.remove("xterm-cursor-pointer"),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){var i=e.range.start.y===e.range.end.y,r=e.range.start.y<t.y,s=e.range.end.y>t.y;return(i&&e.range.start.x<=t.x&&e.range.end.x>=t.x||r&&e.range.end.x>=t.x||s&&e.range.start.x<=t.x||r&&s)&&e.range.start.y<=t.y&&e.range.end.y>=t.y}_positionFromMouseEvent(e,t,i){i=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,r,s){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:s}}},i=r([s(0,n.IBufferService)],i);t.Linkifier2=i},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},2962:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;let d=i(511),n=i(2585);i=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(l,e){var c;let _=this._bufferService.buffer.lines.get(l-1);if(_){let i=[],s=this._optionsService.rawOptions.linkHandler,r=new d.CellData,n=_.getTrimmedLength(),o=-1,a=-1,h=!1;for(let t=0;t<n;t++)if(-1!==a||_.hasContent(t)){if(_.loadCell(t,r),r.hasExtendedAttrs()&&r.extended.urlId){if(-1===a){a=t,o=r.extended.urlId;continue}h=r.extended.urlId!==o}else-1!==a&&(h=!0);if(h||-1!==a&&t===n-1){let e=null==(c=this._oscLinkService.getLinkData(o))?void 0:c.uri;if(e){let r={start:{x:a+1,y:l},end:{x:t+(h||t!==n-1?0:1),y:l}};i.push({text:e,range:r,activate:(t,e)=>{if(s)return s.activate(t,e,r);t=e;if(confirm(`Do you want to navigate to ${t}?`)){let e=window.open();if(e){try{e.opener=null}catch(e){}e.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}},hover:(e,t)=>{var i;return null==(i=null==s?void 0:s.hover)?void 0:i.call(s,e,t,r)},leave:(e,t)=>{var i;return null==(i=null==s?void 0:s.leave)?void 0:i.call(s,e,t,r)}})}h=!1,o=r.hasExtendedAttrs()&&r.extended.urlId?(a=t,r.extended.urlId):a=-1}}e(i)}else e(void 0)}};i=r([s(0,n.IBufferService),s(1,n.IOptionsService),s(2,n.IOscLinkService)],i),t.OscLinkProvider=i},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){var e,t;(this._animationFrame=void 0)!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1),this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(var e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;i=i(844);class r extends i.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}dispose(){super.dispose(),this.clearListener()}_updateDpr(){var e;this._outerListener&&(null!=(e=this._resolutionMediaMatchList)&&e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=r},3236:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;let r=i(2950),s=i(1680),n=i(3614),o=i(2584),a=i(5435),h=i(9312),l=i(6114),c=i(3656),_=i(9042),d=i(4567),u=i(1296),f=i(7399),v=i(8460),g=i(8437),p=i(5680),S=i(3230),m=i(4725),C=i(428),b=i(8934),y=i(6465),w=i(5114),E=i(8969),L=i(8055),R=i(4269),k=i(5941),D=i(3107),A=i(5744),x=i(9074),B=i(2585),T=i(2962),M="undefined"!=typeof window?window.document:null;class O extends E.CoreTerminal{constructor(e={}){super(e),this.browser=l,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=new v.EventEmitter,this._onKey=new v.EventEmitter,this._onRender=new v.EventEmitter,this._onSelectionChange=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onBell=new v.EventEmitter,this._onFocus=new v.EventEmitter,this._onBlur=new v.EventEmitter,this._onA11yCharEmitter=new v.EventEmitter,this._onA11yTabEmitter=new v.EventEmitter,this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(y.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((e,t)=>this.refresh(e,t))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this.register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this.register((0,v.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,v.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows)))}get onCursorMove(){return this._onCursorMove.event}get onKey(){return this._onKey.event}get onRender(){return this._onRender.event}get onSelectionChange(){return this._onSelectionChange.event}get onTitleChange(){return this._onTitleChange.event}get onBell(){return this._onBell.event}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}_handleColorEvent(e){var t;if(this._colorManager){for(let i of e){let e,t="";switch(i.index){case 256:e="foreground",t="10";break;case 257:e="background",t="11";break;case 258:e="cursor",t="12";break;default:e="ansi",t="4;"+i.index}switch(i.type){case 0:var r=L.color.toColorRGB("ansi"===e?this._colorManager.colors.ansi[i.index]:this._colorManager.colors[e]);this.coreService.triggerDataEvent(`${o.C0.ESC}]${t};`+(0,k.toRgbString)(r)+o.C1_ESCAPED.ST);break;case 1:"ansi"===e?this._colorManager.colors.ansi[i.index]=L.rgba.toColor(...i.color):this._colorManager.colors[e]=L.rgba.toColor(...i.color);break;case 2:this._colorManager.restoreColor(i.index)}}null!=(t=this._renderService)&&t.setColors(this._colorManager.colors),null!=(e=this.viewport)&&e.onThemeChange(this._colorManager.colors)}}dispose(){var e;this._isDisposed||(super.dispose(),null!=(e=this._renderService)&&e.dispose(),this._customKeyEventHandler=void 0,this.write=()=>{},null==(e=null==(e=this.element)?void 0:e.parentNode))||e.removeChild(this.element)}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_updateOptions(e){var t;switch(super._updateOptions(e),e){case"fontFamily":case"fontSize":null!=(t=this._renderService)&&t.clear(),null!=(t=this._charSizeService)&&t.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"customGlyphs":case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"scrollback":null!=(t=this.viewport)&&t.syncScrollArea();break;case"screenReaderMode":this.optionsService.rawOptions.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new d.AccessibilityManager(this,this._renderService)):(null!=(t=this._accessibilityManager)&&t.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.rawOptions.theme)}}_onTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return null==(e=this.textarea)?void 0:e.blur()}_onTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){var e,t,i,r;this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing&&this._renderService&&(t=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(t))&&(r=Math.min(this.buffer.x,this.cols-1),e=this._renderService.dimensions.actualCellHeight,t=t.getWidth(r),t=this._renderService.dimensions.actualCellWidth*t,i=this.buffer.y*this._renderService.dimensions.actualCellHeight,r=r*this._renderService.dimensions.actualCellWidth,this.textarea.style.left=r+"px",this.textarea.style.top=i+"px",this.textarea.style.width=t+"px",this.textarea.style.height=e+"px",this.textarea.style.lineHeight=e+"px",this.textarea.style.zIndex="-5")}_initGlobal(){this._bindKeys(),this.register((0,c.addDisposableDomListener)(this.element,"copy",e=>{this.hasSelection()&&(0,n.copyHandler)(e,this._selectionService)}));var e=e=>(0,n.handlePasteEvent)(e,this.textarea,this.coreService);this.register((0,c.addDisposableDomListener)(this.textarea,"paste",e)),this.register((0,c.addDisposableDomListener)(this.element,"paste",e)),l.isFirefox?this.register((0,c.addDisposableDomListener)(this.element,"mousedown",e=>{2===e.button&&(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,c.addDisposableDomListener)(this.element,"contextmenu",e=>{(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),l.isLinux&&this.register((0,c.addDisposableDomListener)(this.element,"auxclick",e=>{1===e.button&&(0,n.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,c.addDisposableDomListener)(this.textarea,"keyup",e=>this._keyUp(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keydown",e=>this._keyDown(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keypress",e=>this._keyPress(e),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,c.addDisposableDomListener)(this.textarea,"input",e=>this._inputEvent(e),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),e.appendChild(this.element);var e=M.createDocumentFragment(),t=(this._viewportElement=M.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),e.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=M.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),e.appendChild(this.screenElement),this.textarea=M.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register((0,c.addDisposableDomListener)(this.textarea,"focus",e=>this._onTextAreaFocus(e))),this.register((0,c.addDisposableDomListener)(this.textarea,"blur",()=>this._onTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._coreBrowserService=this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,null!=(t=this._document.defaultView)?t:window),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this._charSizeService=this._instantiationService.createInstance(C.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._theme=this.options.theme||this._theme,this._colorManager=new p.ColorManager(M,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(e=>this._colorManager.onOptionsChange(e,this.optionsService.rawOptions[e]))),this._colorManager.setTheme(this._theme),this._characterJoinerService=this._instantiationService.createInstance(R.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService),this._createRenderer());this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,t,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=M.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(r.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(e),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(s.Viewport,e=>this.scrollLines(e,!0,1),this._viewportElement,this._viewportScrollArea,this.element),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.onCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.onResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.onBlur())),this.register(this.onFocus(()=>this._renderService.onFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(e=>this._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(D.BufferDecorationRenderer,this.screenElement)),this.register((0,c.addDisposableDomListener)(this.element,"mousedown",e=>this._selectionService.onMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new d.AccessibilityManager(this,this._renderService)),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onOptionChange(()=>{!this._overviewRulerRenderer&&this.options.overviewRulerWidth&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier2)}_setTheme(e){var t;this._theme=e,null!=(t=this._colorManager)&&t.setTheme(e),null!=(t=this._renderService)&&t.setColors(this._colorManager.colors),null!=(e=this.viewport)&&e.onThemeChange(this._colorManager.colors)}bindMouse(){let s=this,t=this.element;function i(i){var r=s._mouseService.getMouseReportCoords(i,s.screenElement);if(r){let e,t;switch(i.overrideType||i.type){case"mousemove":t=32,void 0===i.buttons?(e=3,void 0!==i.button&&(e=i.button<3?i.button:3)):e=1&i.buttons?0:4&i.buttons?1:2&i.buttons?2:3;break;case"mouseup":t=0,e=i.button<3?i.button:3;break;case"mousedown":t=1,e=i.button<3?i.button:3;break;case"wheel":if(0===s.viewport.getLinesScrolled(i))return;t=i.deltaY<0?0:1,e=4;break;default:return}void 0===t||void 0===e||4<e||s.coreMouseService.triggerMouseEvent({col:r.col,row:r.row,x:r.x,y:r.y,button:e,action:t,ctrl:i.ctrlKey,alt:i.altKey,shift:i.shiftKey})}}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:e=>(i(e),e.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this.register(this.coreMouseService.onProtocolChange(e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?n.mousemove||(t.addEventListener("mousemove",r.mousemove),n.mousemove=r.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&e?n.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),n.wheel=r.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),2&e?n.mouseup||(n.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&e?n.mousedrag||(n.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,c.addDisposableDomListener)(t,"mousedown",e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(e)})),this.register((0,c.addDisposableDomListener)(t,"wheel",e=>{if(!n.wheel){if(this.buffer.hasScrollback)return this.viewport.onWheel(e)?this.cancel(e):void 0;{var i=this.viewport.getLinesScrolled(e);if(0===i)return;var r=o.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B");let t="";for(let e=0;e<Math.abs(i);e++)t+=r;return this.coreService.triggerDataEvent(t,!0),this.cancel(e,!0)}}},{passive:!1})),this.register((0,c.addDisposableDomListener)(t,"touchstart",e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchStart(e),this.cancel(e)},{passive:!0})),this.register((0,c.addDisposableDomListener)(t,"touchmove",e=>this.coreMouseService.areMouseEventsActive||this.viewport.onTouchMove(e)?void 0:this.cancel(e),{passive:!1}))}refresh(e,t){var i;null!=(i=this._renderService)&&i.refreshRows(e,t)}updateCursorStyle(e){var t;null!=(t=this._selectionService)&&t.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,i=0){super.scrollLines(e,t,i),this.refresh(0,this.rows-1)}paste(e){(0,n.paste)(e,this.textarea,this.coreService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(this._characterJoinerService)return e=this._characterJoinerService.register(e),this.refresh(0,this.rows-1),e;throw new Error("Terminal must be opened first")}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;null!=(e=this._selectionService)&&e.clearSelection()}selectAll(){var e;null!=(e=this._selectionService)&&e.selectAll()}selectLines(e,t){var i;null!=(i=this._selectionService)&&i.selectLines(e,t)}_keyDown(t){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(t))return!1;let e=this.browser.isMac&&this.options.macOptionIsMeta&&t.altKey;if(!e&&!this._compositionHelper.keydown(t))return this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;e||"Dead"!==t.key&&"AltGraph"!==t.key||(this._unprocessedDeadKey=!0);var i=(0,f.evaluateKeyboardEvent)(t,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),3!==i.type&&2!==i.type)return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,t)||(i.cancel&&this.cancel(t,!0),!i.key)||!!(t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&1===t.key.length&&65<=t.key.charCodeAt(0)&&t.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?!(this._unprocessedDeadKey=!1):(i.key!==o.C0.ETX&&i.key!==o.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:t}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(t,!0)));{let e=this.rows-1;return this.scrollLines(2===i.type?-e:e),this.cancel(t,!0)}}_isThirdLevelShift(e,t){e=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return"keypress"===t.type?e:e&&(!t.keyCode||47<t.keyCode)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(16!==e.keyCode&&17!==e.keyCode&&18!==e.keyCode&&this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null==e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1))}_inputEvent(e){if(!e.data||"insertText"!==e.inputType||e.composed&&this._keyDownSeen||this.optionsService.rawOptions.screenReaderMode)return!1;if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;var t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var i;null!=(i=this._charSizeService)&&i.measure(),null!=(i=this.viewport)&&i.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(g.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;var e,t=this._customKeyEventHandler;this._setup(),super.reset(),null!=(e=this._selectionService)&&e.reset(),this._decorationService.reset(),this._customKeyEventHandler=t,this.refresh(0,this.rows-1),null!=(e=this.viewport)&&e.syncScrollArea()}clearTextureAtlas(){var e;null!=(e=this._renderService)&&e.clearTextureAtlas()}_reportFocus(){var e;null!=(e=this.element)&&e.classList.contains("focus")?this.coreService.triggerDataEvent(o.C0.ESC+"[I"):this.coreService.triggerDataEvent(o.C0.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case a.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.canvasWidth.toFixed(0),t=this._renderService.dimensions.canvasHeight.toFixed(0);this.coreService.triggerDataEvent(`${o.C0.ESC}[4;${t};${e}t`);break;case a.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var i=this._renderService.dimensions.actualCellWidth.toFixed(0),r=this._renderService.dimensions.actualCellHeight.toFixed(0);this.coreService.triggerDataEvent(o.C0.ESC+`[6;${r};${i}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=O},9924:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;i=Date.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=i-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){var e,t;void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1),this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t))}}},1680:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;let n=i(844),l=i(3656),o=i(4725),a=i(2585);i=class extends n.Disposable{constructor(e,t,i,r,s,n,o,a,h){super(),this._scrollLines=e,this._viewportElement=t,this._scrollArea=i,this._element=r,this._bufferService=s,this._optionsService=n,this._charSizeService=o,this._renderService=a,this._coreBrowserService=h,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentScaledCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._onScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(e=>this._renderDimensions=e)),setTimeout(()=>this.syncScrollArea(),0)}onThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){e?(this._innerRefresh(),null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame)):null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(0<this._charSizeService.height){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/this._coreBrowserService.dpr,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length?(this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,this._refresh(e)):this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(e)}_onScroll(e){var t;this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent&&(this._ignoreNextScrollEvent?(this._ignoreNextScrollEvent=!1,this._scrollLines(0)):(t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp,this._scrollLines(t)))}_smoothScroll(){var e;this._isDisposed||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target||(e=this._smoothScrollPercent(),this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState())}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){var i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||0<t&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}onWheel(e){var t=this._getPixelsScrolled(e);return 0!==t&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,-1===this._smoothScrollState.target?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}_getPixelsScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getLinesScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(0<this._wheelPartialScroll?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){var i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}onTouchStart(e){this._lastTouchY=e.touches[0].pageY}onTouchMove(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!=t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}},i=r([s(4,a.IBufferService),s(5,a.IOptionsService),s(6,o.ICharSizeService),s(7,o.IRenderService),s(8,o.ICoreBrowserService)],i);t.Viewport=i},3107:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;let n=i(3656),o=i(4725),a=i(844),h=i(2585);i=class extends a.Disposable{constructor(e,t,i,r){super(),this._screenElement=e,this._bufferService=t,this._decorationService=i,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,n.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e)))}dispose(){this._container.remove(),this._decorationElements.clear(),super.dispose()}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this.refreshDecorations(),this._animationFrame=void 0}))}refreshDecorations(){for(var e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var t=document.createElement("div"),i=(t.classList.add("xterm-decoration"),t.style.width=Math.round((e.options.width||1)*this._renderService.dimensions.actualCellWidth)+"px",t.style.height=(e.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",t.style.lineHeight=this._renderService.dimensions.actualCellHeight+"px",null!=(i=e.options.x)?i:0);return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(t){var i=t.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let e=this._decorationElements.get(t);e||(t.onDispose(()=>this._removeDecoration(t)),e=this._createElement(t),t.element=e,this._decorationElements.set(t,e),this._container.appendChild(e)),e.style.top=i*this._renderService.dimensions.actualCellHeight+"px",e.style.display=this._altBufferIsActive?"none":"block",t.onRenderEmitter.fire(e)}}_refreshXPosition(e,t=e.element){var i;t&&(i=null!=(i=e.options.x)?i:0,"right"===(e.options.anchor||"left")?t.style.right=i?i*this._renderService.dimensions.actualCellWidth+"px":"":t.style.left=i?i*this._renderService.dimensions.actualCellWidth+"px":"")}_removeDecoration(e){var t;null!=(t=this._decorationElements.get(e))&&t.remove(),this._decorationElements.delete(e)}},i=r([s(1,h.IBufferService),s(2,h.IDecorationService),s(3,o.IRenderService)],i);t.BufferDecorationRenderer=i},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(var t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}this._zonePoolIndex<this._zonePool.length?(this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++])):(this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++)}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;let a=i(5871),n=i(3656),o=i(4725),h=i(844),l=i(2585),c={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0};i=class extends h.Disposable{constructor(e,t,i,r,s,n,o){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=r,this._renderService=s,this._optionsService=n,this._coreBrowseService=o,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),null!=(e=this._viewportElement.parentElement)&&e.insertBefore(this._canvas,this._viewportElement);t=this._canvas.getContext("2d");if(!t)throw new Error("Ctx cannot be null");this._ctx=t,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners()}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onOptionChange(e=>{"overviewRulerWidth"===e&&this._queueRefresh(!0)})),this.register((0,n.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>{this._queueRefresh(!0)})),this._queueRefresh(!0)}dispose(){var e;null!=(e=this._canvas)&&e.remove(),super.dispose()}_refreshDrawConstants(){var e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=e,_.center=t,_.right=e,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=_.left,d.right=_.left+_.center}_refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowseService.dpr);var e=this._canvas.height/this._bufferService.buffer.lines.length,e=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);c.left=e,c.center=e,c.right=e}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=this._width+"px",this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=this._screenElement.clientHeight+"px",this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(var t of e)"full"!==t.position&&this._renderColorZone(t);for(var i of e)"full"===i.position&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-c[e.position||"full"]/2),_[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}},i=r([s(2,l.IBufferService),s(3,l.IDecorationService),s(4,o.IRenderService),s(5,l.IOptionsService),s(6,o.ICoreBrowserService)],i);t.OverviewRulerRenderer=i},2950:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;let n=i(4725),o=i(2585),a=i(2584);i=class{constructor(e,t,i,r,s,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=r,this._coreService=s,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{var e;this._isSendingComposition&&(this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,0<(e=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start)).length)&&this._coreService.triggerDataEvent(e,!0)},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let i=this._textarea.value;setTimeout(()=>{var e,t;this._isComposing||(t=(e=this._textarea.value).replace(i,""),this._dataAlreadySent=t,e.length>i.length?this._coreService.triggerDataEvent(t,!0):e.length<i.length?this._coreService.triggerDataEvent(""+a.C0.DEL,!0):e.length===i.length&&e!==i&&this._coreService.triggerDataEvent(e,!0))},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.actualCellHeight,i=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,r=e*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=r+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=t+"px",this._compositionView.style.lineHeight=t+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var s=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(s.width,1)+"px",this._textarea.style.height=Math.max(s.height,1)+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}},i=r([s(2,o.IBufferService),s(3,o.IOptionsService),s(4,o.ICoreService),s(5,n.IRenderService)],i);t.CompositionHelper=i},9806:(e,t)=>{function l(e,t,i){var r=i.getBoundingClientRect(),e=e.getComputedStyle(i),i=parseInt(e.getPropertyValue("padding-left")),e=parseInt(e.getPropertyValue("padding-top"));return[t.clientX-r.left-i,t.clientY-r.top-e]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=l,t.getCoords=function(e,t,i,r,s,n,o,a,h){return(n=n&&l(e,t,i))?(n[0]=Math.ceil((n[0]+(h?o/2:0))/o),n[1]=Math.ceil(n[1]/a),n[0]=Math.min(Math.max(n[0],1),r+(h?1:0)),n[1]=Math.min(Math.max(n[1],1),s),n):void 0}},9504:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;let r=i(2584);function f(e,t,i,r){var s=e-v(i,e),n=t-v(i,t);return S(Math.abs(s-n)-((r,s,n)=>{let o=0,a=r-v(n,r),e=s-v(n,s);for(let i=0;i<Math.abs(a-e);i++){let e="A"===h(r,s)?-1:1,t=n.buffer.lines.get(a+e*i);null!=t&&t.isWrapped&&o++}return o})(e,t,i),p(h(e,t),r))}function v(e,t){let i=0,r=e.buffer.lines.get(t),s=null==r?void 0:r.isWrapped;for(;s&&0<=t&&t<e.rows;)i++,r=e.buffer.lines.get(--t),s=null==r?void 0:r.isWrapped;return i}function h(e,t){return t<e?"A":"B"}function g(e,t,i,r,s,n){let o=e,a=t,h="";for(;o!==i||a!==r;)o+=s?1:-1,s&&o>n.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),e=o=0,a++):!s&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),e=o=n.cols-1,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function p(e,t){t=t?"O":"[";return r.C0.ESC+t+e}function S(t,i){t=Math.floor(t);let r="";for(let e=0;e<t;e++)r+=i;return r}t.moveToCellSequence=function(e,t,i,r){var s,n,o,a,h,l,c=i.buffer.x,_=i.buffer.y;if(!i.buffer.hasScrollback)return u=c,(0===f(a=_,t,h=i,l=r).length?"":S(g(u,a,u,a-v(h,a),!1,h).length,p("D",l)))+f(_,t,i,r)+(u=c,a=e,o=0<f(h=_,l=t,s=i,n=r).length?l-v(s,l):h,h=((e,t,i,r,s)=>(s=0<f(i,r,s,n).length?r-v(s,r):t,e<i&&s<=r||i<=e&&s<r?"C":"D"))(u,h,a,l=l,s),S(g(u,o,a,l,"C"===h,s).length,p(h,n)));let d;if(_===t)return d=e<c?"D":"C",S(Math.abs(c-e),p(d,r));d=t<_?"D":"C";var u=Math.abs(_-t);return S(i.cols-(t<_?e:c)+(u-1)*i.cols+1+((t<_?c:e)-1),p(d,r))}},8036:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;i=i(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=i.isFirefox||i.isLegacyEdge?"bottom":"ideographic"},1752:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(e)return e;throw new Error("value must not be falsy")},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||9472<=e&&e<=9631}},1296:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;let c=i(3787),n=i(8036),o=i(844),a=i(4725),h=i(2585),l=i(8460),_=i(8055),d=i(9631),u="xterm-dom-renderer-owner-",f="xterm-focus",v=1,g=class extends o.Disposable{constructor(e,t,i,r,s,n,o,a,h,l){super(),this._colors=e,this._element=t,this._screenElement=i,this._viewportElement=r,this._linkifier2=s,this._charSizeService=o,this._optionsService=a,this._bufferService=h,this._coreBrowserService=l,this._terminalClass=v++,this._rowElements=[],this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._updateDimensions(),this._injectCss(),this._rowFactory=n.createInstance(c.DomRendererRowFactory,document,this._colors),this._element.classList.add(u+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(e=>this._onLinkHover(e))),this.register(this._linkifier2.onHideLinkUnderline(e=>this._onLinkLeave(e)))}get onRequestRedraw(){return(new l.EventEmitter).event}dispose(){this._element.classList.remove(u+this._terminalClass),(0,d.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),super.dispose()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.scaledCharWidth=this._charSizeService.width*e,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*e),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/e),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/e),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(let e of this._rowElements)e.style.width=this.dimensions.canvasWidth+"px",e.style.height=this.dimensions.actualCellHeight+"px",e.style.lineHeight=this.dimensions.actualCellHeight+"px",e.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var t=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"}setColors(e){this._colors=e,this._injectCss()}_injectCss(){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;i=(i=(i=(i=(i+=`${this._terminalSelector} span:not(.${c.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${c.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${c.ITALIC_CLASS} { font-style: italic;}`)+"@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}")+"@keyframes blink_block_"+this._terminalClass+" { 0% {"+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css}; } 50% {`+` background-color: ${this._colors.cursorAccent.css};`+` color: ${this._colors.cursor.css}; }}`)+`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_BLINK_CLASS}:not(.${c.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_BLINK_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BLOCK_CLASS} {`+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css};}`+`${this._terminalSelector} .xterm-rows .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_BAR_CLASS} {`+` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}`+`${this._terminalSelector} .xterm-rows .${c.CURSOR_CLASS}.${c.CURSOR_STYLE_UNDERLINE_CLASS} {`+` box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`)+`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`,this._colors.ansi.forEach((e,t)=>{i+=`${this._terminalSelector} .xterm-fg-${t} { color: ${e.css}; }${this._terminalSelector} .xterm-bg-${t} { background-color: ${e.css}; }`}),i+=`${this._terminalSelector} .xterm-fg-${n.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${n.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`,this._themeStyleElement.textContent=i}onDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}onResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}onCharSizeChanged(){this._updateDimensions()}onBlur(){this._rowContainer.classList.remove(f)}onFocus(){this._rowContainer.classList.add(f)}onSelectionChanged(i,r,e){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(i,r,e),this.renderRows(0,this._bufferService.rows-1),i&&r){var s=i[1]-this._bufferService.buffer.ydisp,n=r[1]-this._bufferService.buffer.ydisp,o=Math.max(s,0),a=Math.min(n,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||a<0)){var h=document.createDocumentFragment();if(e){let e=i[0]>r[0];h.appendChild(this._createSelectionElement(o,(e?r:i)[0],(e?i:r)[0],a-o+1))}else{let e=s===o?i[0]:0,t=o===n?r[0]:this._bufferService.cols;if(h.appendChild(this._createSelectionElement(o,e,t)),h.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,a-o-1)),o!==a){let e=n===a?r[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(a,0,e))}}this._selectionContainer.appendChild(h)}}}_createSelectionElement(e,t,i,r=1){var s=document.createElement("div");return s.style.height=r*this.dimensions.actualCellHeight+"px",s.style.top=e*this.dimensions.actualCellHeight+"px",s.style.left=t*this.dimensions.actualCellWidth+"px",s.style.width=this.dimensions.actualCellWidth*(i-t)+"px",s}onCursorMove(){}onOptionsChanged(){this._updateDimensions(),this._injectCss()}clear(){for(var e of this._rowElements)e.innerText=""}renderRows(e,t){var n=this._bufferService.buffer.ybase+this._bufferService.buffer.y,o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink;for(let s=e;s<=t;s++){let e=this._rowElements[s],t=(e.innerText="",s+this._bufferService.buffer.ydisp),i=this._bufferService.buffer.lines.get(t),r=this._optionsService.rawOptions.cursorStyle;e.appendChild(this._rowFactory.createRow(i,t,t===n,r,o,a,this.dimensions.actualCellWidth,this._bufferService.cols))}}get _terminalSelector(){return"."+u+this._terminalClass}_onLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_onLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(i,e,r,t,s,n){for(;i!==e||r!==t;){let e=this._rowElements[r];if(!e)return;let t=e.children[i];t&&(t.style.textDecoration=n?"underline":"none"),++i>=s&&(i=0,r++)}}};g=r([s(5,h.IInstantiationService),s(6,a.ICharSizeService),s(7,h.IOptionsService),s(8,h.IBufferService),s(9,a.ICoreBrowserService)],g),t.DomRenderer=g},3787:function(e,L,t){var i=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(L,"__esModule",{value:!0}),L.DomRendererRowFactory=L.CURSOR_STYLE_UNDERLINE_CLASS=L.CURSOR_STYLE_BAR_CLASS=L.CURSOR_STYLE_BLOCK_CLASS=L.CURSOR_BLINK_CLASS=L.CURSOR_CLASS=L.STRIKETHROUGH_CLASS=L.UNDERLINE_CLASS=L.ITALIC_CLASS=L.DIM_CLASS=L.BOLD_CLASS=void 0;let R=t(8036),k=t(643),a=t(511),s=t(2585),D=t(8055),n=t(4725),A=t(4269),h=t(1752),x=t(3734);L.BOLD_CLASS="xterm-bold",L.DIM_CLASS="xterm-dim",L.ITALIC_CLASS="xterm-italic",L.UNDERLINE_CLASS="xterm-underline",L.STRIKETHROUGH_CLASS="xterm-strikethrough",L.CURSOR_CLASS="xterm-cursor",L.CURSOR_BLINK_CLASS="xterm-cursor-blink",L.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",L.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",L.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";t=class{constructor(e,t,i,r,s,n,o){this._document=e,this._colors=t,this._characterJoinerService=i,this._optionsService=r,this._coreBrowserService=s,this._coreService=n,this._decorationService=o,this._workCell=new a.CellData,this._columnSelectMode=!1}setColors(e){this._colors=e}onSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(u,f,v,g,p,S,m,t){var C=this._document.createDocumentFragment(),b=this._characterJoinerService.getJoinedCharacters(f);let i=0;for(let e=Math.min(u.length,t)-1;0<=e;e--)if(u.loadCell(e,this._workCell).getCode()!==k.NULL_CELL_CODE||v&&e===p){i=e+1;break}for(let e=0;e<i;e++){u.loadCell(e,this._workCell);let d=this._workCell.getWidth();if(0!==d){let t=!1,i=e,r=this._workCell;if(0<b.length&&e===b[0][0]){t=!0;let e=b.shift();r=new A.JoinedCellData(this._workCell,u.translateToString(!0,e[0],e[1]),e[1]-e[0]),i=e[1]-1,d=r.getWidth()}var y=this._document.createElement("span");if(1<d&&(y.style.width=m*d+"px"),t&&(y.style.display="inline",p>=e)&&p<=i&&(p=e),!this._coreService.isCursorHidden&&v&&e===p)switch(y.classList.add(L.CURSOR_CLASS),S&&y.classList.add(L.CURSOR_BLINK_CLASS),g){case"bar":y.classList.add(L.CURSOR_STYLE_BAR_CLASS);break;case"underline":y.classList.add(L.CURSOR_STYLE_UNDERLINE_CLASS);break;default:y.classList.add(L.CURSOR_STYLE_BLOCK_CLASS)}if(r.isBold()&&y.classList.add(L.BOLD_CLASS),r.isItalic()&&y.classList.add(L.ITALIC_CLASS),r.isDim()&&y.classList.add(L.DIM_CLASS),r.isInvisible()?y.textContent=k.WHITESPACE_CELL_CHAR:y.textContent=r.getChars()||k.WHITESPACE_CELL_CHAR,r.isUnderline()&&(y.classList.add(L.UNDERLINE_CLASS+"-"+r.extended.underlineStyle)," "===y.textContent&&(y.innerHTML=" "),!r.isUnderlineColorDefault()))if(r.isUnderlineColorRGB())y.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(r.getUnderlineColor()).join(",")})`;else{let e=r.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&r.isBold()&&e<8&&(e+=8),y.style.textDecorationColor=this._colors.ansi[e].css}r.isStrikethrough()&&y.classList.add(L.STRIKETHROUGH_CLASS);let s=r.getFgColor(),n=r.getFgColorMode(),o=r.getBgColor(),a=r.getBgColorMode();var w=!!r.isInverse();if(w){let e=s,t=(s=o,o=e,n);n=a,a=t}let h,l,c=!1;this._decorationService.forEachDecorationAtCell(e,f,void 0,e=>{"top"!==e.options.layer&&c||(e.backgroundColorRGB&&(a=50331648,o=e.backgroundColorRGB.rgba>>8&16777215,h=e.backgroundColorRGB),e.foregroundColorRGB&&(n=50331648,s=e.foregroundColorRGB.rgba>>8&16777215,l=e.foregroundColorRGB),c="top"===e.options.layer)});var E=this._isCellInSelection(e,f);let _;switch(c||this._colors.selectionForeground&&E&&(n=50331648,s=this._colors.selectionForeground.rgba>>8&16777215,l=this._colors.selectionForeground),E&&(h=this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque,c=!0),c&&y.classList.add("xterm-decoration-top"),a){case 16777216:case 33554432:_=this._colors.ansi[o],y.classList.add("xterm-bg-"+o);break;case 50331648:_=D.rgba.toColor(o>>16,o>>8&255,255&o),this._addStyle(y,"background-color:#"+B((o>>>0).toString(16),"0",6));break;default:w?(_=this._colors.foreground,y.classList.add("xterm-bg-"+R.INVERTED_DEFAULT_COLOR)):_=this._colors.background}switch(h||r.isDim()&&(h=D.color.multiplyOpacity(_,.5)),n){case 16777216:case 33554432:r.isBold()&&s<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(s+=8),this._applyMinimumContrast(y,_,this._colors.ansi[s],r,h,void 0)||y.classList.add("xterm-fg-"+s);break;case 50331648:let e=D.rgba.toColor(s>>16&255,s>>8&255,255&s);this._applyMinimumContrast(y,_,e,r,h,l)||this._addStyle(y,"color:#"+B(s.toString(16),"0",6));break;default:this._applyMinimumContrast(y,_,this._colors.foreground,r,h,void 0)||w&&y.classList.add("xterm-fg-"+R.INVERTED_DEFAULT_COLOR)}C.appendChild(y),e=i}}return C}_applyMinimumContrast(e,t,i,r,s,n){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,h.excludeFromContrastRatioDemands)(r.getCode()))return!1;let o;return void 0===(o=s||n?o:this._colors.contrastCache.getColor(t.rgba,i.rgba))&&(o=D.color.ensureContrastRatio(s||t,n||i,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((s||t).rgba,(n||i).rgba,null!=o?o:null)),!!o&&(this._addStyle(e,"color:"+o.css),!0)}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){var i=this._selectionStart,r=this._selectionEnd;return!(!i||!r)&&(this._columnSelectMode?i[0]<=r[0]?e>=i[0]&&t>=i[1]&&e<r[0]&&t<=r[1]:e<i[0]&&t>=i[1]&&e>=r[0]&&t<=r[1]:t>i[1]&&t<r[1]||i[1]===r[1]&&t===i[1]&&e>=i[0]&&e<r[0]||i[1]<r[1]&&t===r[1]&&e<r[0]||i[1]<r[1]&&t===i[1]&&e>=i[0])}};function B(e,t,i){for(;e.length<i;)e=t+e;return e}t=i([r(2,n.ICharacterJoinerService),r(3,s.IOptionsService),r(4,n.ICoreBrowserService),r(5,s.ICoreService),r(6,s.IDecorationService)],t),L.DomRendererRowFactory=t},456:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){var e;return this.isSelectAllActive?[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1]:this.selectionStart?!this.selectionEnd||this.areSelectionValuesReversed()?(e=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]:this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?(e=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd:void 0}areSelectionValuesReversed(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}onTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;let n=i(2585),o=i(8460);i=class{constructor(e,t,i){this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=new o.EventEmitter,this._measureStrategy=new a(e,t,this._optionsService)}get hasValidSize(){return 0<this.width&&0<this.height}get onCharSizeChange(){return this._onCharSizeChange.event}measure(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}},i=r([s(2,n.IOptionsService)],i);t.CharSizeService=i;class a{constructor(e,t,i){this._document=e,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=this._optionsService.rawOptions.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(a,e,t){var i=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(e,"__esModule",{value:!0}),e.CharacterJoinerService=e.JoinedCellData=void 0;let s=t(3734),l=t(643),n=t(511),o=t(2585);class h extends s.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}e.JoinedCellData=h;t=class a{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new n.CellData}register(e){e={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(e){if(0===this._characterJoiners.length)return[];var i=this._bufferService.buffer.lines.get(e);if(!i||0===i.length)return[];var r=[],s=i.translateToString(!0);let n=0,o=0,a=0,t=i.getFg(0),h=i.getBg(0);for(let e=0;e<i.getTrimmedLength();e++)if(i.loadCell(e,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==t||this._workCell.bg!==h){if(1<e-n){let t=this._getJoinedRanges(s,a,o,i,n);for(let e=0;e<t.length;e++)r.push(t[e])}n=e,a=o,t=this._workCell.fg,h=this._workCell.bg}o+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(1<this._bufferService.cols-n){let t=this._getJoinedRanges(s,a,o,i,n);for(let e=0;e<t.length;e++)r.push(t[e])}return r}_getJoinedRanges(e,t,i,r,s){var n=e.substring(t,i);let o=[];try{o=this._characterJoiners[0].handler(n)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(n);for(let e=0;e<t.length;e++)a._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,s),o}_stringRangesToCellRanges(r,s,e){let n=0,o=!1,a=0,h=r[n];if(h){for(let i=e;i<this._bufferService.cols;i++){let e=s.getWidth(i),t=s.getString(i).length||l.WHITESPACE_CELL_CHAR.length;if(0!==e){if(!o&&h[0]<=a&&(h[0]=i,o=!0),h[1]<=a){if(h[1]=i,!(h=r[++n]))break;o=h[0]<=a&&(h[0]=i,!0)}a+=t}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let r=!1;for(let e=0;e<t.length;e++){var s=t[e];if(r){if(i[1]<=s[0])return t[e-1][1]=i[1],t;if(i[1]<=s[1])return t[e-1][1]=Math.max(i[1],s[1]),t.splice(e,1),t;t.splice(e,1),e--}else{if(i[1]<=s[0])return t.splice(e,0,i),t;if(i[1]<=s[1])return s[0]=Math.min(i[0],s[0]),t;i[0]<s[1]&&(s[0]=Math.min(i[0],s[0]),r=!0)}}return r?t[t.length-1][1]=i[1]:t.push(i),t}},t=i([r(0,o.IBufferService)],t);e.CharacterJoinerService=t},5114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t}get dpr(){return this.window.devicePixelRatio}get isFocused(){return(this._textarea.getRootNode?this._textarea.getRootNode():this._textarea.ownerDocument).activeElement===this._textarea&&this._textarea.ownerDocument.hasFocus()}}},8934:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;let n=i(4725),o=i(9806);i=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,r,s){return(0,o.getCoords)(window,e,t,i,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,s)}getMouseReportCoords(e,t){e=(0,o.getCoordsRelativeToElement)(window,e,t);if(!(!this._charSizeService.hasValidSize||e[0]<0||e[1]<0||e[0]>=this._renderService.dimensions.canvasWidth||e[1]>=this._renderService.dimensions.canvasHeight))return{col:Math.floor(e[0]/this._renderService.dimensions.actualCellWidth),row:Math.floor(e[1]/this._renderService.dimensions.actualCellHeight),x:Math.floor(e[0]),y:Math.floor(e[1])}}},i=r([s(0,n.IRenderService),s(1,n.ICharSizeService)],i);t.MouseService=i},3230:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;let h=i(6193),l=i(8460),n=i(844),c=i(5596),_=i(3656),o=i(2585),a=i(4725);i=class extends n.Disposable{constructor(e,t,i,r,s,n,o,a){if(super(),this._renderer=e,this._rowCount=t,this._charSizeService=s,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=new l.EventEmitter,this._onRenderedViewportChange=new l.EventEmitter,this._onRender=new l.EventEmitter,this._onRefreshRequest=new l.EventEmitter,this.register({dispose:()=>this._renderer.dispose()}),this._renderDebouncer=new h.RenderDebouncer(a.window,(e,t)=>this._renderRows(e,t)),this.register(this._renderDebouncer),this._screenDprMonitor=new c.ScreenDprMonitor(a.window),this._screenDprMonitor.setListener(()=>this.onDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(o.onResize(()=>this._fullRefresh())),this.register(o.buffers.onBufferActivate(()=>{var e;return null==(e=this._renderer)?void 0:e.clear()})),this.register(r.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.onCharSizeChanged())),this.register(n.onDecorationRegistered(()=>this._fullRefresh())),this.register(n.onDecorationRemoved(()=>this._fullRefresh())),this._renderer.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this.register((0,_.addDisposableDomListener)(a.window,"resize",()=>this.onDevicePixelRatioChange())),"IntersectionObserver"in a.window){let e=new a.window.IntersectionObserver(e=>this._onIntersectionChange(e[e.length-1]),{threshold:0});e.observe(i),this.register({dispose:()=>e.disconnect()})}}get onDimensionsChange(){return this._onDimensionsChange.event}get onRenderedViewportChange(){return this._onRenderedViewportChange.event}get onRender(){return this._onRender.event}get onRefreshRequest(){return this._onRefreshRequest.event}get dimensions(){return this._renderer.dimensions}_onIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()}_fireOnCanvasResize(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)}dispose(){super.dispose()}setRenderer(e){this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;null!=(t=null==(e=this._renderer)?void 0:e.clearTextureAtlas)&&t.call(e),this._fullRefresh()}setColors(e){this._renderer.setColors(e),this._fullRefresh()}onDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)}onResize(e,t){this._renderer.onResize(e,t),this._fullRefresh()}onCharSizeChanged(){this._renderer.onCharSizeChanged()}onBlur(){this._renderer.onBlur()}onFocus(){this._renderer.onFocus()}onSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.onSelectionChanged(e,t,i)}onCursorMove(){this._renderer.onCursorMove()}clear(){this._renderer.clear()}},i=r([s(3,o.IOptionsService),s(4,a.ICharSizeService),s(5,o.IDecorationService),s(6,o.IBufferService),s(7,a.ICoreBrowserService)],i);t.RenderService=i},9312:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;let a=i(6114),l=i(456),c=i(511),_=i(8460),n=i(4725),o=i(2585),h=i(9806),d=i(9504),u=i(844),f=i(4841),v=String.fromCharCode(160),g=new RegExp(v,"g");i=class extends u.Disposable{constructor(e,t,i,r,s,n,o,a,h){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=r,this._coreService=s,this._mouseService=n,this._optionsService=o,this._renderService=a,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this._onRedrawRequest=this.register(new _.EventEmitter),this._onSelectionChange=this.register(new _.EventEmitter),this._onRequestScrollLines=this.register(new _.EventEmitter),this._mouseMoveListener=e=>this._onMouseMove(e),this._mouseUpListener=e=>this._onMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._onTrim(e)),this.register(this._bufferService.buffers.onBufferActivate(e=>this._onBufferActivate(e))),this.enable(),this._model=new l.SelectionModel(this._bufferService),this._activeSelectionMode=0}get onLinuxMouseSelection(){return this._onLinuxMouseSelection.event}get onRequestRedraw(){return this._onRedrawRequest.event}get onSelectionChange(){return this._onSelectionChange.event}get onRequestScrollLines(){return this._onRequestScrollLines.event}dispose(){this._removeMouseDownListeners()}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;if(!e||!s)return"";var n=this._bufferService.buffer,o=[];if(3===this._activeSelectionMode){if(e[0]===s[0])return"";let i=(e[0]<s[0]?e:s)[0],r=(e[0]<s[0]?s:e)[0];for(let t=e[1];t<=s[1];t++){let e=n.translateBufferLineToString(t,!0,i,r);o.push(e)}}else{var t=e[1]===s[1]?s[0]:void 0;o.push(n.translateBufferLineToString(e[1],!0,e[0],t));for(let i=e[1]+1;i<=s[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);null!=e&&e.isWrapped?o[o.length-1]+=t:o.push(t)}if(e[1]!==s[1]){let e=n.lines.get(s[1]),t=n.translateBufferLineToString(s[1],!0,0,s[0]);e&&e.isWrapped?o[o.length-1]+=t:o.push(t)}}return o.map(e=>e.replace(g," ")).join(a.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),a.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){var e=this._getMouseBufferCoords(e),t=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!!(t&&i&&e)&&this._areCoordsInSelection(e,t,i)}isCellInSelection(e,t){var i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!i||!r)&&this._areCoordsInSelection([e,t],i,r)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var i=null==(i=null==(i=this._linkifier.currentLink)?void 0:i.link)?void 0:i.range;return i?(this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(i,this._bufferService.cols),!(this._model.selectionEnd=void 0)):!!(i=this._getMouseBufferCoords(e))&&(this._selectWordAt(i,t),!(this._model.selectionEnd=void 0))}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_onTrim(e){this._model.onTrim(e)&&this.refresh()}_getMouseBufferCoords(e){e=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(e)return e[0]--,e[1]--,e[1]+=this._bufferService.buffer.ydisp,e}_getMouseEventScrollAmount(e){let t=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1];e=this._renderService.dimensions.canvasHeight;return 0<=t&&t<=e?0:(t>e&&(t-=e),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return a.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}onMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_onIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_onSingleClick(e){this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart&&(this._model.selectionEnd=void 0,e=this._bufferService.buffer.lines.get(this._model.selectionStart[1]))&&e.length!==this._model.selectionStart[0]&&0===e.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_onDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_onTripleClick(e){e=this._getMouseBufferCoords(e);e&&(this._activeSelectionMode=2,this._selectLineAt(e[1]))}shouldColumnSelect(e){return e.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_onMouseMove(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(0<this._dragScrollAmount?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let e=i.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}}_dragScroll(){var e;this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount&&(this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1}),e=this._bufferService.buffer,0<this._dragScrollAmount?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh())}_onMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&void 0!==t[0]&&void 0!==t[1]){let e=(0,d.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);i?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,i)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_onBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._onTrim(e))}_convertViewportColToCharacterIndex(t,i){let r=i[0];for(let e=0;i[0]>=e;e++){var s=t.loadCell(e,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:1<s&&i[0]!==e&&(r+=s-1)}return r}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(c,e,t=!0,_=!0){if(!(c[0]>=this._bufferService.cols)){var d=this._bufferService.buffer,u=d.lines.get(c[1]);if(u){var f=d.translateBufferLineToString(c[1],!1);let r=this._convertViewportColToCharacterIndex(u,c),s=r;var v=c[0]-r;let n=0,o=0,a=0,h=0;if(" "===f.charAt(r)){for(;0<r&&" "===f.charAt(r-1);)r--;for(;s<f.length&&" "===f.charAt(s+1);)s++}else{let t=c[0],i=c[0],e=(0===u.getWidth(t)&&(n++,t--),2===u.getWidth(i)&&(o++,i++),u.getString(i).length);for(1<e&&(h+=e-1,s+=e-1);0<t&&0<r&&!this._isCharWordSeparator(u.loadCell(t-1,this._workCell));){u.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;0===this._workCell.getWidth()?(n++,t--):1<e&&(a+=e-1,r-=e-1),r--,t--}for(;i<u.length&&s+1<f.length&&!this._isCharWordSeparator(u.loadCell(i+1,this._workCell));){u.loadCell(i+1,this._workCell);let e=this._workCell.getChars().length;2===this._workCell.getWidth()?(o++,i++):1<e&&(h+=e-1,s+=e-1),s++,i++}}s++;let i=r+v-n+a,l=Math.min(this._bufferService.cols,s-r+n+o-a-h);if(e||""!==f.slice(r,s).trim()){if(t&&0===i&&32!==u.getCodePoint(0)){let e=d.lines.get(c[1]-1);if(e&&u.isWrapped&&32!==e.getCodePoint(this._bufferService.cols-1)){let t=this._getWordAt([this._bufferService.cols-1,c[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;i-=e,l+=e}}}if(_&&i+l===this._bufferService.cols&&32!==u.getCodePoint(this._bufferService.cols-1)){let e=d.lines.get(c[1]+1);if(null!=e&&e.isWrapped&&32!==e.getCodePoint(0)){let e=this._getWordAt([0,c[1]+1],!1,!1,!0);e&&(l+=e.length)}}return{start:i,length:l}}}}}_selectWordAt(e,t){var i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(t){var i=this._getWordAt(t,!0);if(i){let e=t[1];for(;i.start<0;)i.start+=this._bufferService.cols,e--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,e++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,e]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&0<=this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())}_selectLineAt(e){var e=this._bufferService.buffer.getWrappedRangeForLine(e),t={start:{x:0,y:e.first},end:{x:this._bufferService.cols-1,y:e.last}};this._model.selectionStart=[0,e.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(t,this._bufferService.cols)}},i=r([s(3,o.IBufferService),s(4,o.ICoreService),s(5,n.IMouseService),s(6,o.IOptionsService),s(7,n.IRenderService),s(8,n.ICoreBrowserService)],i);t.SelectionService=i},4725:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;i=i(8343);t.ICharSizeService=(0,i.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,i.createDecorator)("CoreBrowserService"),t.IMouseService=(0,i.createDecorator)("MouseService"),t.IRenderService=(0,i.createDecorator)("RenderService"),t.ISelectionService=(0,i.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,i.createDecorator)("CharacterJoinerService")},6349:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;let r=i(8460);t.CircularList=class{constructor(e){this._maxLength=e,this.onDeleteEmitter=new r.EventEmitter,this.onInsertEmitter=new r.EventEmitter,this.onTrimEmitter=new r.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get onDelete(){return this.onDeleteEmitter.event}get onInsert(){return this.onInsertEmitter.event}get onTrim(){return this.onTrimEmitter.event}get maxLength(){return this._maxLength}set maxLength(t){if(this._maxLength!==t){var i=new Array(t);for(let e=0;e<Math.min(t,this.length);e++)i[e]=this._array[this._getCyclicIndex(e)];this._array=i,this._maxLength=t,this._startIndex=0}}get length(){return this._length}set length(t){if(t>this._length)for(let e=this._length;e<t;e++)this._array[e]=void 0;this._length=t}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(t,i,...r){if(i){for(let e=t;e<this._length-i;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+i)];this._length-=i,this.onDeleteEmitter.fire({index:t,amount:i})}for(let e=this._length-1;e>=t;e--)this._array[this._getCyclicIndex(e+r.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<r.length;e++)this._array[this._getCyclicIndex(t+e)]=r[e];if(r.length&&this.onInsertEmitter.fire({index:t,amount:r.length}),this._length+r.length>this._maxLength){let e=this._length+r.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(t,i,r){if(!(i<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(0<r){for(let e=i-1;0<=e;e--)this.set(t+e+r,this.get(t+e));var e=t+i+r-this._length;if(0<e)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<i;e++)this.set(t+e+r,this.get(t+e))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}},1439:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i=5){if("object"!=typeof t)return t;var r,s=Array.isArray(t)?[]:{};for(r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},8055:(e,t)=>{var a,c,o,i;function s(e){e=e.toString(16);return e.length<2?"0"+e:e}function _(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function h(e,t,i){var r=e>>24&255,s=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));for(;l<i&&(0<o||0<a||0<h);)o-=Math.max(0,Math.ceil(.1*o)),a-=Math.max(0,Math.ceil(.1*a)),h-=Math.max(0,Math.ceil(.1*h)),l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));return(o<<24|a<<16|h<<8|255)>>>0}function l(e,t,i){var r=e>>24&255,s=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));for(;l<i&&(o<255||a<255||h<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),a=Math.min(255,a+Math.ceil(.1*(255-a))),h=Math.min(255,h+Math.ceil(.1*(255-h))),l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(r,s,n));return(o<<24|a<<16|h<<8|255)>>>0}function r(e,t,i){e/=255,t/=255,i/=255;return.2126*(e<=.03928?e/12.92:Math.pow((.055+e)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((.055+i)/1.055,2.4))}function n(e,t){var t=Math.round(255*t),[e,i,r]=o.toChannels(e.rgba);return{css:a.toCss(e,i,r,t),rgba:a.toRgba(e,i,r,t)}}Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=void 0,(i=a=t.channels||(t.channels={})).toCss=function(e,t,i,r){return void 0!==r?"#"+s(e)+s(t)+s(i)+s(r):"#"+s(e)+s(t)+s(i)},i.toRgba=function(e,t,i,r=255){return(e<<24|t<<16|i<<8|r)>>>0},(i=t.color||(t.color={})).blend=function(e,t){var i,r,s,n,o=(255&t.rgba)/255;return 1==o?{css:t.css,rgba:t.rgba}:(n=t.rgba>>16&255,i=t.rgba>>8&255,s=e.rgba>>24&255,r=e.rgba>>16&255,e=e.rgba>>8&255,t=s+Math.round(((t.rgba>>24&255)-s)*o),s=r+Math.round((n-r)*o),n=e+Math.round((i-e)*o),{css:a.toCss(t,s,n),rgba:a.toRgba(t,s,n)})},i.isOpaque=function(e){return 255==(255&e.rgba)},i.ensureContrastRatio=function(e,t,i){e=o.ensureContrastRatio(e.rgba,t.rgba,i);if(e)return o.toColor(e>>24&255,e>>16&255,e>>8&255)},i.opaque=function(e){var e=(255|e.rgba)>>>0,[t,i,r]=o.toChannels(e);return{css:a.toCss(t,i,r),rgba:e}},i.opacity=n,i.multiplyOpacity=function(e,t){return n(e,(255&e.rgba)*t/255)},i.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]},(t.css||(t.css={})).toColor=function(s){if(s.match(/#[0-9a-f]{3,8}/i))switch(s.length){case 4:{let e=parseInt(s.slice(1,2).repeat(2),16),t=parseInt(s.slice(2,3).repeat(2),16),i=parseInt(s.slice(3,4).repeat(2),16);return o.toColor(e,t,i)}case 5:{let e=parseInt(s.slice(1,2).repeat(2),16),t=parseInt(s.slice(2,3).repeat(2),16),i=parseInt(s.slice(3,4).repeat(2),16),r=parseInt(s.slice(4,5).repeat(2),16);return o.toColor(e,t,i,r)}case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let n=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n){let e=parseInt(n[1]),t=parseInt(n[2]),i=parseInt(n[3]),r=Math.round(255*(void 0===n[5]?1:parseFloat(n[5])));return o.toColor(e,t,i,r)}throw new Error("css.toColor: Unsupported css format")},(i=c=t.rgb||(t.rgb={})).relativeLuminance=function(e){return r(e>>16&255,e>>8&255,255&e)},i.relativeLuminance2=r,(i=o=t.rgba||(t.rgba={})).ensureContrastRatio=function(r,s,n){let o=c.relativeLuminance(r>>8),e=c.relativeLuminance(s>>8);if(_(o,e)<n){if(e<o){let t=h(r,s,n),i=_(o,c.relativeLuminance(t>>8));if(i<n){let e=l(r,s,n);return i>_(o,c.relativeLuminance(e>>8))?t:e}return t}var t=l(r,s,n),i=_(o,c.relativeLuminance(t>>8));if(i<n){let e=h(r,s,n);return i>_(o,c.relativeLuminance(e>>8))?t:e}return t}},i.reduceLuminance=h,i.increaseLuminance=l,i.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},i.toColor=function(e,t,i,r){return{css:a.toCss(e,t,i,r),rgba:a.toRgba(e,t,i,r)}},t.toPaddedHex=s,t.contrastRatio=_},8969:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;let r=i(844),s=i(2585),n=i(4348),o=i(7866),a=i(744),h=i(7302),l=i(6975),c=i(8460),_=i(1753),d=i(3730),u=i(1480),f=i(7994),v=i(9282),g=i(5435),p=i(5981),S=i(2660),m=!1;class C extends r.Disposable{constructor(e){super(),this._onBinary=new c.EventEmitter,this._onData=new c.EventEmitter,this._onLineFeed=new c.EventEmitter,this._onResize=new c.EventEmitter,this._onScroll=new c.EventEmitter,this._onWriteParsed=new c.EventEmitter,this._instantiationService=new n.InstantiationService,this.optionsService=new h.OptionsService(e),this._instantiationService.setService(s.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(a.BufferService)),this._instantiationService.setService(s.IBufferService,this._bufferService),this._logService=this._instantiationService.createInstance(o.LogService),this._instantiationService.setService(s.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService,()=>this.scrollToBottom())),this._instantiationService.setService(s.ICoreService,this.coreService),this.coreMouseService=this._instantiationService.createInstance(_.CoreMouseService),this._instantiationService.setService(s.ICoreMouseService,this.coreMouseService),this._dirtyRowService=this._instantiationService.createInstance(d.DirtyRowService),this._instantiationService.setService(s.IDirtyRowService,this._dirtyRowService),this.unicodeService=this._instantiationService.createInstance(u.UnicodeService),this._instantiationService.setService(s.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(s.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(s.IOscLinkService,this._oscLinkService),this._inputHandler=new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._dirtyRowService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService),this.register((0,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.optionsService.onOptionChange(e=>this._updateOptions(e))),this.register(this._bufferService.onScroll(e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=new p.WriteBuffer((e,t)=>this._inputHandler.parse(e,t)),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onBinary(){return this._onBinary.event}get onData(){return this._onData.event}get onLineFeed(){return this._onLineFeed.event}get onResize(){return this._onResize.event}get onWriteParsed(){return this._onWriteParsed.event}get onScroll(){return this._onScrollApi||(this._onScrollApi=new c.EventEmitter,this.register(this._onScroll.event(e=>{var t;null!=(t=this._onScrollApi)&&t.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(var t in e)this.optionsService.options[t]=e[t]}dispose(){var e;this._isDisposed||(super.dispose(),null!=(e=this._windowsMode)&&e.dispose(),this._windowsMode=void 0)}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=s.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,a.MINIMUM_COLS),t=Math.max(t,a.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}scrollPages(e){this._bufferService.scrollPages(e)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(e){this._bufferService.scrollToLine(e)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_updateOptions(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():(null!=(t=this._windowsMode)&&t.dispose(),this._windowsMode=void 0)}}_enableWindowsMode(){if(!this._windowsMode){let t=[];t.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsMode={dispose:()=>{for(var e of t)e.dispose()}}}}}t.CoreTerminal=C},8460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=t=>(this._listeners.push(t),{dispose:()=>{if(!this._disposed)for(let e=0;e<this._listeners.length;e++)if(this._listeners[e]===t)return void this._listeners.splice(e,1)}})),this._event}fire(t,i){var r=[];for(let e=0;e<this._listeners.length;e++)r.push(this._listeners[e]);for(let e=0;e<r.length;e++)r[e].call(void 0,t,i)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},t.forwardEvent=function(e,t){return e(e=>t.fire(e))}},5435:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;let d=i(2584),c=i(7116),_=i(2015),r=i(844),u=i(482),f=i(8437),v=i(8460),g=i(643),p=i(511),n=i(3734),a=i(2585),S=i(6242),m=i(6351),s=i(5941),o={"(":0,")":1,"*":2,"+":3,"-":1,".":2},h=131072;function l(e,t){if(24<e)return t.setWinLines;switch(e){case 1:return t.restoreWin;case 2:return t.minimizeWin;case 3:return t.setWinPosition;case 4:return t.setWinSizePixels;case 5:return t.raiseWin;case 6:return t.lowerWin;case 7:return t.refreshWin;case 8:return t.setWinSizeChars;case 9:return t.maximizeWin;case 10:return t.fullscreenWin;case 11:return t.getWinState;case 13:return t.getWinPosition;case 14:return t.getWinSizePixels;case 15:return t.getScreenSizePixels;case 16:return t.getCellSizePixels;case 18:return t.getWinSizeChars;case 19:return t.getScreenSizeChars;case 20:return t.getIconTitle;case 21:return t.getWinTitle;case 22:return t.pushTitle;case 23:return t.popTitle;case 24:return t.setWinLines}}var C;(i=C=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}))[i.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",i[i.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS";class b extends r.Disposable{constructor(e,t,i,r,s,n,o,a,h,l=new _.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._dirtyRowService=r,this._logService=s,this._optionsService=n,this._oscLinkService=o,this._coreMouseService=a,this._unicodeService=h,this._parser=l,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new u.StringToUtf32,this._utf8Decoder=new u.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=new v.EventEmitter,this._onRequestRefreshRows=new v.EventEmitter,this._onRequestReset=new v.EventEmitter,this._onRequestSendFocus=new v.EventEmitter,this._onRequestSyncScrollBar=new v.EventEmitter,this._onRequestWindowsOptionsReport=new v.EventEmitter,this._onA11yChar=new v.EventEmitter,this._onA11yTab=new v.EventEmitter,this._onCursorMove=new v.EventEmitter,this._onLineFeed=new v.EventEmitter,this._onScroll=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onColor=new v.EventEmitter,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})}),this._parser.setOscHandlerFallback((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})}),this._parser.setDcsHandlerFallback((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})}),this._parser.setPrintHandler((e,t,i)=>this.print(e,t,i)),this._parser.registerCsiHandler({final:"@"},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:"A"},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:"B"},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:"C"},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:"D"},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:"E"},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:"F"},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:"G"},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:"H"},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:"I"},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:"J"},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:"K"},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:"L"},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:"M"},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:"P"},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:"S"},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:"T"},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:"X"},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:"Z"},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:"a"},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:"b"},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:"c"},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:">",final:"c"},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:"d"},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:"e"},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:"f"},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:"g"},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:"h"},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"h"},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:"l"},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:"?",final:"l"},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:"m"},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:"n"},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:"?",final:"n"},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:"r"},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:"s"},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:"t"},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:"u"},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new S.OscHandler(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new S.OscHandler(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new S.OscHandler(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new S.OscHandler(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new S.OscHandler(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new S.OscHandler(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new S.OscHandler(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new S.OscHandler(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new S.OscHandler(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new S.OscHandler(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new S.OscHandler(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new S.OscHandler(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let e in c.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e},()=>this.selectCharset("("+e)),this._parser.registerEscHandler({intermediates:")",final:e},()=>this.selectCharset(")"+e)),this._parser.registerEscHandler({intermediates:"*",final:e},()=>this.selectCharset("*"+e)),this._parser.registerEscHandler({intermediates:"+",final:e},()=>this.selectCharset("+"+e)),this._parser.registerEscHandler({intermediates:"-",final:e},()=>this.selectCharset("-"+e)),this._parser.registerEscHandler({intermediates:".",final:e},()=>this.selectCharset("."+e)),this._parser.registerEscHandler({intermediates:"/",final:e},()=>this.selectCharset("/"+e));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error("Parsing error: ",e),e)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}get onRequestBell(){return this._onRequestBell.event}get onRequestRefreshRows(){return this._onRequestRefreshRows.event}get onRequestReset(){return this._onRequestReset.event}get onRequestSendFocus(){return this._onRequestSendFocus.event}get onRequestSyncScrollBar(){return this._onRequestSyncScrollBar.event}get onRequestWindowsOptionsReport(){return this._onRequestWindowsOptionsReport.event}get onA11yChar(){return this._onA11yChar.event}get onA11yTab(){return this._onA11yTab.event}get onCursorMove(){return this._onCursorMove.event}get onLineFeed(){return this._onLineFeed.event}get onScroll(){return this._onScroll.event}get onTitleChange(){return this._onTitleChange.event}get onColor(){return this._onColor.event}dispose(){super.dispose()}_preserveStack(e,t,i,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=a.LogLevelEnum.WARN&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t("#SLOW_TIMEOUT"),5e3))]).catch(e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")})}parse(r,e){let s,n=this._activeBuffer.x,o=this._activeBuffer.y,t=0,i=this._parseStack.paused;if(i){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(s),s;n=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,r.length>h&&(t=this._parseStack.position+h)}if(this._logService.logLevel<=a.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof r?` "${r}"`:` "${Array.prototype.map.call(r,e=>String.fromCharCode(e)).join("")}"`),"string"==typeof r?r.split("").map(e=>e.charCodeAt(0)):r),this._parseBuffer.length<r.length&&this._parseBuffer.length<h&&(this._parseBuffer=new Uint32Array(Math.min(r.length,h))),i||this._dirtyRowService.clearRange(),r.length>h)for(let i=t;i<r.length;i+=h){let e=i+h<r.length?i+h:r.length,t="string"==typeof r?this._stringDecoder.decode(r.substring(i,e),this._parseBuffer):this._utf8Decoder.decode(r.subarray(i,e),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,t))return this._preserveStack(n,o,t,i),this._logSlowResolvingAsync(s),s}else if(!i){let e=("string"==typeof r?this._stringDecoder:this._utf8Decoder).decode(r,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,e))return this._preserveStack(n,o,e,0),this._logSlowResolvingAsync(s),s}this._activeBuffer.x===n&&this._activeBuffer.y===o||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)}print(t,i,r){let s,n;var o=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,_=this._curAttrData;let d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowService.markDirty(this._activeBuffer.y),this._activeBuffer.x&&0<r-i&&2===d.getWidth(this._activeBuffer.x-1)&&d.setCellFromCodePoint(this._activeBuffer.x-1,0,1,_.fg,_.bg,_.extended);for(let e=i;e<r;++e){if(s=t[e],n=this._unicodeService.wcwidth(s),s<127&&o){let e=o[String.fromCharCode(s)];e&&(s=e.charCodeAt(0))}if(a&&this._onA11yChar.fire((0,u.stringFromCodePoint)(s)),void 0!==this._currentLinkId&&this._oscLinkService.addLineToLink(this._currentLinkId,this._activeBuffer.ybase+this._activeBuffer.y),n||!this._activeBuffer.x){if(this._activeBuffer.x+n-1>=h)if(l){for(;this._activeBuffer.x<h;)d.setCellFromCodePoint(this._activeBuffer.x++,0,1,_.fg,_.bg,_.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=h-1,2===n)continue;if(c&&(d.insertCells(this._activeBuffer.x,n,this._activeBuffer.getNullCell(_),_),2===d.getWidth(h-1))&&d.setCellFromCodePoint(h-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,_.fg,_.bg,_.extended),d.setCellFromCodePoint(this._activeBuffer.x++,s,n,_.fg,_.bg,_.extended),0<n)for(;--n;)d.setCellFromCodePoint(this._activeBuffer.x++,0,0,_.fg,_.bg,_.extended)}else d.getWidth(this._activeBuffer.x-1)?d.addCodepointToCell(this._activeBuffer.x-1,s):d.addCodepointToCell(this._activeBuffer.x-2,s)}0<r-i&&(d.loadCell(this._activeBuffer.x-1,this._workCell),2===this._workCell.getWidth()||65535<this._workCell.getCode()?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<h&&0<r-i&&0===d.getWidth(this._activeBuffer.x)&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodePoint(this._activeBuffer.x,0,1,_.fg,_.bg,_.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,e=>!l(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new m.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new S.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowService.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return!(this._activeBuffer.x=0)}backspace(){var e;if(this._coreService.decPrivateModes.reverseWraparound){if(this._restrictCursor(this._bufferService.cols),0<this._activeBuffer.x)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&null!=(e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))&&e.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}this._restrictCursor()}else this._restrictCursor(),0<this._activeBuffer.x&&this._activeBuffer.x--;return!0}tab(){var e;return this._activeBuffer.x>=this._bufferService.cols||(e=this._activeBuffer.x,this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e)),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowService.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){var t=this._activeBuffer.y-this._activeBuffer.scrollTop;return 0<=t?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){var t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return 0<=t?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),!(this._activeBuffer.x=0)}cursorPrecedingLine(e){return this.cursorUp(e),!(this._activeBuffer.x=0)}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(2<=e.length?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){e=e.params[0];return 0===e?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===e&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(!(this._activeBuffer.x>=this._bufferService.cols)){let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop()}return!0}cursorBackwardTab(t){if(!(this._activeBuffer.x>=this._bufferService.cols)){let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop()}return!0}selectProtected(e){e=e.params[0];return 1===e&&(this._curAttrData.bg|=536870912),2!==e&&0!==e||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,r=!1,s=!1){e=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);e.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),s),r&&(e.isWrapped=!1)}_resetBufferLine(e,t=!1){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowService.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;0<e&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){for(var i=this._activeBuffer.ybase+this._activeBuffer.y,e=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-e+1;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0}return!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var i=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom;for(r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0}return!0}insertChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(f.DEFAULT_ATTR_DATA));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}scrollRight(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}insertColumns(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}deleteColumns(e){if(!(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)){var t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){var i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}return!0}eraseChars(e){this._restrictCursor();var t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){if(this._parser.precedingCodepoint){var t=e.params[0]||1,i=new Uint32Array(t);for(let e=0;e<t;++e)i[e]=this._parser.precedingCodepoint;this.print(i,0,i.length)}return!0}sendDeviceAttributesPrimary(e){return 0<e.params[0]||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return 0<e.params[0]||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),this._charsetService.setgCharset(1,c.DEFAULT_CHARSET),this._charsetService.setgCharset(2,c.DEFAULT_CHARSET),this._charsetService.setgCharset(3,c.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===t.params[e]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){var i=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:s}=this._coreMouseService,n=this._coreService,{buffers:o,cols:a}=this._bufferService,{active:o,alt:h}=o,l=this._optionsService.rawOptions,c=e=>e?1:2,e=e.params[0],_=e,a=t?2===e?3:4===e?c(n.modes.insertMode):12===e?4:20===e?c(l.convertEol):0:1===e?c(i.applicationCursorKeys):3===e?l.windowOptions.setWinLines?80===a?2:132===a?1:0:0:6===e?c(i.origin):7===e?c(i.wraparound):8===e?3:9===e?"X10"===r?1:2:12===e?c(l.cursorBlink):25===e?c(!n.isCursorHidden):45===e?c(i.reverseWraparound):66===e?c(i.applicationKeypad):1e3===e?"VT200"===r?1:2:1002===e?"DRAG"===r?1:2:1003===e?"ANY"===r?1:2:1004===e?c(i.sendFocus):1005===e?4:1006===e?"SGR"===s?1:2:1015===e?4:1016===e?"SGR_PIXELS"===s?1:2:1048===e?1:47===e||1047===e||1049===e?o===h?1:2:2004===e?c(i.bracketedPasteMode):0;return n.triggerDataEvent(d.C0.ESC+`[${t?"":"?"}${_};${a}$y`),!0}_updateAttrColor(e,t,i,r,s){return 2===t?e=(e=(e|50331648)&-16777216)|n.AttributeData.fromColorRGB([i,r,s]):5===t&&(e=e&-50331904|(33554432|255&i)),e}_extractColor(i,r,e){var s=[0,0,-1,0,0,0];let n=0,o=0;do{if(s[o+n]=i.params[r+o],i.hasSubParams(r+o)){let e=i.getSubParams(r+o),t=0;for(;5===s[1]&&(n=1),s[o+t+1+n]=e[t],++t<e.length&&t+o+1+n<s.length;);break}}while(!(5===s[1]&&2<=o+n||2===s[1]&&5<=o+n)&&(s[1]&&(n=1),++o+r<i.length&&o+n<s.length));for(let e=2;e<s.length;++e)-1===s[e]&&(s[e]=0);switch(s[0]){case 38:e.fg=this._updateAttrColor(e.fg,s[1],s[3],s[4],s[5]);break;case 48:e.bg=this._updateAttrColor(e.bg,s[1],s[3],s[4],s[5]);break;case 58:e.extended=e.extended.clone(),e.extended.underlineColor=this._updateAttrColor(e.extended.underlineColor,s[1],s[3],s[4],s[5])}return o}_processUnderline(e,t){t.extended=t.extended.clone(),t.extended.underlineStyle=e=!~e||5<e?1:e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}charAttributes(t){if(1===t.length&&0===t.params[0])this._curAttrData.fg=f.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=f.DEFAULT_ATTR_DATA.bg;else{var i,r=t.length,s=this._curAttrData;for(let e=0;e<r;e++)30<=(i=t.params[e])&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):40<=i&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):90<=i&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):100<=i&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?(s.fg=f.DEFAULT_ATTR_DATA.fg,s.bg=f.DEFAULT_ATTR_DATA.bg):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(t.hasSubParams(e)?t.getSubParams(e)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?e+=this._extractColor(t,e,s):59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i)}return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(d.C0.ESC+"[0n");break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!(this._coreService.decPrivateModes.origin=!1)}setCursorStyle(e){e=e.params[0]||1;switch(e){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}return this._optionsService.options.cursorBlink=e%2==1,!0}setScrollRegion(e){var t=e.params[0]||1;let i;return(i=e.length<2||(i=e.params[1])>this._bufferService.rows||0===i?this._bufferService.rows:i)>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(l(e.params[0],this._optionsService.rawOptions.windowOptions)){var t=1<e.length?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(C.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(C.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),10<this._windowTitleStack.length&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),10<this._iconNameStack.length&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let r=[],t=e.split(";");for(;1<t.length;){let e=t.shift(),i=t.shift();if(/^\d+$/.exec(e)){let t=parseInt(e);if(0<=t&&t<256)if("?"===i)r.push({type:0,index:t});else{let e=(0,s.parseColor)(i);e&&r.push({type:1,index:t,color:e})}}}return r.length&&this._onColor.fire(r),!0}setHyperlink(e){e=e.split(";");return!(e.length<2)&&(e[1]?this._createHyperlink(e[0],e[1]):!e[0]&&this._finishHyperlink())}_createHyperlink(e,t){void 0!==this._currentLinkId&&this._finishHyperlink();e=e.split(":");let i;var r=e.findIndex(e=>e.startsWith("id="));return-1!==r&&(i=e[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!(this._currentLinkId=void 0)}_setOrReportSpecialColor(e,t){var i,r=e.split(";");for(let e=0;e<r.length&&!(t>=this._specialColors.length);++e,++t)"?"===r[e]?this._onColor.fire([{type:0,index:this._specialColors[t]}]):(i=(0,s.parseColor)(r[e]))&&this._onColor.fire([{type:1,index:this._specialColors[t],color:i}]);return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(e){var t,i=[],r=e.split(";");for(let e=0;e<r.length;++e)/^\d+$/.exec(r[e])&&0<=(t=parseInt(r[e]))&&t<256&&i.push({type:2,index:t});i.length&&this._onColor.fire(i)}else this._onColor.fire([{type:2}]);return!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,c.DEFAULT_CHARSET),!0}selectCharset(e){return 2!==e.length?this.selectDefaultCharset():"/"!==e[0]&&this._charsetService.setgCharset(o[e[0]],c.CHARSETS[e[1]]||c.DEFAULT_CHARSET),!0}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0}reverseIndex(){var e;return this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop?(e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop,this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)):(this._activeBuffer.y--,this._restrictCursor()),!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){var t=new p.CellData;t.content=1<<22|"E".charCodeAt(0),t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e<this._bufferService.rows;++e){var i=this._activeBuffer.ybase+this._activeBuffer.y+e,i=this._activeBuffer.lines.get(i);i&&(i.fill(t),i.isWrapped=!1)}return this._dirtyRowService.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){var i=this._bufferService.buffer,r=this._optionsService.rawOptions;return i='"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r",this._coreService.triggerDataEvent(d.C0.ESC+i+d.C0.ESC+"\\"),!0}}t.InputHandler=b},844:(e,t)=>{function i(e){for(var t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(var e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){e=this._disposables.indexOf(e);-1!==e&&this._disposables.splice(e,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},1505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,i,r,s){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(i,r,s)}get(e,t,i,r){return null==(e=this._data.get(e,t))?void 0:e.get(i,r)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=void 0;var i="undefined"==typeof navigator,r=i?"node":navigator.userAgent,i=i?"node":navigator.platform;t.isFirefox=r.includes("Firefox"),t.isLegacyEdge=r.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(r),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(i),t.isIpad="iPad"===i,t.isIphone="iPhone"===i,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(i),t.isLinux=0<=i.indexOf("Linux")},6106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let i=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){0!==this._array.length?(i=this._search(this._getKey(e),0,this._array.length-1),this._array.splice(i,0,e)):this._array.push(e)}delete(e){if(0!==this._array.length){var t=this._getKey(e);if(void 0!==t&&-1!==(i=this._search(t,0,this._array.length-1))&&this._getKey(this._array[i])===t)do{if(this._array[i]===e)return this._array.splice(i,1),!0}while(++i<this._array.length&&this._getKey(this._array[i])===t)}return!1}*getKeyIterator(e){if(0!==this._array.length&&!((i=this._search(e,0,this._array.length-1))<0||i>=this._array.length)&&this._getKey(this._array[i])===e)for(;yield this._array[i],++i<this._array.length&&this._getKey(this._array[i])===e;);}forEachByKey(e,t){if(0!==this._array.length&&!((i=this._search(e,0,this._array.length-1))<0||i>=this._array.length)&&this._getKey(this._array[i])===e)for(;t(this._array[i]),++i<this._array.length&&this._getKey(this._array[i])===e;);}values(){return this._array.values()}_search(e,t,i){if(i<t)return t;let r=Math.floor((t+i)/2);var s=this._getKey(this._array[r]);if(e<s)return this._search(e,t,r-1);if(s<e)return this._search(e,r+1,i);for(;0<r&&this._getKey(this._array[r-1])===e;)r--;return r}}},8273:(e,t)=>{function s(t,i,r=0,s=t.length){if(!(r>=t.length)){s=t.length<=s?t.length:(t.length+s)%t.length;for(let e=r=(t.length+r)%t.length;e<s;++e)t[e]=i}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fillFallback=t.fill=void 0,t.fill=function(e,t,i,r){return e.fill?e.fill(t,i,r):s(e,t,i,r)},t.fillFallback=s,t.concat=function(e,t){var i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},9282:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;let r=i(643);t.updateWindowsModeWrappedState=function(e){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),t=null==t?void 0:t.get(e.cols-1),e=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);e&&t&&(e.isWrapped=t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;t.AttributeData=class r{constructor(){this.fg=0,this.bg=0,this.extended=new i}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){var e=new r;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}};class i{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new i(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=i},9092:(e,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferStringIterator=i.Buffer=i.MAX_BUFFER_SIZE=void 0;let r=t(6349),S=t(8437),s=t(511),n=t(643),m=t(4634),o=t(4863),a=t(7116),h=t(3734);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=s.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),this._whitespaceCell=s.CellData.fromCharData([0,n.WHITESPACE_CELL_CHAR,n.WHITESPACE_CELL_WIDTH,n.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new S.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&e<this._rows}_getCorrectBufferLength(e){var t;return this._hasScrollback?(t=e+this._optionsService.rawOptions.scrollback)>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t:e}fillViewportRows(t){if(0===this.lines.length){void 0===t&&(t=S.DEFAULT_ATTR_DATA);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,r){var s=this.getNullCell(S.DEFAULT_ATTR_DATA),n=this._getCorrectBufferLength(r);if(n>this.lines.maxLength&&(this.lines.maxLength=n),0<this.lines.length){if(this._cols<i)for(let e=0;e<this.lines.length;e++)this.lines.get(e).resize(i,s);let t=0;if(this._rows<r)for(let e=this._rows;e<r;e++)this.lines.length<r+this.ybase&&(!this._optionsService.rawOptions.windowsMode&&0<this.ybase&&this.lines.length<=this.ybase+this.y+t+1?(this.ybase--,t++,0<this.ydisp&&this.ydisp--):this.lines.push(new S.BufferLine(i,s)));else for(let e=this._rows;e>r;e--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(n<this.lines.maxLength){let e=this.lines.length-n;0<e&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=n}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,r-1),t&&(this.y+=t),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(i,r),this._cols>i))for(let e=0;e<this.lines.length;e++)this.lines.get(e).resize(i,s);this._cols=i,this._rows=r}get _isReflowEnabled(){return this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){var i=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));0<i.length&&(i=(0,m.reflowLargerCreateNewLayout)(this.lines,i),(0,m.reflowLargerApplyNewLayout)(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved))}_reflowLargerAdjustViewport(e,t,i){var r=this.getNullCell(S.DEFAULT_ATTR_DATA);let s=i;for(;0<s--;)0===this.ybase?(0<this.y&&this.y--,this.lines.length<t&&this.lines.push(new S.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(o,a){let h=this.getNullCell(S.DEFAULT_ATTR_DATA),l=[],c=0;for(let n=this.lines.length-1;0<=n;n--){let e=this.lines.get(n);if(!(!e||!e.isWrapped&&e.getTrimmedLength()<=o)){for(var _=[e];e.isWrapped&&0<n;)e=this.lines.get(--n),_.unshift(e);var d=this.ybase+this.y;if(!(d>=n&&d<n+_.length)){var d=_[_.length-1].getTrimmedLength(),u=(0,m.reflowSmallerGetNewLineLengths)(_,this._cols,o),f=u.length-_.length,v=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+f):Math.max(0,this.lines.length-this.lines.maxLength+f),g=[];for(let e=0;e<f;e++){let e=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);g.push(e)}0<g.length&&(l.push({start:n+_.length+c,newLines:g}),c+=g.length),_.push(...g);let t=u.length-1,i=u[t],r=(0===i&&(t--,i=u[t]),_.length-f-1),s=d;for(;0<=r;){let e=Math.min(s,i);if(void 0===_[t])break;if(_[t].copyCellsFrom(_[r],s-e,i-e,e,!0),0===(i-=e)&&(t--,i=u[t]),0===(s-=e)){r--;let e=Math.max(r,0);s=(0,m.getWrappedLineTrimmedLength)(_,e,this._cols)}}for(let e=0;e<_.length;e++)u[e]<o&&_[e].setCell(u[e],h);let e=f-v;for(;0<e--;)0===this.ybase?this.y<a-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-a&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+f,this.ybase+a-1)}}}if(0<l.length){let i=[],r=[];for(let e=0;e<this.lines.length;e++)r.push(this.lines.get(e));let e=this.lines.length,s=e-1,n=0,o=l[n],a=(this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c),0);for(let t=Math.min(this.lines.maxLength-1,e+c-1);0<=t;t--)if(o&&o.start>s+a){for(let e=o.newLines.length-1;0<=e;e--)this.lines.set(t--,o.newLines[e]);t++,i.push({index:s+1,amount:o.newLines.length}),a+=o.newLines.length,o=l[++n]}else this.lines.set(t,r[s--]);let t=0;for(let e=i.length-1;0<=e;e--)i[e].index+=t,this.lines.onInsertEmitter.fire(i[e]),t+=i[e].amount;var p=Math.max(0,e+c-this.lines.maxLength);0<p&&this.lines.onTrimEmitter.fire(p)}}stringIndexToBufferIndex(t,i,e=!1){for(;i;){var r=this.lines.get(t);if(!r)return[-1,-1];var s=e?r.getTrimmedLength():r.length;for(let e=0;e<s;++e)if(r.get(e)[n.CHAR_DATA_WIDTH_INDEX]&&(i-=r.get(e)[n.CHAR_DATA_CHAR_INDEX].length||1),i<0)return[t,e];t++}return[t,0]}translateBufferLineToString(e,t,i=0,r){e=this.lines.get(e);return e?e.translateToString(t,i,r):""}getWrappedRangeForLine(e){let t=e,i=e;for(;0<t&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(null==e&&(e=this.x);!this.tabs[--e]&&0<e;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let t=new o.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim(e=>{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}iterator(e,t,i,r,s){return new l(this,e,t,i,r,s)}};class l{constructor(e,t,i=0,r=e.lines.length,s=0,n=0){this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=s,this._endOverscan=n,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._current<this._endIndex}next(){var t=this._buffer.getWrappedRangeForLine(this._current);t.first<this._startIndex-this._startOverscan&&(t.first=this._startIndex-this._startOverscan),t.last>this._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);let i="";for(let e=t.first;e<=t.last;++e)i+=this._buffer.translateBufferLineToString(e,this._trimRight);return this._current=t.last+1,{range:t,content:i}}}i.BufferStringIterator=l},8437:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;let s=i(482),n=i(643),o=i(511),a=i(3734),r=(t.DEFAULT_ATTR_DATA=Object.freeze(new a.AttributeData),{startIndex:0});t.BufferLine=class h{constructor(t,e,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);var r=e||o.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let e=0;e<t;++e)this.setCell(e,r);this.length=t}get(e){var t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:i?(0,s.stringFromCodePoint)(i):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],1<t[n.CHAR_DATA_CHAR_INDEX].length?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,s.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return r.startIndex=3*e,t.content=this._data[r.startIndex+0],t.fg=this._data[r.startIndex+1],t.bg=this._data[r.startIndex+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,i,r,s,n){268435456&s&&(this._extendedAttrs[e]=n),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=r,this._data[3*e+2]=s}addCodepointToCell(e,t){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,s.stringFromCodePoint)(t):(i=2097151&i?(this._combined[e]=(0,s.stringFromCodePoint)(2097151&i)+(0,s.stringFromCodePoint)(t),-2097152&i|2097152):t|1<<22,this._data[3*e+0]=i)}insertCells(i,r,s,e){if((i%=this.length)&&2===this.getWidth(i-1)&&this.setCellFromCodePoint(i-1,0,1,(null==e?void 0:e.fg)||0,(null==e?void 0:e.bg)||0,(null==e?void 0:e.extended)||new a.ExtendedAttrs),r<this.length-i){let t=new o.CellData;for(let e=this.length-i-r-1;0<=e;--e)this.setCell(i+r+e,this.loadCell(i+e,t));for(let e=0;e<r;++e)this.setCell(i+e,s)}else for(let e=i;e<this.length;++e)this.setCell(e,s);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-1,0,1,(null==e?void 0:e.fg)||0,(null==e?void 0:e.bg)||0,(null==e?void 0:e.extended)||new a.ExtendedAttrs)}deleteCells(i,r,s,e){if(i%=this.length,r<this.length-i){let t=new o.CellData;for(let e=0;e<this.length-i-r;++e)this.setCell(i+e,this.loadCell(i+r+e,t));for(let e=this.length-r;e<this.length;++e)this.setCell(e,s)}else for(let e=i;e<this.length;++e)this.setCell(e,s);i&&2===this.getWidth(i-1)&&this.setCellFromCodePoint(i-1,0,1,(null==e?void 0:e.fg)||0,(null==e?void 0:e.bg)||0,(null==e?void 0:e.extended)||new a.ExtendedAttrs),0!==this.getWidth(i)||this.hasContent(i)||this.setCellFromCodePoint(i,0,1,(null==e?void 0:e.fg)||0,(null==e?void 0:e.bg)||0,(null==e?void 0:e.extended)||new a.ExtendedAttrs)}replaceCells(e,t,i,r,s=!1){if(s)for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&!this.isProtected(t)&&this.setCellFromCodePoint(t,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new a.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,i)}resize(t,i){if(t!==this.length){if(t>this.length){var e=new Uint32Array(3*t);this.length&&(3*t<this._data.length?e.set(this._data.subarray(0,3*t)):e.set(this._data)),this._data=e;for(let e=this.length;e<t;++e)this.setCell(e,i)}else if(t){let e=new Uint32Array(3*t);e.set(this._data.subarray(0,3*t)),this._data=e;var r=Object.keys(this._combined);for(let e=0;e<r.length;e++){var s=parseInt(r[e],10);t<=s&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=t}}fill(t,e=!1){if(e)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];for(var i in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){var e,t,i=new h(0);for(e in i._data=new Uint32Array(this._data),i.length=this.length,this._combined)i._combined[e]=this._combined[e];for(t in this._extendedAttrs)i._extendedAttrs[t]=this._extendedAttrs[t];return i.isWrapped=this.isWrapped,i}getTrimmedLength(){for(let e=this.length-1;0<=e;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(i,r,s,e,t){var n=i._data;if(t)for(let t=e-1;0<=t;t--){for(let e=0;e<3;e++)this._data[3*(s+t)+e]=n[3*(r+t)+e];268435456&n[3*(r+t)+2]&&(this._extendedAttrs[s+t]=i._extendedAttrs[r+t])}else for(let t=0;t<e;t++){for(let e=0;e<3;e++)this._data[3*(s+t)+e]=n[3*(r+t)+e];268435456&n[3*(r+t)+2]&&(this._extendedAttrs[s+t]=i._extendedAttrs[r+t])}var o=Object.keys(i._combined);for(let t=0;t<o.length;t++){let e=parseInt(o[t],10);e>=r&&(this._combined[e-r+s]=i._combined[e])}}translateToString(e=!1,i=0,t=this.length){e&&(t=Math.min(t,this.getTrimmedLength()));let r="";for(;i<t;){let e=this._data[3*i+0],t=2097151&e;r+=2097152&e?this._combined[i]:t?(0,s.stringFromCodePoint)(t):n.WHITESPACE_CELL_CHAR,i+=e>>22||1}return r}}},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function u(e,t,i){var r;return t===e.length-1?e[t].getTrimmedLength():(r=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),e=2===e[t+1].getWidth(0),r&&e?i-1:i)}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(r,h,l,s,c){let _=[];for(let i=0;i<r.length-1;i++){let e=i,t=r.get(++e);if(t.isWrapped){for(var d=[r.get(i)];e<r.length&&t.isWrapped;)d.push(t),t=r.get(++e);if(!(s>=i&&s<e)){let s=0,n=u(d,s,h),o=1,a=0;for(;o<d.length;){let e=u(d,o,h),t=e-a,i=l-n,r=Math.min(t,i);d[s].copyCellsFrom(d[o],a,n,r,!1),(n+=r)===l&&(s++,n=0),(a+=r)===e&&(o++,a=0),0===n&&0!==s&&2===d[s-1].getWidth(l-1)&&(d[s].copyCellsFrom(d[s-1],l-1,n++,1,!1),d[s-1].setCell(l-1,c))}d[s].replaceCells(n,l,c);let t=0;for(let e=d.length-1;0<e&&(e>s||0===d[e].getTrimmedLength());e--)t++;0<t&&(_.push(i+d.length-t),_.push(t))}i+=d.length-1}}return _},t.reflowLargerCreateNewLayout=function(i,r){let e=[],s=0,n=r[s],o=0;for(let t=0;t<i.length;t++)if(n===t){let e=r[++s];i.onDeleteEmitter.fire({index:t-o,amount:e}),t+=e-1,o+=e,n=r[++s]}else e.push(t);return{layout:e,countRemoved:o}},t.reflowLargerApplyNewLayout=function(t,i){var r=[];for(let e=0;e<i.length;e++)r.push(t.get(i[e]));for(let e=0;e<r.length;e++)t.set(e,r[e]);t.length=i.length},t.reflowSmallerGetNewLineLengths=function(i,r,e){var t=[],s=i.map((e,t)=>u(i,t,r)).reduce((e,t)=>e+t);let n=0,o=0,a=0;for(;a<s;){if(s-a<e){t.push(s-a);break}n+=e;var h=u(i,o,r),h=(n>h&&(n-=h,o++),2===i[o].getWidth(n-1)),h=(h&&n--,h?e-1:e);t.push(h),a+=h}return t},t.getWrappedLineTrimmedLength=u},5295:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;let r=i(9092),s=i(8460),n=i(844);class o extends n.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new s.EventEmitter),this.reset()}get onBufferActivate(){return this._onBufferActivate.event}reset(){this._normal=new r.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let r=i(482),s=i(643),n=i(3734);class o extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){var t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[s.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;var i,r;2<e[s.CHAR_DATA_CHAR_INDEX].length?t=!0:2===e[s.CHAR_DATA_CHAR_INDEX].length?55296<=(i=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0))&&i<=56319&&56320<=(r=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(1))&&r<=57343?this.content=1024*(i-55296)+r-56320+65536|e[s.CHAR_DATA_WIDTH_INDEX]<<22:t=!0:this.content=e[s.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[s.CHAR_DATA_WIDTH_INDEX]<<22,t&&(this.combinedData=e[s.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[s.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;let r=i(8460),s=i(844);class n extends s.Disposable{constructor(e){super(),this.line=e,this._id=n._nextId++,this.isDisposed=!1,this._onDispose=new r.EventEmitter}get id(){return this._id}get onDispose(){return this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),super.dispose())}}(t.Marker=n)._nextId=1},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(e,t)=>{var i,r;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,(r=i=t.C0||(t.C0={})).NUL="\0",r.SOH="",r.STX="",r.ETX="",r.EOT="",r.ENQ="",r.ACK="",r.BEL="",r.BS="\b",r.HT="\t",r.LF="\n",r.VT="\v",r.FF="\f",r.CR="\r",r.SO="",r.SI="",r.DLE="",r.DC1="",r.DC2="",r.DC3="",r.DC4="",r.NAK="",r.SYN="",r.ETB="",r.CAN="",r.EM="",r.SUB="",r.ESC="",r.FS="",r.GS="",r.RS="",r.US="",r.SP=" ",r.DEL="",(r=t.C1||(t.C1={})).PAD="",r.HOP="",r.BPH="",r.NBH="",r.IND="",r.NEL="
",r.SSA="",r.ESA="",r.HTS="",r.HTJ="",r.VTS="",r.PLD="",r.PLU="",r.RI="",r.SS2="",r.SS3="",r.DCS="",r.PU1="",r.PU2="",r.STS="",r.CCH="",r.MW="",r.SPA="",r.EPA="",r.SOS="",r.SGCI="",r.SCI="",r.CSI="",r.ST="",r.OSC="",r.PM="",r.APC="",(t.C1_ESCAPED||(t.C1_ESCAPED={})).ST=i.ESC+"\\"},7399:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;let o=i(2584),a={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(i,e,t,r){var s={type:0,cancel:!1,key:void 0},n=(i.shiftKey?1:0)|(i.altKey?2:0)|(i.ctrlKey?4:0)|(i.metaKey?8:0);switch(i.keyCode){case 0:"UIKeyInputUpArrow"===i.key?s.key=e?o.C0.ESC+"OA":o.C0.ESC+"[A":"UIKeyInputLeftArrow"===i.key?s.key=e?o.C0.ESC+"OD":o.C0.ESC+"[D":"UIKeyInputRightArrow"===i.key?s.key=e?o.C0.ESC+"OC":o.C0.ESC+"[C":"UIKeyInputDownArrow"===i.key&&(s.key=e?o.C0.ESC+"OB":o.C0.ESC+"[B");break;case 8:i.altKey?s.key=o.C0.ESC+o.C0.DEL:s.key=o.C0.DEL;break;case 9:i.shiftKey?s.key=o.C0.ESC+"[Z":(s.key=o.C0.HT,s.cancel=!0);break;case 13:s.key=i.altKey?o.C0.ESC+o.C0.CR:o.C0.CR,s.cancel=!0;break;case 27:s.key=o.C0.ESC,i.altKey&&(s.key=o.C0.ESC+o.C0.ESC),s.cancel=!0;break;case 37:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"D",s.key===o.C0.ESC+"[1;3D"&&(s.key=o.C0.ESC+(t?"b":"[1;5D"))):s.key=e?o.C0.ESC+"OD":o.C0.ESC+"[D");break;case 39:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"C",s.key===o.C0.ESC+"[1;3C"&&(s.key=o.C0.ESC+(t?"f":"[1;5C"))):s.key=e?o.C0.ESC+"OC":o.C0.ESC+"[C");break;case 38:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"A",t||s.key!==o.C0.ESC+"[1;3A"||(s.key=o.C0.ESC+"[1;5A")):s.key=e?o.C0.ESC+"OA":o.C0.ESC+"[A");break;case 40:i.metaKey||(n?(s.key=o.C0.ESC+"[1;"+(1+n)+"B",t||s.key!==o.C0.ESC+"[1;3B"||(s.key=o.C0.ESC+"[1;5B")):s.key=e?o.C0.ESC+"OB":o.C0.ESC+"[B");break;case 45:i.shiftKey||i.ctrlKey||(s.key=o.C0.ESC+"[2~");break;case 46:s.key=n?o.C0.ESC+"[3;"+(1+n)+"~":o.C0.ESC+"[3~";break;case 36:s.key=n?o.C0.ESC+"[1;"+(1+n)+"H":e?o.C0.ESC+"OH":o.C0.ESC+"[H";break;case 35:s.key=n?o.C0.ESC+"[1;"+(1+n)+"F":e?o.C0.ESC+"OF":o.C0.ESC+"[F";break;case 33:i.shiftKey?s.type=2:i.ctrlKey?s.key=o.C0.ESC+"[5;"+(1+n)+"~":s.key=o.C0.ESC+"[5~";break;case 34:i.shiftKey?s.type=3:i.ctrlKey?s.key=o.C0.ESC+"[6;"+(1+n)+"~":s.key=o.C0.ESC+"[6~";break;case 112:s.key=n?o.C0.ESC+"[1;"+(1+n)+"P":o.C0.ESC+"OP";break;case 113:s.key=n?o.C0.ESC+"[1;"+(1+n)+"Q":o.C0.ESC+"OQ";break;case 114:s.key=n?o.C0.ESC+"[1;"+(1+n)+"R":o.C0.ESC+"OR";break;case 115:s.key=n?o.C0.ESC+"[1;"+(1+n)+"S":o.C0.ESC+"OS";break;case 116:s.key=n?o.C0.ESC+"[15;"+(1+n)+"~":o.C0.ESC+"[15~";break;case 117:s.key=n?o.C0.ESC+"[17;"+(1+n)+"~":o.C0.ESC+"[17~";break;case 118:s.key=n?o.C0.ESC+"[18;"+(1+n)+"~":o.C0.ESC+"[18~";break;case 119:s.key=n?o.C0.ESC+"[19;"+(1+n)+"~":o.C0.ESC+"[19~";break;case 120:s.key=n?o.C0.ESC+"[20;"+(1+n)+"~":o.C0.ESC+"[20~";break;case 121:s.key=n?o.C0.ESC+"[21;"+(1+n)+"~":o.C0.ESC+"[21~";break;case 122:s.key=n?o.C0.ESC+"[23;"+(1+n)+"~":o.C0.ESC+"[23~";break;case 123:s.key=n?o.C0.ESC+"[24;"+(1+n)+"~":o.C0.ESC+"[24~";break;default:if(!i.ctrlKey||i.shiftKey||i.altKey||i.metaKey)if(t&&!r||!i.altKey||i.metaKey)!t||i.altKey||i.ctrlKey||i.shiftKey||!i.metaKey?i.key&&!i.ctrlKey&&!i.altKey&&!i.metaKey&&48<=i.keyCode&&1===i.key.length?s.key=i.key:i.key&&i.ctrlKey&&("_"===i.key&&(s.key=o.C0.US),"@"===i.key)&&(s.key=o.C0.NUL):65===i.keyCode&&(s.type=1);else{let e=a[i.keyCode],t=null==e?void 0:e[i.shiftKey?1:0];if(t)s.key=o.C0.ESC+t;else if(65<=i.keyCode&&i.keyCode<=90){let e=i.ctrlKey?i.keyCode-64:i.keyCode+32,t=String.fromCharCode(e);i.shiftKey&&(t=t.toUpperCase()),s.key=o.C0.ESC+t}else if("Dead"===i.key&&i.code.startsWith("Key")){let e=i.code.slice(3,4);i.shiftKey||(e=e.toLowerCase()),s.key=o.C0.ESC+e,s.cancel=!0}}else 65<=i.keyCode&&i.keyCode<=90?s.key=String.fromCharCode(i.keyCode-64):32===i.keyCode?s.key=o.C0.NUL:51<=i.keyCode&&i.keyCode<=55?s.key=String.fromCharCode(i.keyCode-51+27):56===i.keyCode?s.key=o.C0.DEL:219===i.keyCode?s.key=o.C0.ESC:220===i.keyCode?s.key=o.C0.FS:221===i.keyCode&&(s.key=o.C0.GS)}return s}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return 65535<e?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(i,e=0,r=i.length){let s="";for(let t=e;t<r;++t){let e=i[t];65535<e?(e-=65536,s+=String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):s+=String.fromCharCode(e)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(i,r){let s=i.length;if(!s)return 0;let n=0,o=0;if(this._interim){let e=i.charCodeAt(o++);56320<=e&&e<=57343?r[n++]=1024*(this._interim-55296)+e-56320+65536:(r[n++]=this._interim,r[n++]=e),this._interim=0}for(let t=o;t<s;++t){let e=i.charCodeAt(t);if(55296<=e&&e<=56319){if(++t>=s)return this._interim=e,n;var a=i.charCodeAt(t);56320<=a&&a<=57343?r[n++]=1024*(e-55296)+a-56320+65536:(r[n++]=e,r[n++]=a)}else 65279!==e&&(r[n++]=e)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,a){var h=o.length;if(!h)return 0;let e,t,i,r,l=0,s=0,c=0;if(this.interim[0]){let e=!1,t=this.interim[0];t&=192==(224&t)?31:224==(240&t)?15:7;let i,r=0;for(;(i=63&this.interim[++r])&&r<4;)t=(t<<=6)|i;let s=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,n=s-r;for(;c<n;){if(c>=h)return 0;if(128!=(192&(i=o[c++]))){c--,e=!0;break}this.interim[r++]=i,t=(t<<=6)|63&i}e||(2==s?t<128?c--:a[l++]=t:3==s?t<2048||55296<=t&&t<=57343||65279===t||(a[l++]=t):t<65536||1114111<t||(a[l++]=t)),this.interim.fill(0)}let n=h-4,_=c;for(;_<h;){for(;!(!(_<n)||128&(e=o[_])||128&(t=o[_+1])||128&(i=o[_+2])||128&(r=o[_+3]));)a[l++]=e,a[l++]=t,a[l++]=i,a[l++]=r,_+=4;if((e=o[_++])<128)a[l++]=e;else if(192==(224&e)){if(_>=h)return this.interim[0]=e,l;128!=(192&(t=o[_++]))?_--:(s=(31&e)<<6|63&t)<128?_--:a[l++]=s}else if(224==(240&e)){if(_>=h)return this.interim[0]=e,l;if(128!=(192&(t=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,l;128!=(192&(i=o[_++]))?_--:(s=(15&e)<<12|(63&t)<<6|63&i)<2048||55296<=s&&s<=57343||65279===s||(a[l++]=s)}}else if(240==(248&e)){if(_>=h)return this.interim[0]=e,l;if(128!=(192&(t=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,l;if(128!=(192&(i=o[_++])))_--;else{if(_>=h)return this.interim[0]=e,this.interim[1]=t,this.interim[2]=i,l;128!=(192&(r=o[_++]))?_--:(s=(7&e)<<18|(63&t)<<12|(63&i)<<6|63&r)<65536||1114111<s||(a[l++]=s)}}}}return l}}},225:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;let r=i(8273),s=[[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]],n=[[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]],o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),(0,r.fill)(o,1),(o[0]=0,r.fill)(o,0,1,32),(0,r.fill)(o,0,127,160),(0,r.fill)(o,2,4352,4448),o[9001]=2,o[9002]=2,(0,r.fill)(o,2,11904,42192),o[12351]=1,(0,r.fill)(o,2,44032,55204),(0,r.fill)(o,2,63744,64256),(0,r.fill)(o,2,65040,65050),(0,r.fill)(o,2,65072,65136),(0,r.fill)(o,2,65280,65377),(0,r.fill)(o,2,65504,65511);for(let e=0;e<s.length;++e)(0,r.fill)(o,0,s[e][0],s[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:((e,t)=>{let i,r=0,s=t.length-1;if(!(e<t[0][0]||e>t[s][1]))for(;s>=r;)if(e>t[i=r+s>>1][1])r=1+i;else{if(!(e<t[i][0]))return 1;s=i-1}})(e,n)?0:131072<=e&&e<=196605||196608<=e&&e<=262141?2:1}}},5981:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;let r=i(8460),n="undefined"==typeof queueMicrotask?e=>{Promise.resolve().then(e)}:queueMicrotask;t.WriteBuffer=class{constructor(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new r.EventEmitter}get onWriteParsed(){return this._onWriteParsed.event}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)this._syncCalls=0;else if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){var i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}}write(e,t){if(5e7<this._pendingData)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(()=>this._innerWrite())),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,i=!0){let r=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],t=this._action(e,i);if(t){let e=e=>12<=Date.now()-r?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(r,e);return void t.catch(e=>(n(()=>{throw e}),Promise.resolve(!1))).then(e)}var s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=e.length,12<=Date.now()-r)break}this._writeBuffer.length>this._bufferOffset?(50<this._bufferOffset&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;let i=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,n=/^[\da-f]+$/;function s(e,t){var i=e.toString(16),r=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}t.parseColor=function(e){if(e){let r=e.toLowerCase();if(0===r.indexOf("rgb:")){r=r.slice(4);let t=i.exec(r);if(t){let e=t[1]?15:t[4]?255:t[7]?4095:65535;return[Math.round(parseInt(t[1]||t[4]||t[7]||t[10],16)/e*255),Math.round(parseInt(t[2]||t[5]||t[8]||t[11],16)/e*255),Math.round(parseInt(t[3]||t[6]||t[9]||t[12],16)/e*255)]}}else if(0===r.indexOf("#")&&(r=r.slice(1),n.exec(r))&&[3,6,9,12].includes(r.length)){let t=r.length/3,i=[0,0,0];for(let e=0;e<3;++e){var s=parseInt(r.slice(t*e,t*e+t),16);i[e]=1==t?s<<4:2==t?s:3==t?s>>4:s>>8}return i}}},t.toRgbString=function(e,t=16){var[e,i,r]=e;return`rgb:${s(e,t)}/${s(i,t)}/`+s(r,t)}},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;let s=i(482),r=i(8742),n=i(5770),o=[],a=(t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;0<=e;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(t,i,r){if(this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].put(t,i,r);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(t,i,r))}unhook(r,s=!0){if(this._active.length){let e=!1,t=this._active.length-1,i=!1;if(this._stack.paused&&(t=this._stack.loopPosition-1,e=s,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===e){for(;0<=t&&!0!==(e=this._active[t].unhook(r));t--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!1,e;t--}for(;0<=t;t--)if((e=this._active[t].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",r);this._active=o,this._ident=0}},new r.Params);a.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=a,this._hitLimit=!1}hook(e){this._params=1<e.length||e.params[0]?e.clone():a,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params))instanceof Promise)return t.then(e=>(this._params=a,this._data="",this._hitLimit=!1,e));return this._params=a,this._data="",this._hitLimit=!1,t}}},2015:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;let r=i(844),s=i(8273),n=i(8742),o=i(6242),a=i(6351);class h{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){(0,s.fill)(this.table,e<<4|t)}add(e,t,i,r){this.table[t<<8|e]=i<<4|r}addMany(t,i,r,s){for(let e=0;e<t.length;e++)this.table[i<<8|t[e]]=r<<4|s}}t.TransitionTable=h;let _=160;t.VT500_TRANSITION_TABLE=(()=>{let e=new h(4095),i=Array.apply(null,Array(256)).map((e,t)=>t),t=(e,t)=>i.slice(e,t),r=t(32,127),s=t(0,24);s.push(25),s.push.apply(s,t(28,32));var n=t(0,14);let o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),n)e.addMany([24,26,153,154],o,3,0),e.addMany(t(128,144),o,3,0),e.addMany(t(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(t(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(t(64,127),3,7,0),e.addMany(t(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(t(48,60),4,8,4),e.addMany(t(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(t(32,64),6,0,6),e.add(127,6,0,6),e.addMany(t(64,127),6,0,0),e.addMany(t(32,48),3,9,5),e.addMany(t(32,48),5,9,5),e.addMany(t(48,64),5,0,6),e.addMany(t(64,127),5,7,0),e.addMany(t(32,48),4,9,5),e.addMany(t(32,48),1,9,2),e.addMany(t(32,48),2,9,2),e.addMany(t(48,127),2,10,0),e.addMany(t(48,80),1,10,0),e.addMany(t(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(t(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(t(28,32),9,0,9),e.addMany(t(32,48),9,9,12),e.addMany(t(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(t(32,128),11,0,11),e.addMany(t(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(t(28,32),10,0,10),e.addMany(t(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(t(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(t(28,32),12,0,12),e.addMany(t(32,48),12,9,12),e.addMany(t(48,64),12,0,11),e.addMany(t(64,127),12,12,13),e.addMany(t(64,127),10,12,13),e.addMany(t(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(_,0,2,0),e.add(_,8,5,8),e.add(_,6,0,6),e.add(_,11,0,11),e.add(_,13,13,13),e})();class l extends r.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new n.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser=new o.OscParser,this._dcsParser=new a.DcsParser,this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(i,e=[64,126]){let r=0;if(i.prefix){if(1<i.prefix.length)throw new Error("only one byte as prefix supported");if((r=i.prefix.charCodeAt(0))&&r<60||63<r)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(i.intermediates){if(2<i.intermediates.length)throw new Error("only two bytes as intermediates are supported");for(let t=0;t<i.intermediates.length;++t){let e=i.intermediates.charCodeAt(t);if(e<32||47<e)throw new Error("intermediate must be in range 0x20 .. 0x2f");r=r<<8|e}}if(1!==i.final.length)throw new Error("final must be a single byte");let t=i.final.charCodeAt(0);if(e[0]>t||t>e[1])throw new Error(`final must be in range ${e[0]} .. `+e[1]);return r=(r<<=8)|t}identToString(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}dispose(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){e=this._identifier(e,[48,126]);void 0===this._escHandlers[e]&&(this._escHandlers[e]=[]);let i=this._escHandlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){e=this._identifier(e);void 0===this._csiHandlers[e]&&(this._csiHandlers[e]=[]);let i=this._csiHandlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,(this.precedingCodepoint=0)!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(s,n,i){let o,a=0,h=0,l=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let e=this._parseStack.handlers,t=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&-1<t)for(;0<=t&&!0!==(o=e[t](this._params));t--)if(o instanceof Promise)return this._parseStack.handlerPos=t,o;this._parseStack.handlers=[];break;case 4:if(!1===i&&-1<t)for(;0<=t&&!0!==(o=e[t]());t--)if(o instanceof Promise)return this._parseStack.handlerPos=t,o;this._parseStack.handlers=[];break;case 6:if(a=s[this._parseStack.chunkPos],o=this._dcsParser.unhook(24!==a&&26!==a,i))return o;27===a&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(a=s[this._parseStack.chunkPos],o=this._oscParser.end(24!==a&&26!==a,i))return o;27===a&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let r=l;r<n;++r){switch(a=s[r],(h=this._transitions.table[this.currentState<<8|(a<160?a:_)])>>4){case 2:for(let e=r+1;;++e){if(e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}if(++e>=n||(a=s[e])<32||126<a&&a<_){this._printHandler(s,r,e),r=e-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:r,code:a,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let e=this._csiHandlers[this._collect<<8|a],t=e?e.length-1:-1;for(;0<=t&&!0!==(o=e[t](this._params));t--)if(o instanceof Promise)return this._preserveStack(3,e,t,h,r),o;t<0&&this._csiHandlerFb(this._collect<<8|a,this._params),this.precedingCodepoint=0;break;case 8:do{switch(a){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(a-48)}}while(++r<n&&47<(a=s[r])&&a<60);r--;break;case 9:this._collect<<=8,this._collect|=a;break;case 10:var c=this._escHandlers[this._collect<<8|a];let i=c?c.length-1:-1;for(;0<=i&&!0!==(o=c[i]());i--)if(o instanceof Promise)return this._preserveStack(4,c,i,h,r),o;i<0&&this._escHandlerFb(this._collect<<8|a),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|a,this._params);break;case 13:for(let e=r+1;;++e)if(e>=n||24===(a=s[e])||26===a||27===a||127<a&&a<_){this._dcsParser.put(s,r,e),r=e-1;break}break;case 14:if(o=this._dcsParser.unhook(24!==a&&26!==a))return this._preserveStack(6,[],0,h,r),o;27===a&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let e=r+1;;e++)if(e>=n||(a=s[e])<32||127<a&&a<_){this._oscParser.put(s,r,e),r=e-1;break}break;case 6:if(o=this._oscParser.end(24!==a&&26!==a))return this._preserveStack(5,[],0,h,r),o;27===a&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&h}}}t.EscapeSequenceParser=l},6242:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;let r=i(5770),s=i(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;0<=e;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(t,i,r){if(this._active.length)for(let e=this._active.length-1;0<=e;e--)this._active[e].put(t,i,r);else this._handlerFb(this._id,"PUT",(0,s.utf32ToString)(t,i,r))}start(){this.reset(),this._state=1}put(t,i,e){if(3!==this._state){if(1===this._state)for(;i<e;){let e=t[i++];if(59===e){this._state=2,this._start();break}if(e<48||57<e)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+e-48}2===this._state&&0<e-i&&this._put(t,i,e)}}end(r,s=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let e=!1,t=this._active.length-1,i=!1;if(this._stack.paused&&(t=this._stack.loopPosition-1,e=s,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===e){for(;0<=t&&!0!==(e=this._active[t].end(r));t--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!1,e;t--}for(;0<=t;t--)if((e=this._active[t].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=t,this._stack.fallThrough=!0,e}else this._handlerFb(this._id,"END",r);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>r.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data))instanceof Promise)return t.then(e=>(this._data="",this._hitLimit=!1,e));return this._data="",this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;let s=2147483647;class n{constructor(e=32,t=32){if(this.maxLength=e,256<(this.maxSubParamsLength=t))throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(i){var r=new n;if(i.length)for(let e=Array.isArray(i[0])?1:0;e<i.length;++e){let t=i[e];if(Array.isArray(t))for(let e=0;e<t.length;++e)r.addSubParam(t[e]);else r.addParam(t)}return r}clone(){var e=new n(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){var t=[];for(let e=0;e<this.length;++e){t.push(this.params[e]);var i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];0<r-i&&t.push(Array.prototype.slice.call(this._subParams,i,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>s?s:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>s?s:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return 0<(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)}getSubParams(e){var t=this._subParamsIdx[e]>>8,e=255&this._subParamsIdx[e];return 0<e-t?this._subParams.subarray(t,e):null}getSubParamsAll(){var t={};for(let e=0;e<this.length;++e){var i=this._subParamsIdx[e]>>8,r=255&this._subParamsIdx[e];0<r-i&&(t[e]=this._subParams.slice(i,r))}return t}addDigit(e){let t;var i,r;this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits||(r=(i=this._digitIsSub?this._subParams:this.params)[t-1],i[t-1]=~r?Math.min(10*r+e,s):e)}}t.Params=n},5741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;0<=e;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(i){if(!i.isDisposed){let t=-1;for(let e=0;e<this._addons.length;e++)if(this._addons[e]===i){t=e;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");i.isDisposed=!0,i.dispose.apply(i.instance),this._addons.splice(t,1)}}}},8771:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;let r=i(3785),s=i(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){e=this._buffer.lines.get(e);if(e)return new r.BufferLineApiView(e)}getNullCell(){return new s.CellData}}},3785:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;let r=i(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},8285:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;let r=i(8771),s=i(8460);t.BufferNamespaceApi=class{constructor(e){this._core=e,this._onBufferChange=new s.EventEmitter,this._normal=new r.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new r.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get onBufferChange(){return this._onBufferChange.event}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},7975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,i){return this._core.registerDcsHandler(e,(e,t)=>i(e,t.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;let n=i(2585),o=i(5295),a=i(8460),h=i(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;i=class extends h.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=new a.EventEmitter,this._onScroll=new a.EventEmitter,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=new o.BufferSet(e,this)}get onResize(){return this._onResize.event}get onScroll(){return this._onScroll.event}get buffer(){return this.buffers.active}dispose(){super.dispose(),this.buffers.dispose()}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){var i=this.buffer;let r;(r=this._cachedBlankLine)&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=i.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;var t=i.ybase+i.scrollTop,s=i.ybase+i.scrollBottom;if(0===i.scrollTop){let e=i.lines.isFull;s===i.lines.length-1?e?i.lines.recycle().copyFrom(r):i.lines.push(r.clone()):i.lines.splice(s+1,0,r.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let e=s-t+1;i.lines.shiftElements(t+1,e-1,-1),i.lines.set(s,r.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t,i){var r=this.buffer;if(e<0){if(0===r.ydisp)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);var s=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),s===r.ydisp||t||this._onScroll.fire(r.ydisp)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){e-=this.buffer.ydisp;0!=e&&this.scrollLines(e)}},i=r([s(0,n.IOptionsService)],i);t.BufferService=i},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;let n=i(2585),o=i(8460),a={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,!(e.shift=!1))},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function h(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?i=(i|=64)|e.action:(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}let l=String.fromCharCode,c={DEFAULT:e=>{e=[h(e,!1)+32,e.col+32,e.row+32];return 255<e[0]||255<e[1]||255<e[2]?"":"[M"+l(e[0])+l(e[1])+l(e[2])},SGR:e=>{var t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.col};`+e.row+t},SGR_PIXELS:e=>{var t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.x};`+e.y+t}};i=class{constructor(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new o.EventEmitter,this._lastEvent=null;for(let e of Object.keys(a))this.addProtocol(e,a[e]);for(let e of Object.keys(c))this.addEncoding(e,c[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}get onProtocolChange(){return this._onProtocolChange.event}triggerMouseEvent(e){var t;return!(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||4===e.button&&32===e.action||3===e.button&&32!==e.action||4!==e.button&&(2===e.action||3===e.action)||(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))||!this._protocols[this._activeProtocol].restrict(e)||((t=this._encodings[this._activeEncoding](e))&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,0))}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(e.row!==t.row)return!1}return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}},i=r([s(0,n.IBufferService),s(1,n.ICoreService)],i);t.CoreMouseService=i},6975:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;let n=i(2585),o=i(8460),a=i(1439),h=i(844),l=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});i=class extends h.Disposable{constructor(e,t,i,r){super(),this._bufferService=t,this._logService=i,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this._onUserInput=this.register(new o.EventEmitter),this._onBinary=this.register(new o.EventEmitter),this._scrollToBottom=e,this.register({dispose:()=>this._scrollToBottom=void 0}),this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(c)}get onData(){return this._onData.event}get onUserInput(){return this._onUserInput.event}get onBinary(){return this._onBinary.event}reset(){this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(c)}triggerDataEvent(e,t=!1){var i;this._optionsService.rawOptions.disableStdin||((i=this._bufferService.buffer).ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(e=>e.charCodeAt(0))),this._onData.fire(e))}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}},i=r([s(1,n.IBufferService),s(2,n.ILogService),s(3,n.IOptionsService)],i);t.CoreService=i},9074:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;let r=i(8055),s=i(8460),n=i(844),o=i(6106),a={xmin:0,xmax:0};class h extends n.Disposable{constructor(){super(...arguments),this._decorations=new o.SortedList(e=>null==e?void 0:e.marker.line),this._onDecorationRegistered=this.register(new s.EventEmitter),this._onDecorationRemoved=this.register(new s.EventEmitter)}get onDecorationRegistered(){return this._onDecorationRegistered.event}get onDecorationRemoved(){return this._onDecorationRemoved.event}get decorations(){return this._decorations.values()}registerDecoration(e){if(!e.marker.isDisposed){let t=new l(e);if(t){let e=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}}reset(){for(var e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){var r,s,n;for(n of this._decorations.getKeyIterator(t))r=null!=(r=n.options.x)?r:0,s=r+(null!=(s=n.options.width)?s:1),r<=e&&e<s&&(!i||(null!=(r=n.options.layer)?r:"bottom")===i)&&(yield n)}forEachDecorationAtCell(i,e,r,s){this._decorations.forEachByKey(e,e=>{var t;a.xmin=null!=(t=e.options.x)?t:0,a.xmax=a.xmin+(null!=(t=e.options.width)?t:1),i>=a.xmin&&i<a.xmax&&(!r||(null!=(t=e.options.layer)?t:"bottom")===r)&&s(e)})}dispose(){for(var e of this._decorations.values())this._onDecorationRemoved.fire(e);this.reset()}}t.DecorationService=h;class l extends n.Disposable{constructor(e){super(),this.options=e,this.isDisposed=!1,this.onRenderEmitter=this.register(new s.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new s.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=r.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=r.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._isDisposed||(this._isDisposed=!0,this._onDispose.fire(),super.dispose())}}},3730:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}},i=(Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0,i(2585)),n=class{constructor(e){this._bufferService=e,this.clearRange()}get start(){return this._start}get end(){return this._end}clearRange(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y}markDirty(e){e<this._start?this._start=e:e>this._end&&(this._end=e)}markRangeDirty(e,t){var i;t<e&&(i=e,e=t,t=i),e<this._start&&(this._start=e),t>this._end&&(this._end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}},n=r([s(0,i.IBufferService)],n);t.DirtyRowService=n},4348:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;let r=i(2585),n=i(8343);class s{constructor(...e){this._entries=new Map;for(var[t,i]of e)this.set(t,i)}set(e,t){var i=this._entries.get(e);return this._entries.set(e,t),i}forEach(i){this._entries.forEach((e,t)=>i(t,e))}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=s,t.InstantiationService=class{constructor(){this._services=new s,this._services.set(r.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(i,...e){let r=(0,n.getServiceDependencies)(i).sort((e,t)=>e.index-t.index),s=[];for(let t of r){let e=this._services.get(t.id);if(!e)throw new Error(`[createInstance] ${i.name} depends on UNKNOWN service ${t.id}.`);s.push(e)}var t=0<r.length?r[0].index:e.length;if(e.length!==t)throw new Error(`[createInstance] First service dependency of ${i.name} at position ${t+1} conflicts with ${e.length} static arguments`);return new i(...e,...s)}}},7866:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0;let n=i(2585),o={debug:n.LogLevelEnum.DEBUG,info:n.LogLevelEnum.INFO,warn:n.LogLevelEnum.WARN,error:n.LogLevelEnum.ERROR,off:n.LogLevelEnum.OFF};i=class{constructor(e){this._optionsService=e,this.logLevel=n.LogLevelEnum.OFF,this._updateLogLevel(),this._optionsService.onOptionChange(e=>{"logLevel"===e&&this._updateLogLevel()})}_updateLogLevel(){this.logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)"function"==typeof t[e]&&(t[e]=t[e]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,"xterm.js: "+t,...i)}debug(e,...t){this.logLevel<=n.LogLevelEnum.DEBUG&&this._log(console.log,e,t)}info(e,...t){this.logLevel<=n.LogLevelEnum.INFO&&this._log(console.info,e,t)}warn(e,...t){this.logLevel<=n.LogLevelEnum.WARN&&this._log(console.warn,e,t)}error(e,...t){this.logLevel<=n.LogLevelEnum.ERROR&&this._log(console.error,e,t)}},i=r([s(0,n.IOptionsService)],i);t.LogService=i},7302:(e,s,t)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;let n=t(8460),i=t(6114),r=(s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:i.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0},["normal","bold","100","200","300","400","500","600","700","800","900"]);s.OptionsService=class{constructor(i){this._onOptionChange=new n.EventEmitter;var r=Object.assign({},s.DEFAULT_OPTIONS);for(let t in i)if(t in r)try{let e=i[t];r[t]=this._sanitizeAndValidateOption(t,e)}catch(i){console.error(i)}this.rawOptions=r,this.options=Object.assign({},r),this._setupOptions()}get onOptionChange(){return this._onOptionChange.event}_setupOptions(){var t=e=>{if(e in s.DEFAULT_OPTIONS)return this.rawOptions[e];throw new Error(`No option with key "${e}"`)},i=(e,t)=>{if(!(e in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let e in this.rawOptions){var r={get:t.bind(this,e),set:i.bind(this,e)};Object.defineProperty(this.options,e,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if("block"!==(t=t||s.DEFAULT_OPTIONS[e])&&"underline"!==t&&"bar"!==t)throw new Error(`"${t}" is not a valid value for `+e);break;case"wordSeparator":t=t||s.DEFAULT_OPTIONS[e];break;case"fontWeight":case"fontWeightBold":"number"==typeof t&&1<=t&&t<=1e3||(t=r.includes(t)?t:s.DEFAULT_OPTIONS[e]);break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(e+" cannot be less than 1, value: "+t);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(e+" cannot be less than 0, value: "+t);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(e+" cannot be less than or equal to 0, value: "+t);case"rows":case"cols":if(!t&&0!==t)throw new Error(e+" must be numeric, value: "+t)}return t}}},2660:function(e,t,i){var r=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,o=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(s=e[a])&&(o=(n<3?s(o):3<n?s(t,i,o):s(t,i))||o);return 3<n&&o&&Object.defineProperty(t,i,o),o},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}},i=(Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0,i(2585)),n=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(i){var r=this._bufferService.buffer;if(void 0===i.id){let e=r.addMarker(r.ybase+r.y),t={data:i,id:this._nextId++,lines:[e]};return e.onDispose(()=>this._removeMarkerFromLink(t,e)),this._dataByLinkId.set(t.id,t),t.id}let e=i,t=this._getEntryIdKey(e),s=this._entriesWithId.get(t);if(s)return this.addLineToLink(s.id,r.ybase+r.y),s.id;let n=r.addMarker(r.ybase+r.y),o={id:this._nextId++,key:this._getEntryIdKey(e),data:e,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(i,e))}}getLinkData(e){return null==(e=this._dataByLinkId.get(e))?void 0:e.data}_getEntryIdKey(e){return e.id+";;"+e.uri}_removeMarkerFromLink(e,t){t=e.lines.indexOf(t);-1!==t&&(e.lines.splice(t,1),0===e.lines.length)&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id))}},n=r([s(0,i.IBufferService)],n);t.OscLinkService=n},8343:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);function s(e,t,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");var r;r=s,i=i,(e=e).di$target===e?e.di$dependencies.push({id:r,index:i}):(e.di$dependencies=[{id:r,index:i}],e.di$target=e)}return s.toString=()=>e,t.serviceRegistry.set(e,s),s}},2585:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;var r,i=i(8343);t.IBufferService=(0,i.createDecorator)("BufferService"),t.ICoreMouseService=(0,i.createDecorator)("CoreMouseService"),t.ICoreService=(0,i.createDecorator)("CoreService"),t.ICharsetService=(0,i.createDecorator)("CharsetService"),t.IDirtyRowService=(0,i.createDecorator)("DirtyRowService"),t.IInstantiationService=(0,i.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,i.createDecorator)("LogService"),t.IOptionsService=(0,i.createDecorator)("OptionsService"),t.IOscLinkService=(0,i.createDecorator)("OscLinkService"),t.IUnicodeService=(0,i.createDecorator)("UnicodeService"),t.IDecorationService=(0,i.createDecorator)("DecorationService")},1480:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;let r=i(8460),s=i(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new r.EventEmitter;var e=new s.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}get onChange(){return this._onChange.event}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(i){let r=0;var s=i.length;for(let t=0;t<s;++t){let e=i.charCodeAt(t);if(55296<=e&&e<=56319){if(++t>=s)return r+this.wcwidth(e);var n=i.charCodeAt(t);56320<=n&&n<=57343?e=1024*(e-55296)+n-56320+65536:r+=this.wcwidth(n)}r+=this.wcwidth(e)}return r}}}},r={};function a(e){var t=r[e];return void 0!==t||(t=r[e]={exports:{}},i[e].call(t.exports,t,t.exports,a)),t.exports}var h={};{var l=h;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;let t=a(3236),e=a(9042),i=a(7975),r=a(7090),s=a(5741),n=a(8285),o=["cols","rows"];l.Terminal=class{constructor(e){this._core=new t.Terminal(e),this._addonManager=new s.AddonManager,this._publicOptions=Object.assign({},this._core.options);var i=e=>this._core.options[e],r=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let t in this._core.options){let e={get:i.bind(this,t),set:r.bind(this,t)};Object.defineProperty(this._publicOptions,t,e)}}_checkReadonlyOptions(e){if(o.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._checkProposedApi(),this._parser||(this._parser=new i.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new r.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=new n.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){var e=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(var t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._checkProposedApi(),this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.addMarker(e)}registerDecoration(e){var t;return this._checkProposedApi(),this._verifyPositiveIntegers(null!=(t=e.x)?t:0,null!=(t=e.width)?t:0,null!=(t=e.height)?t:0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){return this._addonManager.loadAddon(this,e)}static get strings(){return e}_verifyIntegers(...e){for(var t of e)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(var t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}}return h})
\ No newline at end of file
1
+!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(self,(function(){return(()=>{"use strict";var e={4567:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const s=i(9042),r=i(6114),n=i(9924),o=i(3656),a=i(844),h=i(5596),c=i(9631);class l extends a.Disposable{constructor(e,t){super(),this._terminal=e,this._renderService=t,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityTreeRoot=document.createElement("div"),this._accessibilityTreeRoot.classList.add("xterm-accessibility"),this._accessibilityTreeRoot.tabIndex=0,this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._onBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._onBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityTreeRoot.appendChild(this._rowContainer),this._renderRowsDebouncer=new n.TimeBasedDebouncer(this._renderRows.bind(this)),this._refreshRows(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityTreeRoot.appendChild(this._liveRegion),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityTreeRoot),this.register(this._renderRowsDebouncer),this.register(this._terminal.onResize((e=>this._onResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._onChar(e)))),this.register(this._terminal.onLineFeed((()=>this._onChar("\n")))),this.register(this._terminal.onA11yTab((e=>this._onTab(e)))),this.register(this._terminal.onKey((e=>this._onKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this._screenDprMonitor=new h.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener((()=>this._refreshRowsDimensions())),this.register((0,o.addDisposableDomListener)(window,"resize",(()=>this._refreshRowsDimensions())))}dispose(){super.dispose(),(0,c.removeElementFromParent)(this._accessibilityTreeRoot),this._rowElements.length=0}_onBoundaryFocus(e,t){const i=e.target,s=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")===(0===t?"1":`${this._terminal.buffer.lines.length}`))return;if(e.relatedTarget!==s)return;let r,n;if(0===t?(r=i,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=i,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){const e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{const e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_onResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_onTab(e){for(let t=0;t<e;t++)this._onChar(" ")}_onChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=s.tooMuchOutput)),r.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((()=>{this._accessibilityTreeRoot.appendChild(this._liveRegion)}),0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,r.isMac&&(0,c.removeElementFromParent)(this._liveRegion)}_onKey(e){this._clearLiveRegion(),this._charsToConsume.push(e)}_refreshRows(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){const e=i.translateBufferLineToString(i.ydisp+r,!0),t=(i.ydisp+r+1).toString(),n=this._rowElements[r];n&&(0===e.length?n.innerText=" ":n.textContent=e,n.setAttribute("aria-posinset",t),n.setAttribute("aria-setsize",s))}this._announceCharacters()}_refreshRowsDimensions(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.actualCellHeight}px`}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}}t.AccessibilityManager=l},3614:(e,t)=>{function i(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function r(e,t,r){e=s(e=i(e),r.decPrivateModes.bracketedPasteMode),r.triggerDataEvent(e,!0),t.value=""}function n(e,t,i){const s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=i,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i){e.stopPropagation(),e.clipboardData&&r(e.clipboardData.getData("text/plain"),t,i)},t.paste=r,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(e,t,i,s,r){n(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}},7239:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const s=i(1505);t.ColorContrastCache=class{constructor(){this._color=new s.TwoKeyMap,this._css=new s.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},5680:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorManager=t.DEFAULT_ANSI_COLORS=void 0;const s=i(8055),r=i(7239),n=s.css.toColor("#ffffff"),o=s.css.toColor("#000000"),a=s.css.toColor("#ffffff"),h=s.css.toColor("#000000"),c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const e=[s.css.toColor("#2e3436"),s.css.toColor("#cc0000"),s.css.toColor("#4e9a06"),s.css.toColor("#c4a000"),s.css.toColor("#3465a4"),s.css.toColor("#75507b"),s.css.toColor("#06989a"),s.css.toColor("#d3d7cf"),s.css.toColor("#555753"),s.css.toColor("#ef2929"),s.css.toColor("#8ae234"),s.css.toColor("#fce94f"),s.css.toColor("#729fcf"),s.css.toColor("#ad7fa8"),s.css.toColor("#34e2e2"),s.css.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){const r=t[i/36%6|0],n=t[i/6%6|0],o=t[i%6];e.push({css:s.channels.toCss(r,n,o),rgba:s.channels.toRgba(r,n,o)})}for(let t=0;t<24;t++){const i=8+10*t;e.push({css:s.channels.toCss(i,i,i),rgba:s.channels.toRgba(i,i,i)})}return e})()),t.ColorManager=class{constructor(e,i){this.allowTransparency=i;const l=e.createElement("canvas");l.width=1,l.height=1;const d=l.getContext("2d");if(!d)throw new Error("Could not get rendering context");this._ctx=d,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new r.ColorContrastCache,this.colors={foreground:n,background:o,cursor:a,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:c,selectionBackgroundOpaque:s.color.blend(o,c),selectionInactiveBackgroundTransparent:c,selectionInactiveBackgroundOpaque:s.color.blend(o,c),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}onOptionsChange(e,t){switch(e){case"minimumContrastRatio":this._contrastCache.clear();break;case"allowTransparency":this.allowTransparency=t}}setTheme(e={}){this.colors.foreground=this._parseColor(e.foreground,n),this.colors.background=this._parseColor(e.background,o),this.colors.cursor=this._parseColor(e.cursor,a,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,h,!0),this.colors.selectionBackgroundTransparent=this._parseColor(e.selectionBackground,c,!0),this.colors.selectionBackgroundOpaque=s.color.blend(this.colors.background,this.colors.selectionBackgroundTransparent),this.colors.selectionInactiveBackgroundTransparent=this._parseColor(e.selectionInactiveBackground,this.colors.selectionBackgroundTransparent,!0),this.colors.selectionInactiveBackgroundOpaque=s.color.blend(this.colors.background,this.colors.selectionInactiveBackgroundTransparent);const i={css:"",rgba:0};if(this.colors.selectionForeground=e.selectionForeground?this._parseColor(e.selectionForeground,i):void 0,this.colors.selectionForeground===i&&(this.colors.selectionForeground=void 0),s.color.isOpaque(this.colors.selectionBackgroundTransparent)){const e=.3;this.colors.selectionBackgroundTransparent=s.color.opacity(this.colors.selectionBackgroundTransparent,e)}if(s.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent)){const e=.3;this.colors.selectionInactiveBackgroundTransparent=s.color.opacity(this.colors.selectionInactiveBackgroundTransparent,e)}if(this.colors.ansi=t.DEFAULT_ANSI_COLORS.slice(),this.colors.ansi[0]=this._parseColor(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){const i=Math.min(this.colors.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)this.colors.ansi[s+16]=this._parseColor(e.extendedAnsi[s],t.DEFAULT_ANSI_COLORS[s+16])}this._contrastCache.clear(),this._updateRestoreColors()}restoreColor(e){if(void 0!==e)switch(e){case 256:this.colors.foreground=this._restoreColors.foreground;break;case 257:this.colors.background=this._restoreColors.background;break;case 258:this.colors.cursor=this._restoreColors.cursor;break;default:this.colors.ansi[e]=this._restoreColors.ansi[e]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this.colors.ansi[e]=this._restoreColors.ansi[e]}_updateRestoreColors(){this._restoreColors={foreground:this.colors.foreground,background:this.colors.background,cursor:this.colors.cursor,ansi:this.colors.ansi.slice()}}_parseColor(e,t,i=this.allowTransparency){if(void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn(`Color: ${e} is invalid using fallback ${t.css}`),t;this._ctx.fillRect(0,0,1,1);const r=this._ctx.getImageData(0,0,1,1).data;if(255!==r[3]){if(!i)return console.warn(`Color: ${e} is using transparency, but allowTransparency is false. Using fallback ${t.css}.`),t;const[r,n,o,a]=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map((e=>Number(e))),h=Math.round(255*a);return{rgba:s.channels.toRgba(r,n,o,h),css:e}}return{css:this._ctx.fillStyle,rgba:s.channels.toRgba(r[0],r[1],r[2],r[3])}}}},9631:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(...e){var t;for(const i of e)null===(t=null==i?void 0:i.parentElement)||void 0===t||t.removeChild(i)}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,s){e.addEventListener(t,i,s);let r=!1;return{dispose:()=>{r||(r=!0,e.removeEventListener(t,i,s))}}}},6465:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;const n=i(2585),o=i(8460),a=i(844),h=i(3656);let c=class extends a.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this._onHideLinkUnderline=this.register(new o.EventEmitter),this.register((0,a.getDisposeArrayDisposable)(this._linkCacheDisposables))}get currentLink(){return this._currentLink}get onShowLinkUnderline(){return this._onShowLinkUnderline.event}get onHideLinkUnderline(){return this._onHideLinkUnderline.event}dispose(){super.dispose(),this._lastMouseEvent=void 0}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const t=this._linkProviders.indexOf(e);-1!==t&&this._linkProviders.splice(t,1)}}}attachToDom(e,t,i){this._element=e,this._mouseService=t,this._renderService=i,this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_onMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;const i=e.composedPath();for(let e=0;e<i.length;e++){const t=i[e];if(t.classList.contains("xterm"))break;if(t.classList.contains("xterm-hover"))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._onHover(t),this._lastBufferCell=t)}_onHover(e){if(this._activeLine!==e.y)return this._clearCurrentLink(),void this._askForLink(e,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var i,s;this._activeProviderReplies&&t||(null===(i=this._activeProviderReplies)||void 0===i||i.forEach((e=>{null==e||e.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(const[i,n]of this._linkProviders.entries())t?(null===(s=this._activeProviderReplies)||void 0===s?void 0:s.get(i))&&(r=this._checkLinkProviderResult(i,e,r)):n.provideLinks(e.y,(t=>{var s,n;if(this._isMouseOut)return;const o=null==t?void 0:t.map((e=>({link:e})));null===(s=this._activeProviderReplies)||void 0===s||s.set(i,o),r=this._checkLinkProviderResult(i,e,r),(null===(n=this._activeProviderReplies)||void 0===n?void 0:n.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){const i=new Set;for(let s=0;s<t.size;s++){const r=t.get(s);if(r)for(let t=0;t<r.length;t++){const s=r[t],n=s.link.range.start.y<e?0:s.link.range.start.x,o=s.link.range.end.y>e?this._bufferService.cols:s.link.range.end.x;for(let e=n;e<=o;e++){if(i.has(e)){r.splice(t--,1);break}i.add(e)}}}}_checkLinkProviderResult(e,t,i){var s;if(!this._activeProviderReplies)return i;const r=this._activeProviderReplies.get(e);let n=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(n=!0);if(!n&&r){const e=r.find((e=>this._linkAtPosition(e.link,t)));e&&(i=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(let e=0;e<this._activeProviderReplies.size;e++){const r=null===(s=this._activeProviderReplies.get(e))||void 0===s?void 0:s.find((e=>this._linkAtPosition(e.link,t)));if(r){i=!0,this._handleNewLink(r);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,a.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var e,t;return null===(t=null===(e=this._currentLink)||void 0===e?void 0:e.state)||void 0===t?void 0:t.decorations.pointerCursor},set:e=>{var t,i;(null===(t=this._currentLink)||void 0===t?void 0:t.state)&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&(null===(i=this._element)||void 0===i||i.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:()=>{var e,t;return null===(t=null===(e=this._currentLink)||void 0===e?void 0:e.state)||void 0===t?void 0:t.decorations.underline},set:t=>{var i,s,r;(null===(i=this._currentLink)||void 0===i?void 0:i.state)&&(null===(r=null===(s=this._currentLink)||void 0===s?void 0:s.state)||void 0===r?void 0:r.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{const t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp;this._clearCurrentLink(t,e.end+1+this._bufferService.buffer.ydisp)}))))}_linkHover(e,t,i){var s;(null===(s=this._currentLink)||void 0===s?void 0:s.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){const i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){var s;(null===(s=this._currentLink)||void 0===s?void 0:s.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){const i=e.range.start.y===e.range.end.y,s=e.range.start.y<t.y,r=e.range.end.y>t.y;return(i&&e.range.start.x<=t.x&&e.range.end.x>=t.x||s&&e.range.end.x>=t.x||r&&e.range.start.x<=t.x||s&&r)&&e.range.start.y<=t.y&&e.range.end.y>=t.y}_positionFromMouseEvent(e,t,i){const s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};c=s([r(0,n.IBufferService)],c),t.Linkifier2=c},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},2962:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=i(511),o=i(2585);let a=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){var i;const s=this._bufferService.buffer.lines.get(e-1);if(!s)return void t(void 0);const r=[],o=this._optionsService.rawOptions.linkHandler,a=new n.CellData,c=s.getTrimmedLength();let l=-1,d=-1,_=!1;for(let t=0;t<c;t++)if(-1!==d||s.hasContent(t)){if(s.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(-1===d){d=t,l=a.extended.urlId;continue}_=a.extended.urlId!==l}else-1!==d&&(_=!0);if(_||-1!==d&&t===c-1){const s=null===(i=this._oscLinkService.getLinkData(l))||void 0===i?void 0:i.uri;if(s){const i={start:{x:d+1,y:e},end:{x:t+(_||t!==c-1?0:1),y:e}};r.push({text:s,range:i,activate:(e,t)=>o?o.activate(e,t,i):h(0,t),hover:(e,t)=>{var s;return null===(s=null==o?void 0:o.hover)||void 0===s?void 0:s.call(o,e,t,i)},leave:(e,t)=>{var s;return null===(s=null==o?void 0:o.leave)||void 0===s?void 0:s.call(o,e,t,i)}})}_=!1,a.hasExtendedAttrs()&&a.extended.urlId?(d=t,l=a.extended.urlId):(d=-1,l=-1)}}t(r)}};function h(e,t){if(confirm(`Do you want to navigate to ${t}?`)){const i=window.open();if(i){try{i.opener=null}catch(e){}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}a=s([r(0,o.IBufferService),r(1,o.IOptionsService),r(2,o.IOscLinkService)],a),t.OscLinkProvider=a},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._parentWindow=e,this._renderCallback=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();const e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},5596:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;const s=i(844);class r extends s.Disposable{constructor(e){super(),this._parentWindow=e,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio}setListener(e){this._listener&&this.clearListener(),this._listener=e,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}dispose(){super.dispose(),this.clearListener()}_updateDpr(){var e;this._outerListener&&(null===(e=this._resolutionMediaMatchList)||void 0===e||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}t.ScreenDprMonitor=r},3236:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const s=i(2950),r=i(1680),n=i(3614),o=i(2584),a=i(5435),h=i(9312),c=i(6114),l=i(3656),d=i(9042),_=i(4567),u=i(1296),f=i(7399),v=i(8460),g=i(8437),p=i(5680),S=i(3230),m=i(4725),C=i(428),b=i(8934),y=i(6465),w=i(5114),E=i(8969),L=i(8055),R=i(4269),k=i(5941),D=i(3107),A=i(5744),x=i(9074),B=i(2585),T=i(2962),M="undefined"!=typeof window?window.document:null;class O extends E.CoreTerminal{constructor(e={}){super(e),this.browser=c,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=new v.EventEmitter,this._onKey=new v.EventEmitter,this._onRender=new v.EventEmitter,this._onSelectionChange=new v.EventEmitter,this._onTitleChange=new v.EventEmitter,this._onBell=new v.EventEmitter,this._onFocus=new v.EventEmitter,this._onBlur=new v.EventEmitter,this._onA11yCharEmitter=new v.EventEmitter,this._onA11yTabEmitter=new v.EventEmitter,this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(y.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,v.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,v.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,v.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows))))}get onCursorMove(){return this._onCursorMove.event}get onKey(){return this._onKey.event}get onRender(){return this._onRender.event}get onSelectionChange(){return this._onSelectionChange.event}get onTitleChange(){return this._onTitleChange.event}get onBell(){return this._onBell.event}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}_handleColorEvent(e){var t,i;if(this._colorManager){for(const t of e){let e,i="";switch(t.index){case 256:e="foreground",i="10";break;case 257:e="background",i="11";break;case 258:e="cursor",i="12";break;default:e="ansi",i="4;"+t.index}switch(t.type){case 0:const s=L.color.toColorRGB("ansi"===e?this._colorManager.colors.ansi[t.index]:this._colorManager.colors[e]);this.coreService.triggerDataEvent(`${o.C0.ESC}]${i};${(0,k.toRgbString)(s)}${o.C1_ESCAPED.ST}`);break;case 1:"ansi"===e?this._colorManager.colors.ansi[t.index]=L.rgba.toColor(...t.color):this._colorManager.colors[e]=L.rgba.toColor(...t.color);break;case 2:this._colorManager.restoreColor(t.index)}}null===(t=this._renderService)||void 0===t||t.setColors(this._colorManager.colors),null===(i=this.viewport)||void 0===i||i.onThemeChange(this._colorManager.colors)}}dispose(){var e,t,i;this._isDisposed||(super.dispose(),null===(e=this._renderService)||void 0===e||e.dispose(),this._customKeyEventHandler=void 0,this.write=()=>{},null===(i=null===(t=this.element)||void 0===t?void 0:t.parentNode)||void 0===i||i.removeChild(this.element))}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_updateOptions(e){var t,i,s,r;switch(super._updateOptions(e),e){case"fontFamily":case"fontSize":null===(t=this._renderService)||void 0===t||t.clear(),null===(i=this._charSizeService)||void 0===i||i.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"customGlyphs":case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"scrollback":null===(s=this.viewport)||void 0===s||s.syncScrollArea();break;case"screenReaderMode":this.optionsService.rawOptions.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)):(null===(r=this._accessibilityManager)||void 0===r||r.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.rawOptions.theme)}}_onTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return null===(e=this.textarea)||void 0===e?void 0:e.blur()}_onTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(o.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;const i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.actualCellHeight,r=t.getWidth(i),n=this._renderService.dimensions.actualCellWidth*r,o=this.buffer.y*this._renderService.dimensions.actualCellHeight,a=i*this._renderService.dimensions.actualCellWidth;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,l.addDisposableDomListener)(this.element,"copy",(e=>{this.hasSelection()&&(0,n.copyHandler)(e,this._selectionService)})));const e=e=>(0,n.handlePasteEvent)(e,this.textarea,this.coreService);this.register((0,l.addDisposableDomListener)(this.textarea,"paste",e)),this.register((0,l.addDisposableDomListener)(this.element,"paste",e)),c.isFirefox?this.register((0,l.addDisposableDomListener)(this.element,"mousedown",(e=>{2===e.button&&(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,l.addDisposableDomListener)(this.element,"contextmenu",(e=>{(0,n.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),c.isLinux&&this.register((0,l.addDisposableDomListener)(this.element,"auxclick",(e=>{1===e.button&&(0,n.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,l.addDisposableDomListener)(this.textarea,"keyup",(e=>this._keyUp(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"keydown",(e=>this._keyDown(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"keypress",(e=>this._keyPress(e)),!0)),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionupdate",(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,l.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,l.addDisposableDomListener)(this.textarea,"input",(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){var t;if(!e)throw new Error("Terminal requires a parent element.");e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),e.appendChild(this.element);const i=M.createDocumentFragment();this._viewportElement=M.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=M.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this.textarea=M.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register((0,l.addDisposableDomListener)(this.textarea,"focus",(e=>this._onTextAreaFocus(e)))),this.register((0,l.addDisposableDomListener)(this.textarea,"blur",(()=>this._onTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._coreBrowserService=this._instantiationService.createInstance(w.CoreBrowserService,this.textarea,null!==(t=this._document.defaultView)&&void 0!==t?t:window),this._instantiationService.setService(m.ICoreBrowserService,this._coreBrowserService),this._charSizeService=this._instantiationService.createInstance(C.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(m.ICharSizeService,this._charSizeService),this._theme=this.options.theme||this._theme,this._colorManager=new p.ColorManager(M,this.options.allowTransparency),this.register(this.optionsService.onOptionChange((e=>this._colorManager.onOptionsChange(e,this.optionsService.rawOptions[e])))),this._colorManager.setTheme(this._theme),this._characterJoinerService=this._instantiationService.createInstance(R.CharacterJoinerService),this._instantiationService.setService(m.ICharacterJoinerService,this._characterJoinerService);const n=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(S.RenderService,n,this.rows,this.screenElement)),this._instantiationService.setService(m.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=M.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(i),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(m.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(r.Viewport,(e=>this.scrollLines(e,!0,1)),this._viewportElement,this._viewportScrollArea,this.element),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.onCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.onResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.onBlur()))),this.register(this.onFocus((()=>this._renderService.onFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(m.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(D.BufferDecorationRenderer,this.screenElement)),this.register((0,l.addDisposableDomListener)(this.element,"mousedown",(e=>this._selectionService.onMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new _.AccessibilityManager(this,this._renderService)),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onOptionChange((()=>{!this._overviewRulerRenderer&&this.options.overviewRulerWidth&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(A.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier2)}_setTheme(e){var t,i,s;this._theme=e,null===(t=this._colorManager)||void 0===t||t.setTheme(e),null===(i=this._renderService)||void 0===i||i.setColors(this._colorManager.colors),null===(s=this.viewport)||void 0===s||s.onThemeChange(this._colorManager.colors)}bindMouse(){const e=this,t=this.element;function i(t){const i=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!i)return!1;let s,r;switch(t.overrideType||t.type){case"mousemove":r=32,void 0===t.buttons?(s=3,void 0!==t.button&&(s=t.button<3?t.button:3)):s=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case"mouseup":r=0,s=t.button<3?t.button:3;break;case"mousedown":r=1,s=t.button<3?t.button:3;break;case"wheel":if(0===e.viewport.getLinesScrolled(t))return!1;r=t.deltaY<0?0:1,s=4;break;default:return!1}return!(void 0===r||void 0===s||s>4)&&e.coreMouseService.triggerMouseEvent({col:i.col,row:i.row,x:i.x,y:i.y,button:s,action:r,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}const s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:e=>(i(e),e.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),16&e?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),2&e?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),4&e?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,l.addDisposableDomListener)(t,"mousedown",(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(e)}))),this.register((0,l.addDisposableDomListener)(t,"wheel",(e=>{if(!s.wheel){if(!this.buffer.hasScrollback){const t=this.viewport.getLinesScrolled(e);if(0===t)return;const i=o.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B");let s="";for(let e=0;e<Math.abs(t);e++)s+=i;return this.coreService.triggerDataEvent(s,!0),this.cancel(e,!0)}return this.viewport.onWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,l.addDisposableDomListener)(t,"touchstart",(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,l.addDisposableDomListener)(t,"touchmove",(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){var i;null===(i=this._renderService)||void 0===i||i.refreshRows(e,t)}updateCursorStyle(e){var t;(null===(t=this._selectionService)||void 0===t?void 0:t.shouldColumnSelect(e))?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,i=0){super.scrollLines(e,t,i),this.refresh(0,this.rows-1)}paste(e){(0,n.paste)(e,this.textarea,this.coreService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}registerLinkProvider(e){return this.linkifier2.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;null===(e=this._selectionService)||void 0===e||e.clearSelection()}selectAll(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()}selectLines(e,t){var i;null===(i=this._selectionService)||void 0===i||i.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;const t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;t||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);const i=(0,f.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===i.type||2===i.type){const t=this.rows-1;return this.scrollLines(2===i.type?-t:t),this.cancel(e,!0)}return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(i.key!==o.C0.ETX&&i.key!==o.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0))))}_isThirdLevelShift(e,t){const i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){var i,s;null===(i=this._charSizeService)||void 0===i||i.measure(),null===(s=this.viewport)||void 0===s||s.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(g.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){var e,t;this.options.rows=this.rows,this.options.cols=this.cols;const i=this._customKeyEventHandler;this._setup(),super.reset(),null===(e=this._selectionService)||void 0===e||e.reset(),this._decorationService.reset(),this._customKeyEventHandler=i,this.refresh(0,this.rows-1),null===(t=this.viewport)||void 0===t||t.syncScrollArea()}clearTextureAtlas(){var e;null===(e=this._renderService)||void 0===e||e.clearTextureAtlas()}_reportFocus(){var e;(null===(e=this.element)||void 0===e?void 0:e.classList.contains("focus"))?this.coreService.triggerDataEvent(o.C0.ESC+"[I"):this.coreService.triggerDataEvent(o.C0.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case a.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const e=this._renderService.dimensions.canvasWidth.toFixed(0),t=this._renderService.dimensions.canvasHeight.toFixed(0);this.coreService.triggerDataEvent(`${o.C0.ESC}[4;${t};${e}t`);break;case a.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const i=this._renderService.dimensions.actualCellWidth.toFixed(0),s=this._renderService.dimensions.actualCellHeight.toFixed(0);this.coreService.triggerDataEvent(`${o.C0.ESC}[6;${s};${i}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=O},9924:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;const s=Date.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){const e=s-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;const e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=i(844),o=i(3656),a=i(4725),h=i(2585);let c=class extends n.Disposable{constructor(e,t,i,s,r,n,a,h,c){super(),this._scrollLines=e,this._viewportElement=t,this._scrollArea=i,this._element=s,this._bufferService=r,this._optionsService=n,this._charSizeService=a,this._renderService=h,this._coreBrowserService=c,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentScaledCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,o.addDisposableDomListener)(this._viewportElement,"scroll",this._onScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),setTimeout((()=>this.syncScrollArea()),0)}onThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/this._coreBrowserService.dpr,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(e)}_onScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t)}_smoothScroll(){if(this._isDisposed||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}onWheel(e){const t=this._getPixelsScrolled(e);return 0!==t&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,-1===this._smoothScrollState.target?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}_getPixelsScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getLinesScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){const i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}onTouchStart(e){this._lastTouchY=e.touches[0].pageY}onTouchMove(e){const t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};c=s([r(4,h.IBufferService),r(5,h.IOptionsService),r(6,a.ICharSizeService),r(7,a.IRenderService),r(8,a.ICoreBrowserService)],c),t.Viewport=c},3107:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=i(3656),o=i(4725),a=i(844),h=i(2585);let c=class extends a.Disposable{constructor(e,t,i,s){super(),this._screenElement=e,this._bufferService=t,this._decorationService=i,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register((0,n.addDisposableDomListener)(window,"resize",(()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e))))}dispose(){this._container.remove(),this._decorationElements.clear(),super.dispose()}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this.refreshDecorations(),this._animationFrame=void 0})))}refreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var t;const i=document.createElement("div");i.classList.add("xterm-decoration"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.actualCellWidth)}px`,i.style.height=(e.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",i.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",i.style.lineHeight=`${this._renderService.dimensions.actualCellHeight}px`;const s=null!==(t=e.options.x)&&void 0!==t?t:0;return s&&s>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){const t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(e.onDispose((()=>this._removeDecoration(e))),i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i)),i.style.top=t*this._renderService.dimensions.actualCellHeight+"px",i.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){var i;if(!t)return;const s=null!==(i=e.options.x)&&void 0!==i?i:0;"right"===(e.options.anchor||"left")?t.style.right=s?s*this._renderService.dimensions.actualCellWidth+"px":"":t.style.left=s?s*this._renderService.dimensions.actualCellWidth+"px":""}_removeDecoration(e){var t;null===(t=this._decorationElements.get(e))||void 0===t||t.remove(),this._decorationElements.delete(e)}};c=s([r(1,h.IBufferService),r(2,h.IDecorationService),r(3,o.IRenderService)],c),t.BufferDecorationRenderer=c},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(const t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=i(5871),o=i(3656),a=i(4725),h=i(844),c=i(2585),l={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let u=class extends h.Disposable{constructor(e,t,i,s,r,o,a){var h;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=o,this._coreBrowseService=a,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),null===(h=this._viewportElement.parentElement)||void 0===h||h.insertBefore(this._canvas,this._viewportElement);const c=this._canvas.getContext("2d");if(!c)throw new Error("Ctx cannot be null");this._ctx=c,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners()}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onOptionChange((e=>{"overviewRulerWidth"===e&&this._queueRefresh(!0)}))),this.register((0,o.addDisposableDomListener)(this._coreBrowseService.window,"resize",(()=>{this._queueRefresh(!0)}))),this._queueRefresh(!0)}dispose(){var e;null===(e=this._canvas)||void 0===e||e.remove(),super.dispose()}_refreshDrawConstants(){const e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);d.full=this._canvas.width,d.left=e,d.center=t,d.right=e,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=d.left,_.right=d.left+d.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowseService.dpr);const e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowseService.dpr);l.left=t,l.center=t,l.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;const e=this._colorZoneStore.zones;for(const t of e)"full"!==t.position&&this._renderColorZone(t);for(const t of e)"full"===t.position&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(_[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-l[e.position||"full"]/2),d[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};u=s([r(2,c.IBufferService),r(3,c.IDecorationService),r(4,a.IRenderService),r(5,c.IOptionsService),r(6,a.ICoreBrowserService)],u),t.OverviewRulerRenderer=u},2950:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=i(4725),o=i(2585),a=i(2584);let h=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${a.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.actualCellHeight,i=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,s=e*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=s+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=t+"px",this._compositionView.style.lineHeight=t+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const r=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(r.width,1)+"px",this._textarea.style.height=Math.max(r.height,1)+"px",this._textarea.style.lineHeight=r.height+"px"}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};h=s([r(2,o.IBufferService),r(3,o.IOptionsService),r(4,o.ICoreService),r(5,n.IRenderService)],h),t.CompositionHelper=h},9806:(e,t)=>{function i(e,t,i){const s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=i,t.getCoords=function(e,t,s,r,n,o,a,h,c){if(!o)return;const l=i(e,t,s);return l?(l[0]=Math.ceil((l[0]+(c?a/2:0))/a),l[1]=Math.ceil(l[1]/h),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),n),l):void 0}},9504:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const s=i(2584);function r(e,t,i,s){const r=e-n(i,e),a=t-n(i,t),l=Math.abs(r-a)-function(e,t,i){let s=0;const r=e-n(i,e),a=t-n(i,t);for(let n=0;n<Math.abs(r-a);n++){const a="A"===o(e,t)?-1:1,h=i.buffer.lines.get(r+a*n);(null==h?void 0:h.isWrapped)&&s++}return s}(e,t,i);return c(l,h(o(e,t),s))}function n(e,t){let i=0,s=e.buffer.lines.get(t),r=null==s?void 0:s.isWrapped;for(;r&&t>=0&&t<e.rows;)i++,s=e.buffer.lines.get(--t),r=null==s?void 0:s.isWrapped;return i}function o(e,t){return e>t?"A":"B"}function a(e,t,i,s,r,n){let o=e,a=t,h="";for(;o!==i||a!==s;)o+=r?1:-1,r&&o>n.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function h(e,t){const i=t?"O":"[";return s.C0.ESC+i+e}function c(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}t.moveToCellSequence=function(e,t,i,s){const o=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return function(e,t,i,s,o,l){return 0===r(t,s,o,l).length?"":c(a(e,t,e,t-n(o,t),!1,o).length,h("D",l))}(o,l,0,t,i,s)+r(l,t,i,s)+function(e,t,i,s,o,l){let d;d=r(t,s,o,l).length>0?s-n(o,s):t;const _=s,u=function(e,t,i,s,o,a){let h;return h=r(i,s,o,a).length>0?s-n(o,s):t,e<i&&h<=s||e>=i&&h<s?"C":"D"}(e,t,i,s,o,l);return c(a(e,d,i,_,"C"===u,o).length,h(u,l))}(o,l,e,t,i,s);let d;if(l===t)return d=o>e?"D":"C",c(Math.abs(o-e),h(d,s));d=l>t?"D":"C";const _=Math.abs(l-t);return c(function(e,t){return t.cols-e}(l>t?e:o,i)+(_-1)*i.cols+1+((l>t?o:e)-1),h(d,s))}},8036:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const s=i(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},1752:(e,t)=>{function i(e){return 57508<=e&&e<=57558}Object.defineProperty(t,"__esModule",{value:!0}),t.excludeFromContrastRatioDemands=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.excludeFromContrastRatioDemands=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)}},1296:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=i(3787),o=i(8036),a=i(844),h=i(4725),c=i(2585),l=i(8460),d=i(8055),_=i(9631),u="xterm-dom-renderer-owner-",f="xterm-focus";let v=1,g=class extends a.Disposable{constructor(e,t,i,s,r,o,a,h,c,l){super(),this._colors=e,this._element=t,this._screenElement=i,this._viewportElement=s,this._linkifier2=r,this._charSizeService=a,this._optionsService=h,this._bufferService=c,this._coreBrowserService=l,this._terminalClass=v++,this._rowElements=[],this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._updateDimensions(),this._injectCss(),this._rowFactory=o.createInstance(n.DomRendererRowFactory,document,this._colors),this._element.classList.add(u+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._onLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._onLinkLeave(e))))}get onRequestRedraw(){return(new l.EventEmitter).event}dispose(){this._element.classList.remove(u+this._terminalClass),(0,_.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),super.dispose()}_updateDimensions(){const e=this._coreBrowserService.dpr;this.dimensions.scaledCharWidth=this._charSizeService.width*e,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*e),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/e),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/e),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(const e of this._rowElements)e.style.width=`${this.dimensions.canvasWidth}px`,e.style.height=`${this.dimensions.actualCellHeight}px`,e.style.lineHeight=`${this.dimensions.actualCellHeight}px`,e.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const t=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.canvasWidth}px`,this._screenElement.style.height=`${this.dimensions.canvasHeight}px`}setColors(e){this._colors=e,this._injectCss()}_injectCss(){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let e=`${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;e+=`${this._terminalSelector} span:not(.${n.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${n.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${n.ITALIC_CLASS} { font-style: italic;}`,e+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",e+="@keyframes blink_block_"+this._terminalClass+" { 0% {"+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css}; } 50% {`+` background-color: ${this._colors.cursorAccent.css};`+` color: ${this._colors.cursor.css}; }}`,e+=`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_BLINK_CLASS}:not(.${n.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_BLINK_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+" 1s step-end infinite;}"+`${this._terminalSelector} .xterm-rows.xterm-focus .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BLOCK_CLASS} {`+` background-color: ${this._colors.cursor.css};`+` color: ${this._colors.cursorAccent.css};}`+`${this._terminalSelector} .xterm-rows .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_BAR_CLASS} {`+` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}`+`${this._terminalSelector} .xterm-rows .${n.CURSOR_CLASS}.${n.CURSOR_STYLE_UNDERLINE_CLASS} {`+` box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`,e+=`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`,this._colors.ansi.forEach(((t,i)=>{e+=`${this._terminalSelector} .xterm-fg-${i} { color: ${t.css}; }${this._terminalSelector} .xterm-bg-${i} { background-color: ${t.css}; }`})),e+=`${this._terminalSelector} .xterm-fg-${o.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${o.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`,this._themeStyleElement.textContent=e}onDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){const e=document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}onResize(e,t){this._refreshRowElements(e,t),this._updateDimensions()}onCharSizeChanged(){this._updateDimensions()}onBlur(){this._rowContainer.classList.remove(f)}onFocus(){this._rowContainer.classList.add(f)}onSelectionChanged(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;const s=e[1]-this._bufferService.buffer.ydisp,r=t[1]-this._bufferService.buffer.ydisp,n=Math.max(s,0),o=Math.min(r,this._bufferService.rows-1);if(n>=this._bufferService.rows||o<0)return;const a=document.createDocumentFragment();if(i){const i=e[0]>t[0];a.appendChild(this._createSelectionElement(n,i?t[0]:e[0],i?e[0]:t[0],o-n+1))}else{const i=s===n?e[0]:0,h=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,i,h));const c=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,c)),n!==o){const e=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){const r=document.createElement("div");return r.style.height=s*this.dimensions.actualCellHeight+"px",r.style.top=e*this.dimensions.actualCellHeight+"px",r.style.left=t*this.dimensions.actualCellWidth+"px",r.style.width=this.dimensions.actualCellWidth*(i-t)+"px",r}onCursorMove(){}onOptionsChanged(){this._updateDimensions(),this._injectCss()}clear(){for(const e of this._rowElements)e.innerText=""}renderRows(e,t){const i=this._bufferService.buffer.ybase+this._bufferService.buffer.y,s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._optionsService.rawOptions.cursorBlink;for(let n=e;n<=t;n++){const e=this._rowElements[n];e.innerText="";const t=n+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.lines.get(t),a=this._optionsService.rawOptions.cursorStyle;e.appendChild(this._rowFactory.createRow(o,t,t===i,a,s,r,this.dimensions.actualCellWidth,this._bufferService.cols))}}get _terminalSelector(){return`.${u}${this._terminalClass}`}_onLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_onLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){for(;e!==t||i!==s;){const t=this._rowElements[i];if(!t)return;const s=t.children[e];s&&(s.style.textDecoration=n?"underline":"none"),++e>=r&&(e=0,i++)}}};g=s([r(5,c.IInstantiationService),r(6,h.ICharSizeService),r(7,c.IOptionsService),r(8,c.IBufferService),r(9,h.ICoreBrowserService)],g),t.DomRenderer=g},3787:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=t.CURSOR_STYLE_UNDERLINE_CLASS=t.CURSOR_STYLE_BAR_CLASS=t.CURSOR_STYLE_BLOCK_CLASS=t.CURSOR_BLINK_CLASS=t.CURSOR_CLASS=t.STRIKETHROUGH_CLASS=t.UNDERLINE_CLASS=t.ITALIC_CLASS=t.DIM_CLASS=t.BOLD_CLASS=void 0;const n=i(8036),o=i(643),a=i(511),h=i(2585),c=i(8055),l=i(4725),d=i(4269),_=i(1752),u=i(3734);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.STRIKETHROUGH_CLASS="xterm-strikethrough",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";let f=class{constructor(e,t,i,s,r,n,o){this._document=e,this._colors=t,this._characterJoinerService=i,this._optionsService=s,this._coreBrowserService=r,this._coreService=n,this._decorationService=o,this._workCell=new a.CellData,this._columnSelectMode=!1}setColors(e){this._colors=e}onSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,i,s,r,a,h,l,_){const f=this._document.createDocumentFragment(),g=this._characterJoinerService.getJoinedCharacters(i);let p=0;for(let t=Math.min(e.length,_)-1;t>=0;t--)if(e.loadCell(t,this._workCell).getCode()!==o.NULL_CELL_CODE||s&&t===a){p=t+1;break}for(let _=0;_<p;_++){e.loadCell(_,this._workCell);let p=this._workCell.getWidth();if(0===p)continue;let S=!1,m=_,C=this._workCell;if(g.length>0&&_===g[0][0]){S=!0;const t=g.shift();C=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),m=t[1]-1,p=C.getWidth()}const b=this._document.createElement("span");if(p>1&&(b.style.width=l*p+"px"),S&&(b.style.display="inline",a>=_&&a<=m&&(a=_)),!this._coreService.isCursorHidden&&s&&_===a)switch(b.classList.add(t.CURSOR_CLASS),h&&b.classList.add(t.CURSOR_BLINK_CLASS),r){case"bar":b.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":b.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:b.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}if(C.isBold()&&b.classList.add(t.BOLD_CLASS),C.isItalic()&&b.classList.add(t.ITALIC_CLASS),C.isDim()&&b.classList.add(t.DIM_CLASS),C.isInvisible()?b.textContent=o.WHITESPACE_CELL_CHAR:b.textContent=C.getChars()||o.WHITESPACE_CELL_CHAR,C.isUnderline()&&(b.classList.add(`${t.UNDERLINE_CLASS}-${C.extended.underlineStyle}`)," "===b.textContent&&(b.innerHTML=" "),!C.isUnderlineColorDefault()))if(C.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(C.getUnderlineColor()).join(",")})`;else{let e=C.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&C.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=this._colors.ansi[e].css}C.isStrikethrough()&&b.classList.add(t.STRIKETHROUGH_CLASS);let y=C.getFgColor(),w=C.getFgColorMode(),E=C.getBgColor(),L=C.getBgColorMode();const R=!!C.isInverse();if(R){const e=y;y=E,E=e;const t=w;w=L,L=t}let k,D,A=!1;this._decorationService.forEachDecorationAtCell(_,i,void 0,(e=>{"top"!==e.options.layer&&A||(e.backgroundColorRGB&&(L=50331648,E=e.backgroundColorRGB.rgba>>8&16777215,k=e.backgroundColorRGB),e.foregroundColorRGB&&(w=50331648,y=e.foregroundColorRGB.rgba>>8&16777215,D=e.foregroundColorRGB),A="top"===e.options.layer)}));const x=this._isCellInSelection(_,i);let B;switch(A||this._colors.selectionForeground&&x&&(w=50331648,y=this._colors.selectionForeground.rgba>>8&16777215,D=this._colors.selectionForeground),x&&(k=this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque,A=!0),A&&b.classList.add("xterm-decoration-top"),L){case 16777216:case 33554432:B=this._colors.ansi[E],b.classList.add(`xterm-bg-${E}`);break;case 50331648:B=c.rgba.toColor(E>>16,E>>8&255,255&E),this._addStyle(b,`background-color:#${v((E>>>0).toString(16),"0",6)}`);break;default:R?(B=this._colors.foreground,b.classList.add(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):B=this._colors.background}switch(k||C.isDim()&&(k=c.color.multiplyOpacity(B,.5)),w){case 16777216:case 33554432:C.isBold()&&y<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(y+=8),this._applyMinimumContrast(b,B,this._colors.ansi[y],C,k,void 0)||b.classList.add(`xterm-fg-${y}`);break;case 50331648:const e=c.rgba.toColor(y>>16&255,y>>8&255,255&y);this._applyMinimumContrast(b,B,e,C,k,D)||this._addStyle(b,`color:#${v(y.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,B,this._colors.foreground,C,k,void 0)||R&&b.classList.add(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}f.appendChild(b),_=m}return f}_applyMinimumContrast(e,t,i,s,r,n){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,_.excludeFromContrastRatioDemands)(s.getCode()))return!1;let o;return r||n||(o=this._colors.contrastCache.getColor(t.rgba,i.rgba)),void 0===o&&(o=c.color.ensureContrastRatio(r||t,n||i,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((r||t).rgba,(n||i).rgba,null!=o?o:null)),!!o&&(this._addStyle(e,`color:${o.css}`),!0)}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){const i=this._selectionStart,s=this._selectionEnd;return!(!i||!s)&&(this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0])}};function v(e,t,i){for(;e.length<i;)e=t+e;return e}f=s([r(2,l.ICharacterJoinerService),r(3,h.IOptionsService),r(4,l.ICoreBrowserService),r(5,h.ICoreService),r(6,h.IDecorationService)],f),t.DomRendererRowFactory=f},456:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}onTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=i(2585),o=i(8460);let a=class{constructor(e,t,i){this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=new o.EventEmitter,this._measureStrategy=new h(e,t,this._optionsService)}get hasValidSize(){return this.width>0&&this.height>0}get onCharSizeChange(){return this._onCharSizeChange.event}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};a=s([r(2,n.IOptionsService)],a),t.CharSizeService=a;class h{constructor(e,t,i){this._document=e,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result}}},4269:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=i(3734),o=i(643),a=i(511),h=i(2585);class c extends n.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=c;let l=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(0===this._characterJoiners.length)return[];const t=this._bufferService.buffer.lines.get(e);if(!t||0===t.length)return[];const i=[],s=t.translateToString(!0);let r=0,n=0,a=0,h=t.getFg(0),c=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==h||this._workCell.bg!==c){if(e-r>1){const e=this._getJoinedRanges(s,a,n,t,r);for(let t=0;t<e.length;t++)i.push(e[t])}r=e,a=n,h=this._workCell.fg,c=this._workCell.bg}n+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1){const e=this._getJoinedRanges(s,a,n,t,r);for(let t=0;t<e.length;t++)i.push(e[t])}return i}_getJoinedRanges(t,i,s,r,n){const o=t.substring(i,s);let a=[];try{a=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{const i=this._characterJoiners[t].handler(o);for(let t=0;t<i.length;t++)e._mergeRanges(a,i[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(a,r,n),a}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,a=e[s];if(a){for(let h=i;h<this._bufferService.cols;h++){const i=t.getWidth(h),c=t.getString(h).length||o.WHITESPACE_CELL_CHAR.length;if(0!==i){if(!r&&a[0]<=n&&(a[0]=h,r=!0),a[1]<=n){if(a[1]=h,a=e[++s],!a)break;a[0]<=n?(a[0]=h,r=!0):r=!1}n+=c}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){const r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0)}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};l=s([r(0,h.IBufferService)],l),t.CharacterJoinerService=l},5114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0,t.CoreBrowserService=class{constructor(e,t){this._textarea=e,this.window=t}get dpr(){return this.window.devicePixelRatio}get isFocused(){return(this._textarea.getRootNode?this._textarea.getRootNode():this._textarea.ownerDocument).activeElement===this._textarea&&this._textarea.ownerDocument.hasFocus()}}},8934:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=i(4725),o=i(9806);let a=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return(0,o.getCoords)(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,r)}getMouseReportCoords(e,t){const i=(0,o.getCoordsRelativeToElement)(window,e,t);if(!(!this._charSizeService.hasValidSize||i[0]<0||i[1]<0||i[0]>=this._renderService.dimensions.canvasWidth||i[1]>=this._renderService.dimensions.canvasHeight))return{col:Math.floor(i[0]/this._renderService.dimensions.actualCellWidth),row:Math.floor(i[1]/this._renderService.dimensions.actualCellHeight),x:Math.floor(i[0]),y:Math.floor(i[1])}}};a=s([r(0,n.IRenderService),r(1,n.ICharSizeService)],a),t.MouseService=a},3230:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=i(6193),o=i(8460),a=i(844),h=i(5596),c=i(3656),l=i(2585),d=i(4725);let _=class extends a.Disposable{constructor(e,t,i,s,r,a,l,d){if(super(),this._renderer=e,this._rowCount=t,this._charSizeService=r,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=new o.EventEmitter,this._onRenderedViewportChange=new o.EventEmitter,this._onRender=new o.EventEmitter,this._onRefreshRequest=new o.EventEmitter,this.register({dispose:()=>this._renderer.dispose()}),this._renderDebouncer=new n.RenderDebouncer(d.window,((e,t)=>this._renderRows(e,t))),this.register(this._renderDebouncer),this._screenDprMonitor=new h.ScreenDprMonitor(d.window),this._screenDprMonitor.setListener((()=>this.onDevicePixelRatioChange())),this.register(this._screenDprMonitor),this.register(l.onResize((()=>this._fullRefresh()))),this.register(l.buffers.onBufferActivate((()=>{var e;return null===(e=this._renderer)||void 0===e?void 0:e.clear()}))),this.register(s.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.onCharSizeChanged()))),this.register(a.onDecorationRegistered((()=>this._fullRefresh()))),this.register(a.onDecorationRemoved((()=>this._fullRefresh()))),this._renderer.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this.register((0,c.addDisposableDomListener)(d.window,"resize",(()=>this.onDevicePixelRatioChange()))),"IntersectionObserver"in d.window){const e=new d.window.IntersectionObserver((e=>this._onIntersectionChange(e[e.length-1])),{threshold:0});e.observe(i),this.register({dispose:()=>e.disconnect()})}}get onDimensionsChange(){return this._onDimensionsChange.event}get onRenderedViewportChange(){return this._onRenderedViewportChange.event}get onRender(){return this._onRender.event}get onRefreshRequest(){return this._onRefreshRequest.event}get dimensions(){return this._renderer.dimensions}_onIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()}_fireOnCanvasResize(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)}dispose(){super.dispose()}setRenderer(e){this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;null===(t=null===(e=this._renderer)||void 0===e?void 0:e.clearTextureAtlas)||void 0===t||t.call(e),this._fullRefresh()}setColors(e){this._renderer.setColors(e),this._fullRefresh()}onDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)}onResize(e,t){this._renderer.onResize(e,t),this._fullRefresh()}onCharSizeChanged(){this._renderer.onCharSizeChanged()}onBlur(){this._renderer.onBlur()}onFocus(){this._renderer.onFocus()}onSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.onSelectionChanged(e,t,i)}onCursorMove(){this._renderer.onCursorMove()}clear(){this._renderer.clear()}};_=s([r(3,l.IOptionsService),r(4,d.ICharSizeService),r(5,l.IDecorationService),r(6,l.IBufferService),r(7,d.ICoreBrowserService)],_),t.RenderService=_},9312:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=i(6114),o=i(456),a=i(511),h=i(8460),c=i(4725),l=i(2585),d=i(9806),_=i(9504),u=i(844),f=i(4841),v=String.fromCharCode(160),g=new RegExp(v,"g");let p=class extends u.Disposable{constructor(e,t,i,s,r,n,c,l,d){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=c,this._renderService=l,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new a.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this._onRedrawRequest=this.register(new h.EventEmitter),this._onSelectionChange=this.register(new h.EventEmitter),this._onRequestScrollLines=this.register(new h.EventEmitter),this._mouseMoveListener=e=>this._onMouseMove(e),this._mouseUpListener=e=>this._onMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._onTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._onBufferActivate(e)))),this.enable(),this._model=new o.SelectionModel(this._bufferService),this._activeSelectionMode=0}get onLinuxMouseSelection(){return this._onLinuxMouseSelection.event}get onRequestRedraw(){return this._onRedrawRequest.event}get onSelectionChange(){return this._onSelectionChange.event}get onRequestScrollLines(){return this._onRequestScrollLines.event}dispose(){this._removeMouseDownListeners()}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";const i=this._bufferService.buffer,s=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";const r=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){const e=i.translateBufferLineToString(o,!0,r,n);s.push(e)}}else{const r=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let r=e[1]+1;r<=t[1]-1;r++){const e=i.lines.get(r),t=i.translateBufferLineToString(r,!0);(null==e?void 0:e.isWrapped)?s[s.length-1]+=t:s.push(t)}if(e[1]!==t[1]){const e=i.lines.get(t[1]),r=i.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?s[s.length-1]+=r:s.push(r)}}return s.map((e=>e.replace(g," "))).join(n.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),n.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){const t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!!(i&&s&&t)&&this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){const i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!(!i||!s)&&this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var i,s;const r=null===(s=null===(i=this._linkifier.currentLink)||void 0===i?void 0:i.link)||void 0===s?void 0:s.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const n=this._getMouseBufferCoords(e);return!!n&&(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_onTrim(e){this._model.onTrim(e)&&this.refresh()}_getMouseBufferCoords(e){const t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1];const i=this._renderService.dimensions.canvasHeight;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return n.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}onMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_onIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_onSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_onDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_onTripleClick(e){const t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(n.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_onMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;const t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){const e=i.lines.get(this._model.selectionEnd[1]);e&&0===e.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_onMouseUp(e){const t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&void 0!==t[0]&&void 0!==t[1]){const e=(0,_.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);i?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,i)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_onBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._onTrim(e)))}_convertViewportColToCharacterIndex(e,t){let i=t[0];for(let s=0;t[0]>=s;s++){const r=e.loadCell(s,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:r>1&&t[0]!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;const r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;const o=r.translateBufferLineToString(e[1],!1);let a=this._convertViewportColToCharacterIndex(n,e),h=a;const c=e[0]-a;let l=0,d=0,_=0,u=0;if(" "===o.charAt(a)){for(;a>0&&" "===o.charAt(a-1);)a--;for(;h<o.length&&" "===o.charAt(h+1);)h++}else{let t=e[0],i=e[0];0===n.getWidth(t)&&(l++,t--),2===n.getWidth(i)&&(d++,i++);const s=n.getString(i).length;for(s>1&&(u+=s-1,h+=s-1);t>0&&a>0&&!this._isCharWordSeparator(n.loadCell(t-1,this._workCell));){n.loadCell(t-1,this._workCell);const e=this._workCell.getChars().length;0===this._workCell.getWidth()?(l++,t--):e>1&&(_+=e-1,a-=e-1),a--,t--}for(;i<n.length&&h+1<o.length&&!this._isCharWordSeparator(n.loadCell(i+1,this._workCell));){n.loadCell(i+1,this._workCell);const e=this._workCell.getChars().length;2===this._workCell.getWidth()?(d++,i++):e>1&&(u+=e-1,h+=e-1),h++,i++}}h++;let f=a+c-l+_,v=Math.min(this._bufferService.cols,h-a+l+d-_-u);if(t||""!==o.slice(a,h).trim()){if(i&&0===f&&32!==n.getCodePoint(0)){const t=r.lines.get(e[1]-1);if(t&&n.isWrapped&&32!==t.getCodePoint(this._bufferService.cols-1)){const t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){const e=this._bufferService.cols-t.start;f-=e,v+=e}}}if(s&&f+v===this._bufferService.cols&&32!==n.getCodePoint(this._bufferService.cols-1)){const t=r.lines.get(e[1]+1);if((null==t?void 0:t.isWrapped)&&32!==t.getCodePoint(0)){const t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(v+=t.length)}}return{start:f,length:v}}}_selectWordAt(e,t){const i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){const t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){const t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(i,this._bufferService.cols)}};p=s([r(3,l.IBufferService),r(4,l.ICoreService),r(5,c.IMouseService),r(6,l.IOptionsService),r(7,c.IRenderService),r(8,c.ICoreBrowserService)],p),t.SelectionService=p},4725:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const s=i(8343);t.ICharSizeService=(0,s.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,s.createDecorator)("CoreBrowserService"),t.IMouseService=(0,s.createDecorator)("MouseService"),t.IRenderService=(0,s.createDecorator)("RenderService"),t.ISelectionService=(0,s.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,s.createDecorator)("CharacterJoinerService")},6349:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const s=i(8460);t.CircularList=class{constructor(e){this._maxLength=e,this.onDeleteEmitter=new s.EventEmitter,this.onInsertEmitter=new s.EventEmitter,this.onTrimEmitter=new s.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get onDelete(){return this.onDeleteEmitter.event}get onInsert(){return this.onInsertEmitter.event}get onTrim(){return this.onTrimEmitter.event}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...i){if(t){for(let i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+i.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<i.length;t++)this._array[this._getCyclicIndex(e+t)]=i[t];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){const e=this._length+i.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let s=t-1;s>=0;s--)this.set(e+s+i,this.get(e+s));const s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}},1439:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i=5){if("object"!=typeof t)return t;const s=Array.isArray(t)?[]:{};for(const r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},8055:(e,t)=>{var i,s,r;function n(e){const t=e.toString(16);return t.length<2?"0"+t:t}function o(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=void 0,function(e){e.toCss=function(e,t,i,s){return void 0!==s?`#${n(e)}${n(t)}${n(i)}${n(s)}`:`#${n(e)}${n(t)}${n(i)}`},e.toRgba=function(e,t,i,s=255){return(e<<24|t<<16|i<<8|s)>>>0}}(i=t.channels||(t.channels={})),function(e){function t(e,t){const s=Math.round(255*t),[n,o,a]=r.toChannels(e.rgba);return{css:i.toCss(n,o,a,s),rgba:i.toRgba(n,o,a,s)}}e.blend=function(e,t){const s=(255&t.rgba)/255;if(1===s)return{css:t.css,rgba:t.rgba};const r=t.rgba>>24&255,n=t.rgba>>16&255,o=t.rgba>>8&255,a=e.rgba>>24&255,h=e.rgba>>16&255,c=e.rgba>>8&255,l=a+Math.round((r-a)*s),d=h+Math.round((n-h)*s),_=c+Math.round((o-c)*s);return{css:i.toCss(l,d,_),rgba:i.toRgba(l,d,_)}},e.isOpaque=function(e){return!(255&~e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=r.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return r.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0,[s,n,o]=r.toChannels(t);return{css:i.toCss(s,n,o),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return t(e,(255&e.rgba)*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(t.color||(t.color={})),(t.css||(t.css={})).toColor=function(e){if(e.match(/#[0-9a-f]{3,8}/i))switch(e.length){case 4:{const t=parseInt(e.slice(1,2).repeat(2),16),i=parseInt(e.slice(2,3).repeat(2),16),s=parseInt(e.slice(3,4).repeat(2),16);return r.toColor(t,i,s)}case 5:{const t=parseInt(e.slice(1,2).repeat(2),16),i=parseInt(e.slice(2,3).repeat(2),16),s=parseInt(e.slice(3,4).repeat(2),16),n=parseInt(e.slice(4,5).repeat(2),16);return r.toColor(t,i,s,n)}case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const t=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(t){const e=parseInt(t[1]),i=parseInt(t[2]),s=parseInt(t[3]),n=Math.round(255*(void 0===t[5]?1:parseFloat(t[5])));return r.toColor(e,i,s,n)}throw new Error("css.toColor: Unsupported css format")},function(e){function t(e,t,i){const s=e/255,r=t/255,n=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(s=t.rgb||(t.rgb={})),function(e){function t(e,t,i){const r=e>>24&255,n=e>>16&255,a=e>>8&255;let h=t>>24&255,c=t>>16&255,l=t>>8&255,d=o(s.relativeLuminance2(h,c,l),s.relativeLuminance2(r,n,a));for(;d<i&&(h>0||c>0||l>0);)h-=Math.max(0,Math.ceil(.1*h)),c-=Math.max(0,Math.ceil(.1*c)),l-=Math.max(0,Math.ceil(.1*l)),d=o(s.relativeLuminance2(h,c,l),s.relativeLuminance2(r,n,a));return(h<<24|c<<16|l<<8|255)>>>0}function r(e,t,i){const r=e>>24&255,n=e>>16&255,a=e>>8&255;let h=t>>24&255,c=t>>16&255,l=t>>8&255,d=o(s.relativeLuminance2(h,c,l),s.relativeLuminance2(r,n,a));for(;d<i&&(h<255||c<255||l<255);)h=Math.min(255,h+Math.ceil(.1*(255-h))),c=Math.min(255,c+Math.ceil(.1*(255-c))),l=Math.min(255,l+Math.ceil(.1*(255-l))),d=o(s.relativeLuminance2(h,c,l),s.relativeLuminance2(r,n,a));return(h<<24|c<<16|l<<8|255)>>>0}e.ensureContrastRatio=function(e,i,n){const a=s.relativeLuminance(e>>8),h=s.relativeLuminance(i>>8);if(o(a,h)<n){if(h<a){const h=t(e,i,n),c=o(a,s.relativeLuminance(h>>8));if(c<n){const t=r(e,i,n);return c>o(a,s.relativeLuminance(t>>8))?h:t}return h}const c=r(e,i,n),l=o(a,s.relativeLuminance(c>>8));if(l<n){const r=t(e,i,n);return l>o(a,s.relativeLuminance(r>>8))?c:r}return c}},e.reduceLuminance=t,e.increaseLuminance=r,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,s,r){return{css:i.toCss(e,t,s,r),rgba:i.toRgba(e,t,s,r)}}}(r=t.rgba||(t.rgba={})),t.toPaddedHex=n,t.contrastRatio=o},8969:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const s=i(844),r=i(2585),n=i(4348),o=i(7866),a=i(744),h=i(7302),c=i(6975),l=i(8460),d=i(1753),_=i(3730),u=i(1480),f=i(7994),v=i(9282),g=i(5435),p=i(5981),S=i(2660);let m=!1;class C extends s.Disposable{constructor(e){super(),this._onBinary=new l.EventEmitter,this._onData=new l.EventEmitter,this._onLineFeed=new l.EventEmitter,this._onResize=new l.EventEmitter,this._onScroll=new l.EventEmitter,this._onWriteParsed=new l.EventEmitter,this._instantiationService=new n.InstantiationService,this.optionsService=new h.OptionsService(e),this._instantiationService.setService(r.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(a.BufferService)),this._instantiationService.setService(r.IBufferService,this._bufferService),this._logService=this._instantiationService.createInstance(o.LogService),this._instantiationService.setService(r.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.CoreService,(()=>this.scrollToBottom()))),this._instantiationService.setService(r.ICoreService,this.coreService),this.coreMouseService=this._instantiationService.createInstance(d.CoreMouseService),this._instantiationService.setService(r.ICoreMouseService,this.coreMouseService),this._dirtyRowService=this._instantiationService.createInstance(_.DirtyRowService),this._instantiationService.setService(r.IDirtyRowService,this._dirtyRowService),this.unicodeService=this._instantiationService.createInstance(u.UnicodeService),this._instantiationService.setService(r.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(r.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S.OscLinkService),this._instantiationService.setService(r.IOscLinkService,this._oscLinkService),this._inputHandler=new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._dirtyRowService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.optionsService.onOptionChange((e=>this._updateOptions(e)))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=new p.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onBinary(){return this._onBinary.event}get onData(){return this._onData.event}get onLineFeed(){return this._onLineFeed.event}get onResize(){return this._onResize.event}get onWriteParsed(){return this._onWriteParsed.event}get onScroll(){return this._onScrollApi||(this._onScrollApi=new l.EventEmitter,this.register(this._onScroll.event((e=>{var t;null===(t=this._onScrollApi)||void 0===t||t.fire(e.position)})))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(const t in e)this.optionsService.options[t]=e[t]}dispose(){var e;this._isDisposed||(super.dispose(),null===(e=this._windowsMode)||void 0===e||e.dispose(),this._windowsMode=void 0)}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=r.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,a.MINIMUM_COLS),t=Math.max(t,a.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}scrollPages(e){this._bufferService.scrollPages(e)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(e){this._bufferService.scrollToLine(e)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_updateOptions(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}}_enableWindowsMode(){if(!this._windowsMode){const e=[];e.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},(()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsMode={dispose:()=>{for(const t of e)t.dispose()}}}}}t.CoreTerminal=C},8460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}})),this._event}fire(e,t){const i=[];for(let e=0;e<this._listeners.length;e++)i.push(this._listeners[e]);for(let s=0;s<i.length;s++)i[s].call(void 0,e,t)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))}},5435:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const s=i(2584),r=i(7116),n=i(2015),o=i(844),a=i(482),h=i(8437),c=i(8460),l=i(643),d=i(511),_=i(3734),u=i(2585),f=i(6242),v=i(6351),g=i(5941),p={"(":0,")":1,"*":2,"+":3,"-":1,".":2},S=131072;function m(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var C;!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(C=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));class b extends o.Disposable{constructor(e,t,i,o,l,_,u,g,p,S=new n.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._dirtyRowService=o,this._logService=l,this._optionsService=_,this._oscLinkService=u,this._coreMouseService=g,this._unicodeService=p,this._parser=S,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new a.StringToUtf32,this._utf8Decoder=new a.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=new c.EventEmitter,this._onRequestRefreshRows=new c.EventEmitter,this._onRequestReset=new c.EventEmitter,this._onRequestSendFocus=new c.EventEmitter,this._onRequestSyncScrollBar=new c.EventEmitter,this._onRequestWindowsOptionsReport=new c.EventEmitter,this._onA11yChar=new c.EventEmitter,this._onA11yTab=new c.EventEmitter,this._onCursorMove=new c.EventEmitter,this._onLineFeed=new c.EventEmitter,this._onScroll=new c.EventEmitter,this._onTitleChange=new c.EventEmitter,this._onColor=new c.EventEmitter,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})})),this._parser.setOscHandlerFallback(((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})})),this._parser.setDcsHandlerFallback(((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})})),this._parser.setPrintHandler(((e,t,i)=>this.print(e,t,i))),this._parser.registerCsiHandler({final:"@"},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:"A"},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:"B"},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:"C"},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:"D"},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:"E"},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:"F"},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:"G"},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:"H"},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:"I"},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:"J"},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:"K"},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:"L"},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:"M"},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:"P"},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:"S"},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:"T"},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:"X"},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:"Z"},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:"a"},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:"b"},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:"c"},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:">",final:"c"},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:"d"},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:"e"},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:"f"},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:"g"},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:"h"},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:"l"},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:"m"},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:"n"},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:"r"},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:"s"},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:"t"},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:"u"},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(s.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(s.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(s.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(s.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(s.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(s.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(s.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(s.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(s.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(s.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new f.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new f.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new f.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new f.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new f.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new f.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new f.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new f.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new f.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new f.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new f.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new f.OscHandler((e=>this.restoreCursorColor(e)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const e in r.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:e},(()=>this.selectCharset("("+e))),this._parser.registerEscHandler({intermediates:")",final:e},(()=>this.selectCharset(")"+e))),this._parser.registerEscHandler({intermediates:"*",final:e},(()=>this.selectCharset("*"+e))),this._parser.registerEscHandler({intermediates:"+",final:e},(()=>this.selectCharset("+"+e))),this._parser.registerEscHandler({intermediates:"-",final:e},(()=>this.selectCharset("-"+e))),this._parser.registerEscHandler({intermediates:".",final:e},(()=>this.selectCharset("."+e))),this._parser.registerEscHandler({intermediates:"/",final:e},(()=>this.selectCharset("/"+e)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error("Parsing error: ",e),e))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new v.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}getAttrData(){return this._curAttrData}get onRequestBell(){return this._onRequestBell.event}get onRequestRefreshRows(){return this._onRequestRefreshRows.event}get onRequestReset(){return this._onRequestReset.event}get onRequestSendFocus(){return this._onRequestSendFocus.event}get onRequestSyncScrollBar(){return this._onRequestSyncScrollBar.event}get onRequestWindowsOptionsReport(){return this._onRequestWindowsOptionsReport.event}get onA11yChar(){return this._onA11yChar.event}get onA11yTab(){return this._onA11yTab.event}get onCursorMove(){return this._onCursorMove.event}get onLineFeed(){return this._onLineFeed.event}get onScroll(){return this._onScroll.event}get onTitleChange(){return this._onTitleChange.event}get onColor(){return this._onColor.event}dispose(){super.dispose()}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=u.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t("#SLOW_TIMEOUT")),5e3)))]).catch((e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")}))}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0;const o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>S&&(n=this._parseStack.position+S)}if(this._logService.logLevel<=u.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join("")}"`),"string"==typeof e?e.split("").map((e=>e.charCodeAt(0))):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<S&&(this._parseBuffer=new Uint32Array(Math.min(e.length,S))),o||this._dirtyRowService.clearRange(),e.length>S)for(let t=n;t<e.length;t+=S){const n=t+S<e.length?t+S:e.length,o="string"==typeof e?this._stringDecoder.decode(e.substring(t,n),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,n),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,o))return this._preserveStack(s,r,o,t),this._logSlowResolvingAsync(i),i}else if(!o){const t="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,t))return this._preserveStack(s,r,t,0),this._logSlowResolvingAsync(i),i}this._activeBuffer.x===s&&this._activeBuffer.y===r||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)}print(e,t,i){let s,r;const n=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,_=this._curAttrData;let u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowService.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&2===u.getWidth(this._activeBuffer.x-1)&&u.setCellFromCodePoint(this._activeBuffer.x-1,0,1,_.fg,_.bg,_.extended);for(let f=t;f<i;++f){if(s=e[f],r=this._unicodeService.wcwidth(s),s<127&&n){const e=n[String.fromCharCode(s)];e&&(s=e.charCodeAt(0))}if(o&&this._onA11yChar.fire((0,a.stringFromCodePoint)(s)),void 0!==this._currentLinkId&&this._oscLinkService.addLineToLink(this._currentLinkId,this._activeBuffer.ybase+this._activeBuffer.y),r||!this._activeBuffer.x){if(this._activeBuffer.x+r-1>=h)if(c){for(;this._activeBuffer.x<h;)u.setCellFromCodePoint(this._activeBuffer.x++,0,1,_.fg,_.bg,_.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=h-1,2===r)continue;if(d&&(u.insertCells(this._activeBuffer.x,r,this._activeBuffer.getNullCell(_),_),2===u.getWidth(h-1)&&u.setCellFromCodePoint(h-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,_.fg,_.bg,_.extended)),u.setCellFromCodePoint(this._activeBuffer.x++,s,r,_.fg,_.bg,_.extended),r>0)for(;--r;)u.setCellFromCodePoint(this._activeBuffer.x++,0,0,_.fg,_.bg,_.extended)}else u.getWidth(this._activeBuffer.x-1)?u.addCodepointToCell(this._activeBuffer.x-1,s):u.addCodepointToCell(this._activeBuffer.x-2,s)}i-t>0&&(u.loadCell(this._activeBuffer.x-1,this._workCell),2===this._workCell.getWidth()||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<h&&i-t>0&&0===u.getWidth(this._activeBuffer.x)&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodePoint(this._activeBuffer.x,0,1,_.fg,_.bg,_.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!m(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new v.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new f.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowService.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var e;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(null===(e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))||void 0===e?void 0:e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowService.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){const t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){const t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){const t=e.params[0];return 0===t?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===t&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){const t=e.params[0];return 1===t&&(this._curAttrData.bg|=536870912),2!==t&&0!==t||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){const n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowService.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowService.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowService.markDirty(0);break;case 3:const e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const i=this._activeBuffer.ybase+this._activeBuffer.y;let s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();const t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();const t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(h.DEFAULT_ATTR_DATA));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),i.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();const t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){if(!this._parser.precedingCodepoint)return!0;const t=e.params[0]||1,i=new Uint32Array(t);for(let e=0;e<t;++e)i[e]=this._parser.precedingCodepoint;return this.print(i,0,i.length),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(s.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(s.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(s.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(s.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(s.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,r.DEFAULT_CHARSET),this._charsetService.setgCharset(1,r.DEFAULT_CHARSET),this._charsetService.setgCharset(2,r.DEFAULT_CHARSET),this._charsetService.setgCharset(3,r.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[t]&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){const i=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:a,cols:h}=this._bufferService,{active:c,alt:l}=a,d=this._optionsService.rawOptions,_=e=>e?1:2,u=e.params[0];return f=u,v=t?2===u?3:4===u?_(o.modes.insertMode):12===u?4:20===u?_(d.convertEol):0:1===u?_(i.applicationCursorKeys):3===u?d.windowOptions.setWinLines?80===h?2:132===h?1:0:0:6===u?_(i.origin):7===u?_(i.wraparound):8===u?3:9===u?_("X10"===r):12===u?_(d.cursorBlink):25===u?_(!o.isCursorHidden):45===u?_(i.reverseWraparound):66===u?_(i.applicationKeypad):1e3===u?_("VT200"===r):1002===u?_("DRAG"===r):1003===u?_("ANY"===r):1004===u?_(i.sendFocus):1005===u?4:1006===u?_("SGR"===n):1015===u?4:1016===u?_("SGR_PIXELS"===n):1048===u?1:47===u||1047===u||1049===u?_(c===l):2004===u?_(i.bracketedPasteMode):0,o.triggerDataEvent(`${s.C0.ESC}[${t?"":"?"}${f};${v}$y`),!0;var f,v}_updateAttrColor(e,t,i,s,r){return 2===t?(e|=50331648,e&=-16777216,e|=_.AttributeData.fromColorRGB([i,s,r])):5===t&&(e&=-50331904,e|=33554432|255&i),e}_extractColor(e,t,i){const s=[0,0,-1,0,0,0];let r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){const i=e.getSubParams(t+n);let o=0;do{5===s[1]&&(r=1),s[n+o+1+r]=i[o]}while(++o<i.length&&o+n+1+r<s.length);break}if(5===s[1]&&n+r>=2||2===s[1]&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let e=2;e<s.length;++e)-1===s[e]&&(s[e]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=h.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=h.DEFAULT_ATTR_DATA.bg,!0;const t=e.length;let i;const s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?(s.fg=h.DEFAULT_ATTR_DATA.fg,s.bg=h.DEFAULT_ATTR_DATA.bg):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?r+=this._extractColor(e,r,s):59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${s.C0.ESC}[0n`);break;case 6:const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${s.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${s.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){const t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const i=t%2==1;return this._optionsService.options.cursorBlink=i,!0}setScrollRegion(e){const t=e.params[0]||1;let i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||0===i)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!m(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;const t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(C.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(C.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${s.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){const t=[],i=e.split(";");for(;i.length>1;){const e=i.shift(),s=i.shift();if(/^\d+$/.exec(e)){const i=parseInt(e);if(0<=i&&i<256)if("?"===s)t.push({type:0,index:i});else{const e=(0,g.parseColor)(s);e&&t.push({type:1,index:i,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){const t=e.split(";");return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){void 0!==this._currentLinkId&&this._finishHyperlink();const i=e.split(":");let s;const r=i.findIndex((e=>e.startsWith("id=")));return-1!==r&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),this._currentLinkId=void 0,!0}_setOrReportSpecialColor(e,t){const i=e.split(";");for(let e=0;e<i.length&&!(t>=this._specialColors.length);++e,++t)if("?"===i[e])this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{const s=(0,g.parseColor)(i[e]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;const t=[],i=e.split(";");for(let e=0;e<i.length;++e)if(/^\d+$/.exec(i[e])){const s=parseInt(i[e]);0<=s&&s<256&&t.push({type:2,index:s})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,r.DEFAULT_CHARSET),!0}selectCharset(e){return 2!==e.length?(this.selectDefaultCharset(),!0):("/"===e[0]||this._charsetService.setgCharset(p[e[0]],r.CHARSETS[e[1]]||r.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){const e=new d.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){const i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowService.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){const i=this._bufferService.buffer,r=this._optionsService.rawOptions;return(e=>(this._coreService.triggerDataEvent(`${s.C0.ESC}${e}${s.C0.ESC}\\`),!0))('"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}}t.InputHandler=b},844:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},1505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,n){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,n)}get(e,t,i,s){var r;return null===(r=this._data.get(e,t))||void 0===r?void 0:r.get(i,s)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isLegacyEdge=t.isFirefox=void 0;const i="undefined"==typeof navigator,s=i?"node":navigator.userAgent,r=i?"node":navigator.platform;t.isFirefox=s.includes("Firefox"),t.isLegacyEdge=s.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(s),t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(r),t.isIpad="iPad"===r,t.isIphone="iPhone"===r,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(r),t.isLinux=r.indexOf("Linux")>=0},6106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let i=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){0!==this._array.length?(i=this._search(this._getKey(e),0,this._array.length-1),this._array.splice(i,0,e)):this._array.push(e)}delete(e){if(0===this._array.length)return!1;const t=this._getKey(e);if(void 0===t)return!1;if(i=this._search(t,0,this._array.length-1),-1===i)return!1;if(this._getKey(this._array[i])!==t)return!1;do{if(this._array[i]===e)return this._array.splice(i,1),!0}while(++i<this._array.length&&this._getKey(this._array[i])===t);return!1}*getKeyIterator(e){if(0!==this._array.length&&(i=this._search(e,0,this._array.length-1),!(i<0||i>=this._array.length)&&this._getKey(this._array[i])===e))do{yield this._array[i]}while(++i<this._array.length&&this._getKey(this._array[i])===e)}forEachByKey(e,t){if(0!==this._array.length&&(i=this._search(e,0,this._array.length-1),!(i<0||i>=this._array.length)&&this._getKey(this._array[i])===e))do{t(this._array[i])}while(++i<this._array.length&&this._getKey(this._array[i])===e)}values(){return this._array.values()}_search(e,t,i){if(i<t)return t;let s=Math.floor((t+i)/2);const r=this._getKey(this._array[s]);if(r>e)return this._search(e,t,s-1);if(r<e)return this._search(e,s+1,i);for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}},8273:(e,t)=>{function i(e,t,i=0,s=e.length){if(i>=e.length)return e;i=(e.length+i)%e.length,s=s>=e.length?e.length:(e.length+s)%e.length;for(let r=i;r<s;++r)e[r]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fillFallback=t.fill=void 0,t.fill=function(e,t,s,r){return e.fill?e.fill(t,s,r):i(e,t,s,r)},t.fillFallback=i,t.concat=function(e,t){const i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},9282:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const s=i(643);t.updateWindowsModeWrappedState=function(e){const t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),i=null==t?void 0:t.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=i[s.CHAR_DATA_CODE_INDEX]!==s.NULL_CELL_CODE&&i[s.CHAR_DATA_CODE_INDEX]!==s.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return!(50331648&~this.fg)}isBgRGB(){return!(50331648&~this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return!(50331648&this.fg)}isBgDefault(){return!(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&~this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?!(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}t.AttributeData=i;class s{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},9092:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;const s=i(6349),r=i(8437),n=i(511),o=i(643),a=i(4634),h=i(4863),c=i(7116),l=i(3734);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=r.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=n.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new r.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;const i=e+this._optionsService.rawOptions.scrollback;return i>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=r.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const i=this.getNullCell(r.DEFAULT_ATTR_DATA),s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)this.lines.get(t).resize(e,i);let n=0;if(this._rows<t)for(let s=this._rows;s<t;s++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode?this.lines.push(new r.BufferLine(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new r.BufferLine(e,i)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){const e=this.lines.length-s;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)this.lines.get(t).resize(e,i);this._cols=e,this._rows=t}get _isReflowEnabled(){return this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const i=(0,a.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(r.DEFAULT_ATTR_DATA));if(i.length>0){const s=(0,a.reflowLargerCreateNewLayout)(this.lines,i);(0,a.reflowLargerApplyNewLayout)(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){const s=this.getNullCell(r.DEFAULT_ATTR_DATA);let n=i;for(;n-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new r.BufferLine(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){const i=this.getNullCell(r.DEFAULT_ATTR_DATA),s=[];let n=0;for(let o=this.lines.length-1;o>=0;o--){let h=this.lines.get(o);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;const c=[h];for(;h.isWrapped&&o>0;)h=this.lines.get(--o),c.unshift(h);const l=this.ybase+this.y;if(l>=o&&l<o+c.length)continue;const d=c[c.length-1].getTrimmedLength(),_=(0,a.reflowSmallerGetNewLineLengths)(c,this._cols,e),u=_.length-c.length;let f;f=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+u):Math.max(0,this.lines.length-this.lines.maxLength+u);const v=[];for(let e=0;e<u;e++){const e=this.getBlankLine(r.DEFAULT_ATTR_DATA,!0);v.push(e)}v.length>0&&(s.push({start:o+c.length+n,newLines:v}),n+=v.length),c.push(...v);let g=_.length-1,p=_[g];0===p&&(g--,p=_[g]);let S=c.length-u-1,m=d;for(;S>=0;){const e=Math.min(m,p);if(void 0===c[g])break;if(c[g].copyCellsFrom(c[S],m-e,p-e,e,!0),p-=e,0===p&&(g--,p=_[g]),m-=e,0===m){S--;const e=Math.max(S,0);m=(0,a.getWrappedLineTrimmedLength)(c,e,this._cols)}}for(let t=0;t<c.length;t++)_[t]<e&&c[t].setCell(_[t],i);let C=u-f;for(;C-- >0;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(s.length>0){const e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));const i=this.lines.length;let r=i-1,o=0,a=s[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let h=0;for(let c=Math.min(this.lines.maxLength-1,i+n-1);c>=0;c--)if(a&&a.start>r+h){for(let e=a.newLines.length-1;e>=0;e--)this.lines.set(c--,a.newLines[e]);c++,e.push({index:r+1,amount:a.newLines.length}),h+=a.newLines.length,a=s[++o]}else this.lines.set(c,t[r--]);let c=0;for(let t=e.length-1;t>=0;t--)e[t].index+=c,this.lines.onInsertEmitter.fire(e[t]),c+=e[t].amount;const l=Math.max(0,i+n-this.lines.maxLength);l>0&&this.lines.onTrimEmitter.fire(l)}}stringIndexToBufferIndex(e,t,i=!1){for(;t;){const s=this.lines.get(e);if(!s)return[-1,-1];const r=i?s.getTrimmedLength():s.length;for(let i=0;i<r;++i)if(s.get(i)[o.CHAR_DATA_WIDTH_INDEX]&&(t-=s.get(i)[o.CHAR_DATA_CHAR_INDEX].length||1),t<0)return[e,i];e++}return[e,0]}translateBufferLineToString(e,t,i=0,s){const r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){const t=new h.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((e=>{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}iterator(e,t,i,s,r){return new d(this,e,t,i,s,r)}};class d{constructor(e,t,i=0,s=e.lines.length,r=0,n=0){this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=s,this._startOverscan=r,this._endOverscan=n,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._current<this._endIndex}next(){const e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);let t="";for(let i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}}}t.BufferStringIterator=d},8437:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const s=i(482),r=i(643),n=i(511),o=i(3734);t.DEFAULT_ATTR_DATA=Object.freeze(new o.AttributeData);const a={startIndex:0};class h{constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=t||n.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]);for(let t=0;t<e;++t)this.setCell(t,s);this.length=e}get(e){const t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:i?(0,s.stringFromCodePoint)(i):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[r.CHAR_DATA_ATTR_INDEX],t[r.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[r.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[r.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,s.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return a.startIndex=3*e,t.content=this._data[a.startIndex+0],t.fg=this._data[a.startIndex+1],t.bg=this._data[a.startIndex+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodePoint(e,t,i,s,r,n){268435456&r&&(this._extendedAttrs[e]=n),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=s,this._data[3*e+2]=r}addCodepointToCell(e,t){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,s.stringFromCodePoint)(t):(2097151&i?(this._combined[e]=(0,s.stringFromCodePoint)(2097151&i)+(0,s.stringFromCodePoint)(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[3*e+0]=i)}insertCells(e,t,i,s){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),t<this.length-e){const s=new n.CellData;for(let i=this.length-e-t-1;i>=0;--i)this.setCell(e+t+i,this.loadCell(e+i,s));for(let s=0;s<t;++s)this.setCell(e+s,i)}else for(let t=e;t<this.length;++t)this.setCell(t,i);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs)}deleteCells(e,t,i,s){if(e%=this.length,t<this.length-e){const s=new n.CellData;for(let i=0;i<this.length-e-t;++i)this.setCell(e+i,this.loadCell(e+t+i,s));for(let e=this.length-t;e<this.length;++e)this.setCell(e,i)}else for(let t=e;t<this.length;++t)this.setCell(t,i);e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs)}replaceCells(e,t,i,s,r=!1){if(r)for(e&&2===this.getWidth(e-1)&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&!this.isProtected(t)&&this.setCellFromCodePoint(t,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null==s?void 0:s.fg)||0,(null==s?void 0:s.bg)||0,(null==s?void 0:s.extended)||new o.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,i)}resize(e,t){if(e!==this.length){if(e>this.length){const i=new Uint32Array(3*e);this.length&&(3*e<this._data.length?i.set(this._data.subarray(0,3*e)):i.set(this._data)),this._data=i;for(let i=this.length;i<e;++i)this.setCell(i,t)}else if(e){const t=new Uint32Array(3*e);t.set(this._data.subarray(0,3*e)),this._data=t;const i=Object.keys(this._combined);for(let t=0;t<i.length;t++){const s=parseInt(i[t],10);s>=e&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(const t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){const e=new h(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const t in this._combined)e._combined[t]=this._combined[t];for(const t in this._extendedAttrs)e._extendedAttrs[t]=this._extendedAttrs[t];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let r=s-1;r>=0;r--){for(let e=0;e<3;e++)this._data[3*(i+r)+e]=n[3*(t+r)+e];268435456&n[3*(t+r)+2]&&(this._extendedAttrs[i+r]=e._extendedAttrs[t+r])}else for(let r=0;r<s;r++){for(let e=0;e<3;e++)this._data[3*(i+r)+e]=n[3*(t+r)+e];268435456&n[3*(t+r)+2]&&(this._extendedAttrs[i+r]=e._extendedAttrs[t+r])}const o=Object.keys(e._combined);for(let s=0;s<o.length;s++){const r=parseInt(o[s],10);r>=t&&(this._combined[r-t+i]=e._combined[r])}}translateToString(e=!1,t=0,i=this.length){e&&(i=Math.min(i,this.getTrimmedLength()));let n="";for(;t<i;){const e=this._data[3*t+0],i=2097151&e;n+=2097152&e?this._combined[t]:i?(0,s.stringFromCodePoint)(i):r.WHITESPACE_CELL_CHAR,t+=e>>22||1}return n}}t.BufferLine=h},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function i(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();const s=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),r=2===e[t+1].getWidth(0);return s&&r?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,s,r,n){const o=[];for(let a=0;a<e.length-1;a++){let h=a,c=e.get(++h);if(!c.isWrapped)continue;const l=[e.get(a)];for(;h<e.length&&c.isWrapped;)l.push(c),c=e.get(++h);if(r>=a&&r<h){a+=l.length-1;continue}let d=0,_=i(l,d,t),u=1,f=0;for(;u<l.length;){const e=i(l,u,t),r=e-f,o=s-_,a=Math.min(r,o);l[d].copyCellsFrom(l[u],f,_,a,!1),_+=a,_===s&&(d++,_=0),f+=a,f===e&&(u++,f=0),0===_&&0!==d&&2===l[d-1].getWidth(s-1)&&(l[d].copyCellsFrom(l[d-1],s-1,_++,1,!1),l[d-1].setCell(s-1,n))}l[d].replaceCells(_,s,n);let v=0;for(let e=l.length-1;e>0&&(e>d||0===l[e].getTrimmedLength());e--)v++;v>0&&(o.push(a+l.length-v),o.push(v)),a+=l.length-1}return o},t.reflowLargerCreateNewLayout=function(e,t){const i=[];let s=0,r=t[s],n=0;for(let o=0;o<e.length;o++)if(r===o){const i=t[++s];e.onDeleteEmitter.fire({index:o-n,amount:i}),o+=i-1,n+=i,r=t[++s]}else i.push(o);return{layout:i,countRemoved:n}},t.reflowLargerApplyNewLayout=function(e,t){const i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let t=0;t<i.length;t++)e.set(t,i[t]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,s){const r=[],n=e.map(((s,r)=>i(e,r,t))).reduce(((e,t)=>e+t));let o=0,a=0,h=0;for(;h<n;){if(n-h<s){r.push(n-h);break}o+=s;const c=i(e,a,t);o>c&&(o-=c,a++);const l=2===e[a].getWidth(o-1);l&&o--;const d=l?s-1:s;r.push(d),h+=d}return r},t.getWrappedLineTrimmedLength=i},5295:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const s=i(9092),r=i(8460),n=i(844);class o extends n.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new r.EventEmitter),this.reset()}get onBufferActivate(){return this._onBufferActivate.event}reset(){this._normal=new s.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new s.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(482),r=i(643),n=i(3734);class o extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const s=i(8460),r=i(844);class n extends r.Disposable{constructor(e){super(),this.line=e,this._id=n._nextId++,this.isDisposed=!1,this._onDispose=new s.EventEmitter}get id(){return this._id}get onDispose(){return this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),super.dispose())}}t.Marker=n,n._nextId=1},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(e,t)=>{var i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(i=t.C0||(t.C0={})),(s=t.C1||(t.C1={})).PAD="",s.HOP="",s.BPH="",s.NBH="",s.IND="",s.NEL="
",s.SSA="",s.ESA="",s.HTS="",s.HTJ="",s.VTS="",s.PLD="",s.PLU="",s.RI="",s.SS2="",s.SS3="",s.DCS="",s.PU1="",s.PU2="",s.STS="",s.CCH="",s.MW="",s.SPA="",s.EPA="",s.SOS="",s.SGCI="",s.SCI="",s.CSI="",s.ST="",s.OSC="",s.PM="",s.APC="",(t.C1_ESCAPED||(t.C1_ESCAPED={})).ST=`${i.ESC}\\`},7399:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const s=i(2584),r={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,n){const o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B");break;case 8:if(e.altKey){o.key=s.C0.ESC+s.C0.DEL;break}o.key=s.C0.DEL;break;case 9:if(e.shiftKey){o.key=s.C0.ESC+"[Z";break}o.key=s.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?s.C0.ESC+s.C0.CR:s.C0.CR,o.cancel=!0;break;case 27:o.key=s.C0.ESC,e.altKey&&(o.key=s.C0.ESC+s.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"D",o.key===s.C0.ESC+"[1;3D"&&(o.key=s.C0.ESC+(i?"b":"[1;5D"))):o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D";break;case 39:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"C",o.key===s.C0.ESC+"[1;3C"&&(o.key=s.C0.ESC+(i?"f":"[1;5C"))):o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C";break;case 38:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"A",i||o.key!==s.C0.ESC+"[1;3A"||(o.key=s.C0.ESC+"[1;5A")):o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A";break;case 40:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"B",i||o.key!==s.C0.ESC+"[1;3B"||(o.key=s.C0.ESC+"[1;5B")):o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(o.key=s.C0.ESC+"[2~");break;case 46:o.key=a?s.C0.ESC+"[3;"+(a+1)+"~":s.C0.ESC+"[3~";break;case 36:o.key=a?s.C0.ESC+"[1;"+(a+1)+"H":t?s.C0.ESC+"OH":s.C0.ESC+"[H";break;case 35:o.key=a?s.C0.ESC+"[1;"+(a+1)+"F":t?s.C0.ESC+"OF":s.C0.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=s.C0.ESC+"[5;"+(a+1)+"~":o.key=s.C0.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=s.C0.ESC+"[6;"+(a+1)+"~":o.key=s.C0.ESC+"[6~";break;case 112:o.key=a?s.C0.ESC+"[1;"+(a+1)+"P":s.C0.ESC+"OP";break;case 113:o.key=a?s.C0.ESC+"[1;"+(a+1)+"Q":s.C0.ESC+"OQ";break;case 114:o.key=a?s.C0.ESC+"[1;"+(a+1)+"R":s.C0.ESC+"OR";break;case 115:o.key=a?s.C0.ESC+"[1;"+(a+1)+"S":s.C0.ESC+"OS";break;case 116:o.key=a?s.C0.ESC+"[15;"+(a+1)+"~":s.C0.ESC+"[15~";break;case 117:o.key=a?s.C0.ESC+"[17;"+(a+1)+"~":s.C0.ESC+"[17~";break;case 118:o.key=a?s.C0.ESC+"[18;"+(a+1)+"~":s.C0.ESC+"[18~";break;case 119:o.key=a?s.C0.ESC+"[19;"+(a+1)+"~":s.C0.ESC+"[19~";break;case 120:o.key=a?s.C0.ESC+"[20;"+(a+1)+"~":s.C0.ESC+"[20~";break;case 121:o.key=a?s.C0.ESC+"[21;"+(a+1)+"~":s.C0.ESC+"[21~";break;case 122:o.key=a?s.C0.ESC+"[23;"+(a+1)+"~":s.C0.ESC+"[23~";break;case 123:o.key=a?s.C0.ESC+"[24;"+(a+1)+"~":s.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!n||!e.altKey||e.metaKey)!i||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?o.key=e.key:e.key&&e.ctrlKey&&("_"===e.key&&(o.key=s.C0.US),"@"===e.key&&(o.key=s.C0.NUL)):65===e.keyCode&&(o.type=1);else{const t=r[e.keyCode],i=null==t?void 0:t[e.shiftKey?1:0];if(i)o.key=s.C0.ESC+i;else if(e.keyCode>=65&&e.keyCode<=90){const t=e.ctrlKey?e.keyCode-64:e.keyCode+32;let i=String.fromCharCode(t);e.shiftKey&&(i=i.toUpperCase()),o.key=s.C0.ESC+i}else if("Dead"===e.key&&e.code.startsWith("Key")){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=s.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?o.key=s.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?o.key=s.C0.DEL:219===e.keyCode?o.key=s.C0.ESC:220===e.keyCode?o.key=s.C0.FS:221===e.keyCode&&(o.key=s.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let t=e[r];t>65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let n=r;n<i;++n){const r=e.charCodeAt(n);if(55296<=r&&r<=56319){if(++n>=i)return this._interim=r,s;const o=e.charCodeAt(n);56320<=o&&o<=57343?t[s++]=1024*(r-55296)+o-56320+65536:(t[s++]=r,t[s++]=o)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,n,o,a=0,h=0,c=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let n,o=0;for(;(n=63&this.interim[++o])&&o<4;)r<<=6,r|=n;const h=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,l=h-o;for(;c<l;){if(c>=i)return 0;if(n=e[c++],128!=(192&n)){c--,s=!0;break}this.interim[o++]=n,r<<=6,r|=63&n}s||(2===h?r<128?c--:t[a++]=r:3===h?r<2048||r>=55296&&r<=57343||65279===r||(t[a++]=r):r<65536||r>1114111||(t[a++]=r)),this.interim.fill(0)}const l=i-4;let d=c;for(;d<i;){for(;!(!(d<l)||128&(s=e[d])||128&(r=e[d+1])||128&(n=e[d+2])||128&(o=e[d+3]));)t[a++]=s,t[a++]=r,t[a++]=n,t[a++]=o,d+=4;if(s=e[d++],s<128)t[a++]=s;else if(192==(224&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(h=(31&s)<<6|63&r,h<128){d--;continue}t[a++]=h}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(h=(15&s)<<12|(63&r)<<6|63&n,h<2048||h>=55296&&h<=57343||65279===h)continue;t[a++]=h}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=n,a;if(o=e[d++],128!=(192&o)){d--;continue}if(h=(7&s)<<18|(63&r)<<12|(63&n)<<6|63&o,h<65536||h>1114111)continue;t[a++]=h}}return a}}},225:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const s=i(8273),r=[[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]],n=[[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]];let o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),(0,s.fill)(o,1),o[0]=0,(0,s.fill)(o,0,1,32),(0,s.fill)(o,0,127,160),(0,s.fill)(o,2,4352,4448),o[9001]=2,o[9002]=2,(0,s.fill)(o,2,11904,42192),o[12351]=1,(0,s.fill)(o,2,44032,55204),(0,s.fill)(o,2,63744,64256),(0,s.fill)(o,2,65040,65050),(0,s.fill)(o,2,65072,65136),(0,s.fill)(o,2,65280,65377),(0,s.fill)(o,2,65504,65511);for(let e=0;e<r.length;++e)(0,s.fill)(o,0,r[e][0],r[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let i,s=0,r=t.length-1;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=s;)if(i=s+r>>1,e>t[i][1])s=i+1;else{if(!(e<t[i][0]))return!0;r=i-1}return!1}(e,n)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}}},5981:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const s=i(8460),r="undefined"==typeof queueMicrotask?e=>{Promise.resolve().then(e)}:queueMicrotask;t.WriteBuffer=class{constructor(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new s.EventEmitter}get onWriteParsed(){return this._onWriteParsed.event}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout((()=>this._innerWrite()))),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,t);if(s){const e=e=>Date.now()-i>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(i,e);return void s.catch((e=>(r((()=>{throw e})),Promise.resolve(!1)))).then(e)}const n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-i>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const i=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,s=/^[\da-f]+$/;function r(e,t){const i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(0===t.indexOf("rgb:")){t=t.slice(4);const e=i.exec(t);if(e){const t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(0===t.indexOf("#")&&(t=t.slice(1),s.exec(t)&&[3,6,9,12].includes(t.length))){const e=t.length/3,i=[0,0,0];for(let s=0;s<3;++s){const r=parseInt(t.slice(e*s,e*s+e),16);i[s]=1===e?r<<4:2===e?r:3===e?r>>4:r>>8}return i}},t.toRgbString=function(e,t=16){const[i,s,n]=e;return`rgb:${r(i,t)}/${r(s,t)}/${r(n,t)}`}},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const s=i(482),r=i(8742),n=i(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(e,t,i))}unhook(e,t=!0){if(this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].unhook(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",e);this._active=o,this._ident=0}};const a=new r.Params;a.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=a,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():a,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=a,this._data="",this._hitLimit=!1,e)));return this._params=a,this._data="",this._hitLimit=!1,t}}},2015:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const s=i(844),r=i(8273),n=i(8742),o=i(6242),a=i(6351);class h{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){(0,r.fill)(this.table,e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}}t.TransitionTable=h;const c=160;t.VT500_TRANSITION_TABLE=function(){const e=new h(4095),t=Array.apply(null,Array(256)).map(((e,t)=>t)),i=(e,i)=>t.slice(e,i),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));const n=i(0,14);let o;for(o in e.setDefault(1,0),e.addMany(s,0,2,0),n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(c,0,2,0),e.add(c,8,5,8),e.add(c,6,0,6),e.add(c,11,0,11),e.add(c,13,13,13),e}();class l extends s.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new n.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser=new o.OscParser,this._dcsParser=new a.DcsParser,this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let t=0;t<e.intermediates.length;++t){const s=e.intermediates.charCodeAt(t);if(32>s||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=s}}if(1!==e.final.length)throw new Error("final must be a single byte");const s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}dispose(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);const s=this._escHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);const s=this._csiHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const t=this._parseStack.handlers;let n=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](this._params),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 4:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],s=this._dcsParser.unhook(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],s=this._oscParser.end(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let i=o;i<t;++i){switch(r=e[i],n=this._transitions.table[this.currentState<<8|(r<160?r:c)],n>>4){case 2:for(let s=i+1;;++s){if(s>=t||(r=e[s])<32||r>126&&r<c){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<c){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<c){this._printHandler(e,i,s),i=s-1;break}if(++s>=t||(r=e[s])<32||r>126&&r<c){this._printHandler(e,i,s),i=s-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:i,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const o=this._csiHandlers[this._collect<<8|r];let a=o?o.length-1:-1;for(;a>=0&&(s=o[a](this._params),!0!==s);a--)if(s instanceof Promise)return this._preserveStack(3,o,a,n,i),s;a<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingCodepoint=0;break;case 8:do{switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}}while(++i<t&&(r=e[i])>47&&r<60);i--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:const h=this._escHandlers[this._collect<<8|r];let l=h?h.length-1:-1;for(;l>=0&&(s=h[l](),!0!==s);l--)if(s instanceof Promise)return this._preserveStack(4,h,l,n,i),s;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let s=i+1;;++s)if(s>=t||24===(r=e[s])||26===r||27===r||r>127&&r<c){this._dcsParser.put(e,i,s),i=s-1;break}break;case 14:if(s=this._dcsParser.unhook(24!==r&&26!==r),s)return this._preserveStack(6,[],0,n,i),s;27===r&&(n|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let s=i+1;;s++)if(s>=t||(r=e[s])<32||r>127&&r<c){this._oscParser.put(e,i,s),i=s-1;break}break;case 6:if(s=this._oscParser.end(24!==r&&26!==r),s)return this._preserveStack(5,[],0,n,i),s;27===r&&(n|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&n}}}t.EscapeSequenceParser=l},6242:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const s=i(5770),r=i(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._id,"PUT",(0,r.utf32ToString)(e,t,i))}start(){this.reset(),this._state=1}put(e,t,i){if(3!==this._state){if(1===this._state)for(;t<i;){const i=e[t++];if(59===i){this._state=2,this._start();break}if(i<48||57<i)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+i-48}2===this._state&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].end(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._id,"END",e);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,i),this._data.length>s.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data="",this._hitLimit=!1,e)));return this._data="",this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const i=2147483647;class s{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Array.isArray(e[0])?1:0;i<e.length;++i){const s=e[i];if(Array.isArray(s))for(let e=0;e<s.length;++e)t.addSubParam(s[e]);else t.addParam(s)}return t}clone(){const e=new s(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){const e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);const i=this._subParamsIdx[t]>>8,s=255&this._subParamsIdx[t];s-i>0&&e.push(Array.prototype.slice.call(this._subParams,i,s))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>i?i:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>i?i:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParamsIdx[e];return i-t>0?this._subParams.subarray(t,i):null}getSubParamsAll(){const e={};for(let t=0;t<this.length;++t){const i=this._subParamsIdx[t]>>8,s=255&this._subParamsIdx[t];s-i>0&&(e[t]=this._subParams.slice(i,s))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const s=this._digitIsSub?this._subParams:this.params,r=s[t-1];s[t-1]=~r?Math.min(10*r+e,i):e}}t.Params=s},5741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){const i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}}},8771:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const s=i(3785),r=i(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){const t=this._buffer.lines.get(e);if(t)return new s.BufferLineApiView(t)}getNullCell(){return new r.CellData}}},3785:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const s=i(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new s.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},8285:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const s=i(8771),r=i(8460);t.BufferNamespaceApi=class{constructor(e){this._core=e,this._onBufferChange=new r.EventEmitter,this._normal=new s.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new s.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get onBufferChange(){return this._onBufferChange.event}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},7975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,i)=>t(e,i.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=i(2585),o=i(5295),a=i(8460),h=i(844);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let c=class extends h.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=new a.EventEmitter,this._onScroll=new a.EventEmitter,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=new o.BufferSet(e,this)}get onResize(){return this._onResize.event}get onScroll(){return this._onScroll.event}get buffer(){return this.buffers.active}dispose(){super.dispose(),this.buffers.dispose()}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){const i=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;const r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(0===i.scrollTop){const e=i.lines.isFull;n===i.lines.length-1?e?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const e=n-r+1;i.lines.shiftElements(r+1,e-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t,i){const s=this.buffer;if(e<0){if(0===s.ydisp)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const r=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),r!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)}};c=s([r(0,n.IOptionsService)],c),t.BufferService=c},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=i(2585),o=i(8460),a={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function h(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(i|=64,i|=e.action):(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}const c=String.fromCharCode,l={DEFAULT:e=>{const t=[h(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`[M${c(t[0])}${c(t[1])}${c(t[2])}`},SGR:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${h(e,!0)};${e.x};${e.y}${t}`}};let d=class{constructor(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new o.EventEmitter,this._lastEvent=null;for(const e of Object.keys(a))this.addProtocol(e,a[e]);for(const e of Object.keys(l))this.addEncoding(e,l[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}get onProtocolChange(){return this._onProtocolChange.event}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;const t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(e.row!==t.row)return!1}return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};d=s([r(0,n.IBufferService),r(1,n.ICoreService)],d),t.CoreMouseService=d},6975:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=i(2585),o=i(8460),a=i(1439),h=i(844),c=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let d=class extends h.Disposable{constructor(e,t,i,s){super(),this._bufferService=t,this._logService=i,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this._onUserInput=this.register(new o.EventEmitter),this._onBinary=this.register(new o.EventEmitter),this._scrollToBottom=e,this.register({dispose:()=>this._scrollToBottom=void 0}),this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(l)}get onData(){return this._onData.event}get onUserInput(){return this._onUserInput.event}get onBinary(){return this._onBinary.event}reset(){this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(l)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const i=this._bufferService.buffer;i.ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};d=s([r(1,n.IBufferService),r(2,n.ILogService),r(3,n.IOptionsService)],d),t.CoreService=d},9074:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const s=i(8055),r=i(8460),n=i(844),o=i(6106),a={xmin:0,xmax:0};class h extends n.Disposable{constructor(){super(...arguments),this._decorations=new o.SortedList((e=>null==e?void 0:e.marker.line)),this._onDecorationRegistered=this.register(new r.EventEmitter),this._onDecorationRemoved=this.register(new r.EventEmitter)}get onDecorationRegistered(){return this._onDecorationRegistered.event}get onDecorationRemoved(){return this._onDecorationRemoved.event}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;const t=new c(e);if(t){const e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){var s,r,n;let o=0,a=0;for(const h of this._decorations.getKeyIterator(t))o=null!==(s=h.options.x)&&void 0!==s?s:0,a=o+(null!==(r=h.options.width)&&void 0!==r?r:1),e>=o&&e<a&&(!i||(null!==(n=h.options.layer)&&void 0!==n?n:"bottom")===i)&&(yield h)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,(t=>{var r,n,o;a.xmin=null!==(r=t.options.x)&&void 0!==r?r:0,a.xmax=a.xmin+(null!==(n=t.options.width)&&void 0!==n?n:1),e>=a.xmin&&e<a.xmax&&(!i||(null!==(o=t.options.layer)&&void 0!==o?o:"bottom")===i)&&s(t)}))}dispose(){for(const e of this._decorations.values())this._onDecorationRemoved.fire(e);this.reset()}}t.DecorationService=h;class c extends n.Disposable{constructor(e){super(),this.options=e,this.isDisposed=!1,this.onRenderEmitter=this.register(new r.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new r.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return null===this._cachedBg&&(this.options.backgroundColor?this._cachedBg=s.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return null===this._cachedFg&&(this.options.foregroundColor?this._cachedFg=s.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._isDisposed||(this._isDisposed=!0,this._onDispose.fire(),super.dispose())}}},3730:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0;const n=i(2585);let o=class{constructor(e){this._bufferService=e,this.clearRange()}get start(){return this._start}get end(){return this._end}clearRange(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y}markDirty(e){e<this._start?this._start=e:e>this._end&&(this._end=e)}markRangeDirty(e,t){if(e>t){const i=e;e=t,t=i}e<this._start&&(this._start=e),t>this._end&&(this._end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};o=s([r(0,n.IBufferService)],o),t.DirtyRowService=o},4348:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const s=i(2585),r=i(8343);class n{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){this._entries.forEach(((t,i)=>e(i,t)))}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(s.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){const i=(0,r.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),s=[];for(const t of i){const i=this._services.get(t.id);if(!i)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);s.push(i)}const n=i.length>0?i[0].index:t.length;if(t.length!==n)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${n+1} conflicts with ${t.length} static arguments`);return new e(...[...t,...s])}}},7866:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=void 0;const n=i(2585),o={debug:n.LogLevelEnum.DEBUG,info:n.LogLevelEnum.INFO,warn:n.LogLevelEnum.WARN,error:n.LogLevelEnum.ERROR,off:n.LogLevelEnum.OFF};let a=class{constructor(e){this._optionsService=e,this.logLevel=n.LogLevelEnum.OFF,this._updateLogLevel(),this._optionsService.onOptionChange((e=>{"logLevel"===e&&this._updateLogLevel()}))}_updateLogLevel(){this.logLevel=o[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,"xterm.js: "+t,...i)}debug(e,...t){this.logLevel<=n.LogLevelEnum.DEBUG&&this._log(console.log,e,t)}info(e,...t){this.logLevel<=n.LogLevelEnum.INFO&&this._log(console.info,e,t)}warn(e,...t){this.logLevel<=n.LogLevelEnum.WARN&&this._log(console.warn,e,t)}error(e,...t){this.logLevel<=n.LogLevelEnum.ERROR&&this._log(console.error,e,t)}};a=s([r(0,n.IOptionsService)],a),t.LogService=a},7302:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const s=i(8460),r=i(6114);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:r.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const n=["normal","bold","100","200","300","400","500","600","700","800","900"];t.OptionsService=class{constructor(e){this._onOptionChange=new s.EventEmitter;const i=Object.assign({},t.DEFAULT_OPTIONS);for(const t in e)if(t in i)try{const s=e[t];i[t]=this._sanitizeAndValidateOption(t,s)}catch(e){console.error(e)}this.rawOptions=i,this.options=Object.assign({},i),this._setupOptions()}get onOptionChange(){return this._onOptionChange.event}_setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(const t in this.rawOptions){const s={get:e.bind(this,t),set:i.bind(this,t)};Object.defineProperty(this.options,t,s)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t.DEFAULT_OPTIONS[e]),!function(e){return"block"===e||"underline"===e||"bar"===e}(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=n.includes(i)?i:t.DEFAULT_OPTIONS[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);case"rows":case"cols":if(!i&&0!==i)throw new Error(`${e} must be numeric, value: ${i}`)}return i}}},2660:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=i(2585);let o=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){const t=this._bufferService.buffer;if(void 0===e.id){const i=t.addMarker(t.ybase+t.y),s={data:e,id:this._nextId++,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(s,i))),this._dataByLinkId.set(s.id,s),s.id}const i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;const n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(o,n))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){const i=this._dataByLinkId.get(e);if(i&&i.lines.every((e=>e.line!==t))){const e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(i,e)))}}getLinkData(e){var t;return null===(t=this._dataByLinkId.get(e))||void 0===t?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){const i=e.lines.indexOf(t);-1!==i&&(e.lines.splice(i,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};o=s([r(0,n.IBufferService)],o),t.OscLinkService=o},8343:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const i=function(e,t,s){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t.di$target===t?t.di$dependencies.push({id:e,index:i}):(t.di$dependencies=[{id:e,index:i}],t.di$target=t)}(i,e,s)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},2585:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(8343);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IDirtyRowService=(0,s.createDecorator)("DirtyRowService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),(r=t.LogLevelEnum||(t.LogLevelEnum={}))[r.DEBUG=0]="DEBUG",r[r.INFO=1]="INFO",r[r.WARN=2]="WARN",r[r.ERROR=3]="ERROR",r[r.OFF=4]="OFF",t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")},1480:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const s=i(8460),r=i(225);t.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new s.EventEmitter;const e=new r.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}get onChange(){return this._onChange.event}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0;const i=e.length;for(let s=0;s<i;++s){let r=e.charCodeAt(s);if(55296<=r&&r<=56319){if(++s>=i)return t+this.wcwidth(r);const n=e.charCodeAt(s);56320<=n&&n<=57343?r=1024*(r-55296)+n-56320+65536:t+=this.wcwidth(n)}t+=this.wcwidth(r)}return t}}}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.Terminal=void 0;const t=i(3236),r=i(9042),n=i(7975),o=i(7090),a=i(5741),h=i(8285),c=["cols","rows"];e.Terminal=class{constructor(e){this._core=new t.Terminal(e),this._addonManager=new a.AddonManager,this._publicOptions=Object.assign({},this._core.options);const i=e=>this._core.options[e],s=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(const e in this._core.options){const t={get:i.bind(this,e),set:s.bind(this,e)};Object.defineProperty(this._publicOptions,e,t)}}_checkReadonlyOptions(e){if(c.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._checkProposedApi(),this._parser||(this._parser=new n.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new o.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._checkProposedApi(),this._buffer||(this._buffer=new h.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const e=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(const t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}registerLinkProvider(e){return this._checkProposedApi(),this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.addMarker(e)}registerDecoration(e){var t,i,s;return this._checkProposedApi(),this._verifyPositiveIntegers(null!==(t=e.x)&&void 0!==t?t:0,null!==(i=e.width)&&void 0!==i?i:0,null!==(s=e.height)&&void 0!==s?s:0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){return this._addonManager.loadAddon(this,e)}static get strings(){return r}_verifyIntegers(...e){for(const t of e)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(const t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}})(),s})()}))
\ No newline at end of file
public/scripts/zlib-adler32-min.js
+1
-1
@@ -1 +1 @@
1
-"undefined"==typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-adler32.js"),(()=>{var b=65521,v=5552;ZLIB.adler32=function(r,e,o,t){if("string"==typeof e){var a,d=r,c=e,C=o,h=t,A=d>>>16&65535;if(d&=65535,1==h)d+=255&c.charCodeAt(C),b<=d&&(d-=b),b<=(A+=d)&&(A-=b);else{if(null===c)return 1;if(h<16){for(;h--;)A+=d+=255&c.charCodeAt(C++);return b<=d&&(d-=b),d|(A%=b)<<16}for(;v<=h;){for(h-=v,a=347;A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A+=d+=255&c.charCodeAt(C++))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)),--a;);d%=b,A%=b}if(h){for(;16<=h;)h-=16,A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A=(A+=d+=255&c.charCodeAt(C++))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++)))+(d+=255&c.charCodeAt(C++));for(;h--;)A+=d+=255&c.charCodeAt(C++);d%=b,A%=b}}return d|A<<16}var f,n=r,i=e,l=o,u=t,s=n>>>16&65535;if(n&=65535,1==u)n+=i[l],b<=n&&(n-=b),b<=(s+=n)&&(s-=b);else{if(null===i)return 1;if(u<16){for(;u--;)s+=n+=i[l++];return b<=n&&(n-=b),n|(s%=b)<<16}for(;v<=u;){for(u-=v,f=347;s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s+=n+=i[l++])+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]),--f;);n%=b,s%=b}if(u){for(;16<=u;)u-=16,s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s=(s+=n+=i[l++])+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]))+(n+=i[l++]);for(;u--;)s+=n+=i[l++];n%=b,s%=b}}return n|s<<16},ZLIB.adler32_combine=function(r,e,o){var t,a;return o<0?4294967295:(a=(o%=b)*(t=65535&r),b<=(t+=(65535&e)+b-1)&&(t-=b),b<=t&&(t-=b),b<<1<=(a=a%b+((r>>16&65535)+(e>>16&65535)+b-o))&&(a-=b<<1),b<=a&&(a-=b),t|a<<16)}})()
\ No newline at end of file
1
+"undefined"==typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-adler32.js"),function(){var r=65521,e=5552;ZLIB.adler32=function(o,t,d,a){return"string"==typeof t?function(o,t,d,a){var c,h;if(c=o>>>16&65535,o&=65535,1==a)return(o+=255&t.charCodeAt(d))>=r&&(o-=r),(c+=o)>=r&&(c-=r),o|c<<16;if(null===t)return 1;if(a<16){for(;a--;)c+=o+=255&t.charCodeAt(d++);return o>=r&&(o-=r),o|(c%=r)<<16}for(;a>=e;){a-=e,h=347;do{c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++)}while(--h);o%=r,c%=r}if(a){for(;a>=16;)a-=16,c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++),c+=o+=255&t.charCodeAt(d++);for(;a--;)c+=o+=255&t.charCodeAt(d++);o%=r,c%=r}return o|c<<16}(o,t,d,a):function(o,t,d,a){var c,h;if(c=o>>>16&65535,o&=65535,1==a)return(o+=t[d])>=r&&(o-=r),(c+=o)>=r&&(c-=r),o|c<<16;if(null===t)return 1;if(a<16){for(;a--;)c+=o+=t[d++];return o>=r&&(o-=r),o|(c%=r)<<16}for(;a>=e;){a-=e,h=347;do{c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++]}while(--h);o%=r,c%=r}if(a){for(;a>=16;)a-=16,c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++],c+=o+=t[d++];for(;a--;)c+=o+=t[d++];o%=r,c%=r}return o|c<<16}(o,t,d,a)},ZLIB.adler32_combine=function(e,o,t){var d,a,c;return t<0?4294967295:(a=(c=t%=r)*(d=65535&e),a%=r,(d+=(65535&o)+r-1)>=r&&(d-=r),d>=r&&(d-=r),(a+=(e>>16&65535)+(o>>16&65535)+r-c)>=131042&&(a-=131042),a>=r&&(a-=r),d|a<<16)}}()
\ No newline at end of file
public/scripts/zlib-crc32-min.js
+1
-1
@@ -1 +1 @@
1
-"undefined"==typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js"),(()=>{var C=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function a(r,e){for(var o=0,n=0;e;)1&e&&(n^=r[o]),e>>=1,o++;return n}function i(r,e){for(var o=0;o<32;o++)r[o]=a(e,e[o])}ZLIB.crc32=function(r,e,o,n){if("string"==typeof e){var t=r,f=e,c=o,a=n;if(null==f)return 0;for(t^=4294967295;8<=a;)t=C[255&(t^f.charCodeAt(c++))]^t>>>8,t=C[255&(t^f.charCodeAt(c++))]^t>>>8,t=C[255&(t^f.charCodeAt(c++))]^t>>>8,t=C[255&(t^f.charCodeAt(c++))]^t>>>8,t=C[255&(t^f.charCodeAt(c++))]^t>>>8,t=C[255&(t^f.charCodeAt(c++))]^t>>>8,t=C[255&(t^f.charCodeAt(c++))]^t>>>8,t=C[255&(t^f.charCodeAt(c++))]^t>>>8,a-=8;if(a)for(;t=C[255&(t^f.charCodeAt(c++))]^t>>>8,--a;);return 4294967295^t}var i=r,d=e,u=o,A=n;if(null==d)return 0;for(i^=4294967295;8<=A;)i=C[255&(i^d[u++])]^i>>>8,i=C[255&(i^d[u++])]^i>>>8,i=C[255&(i^d[u++])]^i>>>8,i=C[255&(i^d[u++])]^i>>>8,i=C[255&(i^d[u++])]^i>>>8,i=C[255&(i^d[u++])]^i>>>8,i=C[255&(i^d[u++])]^i>>>8,i=C[255&(i^d[u++])]^i>>>8,A-=8;if(A)for(;i=C[255&(i^d[u++])]^i>>>8,--A;);return 4294967295^i},ZLIB.crc32_combine=function(r,e,o){var n,t,f,c;if(!(o<=0)){for(f=new Array(32),(c=new Array(32))[0]=3988292384,n=t=1;n<32;n++)c[n]=t,t<<=1;for(i(f,c),i(c,f);i(f,c),1&o&&(r=a(f,r)),0!=(o>>=1)&&(i(c,f),1&o&&(r=a(c,r)),0!=(o>>=1)););r^=e}return r}})()
\ No newline at end of file
1
+"undefined"==typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js"),function(){var r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];ZLIB.crc32=function(e,n,o,t){return"string"==typeof n?function(e,n,o,t){if(null==n)return 0;for(e^=4294967295;t>=8;)e=r[255&(e^n.charCodeAt(o++))]^e>>>8,e=r[255&(e^n.charCodeAt(o++))]^e>>>8,e=r[255&(e^n.charCodeAt(o++))]^e>>>8,e=r[255&(e^n.charCodeAt(o++))]^e>>>8,e=r[255&(e^n.charCodeAt(o++))]^e>>>8,e=r[255&(e^n.charCodeAt(o++))]^e>>>8,e=r[255&(e^n.charCodeAt(o++))]^e>>>8,e=r[255&(e^n.charCodeAt(o++))]^e>>>8,t-=8;if(t)do{e=r[255&(e^n.charCodeAt(o++))]^e>>>8}while(--t);return 4294967295^e}(e,n,o,t):function(e,n,o,t){if(null==n)return 0;for(e^=4294967295;t>=8;)e=r[255&(e^n[o++])]^e>>>8,e=r[255&(e^n[o++])]^e>>>8,e=r[255&(e^n[o++])]^e>>>8,e=r[255&(e^n[o++])]^e>>>8,e=r[255&(e^n[o++])]^e>>>8,e=r[255&(e^n[o++])]^e>>>8,e=r[255&(e^n[o++])]^e>>>8,e=r[255&(e^n[o++])]^e>>>8,t-=8;if(t)do{e=r[255&(e^n[o++])]^e>>>8}while(--t);return 4294967295^e}(e,n,o,t)};function e(r,e){var n,o=0;for(n=0;e;)1&e&&(n^=r[o]),e>>=1,o++;return n}function n(r,n){var o;for(o=0;o<32;o++)r[o]=e(n,n[o])}ZLIB.crc32_combine=function(r,o,t){var c,f,i,u;if(t<=0)return r;for(i=new Array(32),(u=new Array(32))[0]=3988292384,f=1,c=1;c<32;c++)u[c]=f,f<<=1;n(i,u),n(u,i);do{if(n(i,u),1&t&&(r=e(i,r)),0==(t>>=1))break;n(u,i),1&t&&(r=e(u,r)),t>>=1}while(0!=t);return r^=o}}()
\ No newline at end of file
public/scripts/zlib-inflate-min.js
+1
-1
@@ -1 +1 @@
1
-"undefined"==typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js"),(()=>{var Y=11,q=29,C=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],O=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,203,69],T=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],y=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function G(t,a){for(var i,s,o,l,e,b,v,p,n,d,r,h,c,f,u,m,_,k,g,w,x=t.next,Z=2==a?t.distbits:t.lenbits,I=t.work,L=t.lens,B=2==a?t.nlen:0,R=t.codes,E=1==a?t.nlen:2==a?t.ndist:19,A=new Array(16),S=new Array(16),z=0;z<=15;z++)A[z]=0;for(i=0;i<E;i++)A[L[B+i]]++;for(l=Z,o=15;1<=o&&0==A[o];o--);if(o<l&&(l=o),0==o)R[x++]=f={op:64,bits:1,val:0},R[x++]=f,2==a?t.distbits=1:t.lenbits=1,t.next=x;else{for(s=1;s<o&&0==A[s];s++);for(l<s&&(l=s),z=v=1;z<=15;z++)if((v=(v<<=1)-A[z])<0)return-1;if(0<v&&(0==a||1!=o))return t.next=x,-1;for(S[1]=0,z=1;z<15;z++)S[z+1]=S[z]+A[z];for(i=0;i<E;i++)0!=L[B+i]&&(I[S[L[B+i]]++]=i);switch(a){case 0:m=k=I,g=_=0,w=19;break;case 1:m=C,k=O,g=_=-257,w=256;break;default:m=T,k=y,g=_=0,w=-1}if(z=s,u=x,b=i=n=0,h=-1,c=(p=1<<(e=l))-1,1==a&&852<=p||2==a&&592<=p)return t.next=x,1;for(;;){for(f={op:0,bits:z-b,val:0},I[i]<w?f.val=I[i]:I[i]>w?(f.op=k[g+I[i]],f.val=m[_+I[i]]):f.op=96,d=1<<z-b,s=r=1<<e;R[u+(n>>>b)+(r-=d)]=f,0!=r;);for(d=1<<z-1;n&d;)d>>>=1;if(n=0!=d?(n&d-1)+d:0,i++,0==--A[z]){if(z==o)break;z=L[B+I[i]]}if(l<z&&(n&c)!=h){for(u+=s,v=1<<(e=z-(b=0==b?l:b));e+b<o&&!((v-=A[e+b])<=0);)e++,v<<=1;if(p+=1<<e,1==a&&852<=p||2==a&&592<=p)return t.next=x,1;R[x+(h=n&c)]={op:e,bits:l,val:u-x}}}0!=n&&(R[u+n]={op:64,bits:z-b,val:0}),t.next=x+p,2==a?t.distbits=l:t.lenbits=l}return 0}function i(t){for(var a=new Array(t),i=0;i<t;i++)a[i]=0;return a}function l(t,a,i){return t&&a in t?t[a]:i}function o(){return 0}function s(){this.mode=0,this.last=0,this.wrap=0,this.havedict=0,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=0,this.distcode=0,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=0,this.lens=i(320),this.work=i(288),this.codes=new Array(1444);for(var t={op:0,bits:0,val:0},a=0;a<1444;a++)this.codes[a]=t;this.sane=0,this.back=0,this.was=0}ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ",ZLIB.inflateResetKeep=function(t){var a;return t&&t.state?(a=t.state,t.total_in=t.total_out=a.total=0,t.msg=null,a.wrap&&(t.adler=1&a.wrap),a.mode=0,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=0,a.distcode=0,a.next=0,a.sane=1,a.back=-1,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.inflateReset=function(t,a){var i,s;return!t||!t.state||(s=t.state,(a=void 0===a?15:a)<0?(i=0,a=-a):(i=1+(a>>>4),a<48&&(a&=15)),1==i&&"function"==typeof ZLIB.adler32?t.checksum_function=ZLIB.adler32:2==i&&"function"==typeof ZLIB.crc32?t.checksum_function=ZLIB.crc32:t.checksum_function=o,a&&(a<8||15<a))?ZLIB.Z_STREAM_ERROR:(s.window&&s.wbits!=a&&(s.window=null),s.wrap=i,s.wbits=a,s.wsize=0,s.whave=0,s.wnext=0,ZLIB.inflateResetKeep(t))},ZLIB.inflateInit=function(t){var a=new ZLIB.z_stream;return a.state=new s,ZLIB.inflateReset(a,t),a},ZLIB.inflatePrime=function(t,a,i){if(!t||!t.state)return ZLIB.Z_STREAM_ERROR;if(t=t.state,a<0)t.hold=0,t.bits=0;else{if(16<a||32<t.bits+a)return ZLIB.Z_STREAM_ERROR;t.hold+=(i&=(1<<a)-1)<<t.bits,t.bits+=a}return ZLIB.Z_OK};var J=null,Q=null;function V(t,a){t.state.check=t.checksum_function(t.state.check,[255&a,a>>>8&255],0,2)}function W(t,a){a.strm=t,a.left=t.avail_out,a.next=t.next_in,a.have=t.avail_in,a.hold=t.state.hold,a.bits=t.state.bits}function X(t){var a=t.strm;a.next_in=t.next,a.avail_out=t.left,a.avail_in=t.have,a.state.hold=t.hold,a.state.bits=t.bits}function $(t){t.hold=0,t.bits=0}function tt(t){return 0!=t.have&&(t.have--,t.hold+=(255&t.strm.input_data.charCodeAt(t.next++))<<t.bits,t.bits+=8,1)}function at(t,a){for(;t.bits<a;)if(!tt(t))return;return 1}function it(t,a){return t.hold&(1<<a)-1}function st(t,a){t.hold>>>=a,t.bits-=a}function ot(t){t.hold>>>=7&t.bits,t.bits-=7&t.bits}function lt(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}var et=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(t,a){var i,s,o,l,e,b,v,p,n,d,r,h,c=-1,f=-1;if(!t||!t.state||!t.input_data&&0!=t.avail_in)return ZLIB.Z_STREAM_ERROR;(i=t.state).mode==Y&&(i.mode=12),W(t,s={}),o=s.have,l=s.left,n=ZLIB.Z_OK;t:for(;;)switch(i.mode){case 0:if(0==i.wrap)i.mode=12;else{if(!at(s,16))break t;if(2&i.wrap&&35615==s.hold)i.check=t.checksum_function(0,null,0,0),V(t,s.hold),$(s),i.mode=1;else if(i.flags=0,null!==i.head&&(i.head.done=-1),!(1&i.wrap)||((it(s,8)<<8)+(s.hold>>>8))%31)t.msg="incorrect header check",i.mode=q;else if(it(s,4)!=ZLIB.Z_DEFLATED)t.msg="unknown compression method",i.mode=q;else{if(st(s,4),p=it(s,4)+8,0==i.wbits)i.wbits=p;else if(p>i.wbits){t.msg="invalid window size",i.mode=q;break}i.dmax=1<<p,t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=512&s.hold?9:Y,$(s)}}break;case 1:if(!at(s,16))break t;if(i.flags=s.hold,(255&i.flags)!=ZLIB.Z_DEFLATED){t.msg="unknown compression method",i.mode=q;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=q;break}null!==i.head&&(i.head.text=s.hold>>>8&1),512&i.flags&&V(t,s.hold),$(s),i.mode=2;case 2:if(!at(s,32))break t;null!==i.head&&(i.head.time=s.hold),512&i.flags&&(x=s.hold,t.state.check=t.checksum_function(t.state.check,[255&x,x>>>8&255,x>>>16&255,x>>>24&255],0,4)),$(s),i.mode=3;case 3:if(!at(s,16))break t;null!==i.head&&(i.head.xflags=255&s.hold,i.head.os=s.hold>>>8),512&i.flags&&V(t,s.hold),$(s),i.mode=4;case 4:if(1024&i.flags){if(!at(s,16))break t;i.length=s.hold,null!==i.head&&(i.head.extra_len=s.hold),512&i.flags&&V(t,s.hold),$(s),i.head.extra=""}else null!==i.head&&(i.head.extra=null);i.mode=5;case 5:if(1024&i.flags&&((e=(e=i.length)>s.have?s.have:e)&&(null!==i.head&&null!==i.head.extra&&(p=i.head.extra_len-i.length,i.head.extra+=t.input_data.substring(s.next,s.next+(p+e>i.head.extra_max?i.head.extra_max-p:e))),512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,i.length-=e),i.length))break t;i.length=0,i.mode=6;case 6:if(2048&i.flags){if(0==s.have)break t;for(null!==i.head&&null===i.head.name&&(i.head.name=""),e=0;p=t.input_data.charAt(s.next+e),e++,"\0"!==p&&(null!==i.head&&i.length<i.head.name_max&&(i.head.name+=p,i.length++),e<s.have););if(512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,"\0"!==p)break t}else null!==i.head&&(i.head.name=null);i.length=0,i.mode=7;case 7:if(4096&i.flags){if(0==s.have)break t;for(e=0,null!==i.head&&null===i.head.comment&&(i.head.comment="");p=t.input_data.charAt(s.next+e),e++,"\0"!==p&&(null!==i.head&&i.length<i.head.comm_max&&(i.head.comment+=p,i.length++),e<s.have););if(512&i.flags&&(i.check=t.checksum_function(i.check,t.input_data,s.next,e)),s.have-=e,s.next+=e,"\0"!==p)break t}else null!==i.head&&(i.head.comment=null);i.mode=8;case 8:if(512&i.flags){if(!at(s,16))break t;if(s.hold!=(65535&i.check)){t.msg="header crc mismatch",i.mode=q;break}$(s)}null!==i.head&&(i.head.hcrc=i.flags>>>9&1,i.head.done=1),t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=Y;break;case 9:if(!at(s,32))break t;t.adler=i.check=lt(s.hold),$(s),i.mode=10;case 10:if(0==i.havedict)return X(s),ZLIB.Z_NEED_DICT;t.adler=i.check=t.checksum_function(0,null,0,0),i.mode=Y;case Y:if(a==ZLIB.Z_BLOCK||a==ZLIB.Z_TREES)break t;case 12:if(i.last)ot(s),i.mode=26;else{if(!at(s,3))break t;switch(i.last=it(s,1),st(s,1),it(s,2)){case 0:i.mode=13;break;case 1:u=m=void 0;var u,m=i;for(J=J||[{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:192},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:160},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:224},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:144},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:208},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:176},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:240},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:200},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:168},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:232},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:152},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:216},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:184},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:248},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:196},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:164},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:228},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:148},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:212},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:180},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:244},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:204},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:172},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:236},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:156},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:220},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:188},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:252},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:194},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:162},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:226},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:146},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:210},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:178},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:242},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:202},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:170},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:234},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:154},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:218},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:186},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:250},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:198},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:166},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:230},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:150},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:214},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:182},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:246},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:206},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:174},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:238},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:158},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:222},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:190},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:254},{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:193},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:161},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:225},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:145},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:209},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:177},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:241},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:201},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:169},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:233},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:153},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:217},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:185},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:249},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:197},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:165},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:229},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:149},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:213},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:181},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:245},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:205},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:173},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:237},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:157},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:221},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:189},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:253},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:195},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:163},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:227},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:147},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:211},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:179},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:243},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:203},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:171},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:235},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:155},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:219},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:187},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:251},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:199},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:167},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:231},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:151},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:215},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:183},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:247},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:207},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:175},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:239},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:159},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:223},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:191},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:255}],Q=Q||[{op:16,bits:5,val:1},{op:23,bits:5,val:257},{op:19,bits:5,val:17},{op:27,bits:5,val:4097},{op:17,bits:5,val:5},{op:25,bits:5,val:1025},{op:21,bits:5,val:65},{op:29,bits:5,val:16385},{op:16,bits:5,val:3},{op:24,bits:5,val:513},{op:20,bits:5,val:33},{op:28,bits:5,val:8193},{op:18,bits:5,val:9},{op:26,bits:5,val:2049},{op:22,bits:5,val:129},{op:64,bits:5,val:0},{op:16,bits:5,val:2},{op:23,bits:5,val:385},{op:19,bits:5,val:25},{op:27,bits:5,val:6145},{op:17,bits:5,val:7},{op:25,bits:5,val:1537},{op:21,bits:5,val:97},{op:29,bits:5,val:24577},{op:16,bits:5,val:4},{op:24,bits:5,val:769},{op:20,bits:5,val:49},{op:28,bits:5,val:12289},{op:18,bits:5,val:13},{op:26,bits:5,val:3073},{op:22,bits:5,val:193},{op:64,bits:5,val:0}],m.lencode=0,m.distcode=512,u=0;u<512;u++)m.codes[u]=J[u];for(u=0;u<32;u++)m.codes[u+512]=Q[u];if(m.lenbits=9,m.distbits=5,i.mode=19,a!=ZLIB.Z_TREES)break;st(s,2);break t;case 2:i.mode=16;break;case 3:t.msg="invalid block type",i.mode=q}st(s,2)}break;case 13:if(ot(s),!at(s,32))break t;if((65535&s.hold)!=(s.hold>>>16&65535^65535)){t.msg="invalid stored block lengths",i.mode=q;break}if(i.length=65535&s.hold,$(s),i.mode=14,a==ZLIB.Z_TREES)break t;case 14:i.mode=15;case 15:if(e=i.length){if(0==(e=(e=e>s.have?s.have:e)>s.left?s.left:e))break t;t.output_data+=t.input_data.substring(s.next,s.next+e),t.next_out+=e,s.have-=e,s.next+=e,s.left-=e,i.length-=e}else i.mode=Y;break;case 16:if(!at(s,14))break t;if(i.nlen=it(s,5)+257,st(s,5),i.ndist=it(s,5)+1,st(s,5),i.ncode=it(s,4)+4,st(s,4),286<i.nlen||30<i.ndist){t.msg="too many length or distance symbols",i.mode=q;break}i.have=0,i.mode=17;case 17:for(;i.have<i.ncode;){if(!at(s,3))break t;var M=it(s,3);i.lens[et[i.have++]]=M,st(s,3)}for(;i.have<19;)i.lens[et[i.have++]]=0;if(i.next=0,i.lencode=0,i.lenbits=7,n=G(i,0)){t.msg="invalid code lengths set",i.mode=q;break}i.have=0,i.mode=18;case 18:for(;i.have<i.nlen+i.ndist;){for(;!((b=i.codes[i.lencode+it(s,i.lenbits)]).bits<=s.bits);)if(!tt(s))break t;if(b.val<16)st(s,b.bits),i.lens[i.have++]=b.val;else{if(16==b.val){if(!at(s,b.bits+2))break t;if(st(s,b.bits),0==i.have){t.msg="invalid bit length repeat",i.mode=q;break}p=i.lens[i.have-1],e=3+it(s,2),st(s,2)}else if(17==b.val){if(!at(s,b.bits+3))break t;st(s,b.bits),p=0,e=3+it(s,3),st(s,3)}else{if(!at(s,b.bits+7))break t;st(s,b.bits),p=0,e=11+it(s,7),st(s,7)}if(i.have+e>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=q;break}for(;e--;)i.lens[i.have++]=p}}if(i.mode==q)break;if(0==i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=q;break}if(i.next=0,i.lencode=i.next,i.lenbits=9,n=G(i,1)){t.msg="invalid literal/lengths set",i.mode=q;break}if(i.distcode=i.next,i.distbits=6,n=G(i,2)){t.msg="invalid distances set",i.mode=q;break}if(i.mode=19,a==ZLIB.Z_TREES)break t;case 19:i.mode=20;case 20:if(6<=s.have&&258<=s.left){X(s),I=Z=y=g=k=_=P=U=j=H=T=O=C=z=N=F=D=S=K=A=E=R=B=L=x=w=void 0;var _,k,g,w=t,x=l,Z=-1,I=-1,L=w.state,B=w.input_data,R=w.next_in,E=R+w.avail_in-5,A=w.next_out,K=A-(x-w.avail_out),S=A+(w.avail_out-257),D=L.wsize,F=L.whave,N=L.wnext,z=L.window,C=L.hold,O=L.bits,T=L.codes,H=L.lencode,j=L.distcode,U=(1<<L.lenbits)-1,P=(1<<L.distbits)-1;a:do{for(O<15&&(C+=(255&B.charCodeAt(R++))<<O,O+=8,C+=(255&B.charCodeAt(R++))<<O,O+=8),_=T[H+(C&U)];;){if(C>>>=k=_.bits,O-=k,0==(k=_.op))w.output_data+=String.fromCharCode(_.val),A++;else{if(!(16&k)){if(0==(64&k)){_=T[H+(_.val+(C&(1<<k)-1))];continue}if(32&k){L.mode=Y;break a}w.msg="invalid literal/length code",L.mode=q;break a}for(g=_.val,(k&=15)&&(O<k&&(C+=(255&B.charCodeAt(R++))<<O,O+=8),g+=C&(1<<k)-1,C>>>=k,O-=k),O<15&&(C+=(255&B.charCodeAt(R++))<<O,O+=8,C+=(255&B.charCodeAt(R++))<<O,O+=8),_=T[j+(C&P)];;){if(C>>>=k=_.bits,O-=k,!(16&(k=_.op))){if(0==(64&k)){_=T[j+(_.val+(C&(1<<k)-1))];continue}w.msg="invalid distance code",L.mode=q;break a}if(y=_.val,O<(k&=15)&&(C+=(255&B.charCodeAt(R++))<<O,(O+=8)<k)&&(C+=(255&B.charCodeAt(R++))<<O,O+=8),y+=C&(1<<k)-1,C>>>=k,O-=k,(k=A-K)<y){if(F<(k=y-k)&&L.sane){w.msg="invalid distance too far back",L.mode=q;break a}I=-1,(Z=0)==N?(Z+=D-k,k<g&&(g-=k,w.output_data+=z.substring(Z,Z+k),A+=k,k=0,Z=-1,I=A-y)):(Z+=N-k,k<g&&(g-=k,w.output_data+=z.substring(Z,Z+k),Z=-1,I=(A+=k)-y))}else Z=-1,I=A-y;if(0<=Z)w.output_data+=z.substring(Z,Z+g),A+=g,Z+=g;else{var y=g;for(A-I<y&&(y=A-I),w.output_data+=w.output_data.substring(I,I+y),I+=y,A=A+y+(g-=y);2<g;)w.output_data+=w.output_data.charAt(I++),w.output_data+=w.output_data.charAt(I++),w.output_data+=w.output_data.charAt(I++),g-=3;g&&(w.output_data+=w.output_data.charAt(I++),1<g)&&(w.output_data+=w.output_data.charAt(I++))}break}}break}}while(R<E&&A<S);C&=(1<<(O-=(g=O>>>3)<<3))-1,w.next_in=R-=g,w.next_out=A,w.avail_in=R<E?E-R+5:5-(R-E),w.avail_out=A<S?S-A+257:257-(A-S),L.hold=C,L.bits=O,W(t,s),i.mode==Y&&(i.back=-1);break}for(i.back=0;!((b=i.codes[i.lencode+it(s,i.lenbits)]).bits<=s.bits);)if(!tt(s))break t;if(b.op&&0==(240&b.op)){for(v=b;b=i.codes[i.lencode+v.val+(it(s,v.bits+v.op)>>>v.bits)],!(v.bits+b.bits<=s.bits);)if(!tt(s))break t;st(s,v.bits),i.back+=v.bits}if(st(s,b.bits),i.back+=b.bits,i.length=b.val,0==b.op){i.mode=25;break}if(32&b.op){i.back=-1,i.mode=Y;break}if(64&b.op){t.msg="invalid literal/length code",i.mode=q;break}i.extra=15&b.op,i.mode=21;case 21:if(i.extra){if(!at(s,i.extra))break t;i.length+=it(s,i.extra),st(s,i.extra),i.back+=i.extra}i.was=i.length,i.mode=22;case 22:for(;!((b=i.codes[i.distcode+it(s,i.distbits)]).bits<=s.bits);)if(!tt(s))break t;if(0==(240&b.op)){for(v=b;b=i.codes[i.distcode+v.val+(it(s,v.bits+v.op)>>>v.bits)],!(v.bits+b.bits<=s.bits);)if(!tt(s))break t;st(s,v.bits),i.back+=v.bits}if(st(s,b.bits),i.back+=b.bits,64&b.op){t.msg="invalid distance code",i.mode=q;break}i.offset=b.val,i.extra=15&b.op,i.mode=23;case 23:if(i.extra){if(!at(s,i.extra))break t;i.offset+=it(s,i.extra),st(s,i.extra),i.back+=i.extra}i.mode=24;case 24:if(0==s.left)break t;if(e=l-s.left,i.offset>e){if((e=i.offset-e)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=q;break}f=(c=e>i.wnext?(e-=i.wnext,i.wsize-e):i.wnext-e,-1),e>i.length&&(e=i.length)}else c=-1,f=t.next_out-i.offset,e=i.length;if(e>s.left&&(e=s.left),s.left-=e,i.length-=e,0<=c)t.output_data+=i.window.substring(c,c+e),t.next_out+=e,e=0;else for(t.next_out+=e;t.output_data+=t.output_data.charAt(f++),--e;);0==i.length&&(i.mode=20);break;case 25:if(0==s.left)break t;t.output_data+=String.fromCharCode(i.length),t.next_out++,s.left--,i.mode=20;break;case 26:if(i.wrap){if(!at(s,32))break t;if(l-=s.left,t.total_out+=l,i.total+=l,l&&(t.adler=i.check=t.checksum_function(i.check,t.output_data,t.output_data.length-l,l)),l=s.left,(i.flags?s.hold:lt(s.hold))!=i.check){t.msg="incorrect data check",i.mode=q;break}$(s)}i.mode=27;case 27:if(i.wrap&&i.flags){if(!at(s,32))break t;if(s.hold!=(4294967295&i.total)){t.msg="incorrect length check",i.mode=q;break}$(s)}i.mode=28;case 28:n=ZLIB.Z_STREAM_END;break t;case q:n=ZLIB.Z_DATA_ERROR;break t;case 30:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}return X(s),(i.wsize||l!=t.avail_out&&i.mode<q&&(i.mode<26||a!=ZLIB.Z_FINISH))&&(r=(d=t).state,h=d.output_data.length,null===r.window&&(r.window=""),0==r.wsize&&(r.wsize=1<<r.wbits),r.wsize<=h?r.window=d.output_data.substring(h-r.wsize):r.whave+h<r.wsize?r.window+=d.output_data:r.window=r.window.substring(r.whave-(r.wsize-h))+d.output_data,r.whave=r.window.length,r.wnext=r.whave<r.wsize?r.whave:0),l-=t.avail_out,t.total_in+=o-=t.avail_in,t.total_out+=l,i.total+=l,i.wrap&&l&&(t.adler=i.check=t.checksum_function(i.check,t.output_data,0,t.output_data.length)),t.data_type=i.bits+(i.last?64:0)+(i.mode==Y?128:0)+(19==i.mode||14==i.mode?256:0),n=(0==o&&0==l||a==ZLIB.Z_FINISH)&&n==ZLIB.Z_OK?ZLIB.Z_BUF_ERROR:n},ZLIB.inflateEnd=function(t){return t&&t.state?(t.state.window=null,t.state=null,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.z_stream.prototype.inflate=function(t,a){this.input_data=t,this.next_in=l(a,"next_in",0),this.avail_in=l(a,"avail_in",t.length-this.next_in),i=l(a,"flush",ZLIB.Z_SYNC_FLUSH),s=l(a,"avail_out",-1);var i,s,o="";do{if(this.avail_out=0<=s?s:16384,this.output_data="",this.next_out=0,this.error=ZLIB.inflate(this,i),0<=s)return this.output_data}while((o+=this.output_data,!(0<this.avail_out))&&this.error==ZLIB.Z_OK);return o},ZLIB.z_stream.prototype.inflateReset=function(t){return ZLIB.inflateReset(this,t)}})()
\ No newline at end of file
1
+"undefined"==typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js"),function(){var t=11,a=29,i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,203,69],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function b(t,a){var b,e,v,p,n,d,r,h,c,f,u,_,m,k,g,w,Z,x,I,R,L,B,E=15,A=t.next,O=2==a?t.distbits:t.lenbits,S=t.work,z=t.lens,C=2==a?t.nlen:0,T=t.codes;b=1==a?t.nlen:2==a?t.ndist:19;var y=new Array(16),M=new Array(16);for(e=0;e<=E;e++)y[e]=0;for(v=0;v<b;v++)y[z[C+v]]++;for(d=O,n=E;n>=1&&0==y[n];n--);if(d>n&&(d=n),0==n)return w={op:64,bits:1,val:0},T[A++]=w,T[A++]=w,2==a?t.distbits=1:t.lenbits=1,t.next=A,0;for(p=1;p<n&&0==y[p];p++);for(d<p&&(d=p),c=1,e=1;e<=E;e++)if(c<<=1,(c-=y[e])<0)return-1;if(c>0&&(0==a||1!=n))return t.next=A,-1;for(M[1]=0,e=1;e<E;e++)M[e+1]=M[e]+y[e];for(v=0;v<b;v++)0!=z[C+v]&&(S[M[z[C+v]]++]=v);switch(a){case 0:x=R=S,I=0,L=0,B=19;break;case 1:x=i,I=-257,R=s,L=-257,B=256;break;default:x=o,R=l,I=0,L=0,B=-1}if(u=0,v=0,e=p,Z=A,r=d,h=0,k=-1,g=(f=1<<d)-1,1==a&&f>=852||2==a&&f>=592)return t.next=A,1;for(;;){w={op:0,bits:e-h,val:0},S[v]<B?w.val=S[v]:S[v]>B?(w.op=R[L+S[v]],w.val=x[I+S[v]]):w.op=96,_=1<<e-h,p=m=1<<r;do{T[Z+(u>>>h)+(m-=_)]=w}while(0!=m);for(_=1<<e-1;u&_;)_>>>=1;if(0!=_?(u&=_-1,u+=_):u=0,v++,0==--y[e]){if(e==n)break;e=z[C+S[v]]}if(e>d&&(u&g)!=k){for(0==h&&(h=d),Z+=p,c=1<<(r=e-h);r+h<n&&!((c-=y[r+h])<=0);)r++,c<<=1;if(f+=1<<r,1==a&&f>=852||2==a&&f>=592)return t.next=A,1;T[A+(k=u&g)]={op:r,bits:d,val:Z-A}}}return 0!=u&&(T[Z+u]={op:64,bits:e-h,val:0}),t.next=A+f,2==a?t.distbits=d:t.lenbits=d,0}function e(i,s){var o,l,b,e,v,p,n,d,r,h,c,f,u,_,m,k,g,w,Z,x,I,R,L=-1,B=-1;o=i.state,l=i.input_data,e=(b=i.next_in)+i.avail_in-5,p=(v=i.next_out)-(s-i.avail_out),n=v+(i.avail_out-257),d=o.wsize,r=o.whave,h=o.wnext,c=o.window,f=o.hold,u=o.bits,_=o.codes,m=o.lencode,k=o.distcode,g=(1<<o.lenbits)-1,w=(1<<o.distbits)-1;t:do{u<15&&(f+=(255&l.charCodeAt(b++))<<u,u+=8,f+=(255&l.charCodeAt(b++))<<u,u+=8),Z=_[m+(f&g)];a:for(;;){if(f>>>=x=Z.bits,u-=x,0==(x=Z.op))i.output_data+=String.fromCharCode(Z.val),v++;else{if(!(16&x)){if(64&x){if(32&x){o.mode=t;break t}i.msg="invalid literal/length code",o.mode=a;break t}Z=_[m+(Z.val+(f&(1<<x)-1))];continue a}I=Z.val,(x&=15)&&(u<x&&(f+=(255&l.charCodeAt(b++))<<u,u+=8),I+=f&(1<<x)-1,f>>>=x,u-=x),u<15&&(f+=(255&l.charCodeAt(b++))<<u,u+=8,f+=(255&l.charCodeAt(b++))<<u,u+=8),Z=_[k+(f&w)];i:for(;;){if(f>>>=x=Z.bits,u-=x,16&(x=Z.op)){if(R=Z.val,u<(x&=15)&&(f+=(255&l.charCodeAt(b++))<<u,(u+=8)<x&&(f+=(255&l.charCodeAt(b++))<<u,u+=8)),R+=f&(1<<x)-1,f>>>=x,u-=x,R>(x=v-p)){if((x=R-x)>r&&o.sane){i.msg="invalid distance too far back",o.mode=a;break t}L=0,B=-1,0==h?(L+=d-x,x<I&&(I-=x,i.output_data+=c.substring(L,L+x),v+=x,x=0,L=-1,B=v-R)):(L+=h-x,x<I&&(I-=x,i.output_data+=c.substring(L,L+x),L=-1,B=(v+=x)-R))}else L=-1,B=v-R;if(L>=0)i.output_data+=c.substring(L,L+I),v+=I,L+=I;else{var E=I;for(E>v-B&&(E=v-B),i.output_data+=i.output_data.substring(B,B+E),v+=E,B+=E,v+=I-=E;I>2;)i.output_data+=i.output_data.charAt(B++),i.output_data+=i.output_data.charAt(B++),i.output_data+=i.output_data.charAt(B++),I-=3;I&&(i.output_data+=i.output_data.charAt(B++),I>1&&(i.output_data+=i.output_data.charAt(B++)))}break i}if(64&x){i.msg="invalid distance code",o.mode=a;break t}Z=_[k+(Z.val+(f&(1<<x)-1))]}}break a}}while(b<e&&v<n);b-=I=u>>>3,f&=(1<<(u-=I<<3))-1,i.next_in=b,i.next_out=v,i.avail_in=b<e?e-b+5:5-(b-e),i.avail_out=v<n?n-v+257:257-(v-n),o.hold=f,o.bits=u}function v(t){var a,i=new Array(t);for(a=0;a<t;a++)i[a]=0;return i}function p(t,a,i){return t&&a in t?t[a]:i}function n(){return 0}function d(){var t;this.mode=0,this.last=0,this.wrap=0,this.havedict=0,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=0,this.distcode=0,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=0,this.lens=v(320),this.work=v(288),this.codes=new Array(1444);var a={op:0,bits:0,val:0};for(t=0;t<1444;t++)this.codes[t]=a;this.sane=0,this.back=0,this.was=0}ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ",ZLIB.inflateResetKeep=function(t){var a;return t&&t.state?(a=t.state,t.total_in=t.total_out=a.total=0,t.msg=null,a.wrap&&(t.adler=1&a.wrap),a.mode=0,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=0,a.distcode=0,a.next=0,a.sane=1,a.back=-1,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.inflateReset=function(t,a){var i,s;return t&&t.state?(s=t.state,void 0===a&&(a=15),a<0?(i=0,a=-a):(i=(a>>>4)+1,a<48&&(a&=15)),1==i&&"function"==typeof ZLIB.adler32?t.checksum_function=ZLIB.adler32:2==i&&"function"==typeof ZLIB.crc32?t.checksum_function=ZLIB.crc32:t.checksum_function=n,a&&(a<8||a>15)?ZLIB.Z_STREAM_ERROR:(s.window&&s.wbits!=a&&(s.window=null),s.wrap=i,s.wbits=a,s.wsize=0,s.whave=0,s.wnext=0,ZLIB.inflateResetKeep(t))):ZLIB.Z_STREAM_ERROR},ZLIB.inflateInit=function(t){var a=new ZLIB.z_stream;return a.state=new d,ZLIB.inflateReset(a,t),a},ZLIB.inflatePrime=function(t,a,i){var s;return t&&t.state?(s=t.state,a<0?(s.hold=0,s.bits=0,ZLIB.Z_OK):a>16||s.bits+a>32?ZLIB.Z_STREAM_ERROR:(i&=(1<<a)-1,s.hold+=i<<s.bits,s.bits+=a,ZLIB.Z_OK)):ZLIB.Z_STREAM_ERROR};var r=null,h=null;function c(t){var a;for(r||(r=[{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:192},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:160},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:224},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:144},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:208},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:176},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:240},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:200},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:168},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:232},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:152},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:216},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:184},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:248},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:196},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:164},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:228},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:148},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:212},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:180},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:244},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:204},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:172},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:236},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:156},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:220},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:188},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:252},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:194},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:162},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:226},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:146},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:210},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:178},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:242},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:202},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:170},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:234},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:154},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:218},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:186},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:250},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:198},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:166},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:230},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:150},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:214},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:182},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:246},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:206},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:174},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:238},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:158},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:222},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:190},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:254},{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:193},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:161},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:225},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:145},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:209},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:177},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:241},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:201},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:169},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:233},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:153},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:217},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:185},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:249},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:197},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:165},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:229},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:149},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:213},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:181},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:245},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:205},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:173},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:237},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:157},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:221},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:189},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:253},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:195},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:163},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:227},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:147},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:211},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:179},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:243},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:203},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:171},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:235},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:155},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:219},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:187},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:251},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:199},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:167},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:231},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:151},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:215},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:183},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:247},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:207},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:175},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:239},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:159},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:223},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:191},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:255}]),h||(h=[{op:16,bits:5,val:1},{op:23,bits:5,val:257},{op:19,bits:5,val:17},{op:27,bits:5,val:4097},{op:17,bits:5,val:5},{op:25,bits:5,val:1025},{op:21,bits:5,val:65},{op:29,bits:5,val:16385},{op:16,bits:5,val:3},{op:24,bits:5,val:513},{op:20,bits:5,val:33},{op:28,bits:5,val:8193},{op:18,bits:5,val:9},{op:26,bits:5,val:2049},{op:22,bits:5,val:129},{op:64,bits:5,val:0},{op:16,bits:5,val:2},{op:23,bits:5,val:385},{op:19,bits:5,val:25},{op:27,bits:5,val:6145},{op:17,bits:5,val:7},{op:25,bits:5,val:1537},{op:21,bits:5,val:97},{op:29,bits:5,val:24577},{op:16,bits:5,val:4},{op:24,bits:5,val:769},{op:20,bits:5,val:49},{op:28,bits:5,val:12289},{op:18,bits:5,val:13},{op:26,bits:5,val:3073},{op:22,bits:5,val:193},{op:64,bits:5,val:0}]),t.lencode=0,t.distcode=512,a=0;a<512;a++)t.codes[a]=r[a];for(a=0;a<32;a++)t.codes[a+512]=h[a];t.lenbits=9,t.distbits=5}function f(t,a){var i=[255&a,a>>>8&255];t.state.check=t.checksum_function(t.state.check,i,0,2)}function u(t,a){var i=[255&a,a>>>8&255,a>>>16&255,a>>>24&255];t.state.check=t.checksum_function(t.state.check,i,0,4)}function _(t,a){return a.strm=t,a.left=t.avail_out,a.next=t.next_in,a.have=t.avail_in,a.hold=t.state.hold,a.bits=t.state.bits,a}function m(t){var a=t.strm;a.next_in=t.next,a.avail_out=t.left,a.avail_in=t.have,a.state.hold=t.hold,a.state.bits=t.bits}function k(t){t.hold=0,t.bits=0}function g(t){return 0!=t.have&&(t.have--,t.hold+=(255&t.strm.input_data.charCodeAt(t.next++))<<t.bits,t.bits+=8,!0)}function w(t,a){for(;t.bits<a;)if(!g(t))return!1;return!0}function Z(t,a){return t.hold&(1<<a)-1}function x(t,a){t.hold>>>=a,t.bits-=a}function I(t){t.hold>>>=7&t.bits,t.bits-=7&t.bits}function R(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}var L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(i,s){var o,l,v,p,n,d,r,h,B,E=-1,A=-1;if(!i||!i.state||!i.input_data&&0!=i.avail_in)return ZLIB.Z_STREAM_ERROR;(o=i.state).mode==t&&(o.mode=12),_(i,l={}),v=l.have,p=l.left,B=ZLIB.Z_OK;t:for(;;)switch(o.mode){case 0:if(0==o.wrap){o.mode=12;break}if(!w(l,16))break t;if(2&o.wrap&&35615==l.hold){o.check=i.checksum_function(0,null,0,0),f(i,l.hold),k(l),o.mode=1;break}if(o.flags=0,null!==o.head&&(o.head.done=-1),!(1&o.wrap)||((Z(l,8)<<8)+(l.hold>>>8))%31){i.msg="incorrect header check",o.mode=a;break}if(Z(l,4)!=ZLIB.Z_DEFLATED){i.msg="unknown compression method",o.mode=a;break}if(x(l,4),h=Z(l,4)+8,0==o.wbits)o.wbits=h;else if(h>o.wbits){i.msg="invalid window size",o.mode=a;break}o.dmax=1<<h,i.adler=o.check=i.checksum_function(0,null,0,0),o.mode=512&l.hold?9:t,k(l);break;case 1:if(!w(l,16))break t;if(o.flags=l.hold,(255&o.flags)!=ZLIB.Z_DEFLATED){i.msg="unknown compression method",o.mode=a;break}if(57344&o.flags){i.msg="unknown header flags set",o.mode=a;break}null!==o.head&&(o.head.text=l.hold>>>8&1),512&o.flags&&f(i,l.hold),k(l),o.mode=2;case 2:if(!w(l,32))break t;null!==o.head&&(o.head.time=l.hold),512&o.flags&&u(i,l.hold),k(l),o.mode=3;case 3:if(!w(l,16))break t;null!==o.head&&(o.head.xflags=255&l.hold,o.head.os=l.hold>>>8),512&o.flags&&f(i,l.hold),k(l),o.mode=4;case 4:if(1024&o.flags){if(!w(l,16))break t;o.length=l.hold,null!==o.head&&(o.head.extra_len=l.hold),512&o.flags&&f(i,l.hold),k(l),o.head.extra=""}else null!==o.head&&(o.head.extra=null);o.mode=5;case 5:if(1024&o.flags&&((n=o.length)>l.have&&(n=l.have),n&&(null!==o.head&&null!==o.head.extra&&(h=o.head.extra_len-o.length,o.head.extra+=i.input_data.substring(l.next,l.next+(h+n>o.head.extra_max?o.head.extra_max-h:n))),512&o.flags&&(o.check=i.checksum_function(o.check,i.input_data,l.next,n)),l.have-=n,l.next+=n,o.length-=n),o.length))break t;o.length=0,o.mode=6;case 6:if(2048&o.flags){if(0==l.have)break t;null!==o.head&&null===o.head.name&&(o.head.name=""),n=0;do{if(h=i.input_data.charAt(l.next+n),n++,"\0"===h)break;null!==o.head&&o.length<o.head.name_max&&(o.head.name+=h,o.length++)}while(n<l.have);if(512&o.flags&&(o.check=i.checksum_function(o.check,i.input_data,l.next,n)),l.have-=n,l.next+=n,"\0"!==h)break t}else null!==o.head&&(o.head.name=null);o.length=0,o.mode=7;case 7:if(4096&o.flags){if(0==l.have)break t;n=0,null!==o.head&&null===o.head.comment&&(o.head.comment="");do{if(h=i.input_data.charAt(l.next+n),n++,"\0"===h)break;null!==o.head&&o.length<o.head.comm_max&&(o.head.comment+=h,o.length++)}while(n<l.have);if(512&o.flags&&(o.check=i.checksum_function(o.check,i.input_data,l.next,n)),l.have-=n,l.next+=n,"\0"!==h)break t}else null!==o.head&&(o.head.comment=null);o.mode=8;case 8:if(512&o.flags){if(!w(l,16))break t;if(l.hold!=(65535&o.check)){i.msg="header crc mismatch",o.mode=a;break}k(l)}null!==o.head&&(o.head.hcrc=o.flags>>>9&1,o.head.done=1),i.adler=o.check=i.checksum_function(0,null,0,0),o.mode=t;break;case 9:if(!w(l,32))break t;i.adler=o.check=R(l.hold),k(l),o.mode=10;case 10:if(0==o.havedict)return m(l),ZLIB.Z_NEED_DICT;i.adler=o.check=i.checksum_function(0,null,0,0),o.mode=t;case t:if(s==ZLIB.Z_BLOCK||s==ZLIB.Z_TREES)break t;case 12:if(o.last){I(l),o.mode=26;break}if(!w(l,3))break t;switch(o.last=Z(l,1),x(l,1),Z(l,2)){case 0:o.mode=13;break;case 1:if(c(o),o.mode=19,s==ZLIB.Z_TREES){x(l,2);break t}break;case 2:o.mode=16;break;case 3:i.msg="invalid block type",o.mode=a}x(l,2);break;case 13:if(I(l),!w(l,32))break t;if((65535&l.hold)!=(l.hold>>>16&65535^65535)){i.msg="invalid stored block lengths",o.mode=a;break}if(o.length=65535&l.hold,k(l),o.mode=14,s==ZLIB.Z_TREES)break t;case 14:o.mode=15;case 15:if(n=o.length){if(n>l.have&&(n=l.have),n>l.left&&(n=l.left),0==n)break t;i.output_data+=i.input_data.substring(l.next,l.next+n),i.next_out+=n,l.have-=n,l.next+=n,l.left-=n,o.length-=n;break}o.mode=t;break;case 16:if(!w(l,14))break t;if(o.nlen=Z(l,5)+257,x(l,5),o.ndist=Z(l,5)+1,x(l,5),o.ncode=Z(l,4)+4,x(l,4),o.nlen>286||o.ndist>30){i.msg="too many length or distance symbols",o.mode=a;break}o.have=0,o.mode=17;case 17:for(;o.have<o.ncode;){if(!w(l,3))break t;var O=Z(l,3);o.lens[L[o.have++]]=O,x(l,3)}for(;o.have<19;)o.lens[L[o.have++]]=0;if(o.next=0,o.lencode=0,o.lenbits=7,B=b(o,0)){i.msg="invalid code lengths set",o.mode=a;break}o.have=0,o.mode=18;case 18:for(;o.have<o.nlen+o.ndist;){for(;!((d=o.codes[o.lencode+Z(l,o.lenbits)]).bits<=l.bits);)if(!g(l))break t;if(d.val<16)x(l,d.bits),o.lens[o.have++]=d.val;else{if(16==d.val){if(!w(l,d.bits+2))break t;if(x(l,d.bits),0==o.have){i.msg="invalid bit length repeat",o.mode=a;break}h=o.lens[o.have-1],n=3+Z(l,2),x(l,2)}else if(17==d.val){if(!w(l,d.bits+3))break t;x(l,d.bits),h=0,n=3+Z(l,3),x(l,3)}else{if(!w(l,d.bits+7))break t;x(l,d.bits),h=0,n=11+Z(l,7),x(l,7)}if(o.have+n>o.nlen+o.ndist){i.msg="invalid bit length repeat",o.mode=a;break}for(;n--;)o.lens[o.have++]=h}}if(o.mode==a)break;if(0==o.lens[256]){i.msg="invalid code -- missing end-of-block",o.mode=a;break}if(o.next=0,o.lencode=o.next,o.lenbits=9,B=b(o,1)){i.msg="invalid literal/lengths set",o.mode=a;break}if(o.distcode=o.next,o.distbits=6,B=b(o,2)){i.msg="invalid distances set",o.mode=a;break}if(o.mode=19,s==ZLIB.Z_TREES)break t;case 19:o.mode=20;case 20:if(l.have>=6&&l.left>=258){m(l),e(i,p),_(i,l),o.mode==t&&(o.back=-1);break}for(o.back=0;!((d=o.codes[o.lencode+Z(l,o.lenbits)]).bits<=l.bits);)if(!g(l))break t;if(d.op&&!(240&d.op)){for(r=d;d=o.codes[o.lencode+r.val+(Z(l,r.bits+r.op)>>>r.bits)],!(r.bits+d.bits<=l.bits);)if(!g(l))break t;x(l,r.bits),o.back+=r.bits}if(x(l,d.bits),o.back+=d.bits,o.length=d.val,0==d.op){o.mode=25;break}if(32&d.op){o.back=-1,o.mode=t;break}if(64&d.op){i.msg="invalid literal/length code",o.mode=a;break}o.extra=15&d.op,o.mode=21;case 21:if(o.extra){if(!w(l,o.extra))break t;o.length+=Z(l,o.extra),x(l,o.extra),o.back+=o.extra}o.was=o.length,o.mode=22;case 22:for(;!((d=o.codes[o.distcode+Z(l,o.distbits)]).bits<=l.bits);)if(!g(l))break t;if(!(240&d.op)){for(r=d;d=o.codes[o.distcode+r.val+(Z(l,r.bits+r.op)>>>r.bits)],!(r.bits+d.bits<=l.bits);)if(!g(l))break t;x(l,r.bits),o.back+=r.bits}if(x(l,d.bits),o.back+=d.bits,64&d.op){i.msg="invalid distance code",o.mode=a;break}o.offset=d.val,o.extra=15&d.op,o.mode=23;case 23:if(o.extra){if(!w(l,o.extra))break t;o.offset+=Z(l,o.extra),x(l,o.extra),o.back+=o.extra}o.mode=24;case 24:if(0==l.left)break t;if(n=p-l.left,o.offset>n){if((n=o.offset-n)>o.whave&&o.sane){i.msg="invalid distance too far back",o.mode=a;break}n>o.wnext?(n-=o.wnext,E=o.wsize-n,A=-1):(E=o.wnext-n,A=-1),n>o.length&&(n=o.length)}else E=-1,A=i.next_out-o.offset,n=o.length;if(n>l.left&&(n=l.left),l.left-=n,o.length-=n,E>=0)i.output_data+=o.window.substring(E,E+n),i.next_out+=n,n=0;else{i.next_out+=n;do{i.output_data+=i.output_data.charAt(A++)}while(--n)}0==o.length&&(o.mode=20);break;case 25:if(0==l.left)break t;i.output_data+=String.fromCharCode(o.length),i.next_out++,l.left--,o.mode=20;break;case 26:if(o.wrap){if(!w(l,32))break t;if(p-=l.left,i.total_out+=p,o.total+=p,p&&(i.adler=o.check=i.checksum_function(o.check,i.output_data,i.output_data.length-p,p)),p=l.left,(o.flags?l.hold:R(l.hold))!=o.check){i.msg="incorrect data check",o.mode=a;break}k(l)}o.mode=27;case 27:if(o.wrap&&o.flags){if(!w(l,32))break t;if(l.hold!=(4294967295&o.total)){i.msg="incorrect length check",o.mode=a;break}k(l)}o.mode=28;case 28:B=ZLIB.Z_STREAM_END;break t;case a:B=ZLIB.Z_DATA_ERROR;break t;case 30:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}return m(l),(o.wsize||p!=i.avail_out&&o.mode<a&&(o.mode<26||s!=ZLIB.Z_FINISH))&&function(t){var a=t.state,i=t.output_data.length;return null===a.window&&(a.window=""),0==a.wsize&&(a.wsize=1<<a.wbits),i>=a.wsize?a.window=t.output_data.substring(i-a.wsize):a.whave+i<a.wsize?a.window+=t.output_data:a.window=a.window.substring(a.whave-(a.wsize-i))+t.output_data,a.whave=a.window.length,a.whave<a.wsize?a.wnext=a.whave:a.wnext=0,0}(i)?(o.mode=30,ZLIB.Z_MEM_ERROR):(v-=i.avail_in,p-=i.avail_out,i.total_in+=v,i.total_out+=p,o.total+=p,o.wrap&&p&&(i.adler=o.check=i.checksum_function(o.check,i.output_data,0,i.output_data.length)),i.data_type=o.bits+(o.last?64:0)+(o.mode==t?128:0)+(19==o.mode||14==o.mode?256:0),(0==v&&0==p||s==ZLIB.Z_FINISH)&&B==ZLIB.Z_OK&&(B=ZLIB.Z_BUF_ERROR),B)},ZLIB.inflateEnd=function(t){return t&&t.state?(t.state.window=null,t.state=null,ZLIB.Z_OK):ZLIB.Z_STREAM_ERROR},ZLIB.z_stream.prototype.inflate=function(t,a){var i,s;this.input_data=t,this.next_in=p(a,"next_in",0),this.avail_in=p(a,"avail_in",t.length-this.next_in),i=p(a,"flush",ZLIB.Z_SYNC_FLUSH),s=p(a,"avail_out",-1);var o="";do{if(this.avail_out=s>=0?s:16384,this.output_data="",this.next_out=0,this.error=ZLIB.inflate(this,i),s>=0)return this.output_data;if(o+=this.output_data,this.avail_out>0)break}while(this.error==ZLIB.Z_OK);return o},ZLIB.z_stream.prototype.inflateReset=function(t){return ZLIB.inflateReset(this,t)}}()
\ No newline at end of file
translate/translate.js
+24
-25
@@ -101,7 +101,6 @@ var minifyMeshCentralSourceFiles = [
101
"../public/scripts/amt-wsman-ws-0.2.0.js",
102
"../public/scripts/common-0.0.1.js",
103
"../public/scripts/meshcentral.js",
104
- "../public/scripts/ol3-contextmenu.js",
104
"../public/scripts/u2f-api.js",
105
"../public/scripts/xterm-addon-fit.js",
106
"../public/scripts/xterm.js",
@@ -168,7 +167,7 @@ function setup() {
167
168
function start() { startEx(process.argv); }
169
171
-function startEx(argv) {
170
+async function startEx(argv) {
171
// Load dependencies
172
jsdom = require('jsdom');
173
esprima = require('esprima'); // https://www.npmjs.com/package/esprima
@@ -366,7 +365,7 @@ function startEx(argv) {
365
if (sourceFile.endsWith('.handlebars') >= 0) { inFile = inFile.split('{{{pluginHandler}}}').join('"{{{pluginHandler}}}"'); }
366
if (sourceFile.endsWith('.js')) { inFile = '<script>' + inFile + '</script>'; }
367
369
- minify(inFile, {
368
+ var minifiedOut = await minify(inFile, {
369
collapseBooleanAttributes: true,
370
collapseInlineTagWhitespace: false, // This is not good.
371
collapseWhitespace: true,
@@ -381,12 +380,12 @@ function startEx(argv) {
380
removeTagWhitespace: true,
381
preserveLineBreaks: false,
382
useShortDoctype: true
384
- }).then(function (minifiedOut) {
385
- // Perform minification post-processing
386
- if (sourceFile.endsWith('.js')) { minifiedOut = minifiedOut.substring(8, minifiedOut.length - 9); }
387
- if (sourceFile.endsWith('.handlebars') >= 0) { minifiedOut = minifiedOut.split('"{{{pluginHandler}}}"').join('{{{pluginHandler}}}'); }
388
- fs.writeFileSync(destinationFile, minifiedOut, { flag: 'w+' });
383
});
384
+
385
+ // Perform minification post-processing
386
+ if (sourceFile.endsWith('.js')) { minifiedOut = minifiedOut.substring(8, minifiedOut.length - 9); }
387
+ if (sourceFile.endsWith('.handlebars') >= 0) { minifiedOut = minifiedOut.split('"{{{pluginHandler}}}"').join('{{{pluginHandler}}}'); }
388
+ fs.writeFileSync(destinationFile, minifiedOut, { flag: 'w+' });
389
}
390
} else if (sourceFiles[i].endsWith('.json')) {
391
// Minify the file .json file
@@ -440,7 +439,7 @@ function startEx(argv) {
439
440
var minifiedOut = null;
441
try {
443
- minify(inFile, {
442
+ minifiedOut = await minify(inFile, {
443
collapseBooleanAttributes: true,
444
collapseInlineTagWhitespace: false, // This is not good.
445
collapseWhitespace: true,
@@ -456,16 +455,16 @@ function startEx(argv) {
455
preserveLineBreaks: false,
456
useShortDoctype: true,
457
log: function(a) { if (typeof a !== 'string') { console.log(a); } } // Log errors from UglifyJS to console output
459
- }).then(function (minifiedOut) {
460
- // Perform minification post-processing
461
- if (outname.endsWith('.js')) { minifiedOut = minifiedOut.substring(8, minifiedOut.length - 9); }
462
- if (outname.endsWith('.handlebars') >= 0) { minifiedOut = minifiedOut.split('"{{{pluginHandler}}}"').join('{{{pluginHandler}}}'); }
463
- fs.writeFileSync(outnamemin, minifiedOut, { flag: 'w+' });
458
});
459
} catch (ex) {
460
console.log(ex);
461
}
462
463
+ // Perform minification post-processing
464
+ if (outname.endsWith('.js')) { minifiedOut = minifiedOut.substring(8, minifiedOut.length - 9); }
465
+ if (outname.endsWith('.handlebars') >= 0) { minifiedOut = minifiedOut.split('"{{{pluginHandler}}}"').join('{{{pluginHandler}}}'); }
466
+ fs.writeFileSync(outnamemin, minifiedOut, { flag: 'w+' });
467
+
468
/*
469
if (outname.endsWith('.js')) {
470
var compressHandler = function compressHandlerFunc(err, buffer, outnamemin2) {
@@ -508,7 +507,7 @@ function startEx(argv) {
507
if (outname.endsWith('.handlebars') >= 0) { inFile = inFile.split('{{{pluginHandler}}}').join('"{{{pluginHandler}}}"'); }
508
if (outname.endsWith('.js')) { inFile = '<script>' + inFile + '</script>'; }
509
511
- minify(inFile, {
510
+ var minifiedOut = await minify(inFile, {
511
collapseBooleanAttributes: true,
512
collapseInlineTagWhitespace: false, // This is not good.
513
collapseWhitespace: true,
@@ -523,12 +522,13 @@ function startEx(argv) {
522
removeTagWhitespace: true,
523
preserveLineBreaks: false,
524
useShortDoctype: true
526
- }).then(function (minifiedOut) {
527
- // Perform minification post-processing
528
- if (outname.endsWith('.js')) { minifiedOut = minifiedOut.substring(8, minifiedOut.length - 9); }
529
- if (outname.endsWith('.handlebars') >= 0) { minifiedOut = minifiedOut.split('"{{{pluginHandler}}}"').join('{{{pluginHandler}}}'); }
530
- fs.writeFileSync(outnamemin, minifiedOut, { flag: 'w+' });
525
});
526
+
527
+ // Perform minification post-processing
528
+ if (outname.endsWith('.js')) { minifiedOut = minifiedOut.substring(8, minifiedOut.length - 9); }
529
+ if (outname.endsWith('.handlebars') >= 0) { minifiedOut = minifiedOut.split('"{{{pluginHandler}}}"').join('{{{pluginHandler}}}'); }
530
+ fs.writeFileSync(outnamemin, minifiedOut, { flag: 'w+' });
531
+
532
}
533
}
534
}
@@ -934,7 +934,7 @@ function translateAllInJson(xlang, langFile, file) {
934
fs.writeFileSync(file, JSON.stringify(json, null, 2), { flag: 'w+' });
935
}
936
937
-function translateFromHtml(lang, file, createSubDir) {
937
+async function translateFromHtml(lang, file, createSubDir) {
938
var data = fs.readFileSync(file);
939
if (file.endsWith('.js')) { data = '<html><head></head><body><script>' + data + '</script></body></html>'; }
940
var { JSDOM } = jsdom;
@@ -988,7 +988,7 @@ function translateFromHtml(lang, file, createSubDir) {
988
// Minify the file
989
if (minifyLib = 2) {
990
if (outnamemin.endsWith('.handlebars') >= 0) { out = out.split('{{{pluginHandler}}}').join('"{{{pluginHandler}}}"'); }
991
- minify(out, {
991
+ var minifiedOut = await minify(out, {
992
collapseBooleanAttributes: true,
993
collapseInlineTagWhitespace: false, // This is not good.
994
collapseWhitespace: true,
@@ -1003,10 +1003,9 @@ function translateFromHtml(lang, file, createSubDir) {
1003
removeTagWhitespace: true,
1004
preserveLineBreaks: false,
1005
useShortDoctype: true
1006
- }).then(function (minifiedOut) {
1007
- if (outnamemin.endsWith('.handlebars') >= 0) { minifiedOut = minifiedOut.split('"{{{pluginHandler}}}"').join('{{{pluginHandler}}}'); }
1008
- fs.writeFileSync(outnamemin, minifiedOut, { flag: 'w+' });
1006
});
1007
+ if (outnamemin.endsWith('.handlebars') >= 0) { minifiedOut = minifiedOut.split('"{{{pluginHandler}}}"').join('{{{pluginHandler}}}'); }
1008
+ fs.writeFileSync(outnamemin, minifiedOut, { flag: 'w+' });
1009
}
1010
}
1011