From b529680615e867ab311ab52fb378c475f7a0dfc8 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 25 Sep 2019 11:37:58 -0700 Subject: [PATCH] Security fixes. --- meshuser.js | 4 +- package.json | 2 +- public/commander.htm | 1570 +++++++++++++++++++------------------- views/default.handlebars | 11 +- webserver.js | 2 +- 5 files changed, 803 insertions(+), 786 deletions(-) diff --git a/meshuser.js b/meshuser.js index 8079fc29..9a0afed6 100644 --- a/meshuser.js +++ b/meshuser.js @@ -2815,6 +2815,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use if (command.meshid.split('/').length == 1) { command.meshid = 'mesh/' + domain.id + '/' + command.meshid; } var smesh = command.meshid.split('/'); if ((smesh.length != 3) || (smesh[0] != 'mesh') || (smesh[1] != domain.id)) { err = 'Invalid group id'; } + var serverName = parent.getWebServerName(domain); + if (parent.args.lanonly == true) { err = 'Server has not fixed IP or DNS name.'; } // Handle any errors if (err != null) { @@ -2831,7 +2833,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use var httpsPort = ((args.aliasport == null) ? args.port : args.aliasport); // Use HTTPS alias port is specified var xdomain = (domain.dns == null) ? domain.id : ''; if (xdomain != '') xdomain += "/"; - var url = "http" + (args.notls ? '' : 's') + "://" + parent.getWebServerName(domain) + ":" + httpsPort + "/" + xdomain + "agentinvite?c=" + inviteCookie; + var url = "http" + (args.notls ? '' : 's') + "://" + serverName + ":" + httpsPort + "/" + xdomain + "agentinvite?c=" + inviteCookie; ws.send(JSON.stringify({ action: 'createInviteLink', meshid: command.meshid, url: url, expire: command.expire, cookie: inviteCookie, responseid: command.responseid, tag: command.tag })); break; diff --git a/package.json b/package.json index 5f07b667..d139828a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.1-f", + "version": "0.4.1-g", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/commander.htm b/public/commander.htm index 77be6702..002b8a39 100644 --- a/public/commander.htm +++ b/public/commander.htm @@ -11,35 +11,35 @@ function ObjectToStringEx(b,c){var a="";if(0!=b&&(!b||null==b))return"(Null)";if function ObjectToStringEx2(b,c){var a="";if(0!=b&&(!b||null==b))return"(Null)";if(b instanceof Array)for(var d in b)a+="\r\n"+gap2(c)+"Item #"+d+": "+ObjectToStringEx2(b[d],c+1);else if(b instanceof Object)for(d in b)a+="\r\n"+gap2(c)+d+" = "+ObjectToStringEx2(b[d],c+1);else a+=EscapeHtml(b);return a}function gap(b){for(var c="",a=0;a<4*b;a++)c+=" ";return c}function gap2(b){for(var c="",a=0;a<4*b;a++)c+=" ";return c}function ObjectToString(b){return ObjectToStringEx(b,0)} function ObjectToString2(b){return ObjectToStringEx2(b,0)}function hex2rstr(b){if("string"!=typeof b||0==b.length)return"";var c="";b=(""+b).match(/../g);for(var a;a=b.shift();)c+=String.fromCharCode("0x"+a);return c}function char2hex(b){return(b+256).toString(16).substr(-2).toUpperCase()}function rstr2hex(b){var c="",a;for(a=0;a>9)-1);b("DEV_FLOPPY",d);break;case 176:if(null==e.cdrom||0==e.cdrom.size)return e.SendCommandEndResponse(0,2,c,58,0),-1;null!=e.cdrom&&(d=(e.cdrom.size>>11)-1);b("DEV_CDDVD",d);break;default:return b("SCSI Internal error 4",c),-1}b("SCSI: READ_CAPACITY2",c,x);e.SendDataToHost(x,!0,IntToStr(d)+String.fromCharCode(0,0,176==c? -8:2,0),A&1);break;case 40:x=ReadInt(d,2);d=ReadShort(d,7);b("SCSI: READ_10",c,x,d);a(c,x,d,A);break;case 42:case 46:x=ReadInt(d,2);d=ReadShort(d,7);b("SCSI: WRITE_10",c,x,d);e.SendGetDataFromHost(c,512*d);break;case 67:x=ReadShort(d,7);var C=d.charCodeAt(1)&2,q=d.charCodeAt(2)&7;0==q&&(q=d.charCodeAt(9)>>6);b("SCSI: READ_TOC, dev="+c+", buflen="+x+", msf="+C+", format="+q);switch(c){case 160:return e.SendCommandEndResponse(1,5,c,32,0),-1;case 176:break;default:return b("SCSI Internal error 9",c), --1}1==q?e.SendDataToHost(c,!0,String.fromCharCode(0,10,1,1,0,20,1,0,0,0,0,0),A&1):0==q&&(C?e.SendDataToHost(c,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19),A&1):e.SendDataToHost(c,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0),A&1));break;case 70:var q=2!=d.charCodeAt(1),M=ReadShort(d,2);x=ReadShort(d,7);b("SCSI: GET_CONFIGURATION",c,q,M,x);if(0==x)return e.SendDataToHost(c,!0,IntToStr(60)+IntToStr(8),A&1),-1;C=IntToStr(8);0==M&&(C+=B);if(1==M||q&&1> -M)C+=l;if(2==M||q&&2>M)C+=g;if(3==M||q&&3>M)C+=I;if(16==M||q&&16>M)C+=u;if(30==M||q&&30>M)C+=D;if(256==M||q&&256>M)C+=w;if(261==M||q&&261>M)C+=y;C=IntToStr(C.length)+C;C.length>x&&(C=C.substring(0,x));e.SendDataToHost(c,!0,C,A&1);return-1;case 74:b("SCSI: GET_EVENT_STATUS_NOTIFICATION",c,d.charCodeAt(1),d.charCodeAt(4),d.charCodeAt(9));if(1!=d.charCodeAt(1)&&16!=d.charCodeAt(4)){b("SCSI ERROR");e.SendCommandEndResponse(1,5,c,38,1);break}d=0;160==c&&null!=e.floppy?d=2:176==c&&null!=e.cdrom&&(d=2); -e.SendDataToHost(c,!0,String.fromCharCode(0,d,128,0),A&1);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 b("SCSI READ_DISC_INFO",c),e.SendCommandEndResponse(0,5,c,32,0),-1;case 85:return b("SCSI ERROR: MODE_SELECT_10",c),e.SendCommandEndResponse(1,5,c,32,0),-1;case 90:b("SCSI: MODE_SENSE_10",c,d.charCodeAt(2)&63);x=ReadShort(d,7);C=null;if(0==x)return e.SendDataToHost(c,!0,IntToStr(60)+IntToStr(8),A& -1),-1;x=0;160==c?null!=e.floppy&&(x=e.floppy.size>>9):null!=e.cdrom&&(x=e.cdrom.size>>11);switch(d.charCodeAt(2)&63){case 1:C=160==c?2880>=x?F:G:E;break;case 5:160==c&&(C=2880>=x?r:p);break;case 63:C=160==c?2880>=x?n:h:v;break;case 26:176==c&&(C=m);break;case 29:176==c&&(C=z);break;case 42:176==c&&(C=k)}null==C?e.SendCommandEndResponse(0,5,c,32,0):e.SendDataToHost(c,!0,C,A&1);break;default:return b("IDER: Unknown SCSI command",d.charCodeAt(0)),e.SendCommandEndResponse(0,5,c,32,0),-1}return 0}function a(a, -b,c,g){var y=null,n=0;160==a&&(y=e.floppy,null!=e.floppy&&(n=e.floppy.size>>9));176==a&&(y=e.cdrom,null!=e.cdrom&&(n=e.cdrom.size>>11));if(0>c||b+c>n)return e.SendCommandEndResponse(1,5,a,33,0),0;if(0==c)return e.SendCommandEndResponse(1,0,a,0,0),0;null!=y&&(e.sectorStats&&e.sectorStats(1,160==a?0:1,n,b,c),160==a?(b<<=9,c<<=9):(b<<=11,c<<=11),null!==C?A.push({media:y,dev:a,lba:b,len:c,fr:g}):(C=y,M=a,ba=b,q=c,d(g)))}function d(a){var b=q,c=ba;q>e.iderinfo.readbfr&&(b=e.iderinfo.readbfr);q-=b;ba+= -b;var g=new FileReader;g.onload=function(){e.SendDataToHost(M,0==q,this.result,a&1);if(0>9:0),e.sectorStats(0,1,e.cdrom?e.cdrom.size>> -11:0))};e.Stop=function(){b("IDER-Stop");e.parent.Stop()};e.ProcessData=function(a){e.bytesFromAmt+=a.length;e.acc+=a;for(b("IDER-ProcessData",e.acc.length,rstr2hex(e.acc));;){a=e.ProcessDataEx();if(0==a)break;if(e.inSequence!=ReadIntX(e.acc,4)){b("ERROR: Out of sequence",e.inSequence,ReadIntX(e.acc,4));e.Stop();break}e.inSequence++;e.acc=e.acc.substring(a)}};e.SendCommand=function(a,c,g,y){null==c&&(c="");g=50>8,0,g?180:181,0,2,0,y&255,y>>8,a,88,133,0,3,0,0,0,a,80,0,0,0,0,0,0)+c,b,g):e.SendCommand(84, -String.fromCharCode(0,c.length&255,c.length>>8,0,g?180:181,0,2,0,y&255,y>>8,a,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0)+c,b,g)};e.SendGetDataFromHost=function(a,b){e.SendCommand(82,String.fromCharCode(0,b&255,b>>8,0,181,0,0,0,b&255,b>>8,a,88,0,0,0,0,0,0,0,0,0,0,0),!1)};e.SendDisableEnableFeatures=function(a,b){null==b&&(b="");e.SendCommand(72,String.fromCharCode(a)+b)};e.ProcessDataEx=function(){if(8>e.acc.length)return 0;switch(e.acc.charCodeAt(0)){case 65:if(30>e.acc.length)break;var a=e.acc.charCodeAt(29); +var CreateAmtRemoteIder=function(){function b(){urlvars&&urlvars.idertrace&&console.log.apply(console,[].concat($jscomp.arrayFromArguments(arguments)))}function c(c,d,y,A){switch(d.charCodeAt(0)){case 0:b("SCSI: TEST_UNIT_READY",c);switch(c){case 160:if(null==e.floppy)return e.SendCommandEndResponse(1,2,c,58,0),-1;if(0==e.floppyReady)return e.floppyReady=!0,e.SendCommandEndResponse(1,6,c,40,0),-1;break;case 176:if(null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;if(0==e.cdromReady)return e.cdromReady= +!0,e.SendCommandEndResponse(1,6,c,40,0),-1;break;default:return b("SCSI Internal error 3",c),-1}e.SendCommandEndResponse(1,0,c,0,0);break;case 8:A=((d.charCodeAt(1)&31)<<16)+(d.charCodeAt(2)<<8)+d.charCodeAt(3);d=d.charCodeAt(4);0==d&&(d=256);b("SCSI: READ_6",c,A,d);a(c,A,d,y);break;case 10:return A=((d.charCodeAt(1)&31)<<16)+(d.charCodeAt(2)<<8)+d.charCodeAt(3),d=d.charCodeAt(4),0==d&&(d=256),b("SCSI: WRITE_6",c,A,d),e.SendCommandEndResponse(1,2,c,58,0),-1;case 26:b("SCSI: MODE_SENSE_6",c);if(63== +d.charCodeAt(2)&&0==d.charCodeAt(3)){A=d=0;switch(c){case 160:if(null==e.floppy)return e.SendCommandEndResponse(1,2,c,58,0),-1;d=0;A=128;break;case 176:if(null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;d=5;A=128;break;default:return b("SCSI Internal error 6",c),-1}e.SendDataToHost(c,!0,String.fromCharCode(0,d,A,0),y&1);return}e.SendCommandEndResponse(1,5,c,36,0);break;case 27:e.SendCommandEndResponse(1,0,c);break;case 30:b("SCSI: ALLOW_MEDIUM_REMOVAL",c);if(160==c&&null==e.floppy||176== +c&&null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;e.SendCommandEndResponse(1,0,c,0,0);break;case 35:b("SCSI: READ_FORMAT_CAPACITIES",c);A=ReadShort(d,7);switch(c){case 160:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,5,c,36,0),-1;break;case 176:if(null==e.cdrom||0==e.cdrom.size)return e.SendCommandEndResponse(0,5,c,36,0),-1;break;default:return b("SCSI Internal error 4",c),-1}e.SendDataToHost(c,!0,IntToStr(8)+String.fromCharCode(0,0,11,64,2,0,2,0),y&1);break; +case 37:b("SCSI: READ_CAPACITY",c);d=0;switch(c){case 160:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,2,c,58,0),-1;null!=e.floppy&&(d=(e.floppy.size>>9)-1);b("DEV_FLOPPY",d);break;case 176:if(null==e.cdrom||0==e.cdrom.size)return e.SendCommandEndResponse(0,2,c,58,0),-1;null!=e.cdrom&&(d=(e.cdrom.size>>11)-1);b("DEV_CDDVD",d);break;default:return b("SCSI Internal error 4",c),-1}b("SCSI: READ_CAPACITY2",c,A);e.SendDataToHost(A,!0,IntToStr(d)+String.fromCharCode(0,0,176==c? +8:2,0),y&1);break;case 40:A=ReadInt(d,2);d=ReadShort(d,7);b("SCSI: READ_10",c,A,d);a(c,A,d,y);break;case 42:case 46:A=ReadInt(d,2);d=ReadShort(d,7);b("SCSI: WRITE_10",c,A,d);e.SendGetDataFromHost(c,512*d);break;case 67:A=ReadShort(d,7);var E=d.charCodeAt(1)&2,r=d.charCodeAt(2)&7;0==r&&(r=d.charCodeAt(9)>>6);b("SCSI: READ_TOC, dev="+c+", buflen="+A+", msf="+E+", format="+r);switch(c){case 160:return e.SendCommandEndResponse(1,5,c,32,0),-1;case 176:break;default:return b("SCSI Internal error 9",c), +-1}1==r?e.SendDataToHost(c,!0,String.fromCharCode(0,10,1,1,0,20,1,0,0,0,0,0),y&1):0==r&&(E?e.SendDataToHost(c,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19),y&1):e.SendDataToHost(c,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0),y&1));break;case 70:var r=2!=d.charCodeAt(1),L=ReadShort(d,2);A=ReadShort(d,7);b("SCSI: GET_CONFIGURATION",c,r,L,A);if(0==A)return e.SendDataToHost(c,!0,IntToStr(60)+IntToStr(8),y&1),-1;E=IntToStr(8);0==L&&(E+=B);if(1==L||r&&1> +L)E+=k;if(2==L||r&&2>L)E+=g;if(3==L||r&&3>L)E+=J;if(16==L||r&&16>L)E+=u;if(30==L||r&&30>L)E+=C;if(256==L||r&&256>L)E+=x;if(261==L||r&&261>L)E+=w;E=IntToStr(E.length)+E;E.length>A&&(E=E.substring(0,A));e.SendDataToHost(c,!0,E,y&1);return-1;case 74:b("SCSI: GET_EVENT_STATUS_NOTIFICATION",c,d.charCodeAt(1),d.charCodeAt(4),d.charCodeAt(9));if(1!=d.charCodeAt(1)&&16!=d.charCodeAt(4)){b("SCSI ERROR");e.SendCommandEndResponse(1,5,c,38,1);break}d=0;160==c&&null!=e.floppy?d=2:176==c&&null!=e.cdrom&&(d=2); +e.SendDataToHost(c,!0,String.fromCharCode(0,d,128,0),y&1);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 b("SCSI READ_DISC_INFO",c),e.SendCommandEndResponse(0,5,c,32,0),-1;case 85:return b("SCSI ERROR: MODE_SELECT_10",c),e.SendCommandEndResponse(1,5,c,32,0),-1;case 90:b("SCSI: MODE_SENSE_10",c,d.charCodeAt(2)&63);A=ReadShort(d,7);E=null;if(0==A)return e.SendDataToHost(c,!0,IntToStr(60)+IntToStr(8),y& +1),-1;A=0;160==c?null!=e.floppy&&(A=e.floppy.size>>9):null!=e.cdrom&&(A=e.cdrom.size>>11);switch(d.charCodeAt(2)&63){case 1:E=160==c?2880>=A?F:H:D;break;case 5:160==c&&(E=2880>=A?q:l);break;case 63:E=160==c?2880>=A?n:p:z;break;case 26:176==c&&(E=m);break;case 29:176==c&&(E=v);break;case 42:176==c&&(E=h)}null==E?e.SendCommandEndResponse(0,5,c,32,0):e.SendDataToHost(c,!0,E,y&1);break;default:return b("IDER: Unknown SCSI command",d.charCodeAt(0)),e.SendCommandEndResponse(0,5,c,32,0),-1}return 0}function a(a, +b,c,g){var w=null,n=0;160==a&&(w=e.floppy,null!=e.floppy&&(n=e.floppy.size>>9));176==a&&(w=e.cdrom,null!=e.cdrom&&(n=e.cdrom.size>>11));if(0>c||b+c>n)return e.SendCommandEndResponse(1,5,a,33,0),0;if(0==c)return e.SendCommandEndResponse(1,0,a,0,0),0;null!=w&&(e.sectorStats&&e.sectorStats(1,160==a?0:1,n,b,c),160==a?(b<<=9,c<<=9):(b<<=11,c<<=11),null!==E?A.push({media:w,dev:a,lba:b,len:c,fr:g}):(E=w,L=a,U=b,r=c,d(g)))}function d(a){var b=r,c=U;r>e.iderinfo.readbfr&&(b=e.iderinfo.readbfr);r-=b;U+=b;var g= +new FileReader;g.onload=function(){e.SendDataToHost(L,0==r,this.result,a&1);if(0>9:0),e.sectorStats(0,1,e.cdrom?e.cdrom.size>>11:0))};e.Stop= +function(){b("IDER-Stop");e.parent.Stop()};e.ProcessData=function(a){e.bytesFromAmt+=a.length;e.acc+=a;for(b("IDER-ProcessData",e.acc.length,rstr2hex(e.acc));;){a=e.ProcessDataEx();if(0==a)break;if(e.inSequence!=ReadIntX(e.acc,4)){b("ERROR: Out of sequence",e.inSequence,ReadIntX(e.acc,4));e.Stop();break}e.inSequence++;e.acc=e.acc.substring(a)}};e.SendCommand=function(a,c,g,w){null==c&&(c="");g=50>8,0,g?180:181,0,2,0,w&255,w>>8,a,88,133,0,3,0,0,0,a,80,0,0,0,0,0,0)+c,b,g):e.SendCommand(84, +String.fromCharCode(0,c.length&255,c.length>>8,0,g?180:181,0,2,0,w&255,w>>8,a,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0)+c,b,g)};e.SendGetDataFromHost=function(a,b){e.SendCommand(82,String.fromCharCode(0,b&255,b>>8,0,181,0,0,0,b&255,b>>8,a,88,0,0,0,0,0,0,0,0,0,0,0),!1)};e.SendDisableEnableFeatures=function(a,b){null==b&&(b="");e.SendCommand(72,String.fromCharCode(a)+b)};e.ProcessDataEx=function(){if(8>e.acc.length)return 0;switch(e.acc.charCodeAt(0)){case 65:if(30>e.acc.length)break;var a=e.acc.charCodeAt(29); if(e.acc.length<30+a)break;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);b(e.iderinfo);0!=e.iderinfo.proto&&(b("Unknown proto",e.iderinfo.proto),e.Stop());8192e.acc.length)break;a=e.acc.charCodeAt(8);null===C?(e.SendCommand(71),b("RESETOCCURED1",a)):(x=!0,b("RESETOCCURED2", +e.Stop());8192e.acc.length)break;a=e.acc.charCodeAt(8);null===E?(e.SendCommand(71),b("RESETOCCURED1",a)):(y=!0,b("RESETOCCURED2", a));return 9;case 73:if(13>e.acc.length)break;var a=e.acc.charCodeAt(8),g=ReadIntX(e.acc,9);b("STATUS_DATA",a,g);switch(a){case 1:g&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=g&2?!0:!1;b("IDER Status: "+e.enabled);break;case 3:1!=g&&b("Register toggle failure")}return 13;case 74:if(11>e.acc.length)break;b("IDER: ABORT",e.acc.charCodeAt(8)); -return 11;case 75:return 8;case 80:if(28>e.acc.length)break;var a=e.acc.charCodeAt(14)&16?176:160,g=e.acc.charCodeAt(14),y=e.acc.substring(16,28),n=e.acc.charCodeAt(9);b("SCSI_CMD",a,rstr2hex(y),n,g);c(a,y,n,g);return 28;case 83:if(14>e.acc.length)break;a=ReadShortX(e.acc,9);if(e.acc.length<14+a)break;b("SCSI_WRITE, len = "+(14+a));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);return 14+a;default:b("Unknown IDER command",e.acc[0]),e.Stop()}return 0}; -var A=[],x=!1,C=null,M,ba,q;return e},CreateAmtRemoteServerIder=function(){function b(){urlvars&&urlvars.idertrace&&console.log.apply(console,[].concat($jscomp.arrayFromArguments(arguments)))}var c={protocol:4,iderStart:0,floppy:null,cdrom:null,state:0,onStateChanged:null,m:{sectorStats:null,onDialogPrompt:null,dialogPrompt:function(a){c.socket.send(JSON.stringify({action:"dialogResponse",args:a}))},bytesToAmt:0,bytesFromAmt:0,server:!0,Stop:function(){c.Stop()}},xxStateChange:function(a){if(c.state!= -a&&(b("SIDER-StateChange",a),c.state=a,null!=c.onStateChanged))c.onStateChanged(c,c.state)},Start:function(a,d,e,p,h){b("SIDER-Start",a,d,e,p,h);c.host=a;c.port=d;c.user=e;c.pass=p;c.connectstate=0;c.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webider.ashx?host="+a+"&port="+d+"&tls="+h+("*"==e?"&serverauth=1":"")+("undefined"===typeof p?"&serverauth=1&user="+e:"")+"&tls1only="+ +return 11;case 75:return 8;case 80:if(28>e.acc.length)break;var a=e.acc.charCodeAt(14)&16?176:160,g=e.acc.charCodeAt(14),w=e.acc.substring(16,28),n=e.acc.charCodeAt(9);b("SCSI_CMD",a,rstr2hex(w),n,g);c(a,w,n,g);return 28;case 83:if(14>e.acc.length)break;a=ReadShortX(e.acc,9);if(e.acc.length<14+a)break;b("SCSI_WRITE, len = "+(14+a));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);return 14+a;default:b("Unknown IDER command",e.acc[0]),e.Stop()}return 0}; +var A=[],y=!1,E=null,L,U,r;return e},CreateAmtRemoteServerIder=function(){function b(){urlvars&&urlvars.idertrace&&console.log.apply(console,[].concat($jscomp.arrayFromArguments(arguments)))}var c={protocol:4,iderStart:0,floppy:null,cdrom:null,state:0,onStateChanged:null,m:{sectorStats:null,onDialogPrompt:null,dialogPrompt:function(a){c.socket.send(JSON.stringify({action:"dialogResponse",args:a}))},bytesToAmt:0,bytesFromAmt:0,server:!0,Stop:function(){c.Stop()}},xxStateChange:function(a){if(c.state!= +a&&(b("SIDER-StateChange",a),c.state=a,null!=c.onStateChanged))c.onStateChanged(c,c.state)},Start:function(a,d,e,l,p){b("SIDER-Start",a,d,e,l,p);c.host=a;c.port=d;c.user=e;c.pass=l;c.connectstate=0;c.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webider.ashx?host="+a+"&port="+d+"&tls="+p+("*"==e?"&serverauth=1":"")+("undefined"===typeof l?"&serverauth=1&user="+e:"")+"&tls1only="+ c.tlsv1only);c.socket.onopen=c.xxOnSocketConnected;c.socket.onmessage=c.xxOnMessage;c.socket.onclose=c.xxOnSocketClosed;c.xxStateChange(1)},Stop:function(){b("SIDER-Stop");null!=c.socket&&(c.socket.close(),c.socket=null);c.xxStateChange(0)},xxOnSocketConnected:function(){c.xxStateChange(2);c.socket.send(JSON.stringify({action:"start"}))},xxOnMessage:function(a){var b=null;try{b=JSON.parse(a.data)}catch(e){}if(null!=b&&"string"==typeof b.action)switch(b.action){case "dialog":if(null!=c.m.onDialogPrompt)c.m.onDialogPrompt(c, b.args,b.buttons);break;case "state":2==b.state&&c.xxStateChange(3);break;case "stats":c.m.bytesToAmt=b.toAmt;c.m.bytesFromAmt=b.fromAmt;c.m.sectorStats&&c.m.sectorStats(b.mode,b.dev,b.total,b.start,b.len);break;case "error":console.log("IDER Error: "+";Floppy disk image does not exist;Invalid floppy disk image;Unable to open floppy disk image;CDROM disk image does not exist;Invalid CDROM disk image;Unable to open CDROM disk image;Can't perform IDER with no disk images".split(";")[b.code]);break; -default:console.log("Unknown Server IDER action: "+b.action),breal}},xxOnSocketClosed:function(){c.Stop()}};return c},CreateWsmanComm=function(b,c,a,d,e){function p(){m.socketState=2;m.socketParseState=0;m.socketAccumulator="";m.socketHeader=null;m.socketData="";for(i in m.pendingAjaxCall)m.sendRequest(m.pendingAjaxCall[i][0],m.pendingAjaxCall[i][3],m.pendingAjaxCall[i][4])}function h(a){if("object"==typeof a.data)if(1==k)v.push(a.data);else if(z.readAsBinaryString)k=!0,z.readAsBinaryString(new Blob([a.data])); -else if(z.readAsArrayBuffer)k=!0,z.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,n=0;na)break;m.socketHeader=m.socketAccumulator.substring(0, +default:console.log("Unknown Server IDER action: "+b.action),breal}},xxOnSocketClosed:function(){c.Stop()}};return c},CreateWsmanComm=function(b,c,a,d,e){function l(){m.socketState=2;m.socketParseState=0;m.socketAccumulator="";m.socketHeader=null;m.socketData="";for(i in m.pendingAjaxCall)m.sendRequest(m.pendingAjaxCall[i][0],m.pendingAjaxCall[i][3],m.pendingAjaxCall[i][4])}function p(a){if("object"==typeof a.data)if(1==h)z.push(a.data);else if(v.readAsBinaryString)h=!0,v.readAsBinaryString(new Blob([a.data])); +else if(v.readAsArrayBuffer)h=!0,v.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,n=0;na)break;m.socketHeader=m.socketAccumulator.substring(0, a).split("\r\n");if(null==m.amtVersion)for(n in m.socketHeader)0==m.socketHeader[n].indexOf("Server: Intel(R) Active Management Technology ")&&(m.amtVersion=m.socketHeader[n].substring(46));m.socketAccumulator=m.socketAccumulator.substring(a+4);m.socketParseState=1;m.socketData="";m.socketXHeader={Directive:m.socketHeader[0].split(" ")};for(n in m.socketHeader)0!=n&&(a=m.socketHeader[n].indexOf(":"),m.socketXHeader[m.socketHeader[n].substring(0,a).toLowerCase()]=m.socketHeader[n].substring(a+2))}if(1== m.socketParseState){b=-1;if(void 0==m.socketXHeader.connection||"close"!=m.socketXHeader.connection.toLowerCase()||void 0!=m.socketXHeader["transfer-encoding"]&&"chunked"==m.socketXHeader["transfer-encoding"].toLowerCase())if(void 0!=m.socketXHeader["content-length"]){b=parseInt(m.socketXHeader["content-length"]);if(m.socketAccumulator.lengthc)break;b=parseInt(m.socketAccumulator.substring(0,c),16);if(isNaN(b)){m.websocket&&m.websocket.close();break}if(m.socketAccumulator.length++m.authcounter?m.challengeParams=m.parseDigest(c["www-authenticate"]):(c=m.pendingAjaxCall.shift(),m.authcounter=0,m.ActiveAjaxCount--, @@ -49,128 +49,128 @@ m.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);m.PerformNextAjax()}};m.PerformAjaxEx= "error",{status:0==m.FailAllError?408:m.FailAllError},[a,b,c,n,d]),m.PerformNextAjax()):(m.pendingAjaxCall.push([a,b,c,n,d,e]),0==m.socketState?m.xxConnectHttpSocket():2==m.socketState&&m.sendRequest(a,n,d))};m.sendRequest=function(a,b,c){b=b?b:"/wsman";c=c?c:"POST";var n=c+" "+b+" HTTP/1.1\r\n";if(null!=m.challengeParams){m.digestRealm=m.challengeParams.realm;if(m.digestRealmMatch&&m.digestRealm!=m.digestRealmMatch){m.FailAllError=997;m.CancelAllQueries(997);return}c=hex_md5(hex_md5(m.user+":"+m.challengeParams.realm+ ":"+m.pass)+":"+m.challengeParams.nonce+":"+m.noncecounter+":"+m.cnonce+":"+m.challengeParams.qop+":"+hex_md5(c+":"+b));n+="Authorization: "+m.renderDigest({username:m.user,realm:m.challengeParams.realm,nonce:m.challengeParams.nonce,uri:b,qop:m.challengeParams.qop,response:c,nc:m.noncecounter++,cnonce:m.cnonce})+"\r\n"}a=n+="Host: "+m.host+":"+m.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==m.socketState&&null!=m.socket&&m.socket.readyState==WebSocket.OPEN){b=new Uint8Array(a.length);for(n= 0;nc.amtaccumulator.length)return;switch(c.amtaccumulator.charCodeAt(1)){case 0:if(13>c.amtaccumulator.length)return;b= -c.amtaccumulator.charCodeAt(12);if(c.amtaccumulator.length<13+b)return;c.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));a=13+b;break;default:c.Stop()}break;case 20:if(9>c.amtaccumulator.length)return;var e=ReadIntX(c.amtaccumulator,5);if(c.amtaccumulator.length<9+e)return;var n=c.amtaccumulator.charCodeAt(1),b=c.amtaccumulator.charCodeAt(4),z=[];for(a=0;ac.amtaccumulator.length)break;a=23;c.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(c.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==c.protocol&&(c.amtkeepalivetimer=setInterval(c.xxSendAmtKeepAlive,2E3)); +c.amtaccumulator.charCodeAt(12);if(c.amtaccumulator.length<13+b)return;c.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));a=13+b;break;default:c.Stop()}break;case 20:if(9>c.amtaccumulator.length)return;var e=ReadIntX(c.amtaccumulator,5);if(c.amtaccumulator.length<9+e)return;var n=c.amtaccumulator.charCodeAt(1),b=c.amtaccumulator.charCodeAt(4),v=[];for(a=0;ac.amtaccumulator.length)break;a=23;c.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(c.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==c.protocol&&(c.amtkeepalivetimer=setInterval(c.xxSendAmtKeepAlive,2E3)); c.connectstate=1;c.xxStateChange(3);break;case 41:if(10>c.amtaccumulator.length)break;a=10;break;case 42:if(10>c.amtaccumulator.length)break;b=10+((c.amtaccumulator.charCodeAt(9)&255)<<8)+(c.amtaccumulator.charCodeAt(8)&255);if(c.amtaccumulator.lengthc.amtaccumulator.length)break;a=8;break;case 65:if(8>c.amtaccumulator.length)break;c.connectstate=1;c.m.Start();8'+a.InstanceID+"";var b="",c;for(c in a)if(a.hasOwnProperty(c)){b+= -'';if(a[c].ReferenceParameters){var b=b+"",b=b+(""+a[c].Address+""+a[c].ReferenceParameters.ResourceURI+""),n=a[c].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(n))for(var d=0;d"+n[d].Value+"";else b+=""+n.Value+"";b+=""}else b+= -a[c];b+=""}return b+""}var m={NextMessageId:1,Address:"/wsman"};m.comm=CreateWsmanComm(b,c,a,d,e,p);m.PerformAjax=function(a,b,c,n,d){null==d&&(d="");m.comm.PerformAjax('
"+a,function(a,c,n){200!=c?b(m,null,{Header:{HttpError:c}},c,n):(a=m.ParseWsman(a))&&null!=a?b(m,a.Header.ResourceURI,a,200,n):b(m,null,{Header:{HttpError:c}},601,n)},c,n)};m.CancelAllQueries=function(a){m.comm.CancelAllQueries(a)};m.GetNameFromUrl=function(a){var b=a.lastIndexOf("/");return-1==b?a:a.substring(b+1)};m.ExecSubscribe=function(a,b,c,d,e,g,I,u,D,w){var y="",F="";u="";null!=D&&null!=w&&(y='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+ -D+''+w+"",F='');null!=u&&(u=""+u+"");"PushWithAck"==b?b="dmtf.org/wbem/wsman/1/wsman/PushWithAck":"Push"==b&&(b="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"); -a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+m.Address+""+a+""+m.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+n(I)+y+'
'+c+""+u+""+F+"";m.PerformAjax(a+"
",d,e, +String.fromCharCode(16,1,0,0,75,86,77,82);c.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82);return c},WsmanStackCreateService=function(b,c,a,d,e,l){function p(a){for(var b,c={},n=0;n'+a.InstanceID+"";var b="",c;for(c in a)if(a.hasOwnProperty(c)){b+= +'';if(a[c].ReferenceParameters){var b=b+"",b=b+(""+a[c].Address+""+a[c].ReferenceParameters.ResourceURI+""),n=a[c].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(n))for(var d=0;d"+n[d].Value+"";else b+=""+n.Value+"";b+=""}else b+= +a[c];b+=""}return b+""}var m={NextMessageId:1,Address:"/wsman"};m.comm=CreateWsmanComm(b,c,a,d,e,l);m.PerformAjax=function(a,b,c,n,d){null==d&&(d="");m.comm.PerformAjax('
"+a,function(a,c,n){200!=c?b(m,null,{Header:{HttpError:c}},c,n):(a=m.ParseWsman(a))&&null!=a?b(m,a.Header.ResourceURI,a,200,n):b(m,null,{Header:{HttpError:c}},601,n)},c,n)};m.CancelAllQueries=function(a){m.comm.CancelAllQueries(a)};m.GetNameFromUrl=function(a){var b=a.lastIndexOf("/");return-1==b?a:a.substring(b+1)};m.ExecSubscribe=function(a,b,c,d,e,g,J,u,C,x){var w="",F="";u="";null!=C&&null!=x&&(w='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken'+ +C+''+x+"",F='');null!=u&&(u=""+u+"");"PushWithAck"==b?b="dmtf.org/wbem/wsman/1/wsman/PushWithAck":"Push"==b&&(b="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push"); +a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe"+m.Address+""+a+""+m.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+n(J)+w+'
'+c+""+u+""+F+"";m.PerformAjax(a+"
",d,e, g,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};m.ExecUnSubscribe=function(a,b,c,d,e){a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe"+m.Address+""+a+""+m.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"+n(e)+"";m.PerformAjax(a+"",b,c,d,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')}; -m.ExecPut=function(a,b,c,d,e,g){g="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+m.Address+""+a+""+m.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+n(g)+"";if(a&&null!=b){var I=m.GetNameFromUrl(a);a="';for(var u in b)if(b.hasOwnProperty(u)&& -0!==u.indexOf("__")&&0!==u.indexOf("@")&&null!=b[u]&&"function"!==typeof b[u])if("object"===typeof b[u]&&b[u].ReferenceParameters){a+=""+b[u].Address+""+b[u].ReferenceParameters.ResourceURI+"";var D=b[u].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(D))for(var w=0;w"+D[w].Value+"";else a+=""+D.Value+""; -a+=""}else if(Array.isArray(b[u]))for(w=0;w"+b[u][w].toString()+"";else a+=""+b[u].toString()+"";b=a+("")}else b="";m.PerformAjax(g+b+"",c,d,e)};m.ExecCreate=function(a,b,c,d,e,g){var I=m.GetNameFromUrl(a);a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+m.Address+""+a+""+m.NextMessageId++ + -"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+n(g)+"';for(var u in b)a+=""+b[u]+"";m.PerformAjax(a+"",c,d,e)};m.ExecDelete=function(a,b,c,d,e){a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+m.Address+""+a+""+m.NextMessageId++ + +m.ExecPut=function(a,b,c,d,e,g){g="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put"+m.Address+""+a+""+m.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60.000S"+n(g)+"";if(a&&null!=b){var J=m.GetNameFromUrl(a);a="';for(var u in b)if(b.hasOwnProperty(u)&& +0!==u.indexOf("__")&&0!==u.indexOf("@")&&null!=b[u]&&"function"!==typeof b[u])if("object"===typeof b[u]&&b[u].ReferenceParameters){a+=""+b[u].Address+""+b[u].ReferenceParameters.ResourceURI+"";var C=b[u].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(C))for(var x=0;x"+C[x].Value+"";else a+=""+C.Value+""; +a+=""}else if(Array.isArray(b[u]))for(x=0;x"+b[u][x].toString()+"";else a+=""+b[u].toString()+"";b=a+("")}else b="";m.PerformAjax(g+b+"",c,d,e)};m.ExecCreate=function(a,b,c,d,e,g){var J=m.GetNameFromUrl(a);a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create"+m.Address+""+a+""+m.NextMessageId++ + +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+n(g)+"';for(var u in b)a+=""+b[u]+"";m.PerformAjax(a+"",c,d,e)};m.ExecDelete=function(a,b,c,d,e){a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete"+m.Address+""+a+""+m.NextMessageId++ + "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+n(b)+"";m.PerformAjax(a,c,d,e)};m.ExecGet=function(a,b,c,n){m.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"+m.Address+""+a+""+m.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S", -b,c,n)};m.ExecMethod=function(a,b,c,n,d,g,e){var u="",D;for(D in c)if(null!=c[D])if(Array.isArray(c[D]))for(var w in c[D])u+=""+c[D][w]+"";else u+=""+c[D]+"";m.ExecMethodXml(a,b,u,n,d,g,e)};m.ExecMethodXml=function(a,b,c,d,e,g,I){m.PerformAjax(a+"/"+b+""+m.Address+""+a+""+m.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+ -n(I)+"'+c+"",d,e,g)};m.ExecEnum=function(a,b,c,n){m.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+m.Address+""+a+""+m.NextMessageId++ +'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S', +b,c,n)};m.ExecMethod=function(a,b,c,n,d,g,e){var u="",C;for(C in c)if(null!=c[C])if(Array.isArray(c[C]))for(var x in c[C])u+=""+c[C][x]+"";else u+=""+c[C]+"";m.ExecMethodXml(a,b,u,n,d,g,e)};m.ExecMethodXml=function(a,b,c,d,e,g,J){m.PerformAjax(a+"/"+b+""+m.Address+""+a+""+m.NextMessageId++ +"http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S"+ +n(J)+"'+c+"",d,e,g)};m.ExecEnum=function(a,b,c,n){m.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate"+m.Address+""+a+""+m.NextMessageId++ +'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S', b,c,n)};m.ExecPull=function(a,b,c,n,d){m.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull"+m.Address+""+a+""+m.NextMessageId++ +'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymousPT60S'+b+"", c,n,d)};m.ParseWsman=function(a){try{if(!a.childNodes){var b=a;if(window.DOMParser)a=(new DOMParser).parseFromString(b,"text/xml");else{var c=new ActiveXObject("Microsoft.XMLDOM");c.async=!1;c.loadXML(b);a=c}}var b={Header:{}},n=a.getElementsByTagName("Header")[0],d;n||(n=a.getElementsByTagName("a:Header")[0]);if(!n)return null;for(c=0;c=k.MaxActiveEnumsCount||0==k.PendingEnums.length?c():(a=k.PendingEnums.shift(), -k.Enum(a[0],a[1],a[2]),e(0))}function p(a,b,g,n,d,e,A){k.PendingBatchOperations-=2;var x=b.shift(),C=k.Enum;"*"==x[0]&&(C=k.Get,x=x.substring(1));C(x,function(d,x,C,l,m){m[2][x]={response:null==C?null:C.Body,responses:C,status:l};0==m[1].length||401==l||1!=e&&200!=l&&400!=l?(k.PendingBatchOperations-=2*b.length,c(),g(k,a,m[2],l,n)):(c(),p(a,b,g,n,m[2],A))},[a,b,d],A);c()}function h(a){a.names.length<=a.current?a.callback(k,a.name,a.responses,200,a.tag):(k.wsman.ExecGet(k.CompleteName(a.names[a.current]), -function(b,c,g,n){null==g||200!=n?a.callback(k,a.name,null,n,a.tag):(a.responses[g.Header.Method]=g,h(a))},a.pri),a.current++);c()}function r(a,b,c,g,d){if(200!=g||"0"!=c.Body.ReturnValue)d[0](k,null,d[2]);else k.AMT_MessageLog_GetRecords(c.Body.IterationIdentifier,390,n,d)}function n(a,b,c,g,d){if(200!=g||"0"!=c.Body.ReturnValue)d[0](k,null,d[2]);else{var e,A,x;b=d[2];g=new Date;var C=c.Body.RecordArray;"string"===typeof C&&(c.Body.RecordArray=[c.Body.RecordArray]);for(e in C){a=null;try{a=window.atob(C[e])}catch(l){}if(null!= -a&&(A=ReadIntX(a,0),0A)){x={DeviceAddress:a.charCodeAt(4),EventSensorType:a.charCodeAt(5),EventType:a.charCodeAt(6),EventOffset:a.charCodeAt(7),EventSourceType:a.charCodeAt(8),EventSeverity:a.charCodeAt(9),SensorNumber:a.charCodeAt(10),Entity:a.charCodeAt(11),EntityInstance:a.charCodeAt(12),EventData:[],Time:new Date(1E3*(A+60*g.getTimezoneOffset()))};for(A=13;21>A;A++)x.EventData.push(a.charCodeAt(A));x.EntityStr=I[x.Entity];x.Desc=m(x.EventSensorType,x.EventOffset,x.EventData,x.Entity); -x.EntityStr||(x.EntityStr="Unknown");b.push(x)}}if(1!=c.Body.NoMoreRecords)k.AMT_MessageLog_GetRecords(c.Body.IterationIdentifier,390,n,[d[0],b,d[2]]);else d[0](k,b,d[2])}}function m(a,b,c,n){if(15==a)return 235==c[0]?"Invalid Data":0==b?l[c[1]]:g[c[1]];if(18==a&&170==c[0])return"Agent watchdog "+char2hex(c[4])+char2hex(c[3])+char2hex(c[2])+char2hex(c[1])+"-"+char2hex(c[6])+char2hex(c[5])+"-... changed to "+k.WatchdogCurrentStates[c[7]];if(5==a&&0==b)return"Case intrusion";if(192==a&&0==b&&170==c[0]&& +if(!e)return null;0=h.MaxActiveEnumsCount||0==h.PendingEnums.length?c():(a=h.PendingEnums.shift(), +h.Enum(a[0],a[1],a[2]),e(0))}function l(a,b,g,n,d,e,A){h.PendingBatchOperations-=2;var y=b.shift(),k=h.Enum;"*"==y[0]&&(k=h.Get,y=y.substring(1));k(y,function(d,y,k,E,H){H[2][y]={response:null==k?null:k.Body,responses:k,status:E};0==H[1].length||401==E||1!=e&&200!=E&&400!=E?(h.PendingBatchOperations-=2*b.length,c(),g(h,a,H[2],E,n)):(c(),l(a,b,g,n,H[2],A))},[a,b,d],A);c()}function p(a){a.names.length<=a.current?a.callback(h,a.name,a.responses,200,a.tag):(h.wsman.ExecGet(h.CompleteName(a.names[a.current]), +function(b,c,g,n){null==g||200!=n?a.callback(h,a.name,null,n,a.tag):(a.responses[g.Header.Method]=g,p(a))},a.pri),a.current++);c()}function q(a,b,c,g,d){if(200!=g||"0"!=c.Body.ReturnValue)d[0](h,null,d[2]);else h.AMT_MessageLog_GetRecords(c.Body.IterationIdentifier,390,n,d)}function n(a,b,c,g,d){if(200!=g||"0"!=c.Body.ReturnValue)d[0](h,null,d[2]);else{var e,A,y;b=d[2];g=new Date;var k=c.Body.RecordArray;"string"===typeof k&&(c.Body.RecordArray=[c.Body.RecordArray]);for(e in k){a=null;try{a=window.atob(k[e])}catch(u){}if(null!= +a&&(A=ReadIntX(a,0),0A)){y={DeviceAddress:a.charCodeAt(4),EventSensorType:a.charCodeAt(5),EventType:a.charCodeAt(6),EventOffset:a.charCodeAt(7),EventSourceType:a.charCodeAt(8),EventSeverity:a.charCodeAt(9),SensorNumber:a.charCodeAt(10),Entity:a.charCodeAt(11),EntityInstance:a.charCodeAt(12),EventData:[],Time:new Date(1E3*(A+60*g.getTimezoneOffset()))};for(A=13;21>A;A++)y.EventData.push(a.charCodeAt(A));y.EntityStr=J[y.Entity];y.Desc=m(y.EventSensorType,y.EventOffset,y.EventData,y.Entity); +y.EntityStr||(y.EntityStr="Unknown");b.push(y)}}if(1!=c.Body.NoMoreRecords)h.AMT_MessageLog_GetRecords(c.Body.IterationIdentifier,390,n,[d[0],b,d[2]]);else d[0](h,b,d[2])}}function m(a,b,c,n){if(15==a)return 235==c[0]?"Invalid Data":0==b?k[c[1]]:g[c[1]];if(18==a&&170==c[0])return"Agent watchdog "+char2hex(c[4])+char2hex(c[3])+char2hex(c[2])+char2hex(c[1])+"-"+char2hex(c[6])+char2hex(c[5])+"-... changed to "+h.WatchdogCurrentStates[c[7]];if(5==a&&0==b)return"Case intrusion";if(192==a&&0==b&&170==c[0]&& 48==c[1]){if(0==c[2])return"A remote Serial Over LAN session was established.";if(1==c[2])return"Remote Serial Over LAN session finished. User control was restored.";if(2==c[2])return"A remote IDE-Redirection session was established.";if(3==c[2])return"Remote IDE-Redirection session finished. User control was restored."}if(36==a)return a=(c[1]<<24)+(c[2]<<16)+(c[3]<<8)+c[4],b="#"+c[0],170==c[0]&&(b="wired"),4294967293==a?"All received packet filter was matched on "+b+" interface.":4294967292==a?"All outbound packet filter was matched on "+ b+" interface.":4294967290==a?"Spoofed packet filter was matched on "+b+" interface.":"Filter "+a+" was matched on "+b+" interface.";if(192==a)return 0==c[2]?"Security policy invoked. Some or all network traffic (TX) was stopped.":2==c[2]?"Security policy invoked. Some or all network traffic (RX) was stopped.":"Security policy invoked.";if(193==a){if(170==c[0]&&48==c[1]&&0==c[2]&&0==c[3])return"User request for remote connection.";if(170==c[0]&&32==c[1]&&3==c[2]&&1==c[3])return"EAC error: attempt to get posture while NAC in Intel\ufffd AMT is disabled."; -if(170==c[0]&&32==c[1]&&4==c[2]&&0==c[3])return"Certificate revoked. "}return 6==a?"Authentication failed "+(c[1]+(c[2]<<8))+" times. The system may be under attack.":30==a?"No bootable media":32==a?"Operating system lockup or power interrupt":35==a?"System boot failure":37==a?"System firmware started (at least one CPU is properly executing).":"Unknown Sensor Type #"+a}function z(a,b,c,g,n){if(200!=g)n[0](k,[],g);else{var d,e,x=n[1],C=new Date,l;if(0Local",d=5);3==b.InitiatorType&&(b.Initiator="KVM Default Port",d=5);l=ReadInt(a,d);b.Time=new Date(1E3*(l+60*C.getTimezoneOffset()));d+=4;b.MCLocationType=a.charCodeAt(d++);l=a.charCodeAt(d++);b.NetAddress=a.substring(d,d+l);d+=l;l=a.charCodeAt(d++);b.Ex=a.substring(d,d+l);b.ExStr=k.GetAuditLogExtendedDataStr(100*b.AuditAppID+b.EventID,b.Ex);x.push(b)}if(c.Body.TotalRecordCount>x.length)k.AMT_AuditLog_ReadRecords(x.length+1,z,[n[0],x]); -else n[0](k,x,g)}}var k={};k.wsman=b;k.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/"];k.PendingEnums=[];k.PendingBatchOperations=0;k.ActiveEnumsCount=0;k.MaxActiveEnumsCount=1;k.onProcessChanged=null;var v=0,B=0;k.GetPendingActions=function(){return 2*k.PendingEnums.length+k.ActiveEnumsCount+k.wsman.comm.PendingAjax.length+k.wsman.comm.ActiveAjaxCount+k.PendingBatchOperations};k.Subscribe=function(a, -b,g,n,d,e,A,x,C,l){k.wsman.ExecSubscribe(k.CompleteName(a),b,g,function(b,g,y,e){c();n(k,a,y,e,d)},0,e,A,x,C,l);c()};k.UnSubscribe=function(a,b,g,n,d){k.wsman.ExecUnSubscribe(k.CompleteName(a),function(n,d,e,C){c();b(k,a,e,C,g)},0,n,d);c()};k.Get=function(a,b,g,n){k.wsman.ExecGet(k.CompleteName(a),function(n,d,e,x){c();b(k,a,e,x,g)},0,n);c()};k.Put=function(a,b,g,n,d,e){k.wsman.ExecPut(k.CompleteName(a),b,function(b,d,e,l){c();g(k,a,e,l,n)},0,d,e);c()};k.Create=function(a,b,g,n,d){k.wsman.ExecCreate(k.CompleteName(a), -b,function(b,d,e,C){c();g(k,a,e,C,n)},0,d);c()};k.Delete=function(a,b,g,n,d){k.wsman.ExecDelete(k.CompleteName(a),b,function(b,d,e,C){c();g(k,a,e,C,n)},0,d);c()};k.Exec=function(a,b,g,n,d,e,A){k.wsman.ExecMethod(k.CompleteName(a),b,g,function(b,g,y,e){c();n(k,a,k.CompleteExecResponse(y),e,d)},0,e,A);c()};k.ExecWithXml=function(a,b,g,n,d,e,A){k.wsman.ExecMethodXml(k.CompleteName(a),b,execArgumentsToXml(g),function(b,g,y,e){c();n(k,a,k.CompleteExecResponse(y),e,d)},0,e,A);c()};k.Enum=function(b,g,n, -d){k.ActiveEnumsCounthttp://schemas.xmlsoap.org/ws/2004/08/addressinghttp://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystemCIM_ComputerSystemManagedSystem', -null,null,b)};k.SetBootConfigRole=function(a,b){k.CIM_BootService_SetBootConfigRole('
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSettingIntel(r) AMT: Boot Configuration 0', -a,b)};k.CancelAllQueries=function(a){k.wsman.CancelAllQueries(a)};k.AMT_AgentPresenceWatchdog_RegisterAgent=function(a){k.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},a)};k.AMT_AgentPresenceWatchdog_AssertPresence=function(a,b){k.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:a},b)};k.AMT_AgentPresenceWatchdog_AssertShutdown=function(a,b){k.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:a},b)};k.AMT_AgentPresenceWatchdog_AddAction=function(a,b,c,g,n,d, -e,x,C){k.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:a,NewState:b,EventOnTransition:c,ActionSd:g,ActionEac:n},d,e,x,C)};k.AMT_AgentPresenceWatchdog_DeleteAllActions=function(a,b,c,g){k.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},a,b,c,g)};k.AMT_AgentPresenceWatchdogAction_GetActionEac=function(a){k.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},a)};k.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(a){k.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},a)};k.AMT_AgentPresenceWatchdogVA_AssertPresence= -function(a,b){k.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:a},b)};k.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(a,b){k.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:a},b)};k.AMT_AgentPresenceWatchdogVA_AddAction=function(a,b,c,g,n,d){k.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:a,NewState:b,EventOnTransition:c,ActionSd:g,ActionEac:n},d)};k.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(a,b){k.Exec("AMT_AgentPresenceWatchdogVA", -"DeleteAllActions",{_method_dummy:a},b)};k.AMT_AuditLog_ClearLog=function(a){k.Exec("AMT_AuditLog","ClearLog",{},a)};k.AMT_AuditLog_RequestStateChange=function(a,b,c){k.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_AuditLog_ReadRecords=function(a,b,c){k.Exec("AMT_AuditLog","ReadRecords",{StartIndex:a},b,c)};k.AMT_AuditLog_SetAuditLock=function(a,b,c,g){k.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:a,Flag:b,Handle:c},g)};k.AMT_AuditLog_ExportAuditLogSignature= -function(a,b){k.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:a},b)};k.AMT_AuditLog_SetSigningKeyMaterial=function(a,b,c,g,n){k.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:a,SigningKey:b,LengthOfCertificates:c,Certificates:g},n)};k.AMT_AuditPolicyRule_SetAuditPolicy=function(a,b,c,g,n){k.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:a,AuditedAppID:b,EventID:c,PolicyType:g},n)};k.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(a,b,c,g,n){k.Exec("AMT_AuditPolicyRule", -"SetAuditPolicyBulk",{Enable:a,AuditedAppID:b,EventID:c,PolicyType:g},n)};k.AMT_AuthorizationService_AddUserAclEntryEx=function(a,b,c,g,n,d){k.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:a,DigestPassword:b,KerberosUserSid:c,AccessPermission:g,Realms:n},d)};k.AMT_AuthorizationService_EnumerateUserAclEntries=function(a,b){k.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:a},b)};k.AMT_AuthorizationService_GetUserAclEntryEx=function(a,b,c){k.Exec("AMT_AuthorizationService", -"GetUserAclEntryEx",{Handle:a},b,c)};k.AMT_AuthorizationService_UpdateUserAclEntryEx=function(a,b,c,g,n,d,e){k.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:a,DigestUsername:b,DigestPassword:c,KerberosUserSid:g,AccessPermission:n,Realms:d},e)};k.AMT_AuthorizationService_RemoveUserAclEntry=function(a,b){k.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:a},b)};k.AMT_AuthorizationService_SetAdminAclEntryEx=function(a,b,c){k.Exec("AMT_AuthorizationService","SetAdminAclEntryEx", -{Username:a,DigestPassword:b},c)};k.AMT_AuthorizationService_GetAdminAclEntry=function(a){k.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},a)};k.AMT_AuthorizationService_GetAdminAclEntryStatus=function(a){k.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},a)};k.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(a){k.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},a)};k.AMT_AuthorizationService_SetAclEnabledState=function(a,b,c,g){k.Exec("AMT_AuthorizationService", -"SetAclEnabledState",{Handle:a,Enabled:b},c,g)};k.AMT_AuthorizationService_GetAclEnabledState=function(a,b,c){k.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:a},b,c)};k.AMT_EndpointAccessControlService_RequestStateChange=function(a,b,c){k.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_EndpointAccessControlService_GetPosture=function(a,b){k.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:a},b)};k.AMT_EndpointAccessControlService_GetPostureHash= -function(a,b){k.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:a},b)};k.AMT_EndpointAccessControlService_UpdatePostureState=function(a,b){k.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:a},b)};k.AMT_EndpointAccessControlService_GetEacOptions=function(a){k.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},a)};k.AMT_EndpointAccessControlService_SetEacOptions=function(a,b,c){k.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:a, -PostureHashAlgorithm:b},c)};k.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(a,b){k.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:a},b)};k.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(a,b){k.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:a},b)};k.AMT_EthernetPortSettings_SetLinkPreference=function(a,b,c){k.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:a,Timeout:b},c)};k.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats= -function(a,b){k.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:a},b)};k.AMT_KerberosSettingData_GetCredentialCacheState=function(a){k.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},a)};k.AMT_KerberosSettingData_SetCredentialCacheState=function(a,b){k.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:a},b)};k.AMT_MessageLog_CancelIteration=function(a,b){k.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:a},b)};k.AMT_MessageLog_RequestStateChange= -function(a,b,c){k.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_MessageLog_ClearLog=function(a){k.Exec("AMT_MessageLog","ClearLog",{},a)};k.AMT_MessageLog_GetRecords=function(a,b,c,g){k.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:a,MaxReadRecords:b},c,g)};k.AMT_MessageLog_GetRecord=function(a,b,c){k.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:a,PositionToNext:b},c)};k.AMT_MessageLog_PositionAtRecord=function(a,b,c,g){k.Exec("AMT_MessageLog", -"PositionAtRecord",{IterationIdentifier:a,MoveAbsolute:b,RecordNumber:c},g)};k.AMT_MessageLog_PositionToFirstRecord=function(a,b){k.Exec("AMT_MessageLog","PositionToFirstRecord",{},a,b)};k.AMT_MessageLog_FreezeLog=function(a,b){k.Exec("AMT_MessageLog","FreezeLog",{Freeze:a},b)};k.AMT_PublicKeyManagementService_AddCRL=function(a,b,c){k.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:a,SerialNumbers:b},c)};k.AMT_PublicKeyManagementService_ResetCRLList=function(a,b){k.Exec("AMT_PublicKeyManagementService", -"ResetCRLList",{_method_dummy:a},b)};k.AMT_PublicKeyManagementService_AddCertificate=function(a,b){k.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:a},b)};k.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(a,b){k.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:a},b)};k.AMT_PublicKeyManagementService_AddKey=function(a,b){k.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:a},b)};k.AMT_PublicKeyManagementService_GeneratePKCS10Request= -function(a,b,c,g){k.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:a,DNName:b,Usage:c},g)};k.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(a,b,c,g){k.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:a,SigningAlgorithm:b,NullSignedCertificateRequest:c},g)};k.AMT_PublicKeyManagementService_GenerateKeyPair=function(a,b,c){k.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:a,KeyLength:b},c)};k.AMT_RedirectionService_RequestStateChange= -function(a,b){k.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:a},b)};k.AMT_RedirectionService_TerminateSession=function(a,b){k.Exec("AMT_RedirectionService","TerminateSession",{SessionType:a},b)};k.AMT_RemoteAccessService_AddMpServer=function(a,b,c,g,n,d,e,x,C){k.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:a,InfoFormat:b,Port:c,AuthMethod:g,Certificate:n,Username:d,Password:e,CN:x},C)};k.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(a,b,c,g,n,d){k.Exec("AMT_RemoteAccessService", -"AddRemoteAccessPolicyRule",{Trigger:a,TunnelLifeTime:b,ExtendedData:c,MpServer:g,InternalMpServer:n},d)};k.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(a,b){k.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:a},b)};k.AMT_SetupAndConfigurationService_CommitChanges=function(a,b){k.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:a},b)};k.AMT_SetupAndConfigurationService_Unprovision=function(a,b){k.Exec("AMT_SetupAndConfigurationService", -"Unprovision",{ProvisioningMode:a},b)};k.AMT_SetupAndConfigurationService_PartialUnprovision=function(a,b){k.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:a},b)};k.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(a,b){k.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:a},b)};k.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(a,b){k.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod", -{Duration:a},b)};k.AMT_SetupAndConfigurationService_SetMEBxPassword=function(a,b){k.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:a},b)};k.AMT_SetupAndConfigurationService_SetTLSPSK=function(a,b,c){k.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:a,PPS:b},c)};k.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(a){k.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},a)};k.AMT_SetupAndConfigurationService_GetUuid=function(a){k.Exec("AMT_SetupAndConfigurationService", -"GetUuid",{},a)};k.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(a){k.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},a)};k.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(a){k.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},a)};k.AMT_SystemDefensePolicy_GetTimeout=function(a){k.Exec("AMT_SystemDefensePolicy","GetTimeout",{},a)};k.AMT_SystemDefensePolicy_SetTimeout=function(a,b){k.Exec("AMT_SystemDefensePolicy", -"SetTimeout",{Timeout:a},b)};k.AMT_SystemDefensePolicy_UpdateStatistics=function(a,b,c,g,n,d){k.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:a,ResetOnRead:b},c,g,n,d)};k.AMT_SystemPowerScheme_SetPowerScheme=function(a,b,c){k.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},a,c,0,{InstanceID:b})};k.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(a,b){k.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},a,b)};k.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch= -function(a,b,c,g,n){k.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:a,Tm1:b,Tm2:c},g,n)};k.AMT_UserInitiatedConnectionService_RequestStateChange=function(a,b,c){k.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_WebUIService_RequestStateChange=function(a,b,c){k.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(a,b,c,g,n,d){k.ExecWithXml("AMT_WiFiPortConfigurationService", -"AddWiFiSettings",{WiFiEndpoint:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:g,CACredential:n},d)};k.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(a,b,c,g,n,d){k.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:g,CACredential:n},d)};k.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(a,b){k.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles", -{_method_dummy:a},b)};k.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(a,b){k.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:a},b)};k.CIM_Account_RequestStateChange=function(a,b,c){k.Exec("CIM_Account","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_AccountManagementService_CreateAccount=function(a,b,c){k.Exec("CIM_AccountManagementService","CreateAccount",{System:a,AccountTemplate:b},c)};k.CIM_BootConfigSetting_ChangeBootOrder=function(a, -b){k.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:a},b)};k.CIM_BootService_SetBootConfigRole=function(a,b,c){k.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:a,Role:b},c,0,1)};k.CIM_Card_ConnectorPower=function(a,b,c){k.Exec("CIM_Card","ConnectorPower",{Connector:a,PoweredOn:b},c)};k.CIM_Card_IsCompatible=function(a,b){k.Exec("CIM_Card","IsCompatible",{ElementToCheck:a},b)};k.CIM_Chassis_IsCompatible=function(a,b){k.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:a},b)}; -k.CIM_Fan_SetSpeed=function(a,b){k.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:a},b)};k.CIM_KVMRedirectionSAP_RequestStateChange=function(a,b,c){k.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:a},c)};k.CIM_MediaAccessDevice_LockMedia=function(a,b){k.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:a},b)};k.CIM_MediaAccessDevice_SetPowerState=function(a,b,c){k.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_MediaAccessDevice_Reset=function(a){k.Exec("CIM_MediaAccessDevice", -"Reset",{},a)};k.CIM_MediaAccessDevice_EnableDevice=function(a,b){k.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:a},b)};k.CIM_MediaAccessDevice_OnlineDevice=function(a,b){k.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:a},b)};k.CIM_MediaAccessDevice_QuiesceDevice=function(a,b){k.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:a},b)};k.CIM_MediaAccessDevice_SaveProperties=function(a){k.Exec("CIM_MediaAccessDevice","SaveProperties",{},a)};k.CIM_MediaAccessDevice_RestoreProperties= -function(a){k.Exec("CIM_MediaAccessDevice","RestoreProperties",{},a)};k.CIM_MediaAccessDevice_RequestStateChange=function(a,b,c){k.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_PhysicalFrame_IsCompatible=function(a,b){k.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:a},b)};k.CIM_PhysicalPackage_IsCompatible=function(a,b){k.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:a},b)};k.CIM_PowerManagementService_RequestPowerStateChange= -function(a,b,c,g,n){k.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:a,ManagedElement:b,Time:c,TimeoutPeriod:g},n,0,1)};k.CIM_PowerSupply_SetPowerState=function(a,b,c){k.Exec("CIM_PowerSupply","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_PowerSupply_Reset=function(a){k.Exec("CIM_PowerSupply","Reset",{},a)};k.CIM_PowerSupply_EnableDevice=function(a,b){k.Exec("CIM_PowerSupply","EnableDevice",{Enabled:a},b)};k.CIM_PowerSupply_OnlineDevice=function(a,b){k.Exec("CIM_PowerSupply", -"OnlineDevice",{Online:a},b)};k.CIM_PowerSupply_QuiesceDevice=function(a,b){k.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:a},b)};k.CIM_PowerSupply_SaveProperties=function(a){k.Exec("CIM_PowerSupply","SaveProperties",{},a)};k.CIM_PowerSupply_RestoreProperties=function(a){k.Exec("CIM_PowerSupply","RestoreProperties",{},a)};k.CIM_PowerSupply_RequestStateChange=function(a,b,c){k.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_Processor_SetPowerState=function(a, -b,c){k.Exec("CIM_Processor","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_Processor_Reset=function(a){k.Exec("CIM_Processor","Reset",{},a)};k.CIM_Processor_EnableDevice=function(a,b){k.Exec("CIM_Processor","EnableDevice",{Enabled:a},b)};k.CIM_Processor_OnlineDevice=function(a,b){k.Exec("CIM_Processor","OnlineDevice",{Online:a},b)};k.CIM_Processor_QuiesceDevice=function(a,b){k.Exec("CIM_Processor","QuiesceDevice",{Quiesce:a},b)};k.CIM_Processor_SaveProperties=function(a){k.Exec("CIM_Processor","SaveProperties", -{},a)};k.CIM_Processor_RestoreProperties=function(a){k.Exec("CIM_Processor","RestoreProperties",{},a)};k.CIM_Processor_RequestStateChange=function(a,b,c){k.Exec("CIM_Processor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_RecordLog_ClearLog=function(a){k.Exec("CIM_RecordLog","ClearLog",{},a)};k.CIM_RecordLog_RequestStateChange=function(a,b,c){k.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_RedirectionService_RequestStateChange=function(a, -b,c){k.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_Sensor_SetPowerState=function(a,b,c){k.Exec("CIM_Sensor","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_Sensor_Reset=function(a){k.Exec("CIM_Sensor","Reset",{},a)};k.CIM_Sensor_EnableDevice=function(a,b){k.Exec("CIM_Sensor","EnableDevice",{Enabled:a},b)};k.CIM_Sensor_OnlineDevice=function(a,b){k.Exec("CIM_Sensor","OnlineDevice",{Online:a},b)};k.CIM_Sensor_QuiesceDevice=function(a,b){k.Exec("CIM_Sensor", -"QuiesceDevice",{Quiesce:a},b)};k.CIM_Sensor_SaveProperties=function(a){k.Exec("CIM_Sensor","SaveProperties",{},a)};k.CIM_Sensor_RestoreProperties=function(a){k.Exec("CIM_Sensor","RestoreProperties",{},a)};k.CIM_Sensor_RequestStateChange=function(a,b,c){k.Exec("CIM_Sensor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_StatisticalData_ResetSelectedStats=function(a,b){k.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:a},b)};k.CIM_Watchdog_KeepAlive=function(a){k.Exec("CIM_Watchdog", -"KeepAlive",{},a)};k.CIM_Watchdog_SetPowerState=function(a,b,c){k.Exec("CIM_Watchdog","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_Watchdog_Reset=function(a){k.Exec("CIM_Watchdog","Reset",{},a)};k.CIM_Watchdog_EnableDevice=function(a,b){k.Exec("CIM_Watchdog","EnableDevice",{Enabled:a},b)};k.CIM_Watchdog_OnlineDevice=function(a,b){k.Exec("CIM_Watchdog","OnlineDevice",{Online:a},b)};k.CIM_Watchdog_QuiesceDevice=function(a,b){k.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:a},b)};k.CIM_Watchdog_SaveProperties= -function(a){k.Exec("CIM_Watchdog","SaveProperties",{},a)};k.CIM_Watchdog_RestoreProperties=function(a){k.Exec("CIM_Watchdog","RestoreProperties",{},a)};k.CIM_Watchdog_RequestStateChange=function(a,b,c){k.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_WiFiPort_SetPowerState=function(a,b,c){k.Exec("CIM_WiFiPort","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_WiFiPort_Reset=function(a){k.Exec("CIM_WiFiPort","Reset",{},a)};k.CIM_WiFiPort_EnableDevice=function(a, -b){k.Exec("CIM_WiFiPort","EnableDevice",{Enabled:a},b)};k.CIM_WiFiPort_OnlineDevice=function(a,b){k.Exec("CIM_WiFiPort","OnlineDevice",{Online:a},b)};k.CIM_WiFiPort_QuiesceDevice=function(a,b){k.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:a},b)};k.CIM_WiFiPort_SaveProperties=function(a){k.Exec("CIM_WiFiPort","SaveProperties",{},a)};k.CIM_WiFiPort_RestoreProperties=function(a){k.Exec("CIM_WiFiPort","RestoreProperties",{},a)};k.CIM_WiFiPort_RequestStateChange=function(a,b,c){k.Exec("CIM_WiFiPort", -"RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.IPS_HostBasedSetupService_Setup=function(a,b,c,g,n,d,e){k.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,Certificate:g,SigningAlgorithm:n,DigitalSignature:d},e)};k.IPS_HostBasedSetupService_AddNextCertInChain=function(a,b,c,g){k.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:a,IsLeafCertificate:b,IsRootCertificate:c},g)};k.IPS_HostBasedSetupService_AdminSetup= -function(a,b,c,g,n,d){k.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,SigningAlgorithm:g,DigitalSignature:n},d)};k.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(a,b,c,g){k.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:a,SigningAlgorithm:b,DigitalSignature:c},g)};k.IPS_HostBasedSetupService_DisableClientControlMode=function(a,b){k.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:a}, -b)};k.IPS_KVMRedirectionSettingData_TerminateSession=function(a){k.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},a)};k.IPS_KVMRedirectionSettingData_DataChannelRead=function(a){k.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},a)};k.IPS_KVMRedirectionSettingData_DataChannelWrite=function(a,b){k.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:a},b)};k.IPS_OptInService_StartOptIn=function(a){k.Exec("IPS_OptInService","StartOptIn",{},a)};k.IPS_OptInService_CancelOptIn= -function(a){k.Exec("IPS_OptInService","CancelOptIn",{},a)};k.IPS_OptInService_SendOptInCode=function(a,b){k.Exec("IPS_OptInService","SendOptInCode",{OptInCode:a},b)};k.IPS_OptInService_StartService=function(a){k.Exec("IPS_OptInService","StartService",{},a)};k.IPS_OptInService_StopService=function(a){k.Exec("IPS_OptInService","StopService",{},a)};k.IPS_OptInService_RequestStateChange=function(a,b,c){k.Exec("IPS_OptInService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.IPS_ProvisioningRecordLog_RequestStateChange= -function(a,b,c){k.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.IPS_ProvisioningRecordLog_ClearLog=function(a,b){k.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:a},b)};k.IPS_ScreenConfigurationService_SetSessionState=function(a,b,c){k.Exec("IPS_ScreenConfigurationService","SetSessionState",{SessionState:a,ConsecutiveRebootsNum:b},c)};k.IPS_SecIOService_RequestStateChange=function(a,b,c){k.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:a, -TimeoutPeriod:b},c)};k.IPS_HTTPProxyService_AddProxyAccessPoint=function(a,b,c,g,n){k.Exec("IPS_HTTPProxyService","AddProxyAccessPoint",{AccessInfo:a,InfoFormat:b,Port:c,NetworkDnsSuffix:g},n)};k.AmtStatusToStr=function(a){return k.AmtStatusCodes[a]?k.AmtStatusCodes[a]:"UNKNOWN_ERROR"};k.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", +if(170==c[0]&&32==c[1]&&4==c[2]&&0==c[3])return"Certificate revoked. "}return 6==a?"Authentication failed "+(c[1]+(c[2]<<8))+" times. The system may be under attack.":30==a?"No bootable media":32==a?"Operating system lockup or power interrupt":35==a?"System boot failure":37==a?"System firmware started (at least one CPU is properly executing).":"Unknown Sensor Type #"+a}function v(a,b,c,g,n){if(200!=g)n[0](h,[],g);else{var d,e,y=n[1],k=new Date,m;if(0Local",d=5);3==b.InitiatorType&&(b.Initiator="KVM Default Port",d=5);m=ReadInt(a,d);b.Time=new Date(1E3*(m+60*k.getTimezoneOffset()));d+=4;b.MCLocationType=a.charCodeAt(d++);m=a.charCodeAt(d++);b.NetAddress=a.substring(d,d+m);d+=m;m=a.charCodeAt(d++);b.Ex=a.substring(d,d+m);b.ExStr=h.GetAuditLogExtendedDataStr(100*b.AuditAppID+b.EventID,b.Ex);y.push(b)}if(c.Body.TotalRecordCount>y.length)h.AMT_AuditLog_ReadRecords(y.length+1,v,[n[0],y]); +else n[0](h,y,g)}}var h={};h.wsman=b;h.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/"];h.PendingEnums=[];h.PendingBatchOperations=0;h.ActiveEnumsCount=0;h.MaxActiveEnumsCount=1;h.onProcessChanged=null;var z=0,B=0;h.GetPendingActions=function(){return 2*h.PendingEnums.length+h.ActiveEnumsCount+h.wsman.comm.PendingAjax.length+h.wsman.comm.ActiveAjaxCount+h.PendingBatchOperations};h.Subscribe=function(a, +b,g,n,d,e,A,y,k,m){h.wsman.ExecSubscribe(h.CompleteName(a),b,g,function(b,g,w,e){c();n(h,a,w,e,d)},0,e,A,y,k,m);c()};h.UnSubscribe=function(a,b,g,n,d){h.wsman.ExecUnSubscribe(h.CompleteName(a),function(n,d,e,k){c();b(h,a,e,k,g)},0,n,d);c()};h.Get=function(a,b,g,n){h.wsman.ExecGet(h.CompleteName(a),function(n,d,e,y){c();b(h,a,e,y,g)},0,n);c()};h.Put=function(a,b,g,n,d,e){h.wsman.ExecPut(h.CompleteName(a),b,function(b,d,e,k){c();g(h,a,e,k,n)},0,d,e);c()};h.Create=function(a,b,g,n,d){h.wsman.ExecCreate(h.CompleteName(a), +b,function(b,d,e,k){c();g(h,a,e,k,n)},0,d);c()};h.Delete=function(a,b,g,n,d){h.wsman.ExecDelete(h.CompleteName(a),b,function(b,d,e,k){c();g(h,a,e,k,n)},0,d);c()};h.Exec=function(a,b,g,n,d,e,A){h.wsman.ExecMethod(h.CompleteName(a),b,g,function(b,g,e,w){c();n(h,a,h.CompleteExecResponse(e),w,d)},0,e,A);c()};h.ExecWithXml=function(a,b,g,n,d,e,A){h.wsman.ExecMethodXml(h.CompleteName(a),b,execArgumentsToXml(g),function(b,g,e,w){c();n(h,a,h.CompleteExecResponse(e),w,d)},0,e,A);c()};h.Enum=function(b,g,n, +d){h.ActiveEnumsCounthttp://schemas.xmlsoap.org/ws/2004/08/addressinghttp://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystemCIM_ComputerSystemManagedSystem', +null,null,b)};h.SetBootConfigRole=function(a,b){h.CIM_BootService_SetBootConfigRole('
http://schemas.xmlsoap.org/ws/2004/08/addressing
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSettingIntel(r) AMT: Boot Configuration 0', +a,b)};h.CancelAllQueries=function(a){h.wsman.CancelAllQueries(a)};h.AMT_AgentPresenceWatchdog_RegisterAgent=function(a){h.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},a)};h.AMT_AgentPresenceWatchdog_AssertPresence=function(a,b){h.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:a},b)};h.AMT_AgentPresenceWatchdog_AssertShutdown=function(a,b){h.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:a},b)};h.AMT_AgentPresenceWatchdog_AddAction=function(a,b,c,g,n,d, +e,y,k){h.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:a,NewState:b,EventOnTransition:c,ActionSd:g,ActionEac:n},d,e,y,k)};h.AMT_AgentPresenceWatchdog_DeleteAllActions=function(a,b,c,g){h.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},a,b,c,g)};h.AMT_AgentPresenceWatchdogAction_GetActionEac=function(a){h.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},a)};h.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(a){h.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},a)};h.AMT_AgentPresenceWatchdogVA_AssertPresence= +function(a,b){h.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:a},b)};h.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(a,b){h.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:a},b)};h.AMT_AgentPresenceWatchdogVA_AddAction=function(a,b,c,g,n,d){h.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:a,NewState:b,EventOnTransition:c,ActionSd:g,ActionEac:n},d)};h.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(a,b){h.Exec("AMT_AgentPresenceWatchdogVA", +"DeleteAllActions",{_method_dummy:a},b)};h.AMT_AuditLog_ClearLog=function(a){h.Exec("AMT_AuditLog","ClearLog",{},a)};h.AMT_AuditLog_RequestStateChange=function(a,b,c){h.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.AMT_AuditLog_ReadRecords=function(a,b,c){h.Exec("AMT_AuditLog","ReadRecords",{StartIndex:a},b,c)};h.AMT_AuditLog_SetAuditLock=function(a,b,c,g){h.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:a,Flag:b,Handle:c},g)};h.AMT_AuditLog_ExportAuditLogSignature= +function(a,b){h.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:a},b)};h.AMT_AuditLog_SetSigningKeyMaterial=function(a,b,c,g,n){h.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:a,SigningKey:b,LengthOfCertificates:c,Certificates:g},n)};h.AMT_AuditPolicyRule_SetAuditPolicy=function(a,b,c,g,n){h.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:a,AuditedAppID:b,EventID:c,PolicyType:g},n)};h.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(a,b,c,g,n){h.Exec("AMT_AuditPolicyRule", +"SetAuditPolicyBulk",{Enable:a,AuditedAppID:b,EventID:c,PolicyType:g},n)};h.AMT_AuthorizationService_AddUserAclEntryEx=function(a,b,c,g,n,d){h.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:a,DigestPassword:b,KerberosUserSid:c,AccessPermission:g,Realms:n},d)};h.AMT_AuthorizationService_EnumerateUserAclEntries=function(a,b){h.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:a},b)};h.AMT_AuthorizationService_GetUserAclEntryEx=function(a,b,c){h.Exec("AMT_AuthorizationService", +"GetUserAclEntryEx",{Handle:a},b,c)};h.AMT_AuthorizationService_UpdateUserAclEntryEx=function(a,b,c,g,n,d,e){h.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:a,DigestUsername:b,DigestPassword:c,KerberosUserSid:g,AccessPermission:n,Realms:d},e)};h.AMT_AuthorizationService_RemoveUserAclEntry=function(a,b){h.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:a},b)};h.AMT_AuthorizationService_SetAdminAclEntryEx=function(a,b,c){h.Exec("AMT_AuthorizationService","SetAdminAclEntryEx", +{Username:a,DigestPassword:b},c)};h.AMT_AuthorizationService_GetAdminAclEntry=function(a){h.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},a)};h.AMT_AuthorizationService_GetAdminAclEntryStatus=function(a){h.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},a)};h.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(a){h.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},a)};h.AMT_AuthorizationService_SetAclEnabledState=function(a,b,c,g){h.Exec("AMT_AuthorizationService", +"SetAclEnabledState",{Handle:a,Enabled:b},c,g)};h.AMT_AuthorizationService_GetAclEnabledState=function(a,b,c){h.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:a},b,c)};h.AMT_EndpointAccessControlService_RequestStateChange=function(a,b,c){h.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.AMT_EndpointAccessControlService_GetPosture=function(a,b){h.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:a},b)};h.AMT_EndpointAccessControlService_GetPostureHash= +function(a,b){h.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:a},b)};h.AMT_EndpointAccessControlService_UpdatePostureState=function(a,b){h.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:a},b)};h.AMT_EndpointAccessControlService_GetEacOptions=function(a){h.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},a)};h.AMT_EndpointAccessControlService_SetEacOptions=function(a,b,c){h.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:a, +PostureHashAlgorithm:b},c)};h.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(a,b){h.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:a},b)};h.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(a,b){h.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:a},b)};h.AMT_EthernetPortSettings_SetLinkPreference=function(a,b,c){h.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:a,Timeout:b},c)};h.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats= +function(a,b){h.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:a},b)};h.AMT_KerberosSettingData_GetCredentialCacheState=function(a){h.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},a)};h.AMT_KerberosSettingData_SetCredentialCacheState=function(a,b){h.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:a},b)};h.AMT_MessageLog_CancelIteration=function(a,b){h.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:a},b)};h.AMT_MessageLog_RequestStateChange= +function(a,b,c){h.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.AMT_MessageLog_ClearLog=function(a){h.Exec("AMT_MessageLog","ClearLog",{},a)};h.AMT_MessageLog_GetRecords=function(a,b,c,g){h.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:a,MaxReadRecords:b},c,g)};h.AMT_MessageLog_GetRecord=function(a,b,c){h.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:a,PositionToNext:b},c)};h.AMT_MessageLog_PositionAtRecord=function(a,b,c,g){h.Exec("AMT_MessageLog", +"PositionAtRecord",{IterationIdentifier:a,MoveAbsolute:b,RecordNumber:c},g)};h.AMT_MessageLog_PositionToFirstRecord=function(a,b){h.Exec("AMT_MessageLog","PositionToFirstRecord",{},a,b)};h.AMT_MessageLog_FreezeLog=function(a,b){h.Exec("AMT_MessageLog","FreezeLog",{Freeze:a},b)};h.AMT_PublicKeyManagementService_AddCRL=function(a,b,c){h.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:a,SerialNumbers:b},c)};h.AMT_PublicKeyManagementService_ResetCRLList=function(a,b){h.Exec("AMT_PublicKeyManagementService", +"ResetCRLList",{_method_dummy:a},b)};h.AMT_PublicKeyManagementService_AddCertificate=function(a,b){h.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:a},b)};h.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(a,b){h.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:a},b)};h.AMT_PublicKeyManagementService_AddKey=function(a,b){h.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:a},b)};h.AMT_PublicKeyManagementService_GeneratePKCS10Request= +function(a,b,c,g){h.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:a,DNName:b,Usage:c},g)};h.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(a,b,c,g){h.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:a,SigningAlgorithm:b,NullSignedCertificateRequest:c},g)};h.AMT_PublicKeyManagementService_GenerateKeyPair=function(a,b,c){h.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:a,KeyLength:b},c)};h.AMT_RedirectionService_RequestStateChange= +function(a,b){h.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:a},b)};h.AMT_RedirectionService_TerminateSession=function(a,b){h.Exec("AMT_RedirectionService","TerminateSession",{SessionType:a},b)};h.AMT_RemoteAccessService_AddMpServer=function(a,b,c,g,n,d,e,y,k){h.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:a,InfoFormat:b,Port:c,AuthMethod:g,Certificate:n,Username:d,Password:e,CN:y},k)};h.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(a,b,c,g,n,d){h.Exec("AMT_RemoteAccessService", +"AddRemoteAccessPolicyRule",{Trigger:a,TunnelLifeTime:b,ExtendedData:c,MpServer:g,InternalMpServer:n},d)};h.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(a,b){h.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:a},b)};h.AMT_SetupAndConfigurationService_CommitChanges=function(a,b){h.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:a},b)};h.AMT_SetupAndConfigurationService_Unprovision=function(a,b){h.Exec("AMT_SetupAndConfigurationService", +"Unprovision",{ProvisioningMode:a},b)};h.AMT_SetupAndConfigurationService_PartialUnprovision=function(a,b){h.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:a},b)};h.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(a,b){h.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:a},b)};h.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(a,b){h.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod", +{Duration:a},b)};h.AMT_SetupAndConfigurationService_SetMEBxPassword=function(a,b){h.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:a},b)};h.AMT_SetupAndConfigurationService_SetTLSPSK=function(a,b,c){h.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:a,PPS:b},c)};h.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(a){h.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},a)};h.AMT_SetupAndConfigurationService_GetUuid=function(a){h.Exec("AMT_SetupAndConfigurationService", +"GetUuid",{},a)};h.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(a){h.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},a)};h.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(a){h.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},a)};h.AMT_SystemDefensePolicy_GetTimeout=function(a){h.Exec("AMT_SystemDefensePolicy","GetTimeout",{},a)};h.AMT_SystemDefensePolicy_SetTimeout=function(a,b){h.Exec("AMT_SystemDefensePolicy", +"SetTimeout",{Timeout:a},b)};h.AMT_SystemDefensePolicy_UpdateStatistics=function(a,b,c,g,n,d){h.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:a,ResetOnRead:b},c,g,n,d)};h.AMT_SystemPowerScheme_SetPowerScheme=function(a,b,c){h.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},a,c,0,{InstanceID:b})};h.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(a,b){h.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},a,b)};h.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch= +function(a,b,c,g,n){h.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:a,Tm1:b,Tm2:c},g,n)};h.AMT_UserInitiatedConnectionService_RequestStateChange=function(a,b,c){h.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.AMT_WebUIService_RequestStateChange=function(a,b,c){h.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(a,b,c,g,n,d){h.ExecWithXml("AMT_WiFiPortConfigurationService", +"AddWiFiSettings",{WiFiEndpoint:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:g,CACredential:n},d)};h.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(a,b,c,g,n,d){h.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:g,CACredential:n},d)};h.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(a,b){h.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles", +{_method_dummy:a},b)};h.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(a,b){h.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:a},b)};h.CIM_Account_RequestStateChange=function(a,b,c){h.Exec("CIM_Account","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.CIM_AccountManagementService_CreateAccount=function(a,b,c){h.Exec("CIM_AccountManagementService","CreateAccount",{System:a,AccountTemplate:b},c)};h.CIM_BootConfigSetting_ChangeBootOrder=function(a, +b){h.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:a},b)};h.CIM_BootService_SetBootConfigRole=function(a,b,c){h.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:a,Role:b},c,0,1)};h.CIM_Card_ConnectorPower=function(a,b,c){h.Exec("CIM_Card","ConnectorPower",{Connector:a,PoweredOn:b},c)};h.CIM_Card_IsCompatible=function(a,b){h.Exec("CIM_Card","IsCompatible",{ElementToCheck:a},b)};h.CIM_Chassis_IsCompatible=function(a,b){h.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:a},b)}; +h.CIM_Fan_SetSpeed=function(a,b){h.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:a},b)};h.CIM_KVMRedirectionSAP_RequestStateChange=function(a,b,c){h.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:a},c)};h.CIM_MediaAccessDevice_LockMedia=function(a,b){h.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:a},b)};h.CIM_MediaAccessDevice_SetPowerState=function(a,b,c){h.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:a,Time:b},c)};h.CIM_MediaAccessDevice_Reset=function(a){h.Exec("CIM_MediaAccessDevice", +"Reset",{},a)};h.CIM_MediaAccessDevice_EnableDevice=function(a,b){h.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:a},b)};h.CIM_MediaAccessDevice_OnlineDevice=function(a,b){h.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:a},b)};h.CIM_MediaAccessDevice_QuiesceDevice=function(a,b){h.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:a},b)};h.CIM_MediaAccessDevice_SaveProperties=function(a){h.Exec("CIM_MediaAccessDevice","SaveProperties",{},a)};h.CIM_MediaAccessDevice_RestoreProperties= +function(a){h.Exec("CIM_MediaAccessDevice","RestoreProperties",{},a)};h.CIM_MediaAccessDevice_RequestStateChange=function(a,b,c){h.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.CIM_PhysicalFrame_IsCompatible=function(a,b){h.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:a},b)};h.CIM_PhysicalPackage_IsCompatible=function(a,b){h.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:a},b)};h.CIM_PowerManagementService_RequestPowerStateChange= +function(a,b,c,g,n){h.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:a,ManagedElement:b,Time:c,TimeoutPeriod:g},n,0,1)};h.CIM_PowerSupply_SetPowerState=function(a,b,c){h.Exec("CIM_PowerSupply","SetPowerState",{PowerState:a,Time:b},c)};h.CIM_PowerSupply_Reset=function(a){h.Exec("CIM_PowerSupply","Reset",{},a)};h.CIM_PowerSupply_EnableDevice=function(a,b){h.Exec("CIM_PowerSupply","EnableDevice",{Enabled:a},b)};h.CIM_PowerSupply_OnlineDevice=function(a,b){h.Exec("CIM_PowerSupply", +"OnlineDevice",{Online:a},b)};h.CIM_PowerSupply_QuiesceDevice=function(a,b){h.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:a},b)};h.CIM_PowerSupply_SaveProperties=function(a){h.Exec("CIM_PowerSupply","SaveProperties",{},a)};h.CIM_PowerSupply_RestoreProperties=function(a){h.Exec("CIM_PowerSupply","RestoreProperties",{},a)};h.CIM_PowerSupply_RequestStateChange=function(a,b,c){h.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.CIM_Processor_SetPowerState=function(a, +b,c){h.Exec("CIM_Processor","SetPowerState",{PowerState:a,Time:b},c)};h.CIM_Processor_Reset=function(a){h.Exec("CIM_Processor","Reset",{},a)};h.CIM_Processor_EnableDevice=function(a,b){h.Exec("CIM_Processor","EnableDevice",{Enabled:a},b)};h.CIM_Processor_OnlineDevice=function(a,b){h.Exec("CIM_Processor","OnlineDevice",{Online:a},b)};h.CIM_Processor_QuiesceDevice=function(a,b){h.Exec("CIM_Processor","QuiesceDevice",{Quiesce:a},b)};h.CIM_Processor_SaveProperties=function(a){h.Exec("CIM_Processor","SaveProperties", +{},a)};h.CIM_Processor_RestoreProperties=function(a){h.Exec("CIM_Processor","RestoreProperties",{},a)};h.CIM_Processor_RequestStateChange=function(a,b,c){h.Exec("CIM_Processor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.CIM_RecordLog_ClearLog=function(a){h.Exec("CIM_RecordLog","ClearLog",{},a)};h.CIM_RecordLog_RequestStateChange=function(a,b,c){h.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.CIM_RedirectionService_RequestStateChange=function(a, +b,c){h.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.CIM_Sensor_SetPowerState=function(a,b,c){h.Exec("CIM_Sensor","SetPowerState",{PowerState:a,Time:b},c)};h.CIM_Sensor_Reset=function(a){h.Exec("CIM_Sensor","Reset",{},a)};h.CIM_Sensor_EnableDevice=function(a,b){h.Exec("CIM_Sensor","EnableDevice",{Enabled:a},b)};h.CIM_Sensor_OnlineDevice=function(a,b){h.Exec("CIM_Sensor","OnlineDevice",{Online:a},b)};h.CIM_Sensor_QuiesceDevice=function(a,b){h.Exec("CIM_Sensor", +"QuiesceDevice",{Quiesce:a},b)};h.CIM_Sensor_SaveProperties=function(a){h.Exec("CIM_Sensor","SaveProperties",{},a)};h.CIM_Sensor_RestoreProperties=function(a){h.Exec("CIM_Sensor","RestoreProperties",{},a)};h.CIM_Sensor_RequestStateChange=function(a,b,c){h.Exec("CIM_Sensor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.CIM_StatisticalData_ResetSelectedStats=function(a,b){h.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:a},b)};h.CIM_Watchdog_KeepAlive=function(a){h.Exec("CIM_Watchdog", +"KeepAlive",{},a)};h.CIM_Watchdog_SetPowerState=function(a,b,c){h.Exec("CIM_Watchdog","SetPowerState",{PowerState:a,Time:b},c)};h.CIM_Watchdog_Reset=function(a){h.Exec("CIM_Watchdog","Reset",{},a)};h.CIM_Watchdog_EnableDevice=function(a,b){h.Exec("CIM_Watchdog","EnableDevice",{Enabled:a},b)};h.CIM_Watchdog_OnlineDevice=function(a,b){h.Exec("CIM_Watchdog","OnlineDevice",{Online:a},b)};h.CIM_Watchdog_QuiesceDevice=function(a,b){h.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:a},b)};h.CIM_Watchdog_SaveProperties= +function(a){h.Exec("CIM_Watchdog","SaveProperties",{},a)};h.CIM_Watchdog_RestoreProperties=function(a){h.Exec("CIM_Watchdog","RestoreProperties",{},a)};h.CIM_Watchdog_RequestStateChange=function(a,b,c){h.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.CIM_WiFiPort_SetPowerState=function(a,b,c){h.Exec("CIM_WiFiPort","SetPowerState",{PowerState:a,Time:b},c)};h.CIM_WiFiPort_Reset=function(a){h.Exec("CIM_WiFiPort","Reset",{},a)};h.CIM_WiFiPort_EnableDevice=function(a, +b){h.Exec("CIM_WiFiPort","EnableDevice",{Enabled:a},b)};h.CIM_WiFiPort_OnlineDevice=function(a,b){h.Exec("CIM_WiFiPort","OnlineDevice",{Online:a},b)};h.CIM_WiFiPort_QuiesceDevice=function(a,b){h.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:a},b)};h.CIM_WiFiPort_SaveProperties=function(a){h.Exec("CIM_WiFiPort","SaveProperties",{},a)};h.CIM_WiFiPort_RestoreProperties=function(a){h.Exec("CIM_WiFiPort","RestoreProperties",{},a)};h.CIM_WiFiPort_RequestStateChange=function(a,b,c){h.Exec("CIM_WiFiPort", +"RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.IPS_HostBasedSetupService_Setup=function(a,b,c,g,n,d,e){h.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,Certificate:g,SigningAlgorithm:n,DigitalSignature:d},e)};h.IPS_HostBasedSetupService_AddNextCertInChain=function(a,b,c,g){h.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:a,IsLeafCertificate:b,IsRootCertificate:c},g)};h.IPS_HostBasedSetupService_AdminSetup= +function(a,b,c,g,n,d){h.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,SigningAlgorithm:g,DigitalSignature:n},d)};h.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(a,b,c,g){h.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:a,SigningAlgorithm:b,DigitalSignature:c},g)};h.IPS_HostBasedSetupService_DisableClientControlMode=function(a,b){h.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:a}, +b)};h.IPS_KVMRedirectionSettingData_TerminateSession=function(a){h.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},a)};h.IPS_KVMRedirectionSettingData_DataChannelRead=function(a){h.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},a)};h.IPS_KVMRedirectionSettingData_DataChannelWrite=function(a,b){h.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:a},b)};h.IPS_OptInService_StartOptIn=function(a){h.Exec("IPS_OptInService","StartOptIn",{},a)};h.IPS_OptInService_CancelOptIn= +function(a){h.Exec("IPS_OptInService","CancelOptIn",{},a)};h.IPS_OptInService_SendOptInCode=function(a,b){h.Exec("IPS_OptInService","SendOptInCode",{OptInCode:a},b)};h.IPS_OptInService_StartService=function(a){h.Exec("IPS_OptInService","StartService",{},a)};h.IPS_OptInService_StopService=function(a){h.Exec("IPS_OptInService","StopService",{},a)};h.IPS_OptInService_RequestStateChange=function(a,b,c){h.Exec("IPS_OptInService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.IPS_ProvisioningRecordLog_RequestStateChange= +function(a,b,c){h.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};h.IPS_ProvisioningRecordLog_ClearLog=function(a,b){h.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:a},b)};h.IPS_ScreenConfigurationService_SetSessionState=function(a,b,c){h.Exec("IPS_ScreenConfigurationService","SetSessionState",{SessionState:a,ConsecutiveRebootsNum:b},c)};h.IPS_SecIOService_RequestStateChange=function(a,b,c){h.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:a, +TimeoutPeriod:b},c)};h.IPS_HTTPProxyService_AddProxyAccessPoint=function(a,b,c,g,n){h.Exec("IPS_HTTPProxyService","AddProxyAccessPoint",{AccessInfo:a,InfoFormat:b,Port:c,NetworkDnsSuffix:g},n)};h.AmtStatusToStr=function(a){return h.AmtStatusCodes[a]?h.AmtStatusCodes[a]:"UNKNOWN_ERROR"};h.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"};k.GetMessageLog=function(a,b){k.AMT_MessageLog_PositionToFirstRecord(r, -[a,b,[]])};var l="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(";"), +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"};h.GetMessageLog=function(a,b){h.AMT_MessageLog_PositionToFirstRecord(q, +[a,b,[]])};var k="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(";"), -I="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(";"); -k.RealmNames=";;Redirection;;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(";");k.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var u={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager", +J="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(";"); +h.RealmNames=";;Redirection;;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(";");h.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var u={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 Master 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"};k.GetAuditLogExtendedDataStr=function(a,b){if((1602==a||1604==a)&&0==b.charCodeAt(0))return b.substring(2,2+b.charCodeAt(1));if(1603==a)return 0==b.charCodeAt(1)?b.substring(3):null;if(1605==a)return["Invalid ME access","Invalid MEBx access"][b.charCodeAt(0)];if(1606==a){var c=["Disabled","Enabled"][b.charCodeAt(0)]; -0==b.charCodeAt(1)&&(c+=", "+b.substring(3));return c}return 1607==a?"Remote "+["NoAuth","ServerAuth","MutualAuth"][b.charCodeAt(0)]+", Local "+["NoAuth","ServerAuth","MutualAuth"][b.charCodeAt(1)]:1617==a?k.RealmNames[ReadInt(b,0)]+", "+["NoAuth","Auth","Disabled"][b.charCodeAt(4)]:1619==a?["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][b.charCodeAt(0)]:1900==a?"From "+ReadShort(b,0)+"."+ReadShort(b,2)+"."+ReadShort(b,4)+"."+ReadShort(b,6)+" to "+ReadShort(b,8)+"."+ReadShort(b,10)+"."+ReadShort(b, -12)+"."+ReadShort(b,14):2100==a?(c=new Date,c.setTime(1E3*ReadInt(b,0)+6E4*(new Date).getTimezoneOffset()),c.toLocaleString()):3E3==a?"From "+["None","KVM","All"][b.charCodeAt(0)]+" to "+["None","KVM","All"][b.charCodeAt(1)]:3001==a?["Success","Failed 3 times"][b.charCodeAt(0)]:null};k.GetAuditLog=function(a){k.AMT_AuditLog_ReadRecords(1,z,[a,[]])};return k}function hex_md5(b){return forge.md.md5.create().update(b).digest().toHex()}function rstr_md5(b){return hex2rstr(hex_md5(b))} +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"};h.GetAuditLogExtendedDataStr=function(a,b){if((1602==a||1604==a)&&0==b.charCodeAt(0))return b.substring(2,2+b.charCodeAt(1));if(1603==a)return 0==b.charCodeAt(1)?b.substring(3):null;if(1605==a)return["Invalid ME access","Invalid MEBx access"][b.charCodeAt(0)];if(1606==a){var c=["Disabled","Enabled"][b.charCodeAt(0)]; +0==b.charCodeAt(1)&&(c+=", "+b.substring(3));return c}return 1607==a?"Remote "+["NoAuth","ServerAuth","MutualAuth"][b.charCodeAt(0)]+", Local "+["NoAuth","ServerAuth","MutualAuth"][b.charCodeAt(1)]:1617==a?h.RealmNames[ReadInt(b,0)]+", "+["NoAuth","Auth","Disabled"][b.charCodeAt(4)]:1619==a?["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][b.charCodeAt(0)]:1900==a?"From "+ReadShort(b,0)+"."+ReadShort(b,2)+"."+ReadShort(b,4)+"."+ReadShort(b,6)+" to "+ReadShort(b,8)+"."+ReadShort(b,10)+"."+ReadShort(b, +12)+"."+ReadShort(b,14):2100==a?(c=new Date,c.setTime(1E3*ReadInt(b,0)+6E4*(new Date).getTimezoneOffset()),c.toLocaleString()):3E3==a?"From "+["None","KVM","All"][b.charCodeAt(0)]+" to "+["None","KVM","All"][b.charCodeAt(1)]:3001==a?["Success","Failed 3 times"][b.charCodeAt(0)]:null};h.GetAuditLog=function(a){h.AMT_AuditLog_ReadRecords(1,v,[a,[]])};return h}function hex_md5(b){return forge.md.md5.create().update(b).digest().toHex()}function rstr_md5(b){return hex2rstr(hex_md5(b))} function execArgumentsToXml(b){if(void 0===b||null===b)return null;var c="",a;for(a in b){var d=b[a];d&&(c="reference"===d.__parameterType?c+referenceToXml(a,d):c+instanceToXml(a,d))}return c} -function instanceToXml(b,c){if(void 0===c||null===c)return null;var a=!!c.__namespace,d=a?"",p;for(p in c)c.hasOwnProperty(p)&&0!==p.indexOf("__")&&("function"===typeof c[p]||Array.isArray(c[p])||("object"===typeof c[p]?console.error("only convert one level down..."):a+=d+p+">"+c[p].toString()+e+p+">"));return a+("")} +function instanceToXml(b,c){if(void 0===c||null===c)return null;var a=!!c.__namespace,d=a?"",l;for(l in c)c.hasOwnProperty(l)&&0!==l.indexOf("__")&&("function"===typeof c[l]||Array.isArray(c[l])||("object"===typeof c[l]?console.error("only convert one level down..."):a+=d+l+">"+c[l].toString()+e+l+">"));return a+("")} function referenceToXml(b,c){if(void 0===c||null===c)return null;var a="/wsman"+c.__resourceUri+"",d;for(d in c)c.hasOwnProperty(d)&&0!==d.indexOf("__")&&("function"===typeof c[d]||"object"===typeof c[d]||Array.isArray(c[d])||(a+=''+c[d].toString()+""));return a+("")} function GetSidString(b){for(var c="S-"+b.charCodeAt(0)+"-"+b.charCodeAt(7),a=2;ab.length||"s"!=b[0]&&"S"!=b[0])return null;for(var c=1;cc&&(a+="0");a+=c.toString(16)}return a};d.DataBuffer.prototype.toString=function(a){var b=new Uint8Array(this.data,this.read,this.length());a=a||"utf8";if("binary"===a||"raw"===a)return d.binary.raw.encode(b);if("hex"===a)return d.binary.hex.encode(b);if("base64"===a)return d.binary.base64.encode(b);if("utf8"===a)return d.text.utf8.decode(b);if("utf16"===a)return d.text.utf16.decode(b);throw Error("Invalid encoding: "+a);};d.createBuffer=function(a,b){void 0!==a&&"utf8"=== -(b||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,b){for(var c="";0>>=1,0>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var e=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];d.encode64=function(a,b){for(var c="",g="",d,n,e,l=0;l>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|n>>4),isNaN(n)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((n&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0,b)+"\r\n",c=c.substr(b));return g+ -c};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",c,g,d,n,l=0;l>4),64!==d&&(b+=String.fromCharCode((g&15)<<4|d>>2),64!==n&&(b+=String.fromCharCode((d&3)<<6|n)));return b};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}}; +(b||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,b){for(var c="";0>>=1,0>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var e=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];d.encode64=function(a,b){for(var c="",g="",d,n,e,k=0;k>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|n>>4),isNaN(n)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((n&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0,b)+"\r\n",c=c.substr(b));return g+ +c};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",c,g,d,n,k=0;k>4),64!==d&&(b+=String.fromCharCode((g&15)<<4|d>>2),64!==n&&(b+=String.fromCharCode((d&3)<<6|n)));return b};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}}; d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(a.length));for(var d=c=c||0,n=0;n>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|n>>4),isNaN(n)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((n&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0, -b)+"\r\n",c=c.substr(b));return g+c};d.binary.base64.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");c=c||0;for(var d,n,l,m,u=0,q=c;u>4,64!==l&&(g[q++]=(n&15)<<4|l>>2,64!==m&&(g[q++]=(l&3)<<6|m));return b?q-c:g.subarray(0,q)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,b,c){a=d.encodeUtf8(a); -var g=b;g||(g=new Uint8Array(a.length));for(var n=c=c||0,e=0;e>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|n>>4),isNaN(n)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((n&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0, +b)+"\r\n",c=c.substr(b));return g+c};d.binary.base64.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");c=c||0;for(var d,n,k,m,u=0,r=c;u>4,64!==k&&(g[r++]=(n&15)<<4|k>>2,64!==m&&(g[r++]=(k&3)<<6|m));return b?r-c:g.subarray(0,r)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,b,c){a=d.encodeUtf8(a); +var g=b;g||(g=new Uint8Array(a.length));for(var n=c=c||0,e=0;e");break;case "%":n.push("%");break;default:n.push("<#"+ c+"?>")}n.push(a.substring(g));return n.join("")};d.formatNumber=function(a,b,c,g){var d=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;g=void 0===g?".":g;c=0>a?"-":"";var n=parseInt(a=Math.abs(+a||0).toFixed(d),10)+"",e=3n;++n)if(a[n]&&0!==a[n].length){var e=d.hexToBytes(a[n]);2>e.length&&g.putByte(0);g.putBytes(e)}else g.fillWithByte(0,c),c=0;return g.getBytes()};d.bytesToIP=function(a){return 4===a.length?d.bytesToIPv4(a):16===a.length?d.bytesToIPv6(a):null};d.bytesToIPv4=function(a){if(4!==a.length)return null;for(var b=[],c=0;cc[g].end-c[g].start&&(g=c.length-1)):c.push({start:k,end:k})}b.push(e)}0A.st&&d.std.st&&A.stc[g].end-c[g].start&&(g=c.length-1)):c.push({start:h,end:h})}b.push(e)}0y.st&&d.std.st&&y.stthis.blockSize<<2)return!1;a.truncate(c);return!0};v.cbc=function(a){a=a||{};this.name="CBC";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints); -this._outBlock=Array(this._ints)};v.cbc.prototype.start=function(a){if(null===a.iv){if(!this._prev)throw Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in a)this._iv=c(a.iv),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.");};v.cbc.prototype.encrypt=function(a,b,c){if(a.length()this.blockSize<<2)return!1;a.truncate(c);return!0};v.cfb=function(b){b=b||{};this.name="CFB";this.cipher=b.cipher;this.blockSize=b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0};v.cfb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=c(a.iv);this._inBlock= -this._iv.slice(0);this._partialBytes=0};v.cfb.prototype.encrypt=function(a,b,c){var d=a.length();if(0===d)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&d>=this.blockSize)for(var n=0;nthis.blockSize<<2)return!1;a.truncate(c);return!0};z.cbc=function(a){a=a||{};this.name="CBC";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints); +this._outBlock=Array(this._ints)};z.cbc.prototype.start=function(a){if(null===a.iv){if(!this._prev)throw Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in a)this._iv=c(a.iv),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.");};z.cbc.prototype.encrypt=function(a,b,c){if(a.length()this.blockSize<<2)return!1;a.truncate(c);return!0};z.cfb=function(b){b=b||{};this.name="CFB";this.cipher=b.cipher;this.blockSize=b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0};z.cfb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=c(a.iv);this._inBlock= +this._iv.slice(0);this._partialBytes=0};z.cfb.prototype.encrypt=function(a,b,c){var d=a.length();if(0===d)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&d>=this.blockSize)for(var n=0;n=this.blockSize)for(var n=0;n=this.blockSize)for(var n=0;n=this.blockSize)for(var e=0;e< -this._ints;++e)b.putInt32(a.getInt32()^this._outBlock[e]);else{var k=(this.blockSize-n)%this.blockSize;0=this.blockSize)for(var n=0;n=this.blockSize)for(var e=0;e< +this._ints;++e)b.putInt32(a.getInt32()^this._outBlock[e]);else{var h=(this.blockSize-n)%this.blockSize;0=this.blockSize){for(var e=0;en;++n)a[n/32|0]&1<<31-n%32&&(c[0]^=d[0],c[1]^=d[1],c[2]^=d[2],c[3]^=d[3]),this.pow(d,d);return c};v.gcm.prototype.pow=function(a,b){for(var c=a[3]&1,d=3;0>>1|(a[d-1]&1)<<31;b[0]=a[0]>>>1;c&&(b[0]^=this._R)};v.gcm.prototype.tableMultiply=function(a){for(var b= -[0,0,0,0],c=0;32>c;++c){var d=this._m[c][a[c/8|0]>>>4*(7-c%8)&15];b[0]^=d[0];b[1]^=d[1];b[2]^=d[2];b[3]^=d[3]}return b};v.gcm.prototype.ghash=function(a,b,c){b[0]^=c[0];b[1]^=c[1];b[2]^=c[2];b[3]^=c[3];return this.tableMultiply(b)};v.gcm.prototype.generateHashTable=function(a,b){for(var c=8/b,d=4*c,c=16*c,n=Array(c),e=0;e>>1,n=Array(c);n[d]=a.slice(0);for(var e=d>>>1;0>=1;for(e=2;eb;++b)a[b]=b<<1,a[b+128]=b+128<<1^283;I=Array(256);u=Array(256);w=Array(4);y=Array(4);for(b=0;4>b;++b)w[b]=Array(256),y[b]=Array(256);for(var c=0,g=0,n,e,k,m,q,b=0;256>b;++b){m=g^g<<1^g<<2^g<<3^g<<4;m=m>>8^m&255^99;I[c]=m;u[m]=c;q=a[m];n=a[c];e=a[n];k=a[e];q^=q<<24^m<<16^m<<8^m;e=(n^e^k)<<24^(c^ -k)<<16^(c^e^k)<<8^c^n^k;for(var v=0;4>v;++v)w[v][c]=q,y[v][m]=e,q=q<<24|q>>>8,e=e<<24|e>>>8;0===c?c=g=1:(c=n^a[a[a[n^k]]],g^=a[a[g]])}}function e(a,b){for(var c=a.slice(0),d,n=1,k=c.length,l=g*(k+6+1),m=k;m>>16&255]<<24^I[d>>>8&255]<<16^I[d&255]<<8^I[d>>>24]^p[n]<<24,n++):6>>24]<<24^I[d>>>16&255]<<16^I[d>>>8&255]<<8^I[d&255]),c[m]=c[m-k]^d;if(b){for(var n=y[0],k=y[1],q=y[2],u=y[3],v=c.slice(0),l=c.length,m=0,w=l-g;m>>24]]^k[I[d>>>16&255]]^q[I[d>>>8&255]]^u[I[d&255]];c=v}return c}function v(a,b,c,d){var g=a.length/4-1,n,e,k,l,m;d?(n=y[0],e=y[1],k=y[2],l=y[3],m=u):(n=w[0],e=w[1],k=w[2],l=w[3],m=I);var v,h,z,p,B,D;v=b[0]^a[0];h=b[d?3:1]^a[1];z=b[2]^a[2];b=b[d?1:3]^a[3];for(var r=3,aa=1;aa>>24]^e[h>>>16&255]^k[z>>>8&255]^l[b&255]^a[++r],B=n[h>>>24]^e[z>>>16&255]^k[b>>>8&255]^l[v&255]^a[++r],D=n[z>>>24]^ -e[b>>>16&255]^k[v>>>8&255]^l[h&255]^a[++r],b=n[b>>>24]^e[v>>>16&255]^k[h>>>8&255]^l[z&255]^a[++r],v=p,h=B,z=D;c[0]=m[v>>>24]<<24^m[h>>>16&255]<<16^m[z>>>8&255]<<8^m[b&255]^a[++r];c[d?3:1]=m[h>>>24]<<24^m[z>>>16&255]<<16^m[b>>>8&255]<<8^m[v&255]^a[++r];c[2]=m[z>>>24]<<24^m[b>>>16&255]<<16^m[v>>>8&255]<<8^m[h&255]^a[++r];c[d?1:3]=m[b>>>24]<<24^m[v>>>16&255]<<16^m[h>>>8&255]<<8^m[z&255]^a[++r]}function h(b){b=b||{};var c="AES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key): -a.cipher.createCipher(c,b.key);var g=d.start;d.start=function(b,c){var e=null;c instanceof a.util.ByteBuffer&&(e=c,c={});c=c||{};c.output=e;c.iv=b;g.call(d,c)};return d}a.aes=a.aes||{};a.aes.startEncrypting=function(a,b,c,d){a=h({key:a,output:c,decrypt:!1,mode:d});a.start(b);return a};a.aes.createEncryptionCipher=function(a,b){return h({key:a,output:null,decrypt:!1,mode:b})};a.aes.startDecrypting=function(a,b,c,d){a=h({key:a,output:c,decrypt:!0,mode:d});a.start(b);return a};a.aes.createDecryptionCipher= -function(a,b){return h({key:a,output:null,decrypt:!0,mode:b})};a.aes.Algorithm=function(a,b){l||d();var c=this;c.name=a;c.mode=new b({blockSize:16,cipher:{encrypt:function(a,b){return v(c._w,a,b,!1)},decrypt:function(a,b){return v(c._w,a,b,!0)}}});c._init=!1};a.aes.Algorithm.prototype.initialize=function(b){if(!this._init){var c=b.key,d;if("string"===typeof c&&(16===c.length||24===c.length||32===c.length))c=a.util.createBuffer(c);else if(a.util.isArray(c)&&(16===c.length||24===c.length||32===c.length)){d= -c;for(var c=a.util.createBuffer(),g=0;g>>=2,g=0;g=this.blockSize){for(var e=0;en;++n)a[n/32|0]&1<<31-n%32&&(c[0]^=d[0],c[1]^=d[1],c[2]^=d[2],c[3]^=d[3]),this.pow(d,d);return c};z.gcm.prototype.pow=function(a,b){for(var c=a[3]&1,d=3;0>>1|(a[d-1]&1)<<31;b[0]=a[0]>>>1;c&&(b[0]^=this._R)};z.gcm.prototype.tableMultiply=function(a){for(var b= +[0,0,0,0],c=0;32>c;++c){var d=this._m[c][a[c/8|0]>>>4*(7-c%8)&15];b[0]^=d[0];b[1]^=d[1];b[2]^=d[2];b[3]^=d[3]}return b};z.gcm.prototype.ghash=function(a,b,c){b[0]^=c[0];b[1]^=c[1];b[2]^=c[2];b[3]^=c[3];return this.tableMultiply(b)};z.gcm.prototype.generateHashTable=function(a,b){for(var c=8/b,d=4*c,c=16*c,n=Array(c),e=0;e>>1,n=Array(c);n[d]=a.slice(0);for(var e=d>>>1;0>=1;for(e=2;eb;++b)a[b]=b<<1,a[b+128]=b+128<<1^283;J=Array(256);u=Array(256);x=Array(4);w=Array(4);for(b=0;4>b;++b)x[b]=Array(256),w[b]=Array(256);for(var c=0,g=0,n,e,h,m,r,b=0;256>b;++b){m=g^g<<1^g<<2^g<<3^g<<4;m=m>>8^m&255^99;J[c]=m;u[m]=c;r=a[m];n=a[c];e=a[n];h=a[e];r^=r<<24^m<<16^m<<8^m;e=(n^e^h)<<24^(c^ +h)<<16^(c^e^h)<<8^c^n^h;for(var z=0;4>z;++z)x[z][c]=r,w[z][m]=e,r=r<<24|r>>>8,e=e<<24|e>>>8;0===c?c=g=1:(c=n^a[a[a[n^h]]],g^=a[a[g]])}}function e(a,b){for(var c=a.slice(0),d,n=1,k=c.length,h=g*(k+6+1),m=k;m>>16&255]<<24^J[d>>>8&255]<<16^J[d&255]<<8^J[d>>>24]^p[n]<<24,n++):6>>24]<<24^J[d>>>16&255]<<16^J[d>>>8&255]<<8^J[d&255]),c[m]=c[m-k]^d;if(b){for(var n=w[0],k=w[1],u=w[2],z=w[3],x=c.slice(0),h=c.length,m=0,M=h-g;m>>24]]^k[J[d>>>16&255]]^u[J[d>>>8&255]]^z[J[d&255]];c=x}return c}function z(a,b,c,d){var g=a.length/4-1,n,e,k,h,m;d?(n=w[0],e=w[1],k=w[2],h=w[3],m=u):(n=x[0],e=x[1],k=x[2],h=x[3],m=J);var z,M,v,l,B,p;z=b[0]^a[0];M=b[d?3:1]^a[1];v=b[2]^a[2];b=b[d?1:3]^a[3];for(var C=3,q=1;q>>24]^e[M>>>16&255]^k[v>>>8&255]^h[b&255]^a[++C],B=n[M>>>24]^e[v>>>16&255]^k[b>>>8&255]^h[z&255]^a[++C],p=n[v>>>24]^ +e[b>>>16&255]^k[z>>>8&255]^h[M&255]^a[++C],b=n[b>>>24]^e[z>>>16&255]^k[M>>>8&255]^h[v&255]^a[++C],z=l,M=B,v=p;c[0]=m[z>>>24]<<24^m[M>>>16&255]<<16^m[v>>>8&255]<<8^m[b&255]^a[++C];c[d?3:1]=m[M>>>24]<<24^m[v>>>16&255]<<16^m[b>>>8&255]<<8^m[z&255]^a[++C];c[2]=m[v>>>24]<<24^m[b>>>16&255]<<16^m[z>>>8&255]<<8^m[M&255]^a[++C];c[d?1:3]=m[b>>>24]<<24^m[z>>>16&255]<<16^m[M>>>8&255]<<8^m[v&255]^a[++C]}function l(b){b=b||{};var c="AES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key): +a.cipher.createCipher(c,b.key);var g=d.start;d.start=function(b,c){var e=null;c instanceof a.util.ByteBuffer&&(e=c,c={});c=c||{};c.output=e;c.iv=b;g.call(d,c)};return d}a.aes=a.aes||{};a.aes.startEncrypting=function(a,b,c,d){a=l({key:a,output:c,decrypt:!1,mode:d});a.start(b);return a};a.aes.createEncryptionCipher=function(a,b){return l({key:a,output:null,decrypt:!1,mode:b})};a.aes.startDecrypting=function(a,b,c,d){a=l({key:a,output:c,decrypt:!0,mode:d});a.start(b);return a};a.aes.createDecryptionCipher= +function(a,b){return l({key:a,output:null,decrypt:!0,mode:b})};a.aes.Algorithm=function(a,b){k||d();var c=this;c.name=a;c.mode=new b({blockSize:16,cipher:{encrypt:function(a,b){return z(c._w,a,b,!1)},decrypt:function(a,b){return z(c._w,a,b,!0)}}});c._init=!1};a.aes.Algorithm.prototype.initialize=function(b){if(!this._init){var c=b.key,d;if("string"===typeof c&&(16===c.length||24===c.length||32===c.length))c=a.util.createBuffer(c);else if(a.util.isArray(c)&&(16===c.length||24===c.length||32===c.length)){d= +c;for(var c=a.util.createBuffer(),g=0;g>>=2,g=0;gb.length()){var k=Error("Too few bytes to parse DER.");k.bytes=b.length();throw k;}var g=b.getByte(),k=g&192,h=g&31,u=d(b);if(b.length()=g.length())d.putByte(g.length()&127);else{k=g.length();b="";do b+=String.fromCharCode(k&255),k>>>=8;while(0>>=7,d||(k|=128),g.push(k),d=!1;while(0c[a].length&&(b+="0"),b+=c[a];return b+"Z"};c.dateToGeneralizedTime=function(a){if("string"=== +a.emailProtection="1.3.6.1.5.5.7.3.4";a["1.3.6.1.5.5.7.3.8"]="timeStamping";a.timeStamping="1.3.6.1.5.5.7.3.8"}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var l,p=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.oids)return c.oids;c.defined.oids=!0;for(var m=0;mb.length()){var k=Error("Too few bytes to parse DER.");k.bytes=b.length();throw k;}var g=b.getByte(),k=g&192,h=g&31,u=d(b);if(b.length()=g.length())d.putByte(g.length()&127);else{h=g.length();b="";do b+=String.fromCharCode(h&255),h>>>=8;while(0>>=7,d||(h|=128),g.push(h),d=!1;while(0c[a].length&&(b+="0"),b+=c[a];return b+"Z"};c.dateToGeneralizedTime=function(a){if("string"=== typeof a)return a;var b="",c=[];c.push(""+a.getUTCFullYear());c.push(""+(a.getUTCMonth()+1));c.push(""+a.getUTCDate());c.push(""+a.getUTCHours());c.push(""+a.getUTCMinutes());c.push(""+a.getUTCSeconds());for(a=0;ac[a].length&&(b+="0"),b+=c[a];return b+"Z"};c.integerToDer=function(b){var c=a.util.createBuffer();if(-128<=b&&128>b)return c.putSignedInt(b,8);if(-32768<=b&&32768>b)return c.putSignedInt(b,16);if(-8388608<=b&&8388608>b)return c.putSignedInt(b,24);if(-2147483648<=b&&2147483648> -b)return c.putSignedInt(b,32);c=Error("Integer too large; max is 32-bits.");c.integer=b;throw c;};c.derToInteger=function(b){"string"===typeof b&&(b=a.util.createBuffer(b));var c=8*b.length();if(32b;++b)g[b]=Math.floor(4294967296* -Math.abs(Math.sin(b+1)));I=!0}function d(a,b,c){for(var e,n,k,m,A,x,C,h=c.length();64<=h;){n=a.h0;k=a.h1;m=a.h2;A=a.h3;for(C=0;16>C;++C)b[C]=c.getInt32Le(),e=A^k&(m^A),e=n+e+g[C]+b[C],x=l[C],n=A,A=m,m=k,k+=e<>>32-x;for(;32>C;++C)e=m^A&(k^m),e=n+e+g[C]+b[p[C]],x=l[C],n=A,A=m,m=k,k+=e<>>32-x;for(;48>C;++C)e=k^m^A,e=n+e+g[C]+b[p[C]],x=l[C],n=A,A=m,m=k,k+=e<>>32-x;for(;64>C;++C)e=m^(k|~A),e=n+e+g[C]+b[p[C]],x=l[C],n=A,A=m,m=k,k+=e<>>32-x;a.h0=a.h0+n|0;a.h1=a.h1+k|0;a.h2=a.h2+m|0;a.h3= -a.h3+A|0;h-=64}}var e=a.md5=a.md5||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.md5=a.md.algorithms.md5=e;e.create=function(){I||c();var b=null,g=a.util.createBuffer(),e=Array(16),k={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){k.messageLength=0;k.fullMessageLength=k.messageLength64=[];for(var c=k.messageLengthSize/4,d=0;d>>0,l>>>0],A=k.fullMessageLength.length-1;0<=A;--A)k.fullMessageLength[A]+=l[1],l[1]=l[0]+(k.fullMessageLength[A]/4294967296>>>0),k.fullMessageLength[A]>>>=0,l[0]=l[1]/4294967296>>>0;g.putBytes(c);d(b,e,g);(2048>>0,c.putInt32Le(m>>>0);m={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3};d(m,e,c);c=a.util.createBuffer();c.putInt32Le(m.h0);c.putInt32Le(m.h1);c.putInt32Le(m.h2);c.putInt32Le(m.h3);return c};return k};var h=null,p=null,l=null,g=null,I=!1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e= -!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var p,h=function(a,c){c.exports=function(c){var e=p.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.md5)return c.md5;c.defined.md5=!0;for(var m=0;mE;++E)e=d.getInt32(),b[E]=e,p=h^k&(m^h),e=(n<<5|n>>>27)+p+v+1518500249+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;20>E;++E)e=b[E-3]^b[E-8]^b[E-14]^b[E-16],e=e<<1|e>>>31,b[E]=e,p=h^k&(m^h),e=(n<<5|n>>>27)+p+v+1518500249+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;32> -E;++E)e=b[E-3]^b[E-8]^b[E-14]^b[E-16],e=e<<1|e>>>31,b[E]=e,p=k^m^h,e=(n<<5|n>>>27)+p+v+1859775393+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;40>E;++E)e=b[E-6]^b[E-16]^b[E-28]^b[E-32],e=e<<2|e>>>30,b[E]=e,p=k^m^h,e=(n<<5|n>>>27)+p+v+1859775393+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;60>E;++E)e=b[E-6]^b[E-16]^b[E-28]^b[E-32],e=e<<2|e>>>30,b[E]=e,p=k&m|h&(k^m),e=(n<<5|n>>>27)+p+v+2400959708+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;80>E;++E)e=b[E-6]^b[E-16]^b[E-28]^b[E-32],e=e<<2|e>>>30,b[E]=e,p=k^m^h,e=(n<<5|n>>> -27)+p+v+3395469782+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;a.h0=a.h0+n|0;a.h1=a.h1+k|0;a.h2=a.h2+m|0;a.h3=a.h3+h|0;a.h4=a.h4+v|0;A-=64}}var d=a.sha1=a.sha1||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha1=a.md.algorithms.sha1=d;d.create=function(){h||(e=String.fromCharCode(128),e+=a.util.fillString(String.fromCharCode(0),64),h=!0);var b=null,d=a.util.createBuffer(),g=Array(80),p={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){p.messageLength= -0;p.fullMessageLength=p.messageLength64=[];for(var c=p.messageLengthSize/4,g=0;g>>0,w>>>0],h=p.fullMessageLength.length-1;0<=h;--h)p.fullMessageLength[h]+=w[1],w[1]=w[0]+(p.fullMessageLength[h]/4294967296>>>0),p.fullMessageLength[h]>>>= -0,w[0]=w[1]/4294967296>>>0;d.putBytes(e);c(b,g,d);(2048>>0,y+=w,u.putInt32(y>>>0),y=h;h={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3, -h4:b.h4};c(h,g,u);u=a.util.createBuffer();u.putInt32(h.h0);u.putInt32(h.h1);u.putInt32(h.h2);u.putInt32(h.h3);u.putInt32(h.h4);return u};return p};var e=null,h=!1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var p,h=function(a,c){c.exports=function(c){var e=p.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha1)return c.sha1;c.defined.sha1= -!0;for(var m=0;mh;++h)b[h]=d.getInt32(); -for(;64>h;++h)e=b[h-2],e=(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10,n=b[h-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,b[h]=e+b[h-7]+n+b[h-16]|0;v=a.h0;E=a.h1;A=a.h2;x=a.h3;C=a.h4;z=a.h5;r=a.h6;q=a.h7;for(h=0;64>h;++h)e=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),k=r^C&(z^r),n=(v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10),m=v&E|A&(v^E),e=q+e+k+p[h]+b[h],n+=m,q=r,r=z,z=C,C=x+e|0,x=A,A=E,E=v,v=e+n|0;a.h0=a.h0+v|0;a.h1=a.h1+E|0;a.h2=a.h2+A|0;a.h3=a.h3+x|0;a.h4=a.h4+C|0;a.h5=a.h5+z|0;a.h6=a.h6+r|0;a.h7=a.h7+q|0;T-= -64}}var d=a.sha256=a.sha256||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha256=a.md.algorithms.sha256=d;d.create=function(){h||(e=String.fromCharCode(128),e+=a.util.fillString(String.fromCharCode(0),64),p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349, -2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=!0);var b=null,d=a.util.createBuffer(),z=Array(64),u={algorithm:"sha256",blockLength:64,digestLength:32, -messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){u.messageLength=0;u.fullMessageLength=u.messageLength64=[];for(var c=u.messageLengthSize/4,e=0;e>>0,h>>>0],p=u.fullMessageLength.length- -1;0<=p;--p)u.fullMessageLength[p]+=h[1],h[1]=h[0]+(u.fullMessageLength[p]/4294967296>>>0),u.fullMessageLength[p]>>>=0,h[0]=h[1]/4294967296>>>0;d.putBytes(e);c(b,z,d);(2048>>0,v+=p,h.putInt32(v>>>0),v=w;w={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3,h4:b.h4,h5:b.h5,h6:b.h6,h7:b.h7};c(w,z,h);h=a.util.createBuffer();h.putInt32(w.h0);h.putInt32(w.h1);h.putInt32(w.h2);h.putInt32(w.h3);h.putInt32(w.h4);h.putInt32(w.h5);h.putInt32(w.h6);h.putInt32(w.h7);return h};return u};var e=null,h=!1,p=null}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge= -{}),b(forge);var p,h=function(a,c){c.exports=function(c){var e=p.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha256)return c.sha256;c.defined.sha256=!0;for(var m=0;mJ;++J)b[J][0]=d.getInt32()>>>0,b[J][1]=d.getInt32()>>>0;for(;80>J;++J)m=b[J-2],h=m[0],m=m[1],g=((h>>>19|m<<13)^(m>>>29|h<<3)^h>>>6)>>>0,e=((h<<13|m>>>19)^(m<<3|h>>>29)^(h<<26|m>>>6))>>>0,m=b[J-15],h=m[0],m=m[1],n=((h>>>1|m<<31)^(h>>>8|m<<24)^h>>>7)>>>0,k=((h<<31|m>>>1)^(h<<24|m>>>8)^(h<<25|m>>>7))>>>0,h=b[J-7],p=b[J- -16],m=e+h[1]+k+p[1],b[J][0]=g+h[0]+n+p[0]+(m/4294967296>>>0)>>>0,b[J][1]=m>>>0;h=a[0][0];p=a[0][1];q=a[1][0];v=a[1][1];z=a[2][0];S=a[2][1];ca=a[3][0];B=a[3][1];r=a[4][0];V=a[4][1];Z=a[5][0];aa=a[5][1];N=a[6][0];Y=a[6][1];L=a[7][0];H=a[7][1];for(J=0;80>J;++J)g=((r>>>14|V<<18)^(r>>>18|V<<14)^(V>>>9|r<<23))>>>0,m=((r<<18|V>>>14)^(r<<14|V>>>18)^(V<<23|r>>>9))>>>0,e=(N^r&(Z^N))>>>0,A=(Y^V&(aa^Y))>>>0,n=((h>>>28|p<<4)^(p>>>2|h<<30)^(p>>>7|h<<25))>>>0,k=((h<<4|p>>>28)^(p<<30|h>>>2)^(p<<25|h>>>7))>>>0,x= -(h&q|z&(h^q))>>>0,C=(p&v|S&(p^v))>>>0,m=H+m+A+l[J][1]+b[J][1],g=L+g+e+l[J][0]+b[J][0]+(m/4294967296>>>0)>>>0,e=m>>>0,m=k+C,n=n+x+(m/4294967296>>>0)>>>0,k=m>>>0,L=N,H=Y,N=Z,Y=aa,Z=r,aa=V,m=B+e,r=ca+g+(m/4294967296>>>0)>>>0,V=m>>>0,ca=z,B=S,z=q,S=v,q=h,v=p,m=e+k,h=g+n+(m/4294967296>>>0)>>>0,p=m>>>0;m=a[0][1]+p;a[0][0]=a[0][0]+h+(m/4294967296>>>0)>>>0;a[0][1]=m>>>0;m=a[1][1]+v;a[1][0]=a[1][0]+q+(m/4294967296>>>0)>>>0;a[1][1]=m>>>0;m=a[2][1]+S;a[2][0]=a[2][0]+z+(m/4294967296>>>0)>>>0;a[2][1]=m>>>0;m= -a[3][1]+B;a[3][0]=a[3][0]+ca+(m/4294967296>>>0)>>>0;a[3][1]=m>>>0;m=a[4][1]+V;a[4][0]=a[4][0]+r+(m/4294967296>>>0)>>>0;a[4][1]=m>>>0;m=a[5][1]+aa;a[5][0]=a[5][0]+Z+(m/4294967296>>>0)>>>0;a[5][1]=m>>>0;m=a[6][1]+Y;a[6][0]=a[6][0]+N+(m/4294967296>>>0)>>>0;a[6][1]=m>>>0;m=a[7][1]+H;a[7][0]=a[7][0]+L+(m/4294967296>>>0)>>>0;a[7][1]=m>>>0;X-=128}}var d=a.sha512=a.sha512||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha512=a.md.algorithms.sha512=d;var e=a.sha384=a.sha512.sha384=a.sha512.sha384|| -{};e.create=function(){return d.create("SHA-384")};a.md.sha384=a.md.algorithms.sha384=e;a.sha512.sha256=a.sha512.sha256||{create:function(){return d.create("SHA-512/256")}};a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256;a.sha512.sha224=a.sha512.sha224||{create:function(){return d.create("SHA-512/224")}};a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224;d.create=function(b){p||(h=String.fromCharCode(128),h+=a.util.fillString(String.fromCharCode(0),128),l=[[1116352408, +break;case c.Type.BMPSTRING:g+=" (BMP String)"}else g+=b.type;g=g+"\n"+(v+"Constructed: "+b.constructed+"\n");if(b.composed){for(var l=0,x="",u=0;ub;++b)g[b]=Math.floor(4294967296* +Math.abs(Math.sin(b+1)));J=!0}function d(a,b,c){for(var e,n,h,m,A,y,E,v=c.length();64<=v;){n=a.h0;h=a.h1;m=a.h2;A=a.h3;for(E=0;16>E;++E)b[E]=c.getInt32Le(),e=A^h&(m^A),e=n+e+g[E]+b[E],y=k[E],n=A,A=m,m=h,h+=e<>>32-y;for(;32>E;++E)e=m^A&(h^m),e=n+e+g[E]+b[p[E]],y=k[E],n=A,A=m,m=h,h+=e<>>32-y;for(;48>E;++E)e=h^m^A,e=n+e+g[E]+b[p[E]],y=k[E],n=A,A=m,m=h,h+=e<>>32-y;for(;64>E;++E)e=m^(h|~A),e=n+e+g[E]+b[p[E]],y=k[E],n=A,A=m,m=h,h+=e<>>32-y;a.h0=a.h0+n|0;a.h1=a.h1+h|0;a.h2=a.h2+m|0;a.h3= +a.h3+A|0;v-=64}}var e=a.md5=a.md5||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.md5=a.md.algorithms.md5=e;e.create=function(){J||c();var b=null,g=a.util.createBuffer(),e=Array(16),h={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){h.messageLength=0;h.fullMessageLength=h.messageLength64=[];for(var c=h.messageLengthSize/4,d=0;d>>0,m>>>0],A=h.fullMessageLength.length-1;0<=A;--A)h.fullMessageLength[A]+=m[1],m[1]=m[0]+(h.fullMessageLength[A]/4294967296>>>0),h.fullMessageLength[A]>>>=0,m[0]=m[1]/4294967296>>>0;g.putBytes(c);d(b,e,g);(2048>>0,c.putInt32Le(k>>>0);k={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3};d(k,e,c);c=a.util.createBuffer();c.putInt32Le(k.h0);c.putInt32Le(k.h1);c.putInt32Le(k.h2);c.putInt32Le(k.h3);return c};return h};var l=null,p=null,k=null,g=null,J=!1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e= +!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var l,p=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.md5)return c.md5;c.defined.md5=!0;for(var m=0;mD;++D)e=d.getInt32(),b[D]=e,v=w^h&(m^w),e=(n<<5|n>>>27)+v+l+1518500249+e,l=w,w=m,m=h<<30|h>>>2,h=n,n=e;for(;20>D;++D)e=b[D-3]^b[D-8]^b[D-14]^b[D-16],e=e<<1|e>>>31,b[D]=e,v=w^h&(m^w),e=(n<<5|n>>>27)+v+l+1518500249+e,l=w,w=m,m=h<<30|h>>>2,h=n,n=e;for(;32> +D;++D)e=b[D-3]^b[D-8]^b[D-14]^b[D-16],e=e<<1|e>>>31,b[D]=e,v=h^m^w,e=(n<<5|n>>>27)+v+l+1859775393+e,l=w,w=m,m=h<<30|h>>>2,h=n,n=e;for(;40>D;++D)e=b[D-6]^b[D-16]^b[D-28]^b[D-32],e=e<<2|e>>>30,b[D]=e,v=h^m^w,e=(n<<5|n>>>27)+v+l+1859775393+e,l=w,w=m,m=h<<30|h>>>2,h=n,n=e;for(;60>D;++D)e=b[D-6]^b[D-16]^b[D-28]^b[D-32],e=e<<2|e>>>30,b[D]=e,v=h&m|w&(h^m),e=(n<<5|n>>>27)+v+l+2400959708+e,l=w,w=m,m=h<<30|h>>>2,h=n,n=e;for(;80>D;++D)e=b[D-6]^b[D-16]^b[D-28]^b[D-32],e=e<<2|e>>>30,b[D]=e,v=h^m^w,e=(n<<5|n>>> +27)+v+l+3395469782+e,l=w,w=m,m=h<<30|h>>>2,h=n,n=e;a.h0=a.h0+n|0;a.h1=a.h1+h|0;a.h2=a.h2+m|0;a.h3=a.h3+w|0;a.h4=a.h4+l|0;A-=64}}var d=a.sha1=a.sha1||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha1=a.md.algorithms.sha1=d;d.create=function(){l||(e=String.fromCharCode(128),e+=a.util.fillString(String.fromCharCode(0),64),l=!0);var b=null,d=a.util.createBuffer(),g=Array(80),v={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){v.messageLength= +0;v.fullMessageLength=v.messageLength64=[];for(var c=v.messageLengthSize/4,g=0;g>>0,x>>>0],w=v.fullMessageLength.length-1;0<=w;--w)v.fullMessageLength[w]+=x[1],x[1]=x[0]+(v.fullMessageLength[w]/4294967296>>>0),v.fullMessageLength[w]>>>= +0,x[0]=x[1]/4294967296>>>0;d.putBytes(e);c(b,g,d);(2048>>0,w+=x,u.putInt32(w>>>0),w=l;l={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3, +h4:b.h4};c(l,g,u);u=a.util.createBuffer();u.putInt32(l.h0);u.putInt32(l.h1);u.putInt32(l.h2);u.putInt32(l.h3);u.putInt32(l.h4);return u};return v};var e=null,l=!1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var l,p=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha1)return c.sha1;c.defined.sha1= +!0;for(var m=0;ml;++l)b[l]=d.getInt32(); +for(;64>l;++l)e=b[l-2],e=(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10,n=b[l-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,b[l]=e+b[l-7]+n+b[l-16]|0;v=a.h0;D=a.h1;A=a.h2;y=a.h3;E=a.h4;z=a.h5;q=a.h6;r=a.h7;for(l=0;64>l;++l)e=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),h=q^E&(z^q),n=(v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10),m=v&D|A&(v^D),e=r+e+h+p[l]+b[l],n+=m,r=q,q=z,z=E,E=y+e|0,y=A,A=D,D=v,v=e+n|0;a.h0=a.h0+v|0;a.h1=a.h1+D|0;a.h2=a.h2+A|0;a.h3=a.h3+y|0;a.h4=a.h4+E|0;a.h5=a.h5+z|0;a.h6=a.h6+q|0;a.h7=a.h7+r|0;P-= +64}}var d=a.sha256=a.sha256||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha256=a.md.algorithms.sha256=d;d.create=function(){l||(e=String.fromCharCode(128),e+=a.util.fillString(String.fromCharCode(0),64),p=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349, +2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=!0);var b=null,d=a.util.createBuffer(),v=Array(64),u={algorithm:"sha256",blockLength:64,digestLength:32, +messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){u.messageLength=0;u.fullMessageLength=u.messageLength64=[];for(var c=u.messageLengthSize/4,e=0;e>>0,w>>>0],l=u.fullMessageLength.length- +1;0<=l;--l)u.fullMessageLength[l]+=w[1],w[1]=w[0]+(u.fullMessageLength[l]/4294967296>>>0),u.fullMessageLength[l]>>>=0,w[0]=w[1]/4294967296>>>0;d.putBytes(e);c(b,v,d);(2048>>0,z+=w,l.putInt32(z>>>0),z=x;x={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3,h4:b.h4,h5:b.h5,h6:b.h6,h7:b.h7};c(x,v,l);l=a.util.createBuffer();l.putInt32(x.h0);l.putInt32(x.h1);l.putInt32(x.h2);l.putInt32(x.h3);l.putInt32(x.h4);l.putInt32(x.h5);l.putInt32(x.h6);l.putInt32(x.h7);return l};return u};var e=null,l=!1,p=null}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge= +{}),b(forge);var l,p=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha256)return c.sha256;c.defined.sha256=!0;for(var m=0;mI;++I)b[I][0]=d.getInt32()>>>0,b[I][1]=d.getInt32()>>>0;for(;80>I;++I)m=b[I-2],l=m[0],m=m[1],g=((l>>>19|m<<13)^(m>>>29|l<<3)^l>>>6)>>>0,e=((l<<13|m>>>19)^(m<<3|l>>>29)^(l<<26|m>>>6))>>>0,m=b[I-15],l=m[0],m=m[1],n=((l>>>1|m<<31)^(l>>>8|m<<24)^l>>>7)>>>0,h=((l<<31|m>>>1)^(l<<24|m>>>8)^(l<<25|m>>>7))>>>0,l=b[I-7],v=b[I- +16],m=e+l[1]+h+v[1],b[I][0]=g+l[0]+n+v[0]+(m/4294967296>>>0)>>>0,b[I][1]=m>>>0;l=a[0][0];v=a[0][1];r=a[1][0];z=a[1][1];p=a[2][0];M=a[2][1];ba=a[3][0];q=a[3][1];B=a[4][0];V=a[4][1];Z=a[5][0];aa=a[5][1];ca=a[6][0];Y=a[6][1];N=a[7][0];G=a[7][1];for(I=0;80>I;++I)g=((B>>>14|V<<18)^(B>>>18|V<<14)^(V>>>9|B<<23))>>>0,m=((B<<18|V>>>14)^(B<<14|V>>>18)^(V<<23|B>>>9))>>>0,e=(ca^B&(Z^ca))>>>0,A=(Y^V&(aa^Y))>>>0,n=((l>>>28|v<<4)^(v>>>2|l<<30)^(v>>>7|l<<25))>>>0,h=((l<<4|v>>>28)^(v<<30|l>>>2)^(v<<25|l>>>7))>>>0, +y=(l&r|p&(l^r))>>>0,E=(v&z|M&(v^z))>>>0,m=G+m+A+k[I][1]+b[I][1],g=N+g+e+k[I][0]+b[I][0]+(m/4294967296>>>0)>>>0,e=m>>>0,m=h+E,n=n+y+(m/4294967296>>>0)>>>0,h=m>>>0,N=ca,G=Y,ca=Z,Y=aa,Z=B,aa=V,m=q+e,B=ba+g+(m/4294967296>>>0)>>>0,V=m>>>0,ba=p,q=M,p=r,M=z,r=l,z=v,m=e+h,l=g+n+(m/4294967296>>>0)>>>0,v=m>>>0;m=a[0][1]+v;a[0][0]=a[0][0]+l+(m/4294967296>>>0)>>>0;a[0][1]=m>>>0;m=a[1][1]+z;a[1][0]=a[1][0]+r+(m/4294967296>>>0)>>>0;a[1][1]=m>>>0;m=a[2][1]+M;a[2][0]=a[2][0]+p+(m/4294967296>>>0)>>>0;a[2][1]=m>>> +0;m=a[3][1]+q;a[3][0]=a[3][0]+ba+(m/4294967296>>>0)>>>0;a[3][1]=m>>>0;m=a[4][1]+V;a[4][0]=a[4][0]+B+(m/4294967296>>>0)>>>0;a[4][1]=m>>>0;m=a[5][1]+aa;a[5][0]=a[5][0]+Z+(m/4294967296>>>0)>>>0;a[5][1]=m>>>0;m=a[6][1]+Y;a[6][0]=a[6][0]+ca+(m/4294967296>>>0)>>>0;a[6][1]=m>>>0;m=a[7][1]+G;a[7][0]=a[7][0]+N+(m/4294967296>>>0)>>>0;a[7][1]=m>>>0;X-=128}}var d=a.sha512=a.sha512||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha512=a.md.algorithms.sha512=d;var e=a.sha384=a.sha512.sha384=a.sha512.sha384|| +{};e.create=function(){return d.create("SHA-384")};a.md.sha384=a.md.algorithms.sha384=e;a.sha512.sha256=a.sha512.sha256||{create:function(){return d.create("SHA-512/256")}};a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256;a.sha512.sha224=a.sha512.sha224||{create:function(){return d.create("SHA-512/224")}};a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224;d.create=function(b){p||(l=String.fromCharCode(128),l+=a.util.fillString(String.fromCharCode(0),128),k=[[1116352408, 3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235], [1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771, 106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900], [3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],g={"SHA-512":[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199], [528734635,4215389547],[1541459225,327033209]],"SHA-384":[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],"SHA-512/256":[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],"SHA-512/224":[[2352822216,424955298],[1944164710, -2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]]},p=!0);"undefined"===typeof b&&(b="SHA-512");if(!(b in g))throw Error("Invalid SHA-512 algorithm: "+b);for(var d=g[b],e=null,k=a.util.createBuffer(),y=Array(80),z=0;80>z;++z)y[z]=Array(2);var G={algorithm:b.replace("-","").toLowerCase(),blockLength:128,digestLength:64,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){G.messageLength= -0;G.fullMessageLength=G.messageLength128=[];for(var b=G.messageLengthSize/4,c=0;c>>0,g>>>0],C=G.fullMessageLength.length-1;0<=C;--C)G.fullMessageLength[C]+=g[1],g[1]=g[0]+(G.fullMessageLength[C]/4294967296>>>0),G.fullMessageLength[C]>>>=0,g[0]= -g[1]/4294967296>>>0;k.putBytes(b);c(e,y,k);(2048>>0,C+=x,d.putInt32(C>>>0),C=g;g=Array(e.length);for(l=0;lb.blockLength&&(b.start(),b.update(l.bytes()),l=b.digest());c=a.util.createBuffer();d=a.util.createBuffer();u=l.length();for(h=0;h>>4^k)&252645135;k^=b;x^=b<<4;b=(x>>>16^k)&65535;k^=b;x^=b<<16;b=(k>>>2^x)&858993459;x^=b;k^=b<<2;b=(k>>>8^x)&16711935;x^=b;k^=b<<8;b=(x>>>1^k)&1431655765;for(var k=k^b,x=x^b<<1,x=x<<1|x>>>31,k=k<<1|k>>>31,m=0;m>>4|k<<28)^a[r+1];b=x; -x=k;k=b^(p[U>>>24&63]|g[U>>>16&63]|u[U>>>8&63]|w[U&63]|h[S>>>24&63]|l[S>>>16&63]|I[S>>>8&63]|D[S&63])}b=x;x=k;k=b}x=x>>>1|x<<31;k=k>>>1|k<<31;b=(x>>>1^k)&1431655765;k^=b;x^=b<<1;b=(k>>>8^x)&16711935;x^=b;k^=b<<8;b=(k>>>2^x)&858993459;x^=b;k^=b<<2;b=(x>>>16^k)&65535;k^=b;x^=b<<16;b=(x>>>4^k)&252645135;c[0]=x^b<<4;c[1]=k^b}function e(b){b=b||{};var c="DES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key):a.cipher.createCipher(c,b.key);var g=d.start;d.start=function(b,c){var e= +2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]]},p=!0);"undefined"===typeof b&&(b="SHA-512");if(!(b in g))throw Error("Invalid SHA-512 algorithm: "+b);for(var d=g[b],e=null,h=a.util.createBuffer(),v=Array(80),F=0;80>F;++F)v[F]=Array(2);var q={algorithm:b.replace("-","").toLowerCase(),blockLength:128,digestLength:64,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){q.messageLength= +0;q.fullMessageLength=q.messageLength128=[];for(var b=q.messageLengthSize/4,c=0;c>>0,g>>>0],k=q.fullMessageLength.length-1;0<=k;--k)q.fullMessageLength[k]+=g[1],g[1]=g[0]+(q.fullMessageLength[k]/4294967296>>>0),q.fullMessageLength[k]>>>=0,g[0]= +g[1]/4294967296>>>0;h.putBytes(b);c(e,v,h);(2048>>0,k+=y,d.putInt32(k>>>0),k=g;g=Array(e.length);for(u=0;ub.blockLength&&(b.start(),b.update(k.bytes()),k=b.digest());c=a.util.createBuffer();d=a.util.createBuffer();u=k.length();for(l=0;l>>4^h)&252645135;h^=b;y^=b<<4;b=(y>>>16^h)&65535;h^=b;y^=b<<16;b=(h>>>2^y)&858993459;y^=b;h^=b<<2;b=(h>>>8^y)&16711935;y^=b;h^=b<<8;b=(y>>>1^h)&1431655765;for(var h=h^b,y=y^b<<1,y=y<<1|y>>>31,h=h<<1|h>>>31,m=0;m>>4|h<<28)^a[P+1];b=y; +y=h;h=b^(p[T>>>24&63]|g[T>>>16&63]|u[T>>>8&63]|x[T&63]|l[M>>>24&63]|k[M>>>16&63]|q[M>>>8&63]|C[M&63])}b=y;y=h;h=b}y=y>>>1|y<<31;h=h>>>1|h<<31;b=(y>>>1^h)&1431655765;h^=b;y^=b<<1;b=(h>>>8^y)&16711935;y^=b;h^=b<<8;b=(h>>>2^y)&858993459;y^=b;h^=b<<2;b=(y>>>16^h)&65535;h^=b;y^=b<<16;b=(y>>>4^h)&252645135;c[0]=y^b<<4;c[1]=h^b}function e(b){b=b||{};var c="DES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key):a.cipher.createCipher(c,b.key);var g=d.start;d.start=function(b,c){var e= null;c instanceof a.util.ByteBuffer&&(e=c,c={});c=c||{};c.output=e;c.iv=b;g.call(d,c)};return d}a.des=a.des||{};a.des.startEncrypting=function(a,b,c,d){a=e({key:a,output:c,decrypt:!1,mode:d||(null===b?"ECB":"CBC")});a.start(b);return a};a.des.createEncryptionCipher=function(a,b){return e({key:a,output:null,decrypt:!1,mode:b})};a.des.startDecrypting=function(a,b,c,d){a=e({key:a,output:c,decrypt:!0,mode:d||(null===b?"ECB":"CBC")});a.start(b);return a};a.des.createDecryptionCipher=function(a,b){return e({key:a, output:null,decrypt:!0,mode:b})};a.des.Algorithm=function(a,b){var c=this;c.name=a;c.mode=new b({blockSize:8,cipher:{encrypt:function(a,b){return d(c._keys,a,b,!1)},decrypt:function(a,b){return d(c._keys,a,b,!0)}}});c._init=!1};a.des.Algorithm.prototype.initialize=function(b){if(!this._init){b=a.util.createBuffer(b.key);if(0===this.name.indexOf("3DES")&&24!==b.length())throw Error("Invalid Triple-DES key size: "+8*b.length());for(var c=[0,4,536870912,536870916,65536,65540,536936448,536936452,512, -516,536871424,536871428,66048,66052,536936960,536936964],d=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],g=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],e=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],k=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256], -m=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],h=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],q=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456, -8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],w=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],v=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],z=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],I=8>>4^H)&252645135;H^=N;L^=N<<4;N=(H>>>-16^L)&65535;L^=N;H^=N<<-16;N=(L>>>2^H)&858993459;H^=N;L^=N<<2;N=(H>>>-16^L)&65535;L^=N;H^=N<<-16;N=(L>>>1^H)&1431655765;H^=N;L^=N<<1;N=(H>>>8^L)&16711935;L^=N;H^=N<<8;N=(L>>>1^H)&1431655765;H^=N;L^=N<<1;N=L<<8|H>>>20&240;for(var L=H<<24|H<<8&16711680|H>>>8&65280|H>>>24&240,H=N,J=0;J>>26,H=H<<2|H>>>26):(L=L<<1|L>>>27,H=H<<1|H>>>27); -var L=L&-15,H=H&-15,X=c[L>>>28]|d[L>>>24&15]|g[L>>>20&15]|e[L>>>16&15]|k[L>>>12&15]|m[L>>>8&15]|l[L>>>4&15],da=h[H>>>28]|q[H>>>24&15]|u[H>>>20&15]|w[H>>>16&15]|p[H>>>12&15]|v[H>>>8&15]|z[H>>>4&15];N=(da>>>16^X)&65535;B[D++]=X^N;B[D++]=da^N<<16}}this._keys=B;this._init=!0}};c("DES-ECB",a.cipher.modes.ecb);c("DES-CBC",a.cipher.modes.cbc);c("DES-CFB",a.cipher.modes.cfb);c("DES-OFB",a.cipher.modes.ofb);c("DES-CTR",a.cipher.modes.ctr);c("3DES-ECB",a.cipher.modes.ecb);c("3DES-CBC",a.cipher.modes.cbc);c("3DES-CFB", -a.cipher.modes.cfb);c("3DES-OFB",a.cipher.modes.ofb);c("3DES-CTR",a.cipher.modes.ctr);var h=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240, +516,536871424,536871428,66048,66052,536936960,536936964],d=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],e=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],g=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],h=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256], +m=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],k=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],r=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],l=[0,268435456,8,268435464,0,268435456, +8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],x=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],M=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],v=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],p=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],z=8>>4^G)&252645135;G^=C;N^=C<<4;C=(G>>>-16^N)&65535;N^=C;G^=C<<-16;C=(N>>>2^G)&858993459;G^=C;N^=C<<2;C=(G>>>-16^N)&65535;N^=C;G^=C<<-16;C=(N>>>1^G)&1431655765;G^=C;N^=C<<1;C=(G>>>8^N)&16711935;N^=C;G^=C<<8;C=(N>>>1^G)&1431655765;G^=C;N^=C<<1;C=N<<8|G>>>20&240;for(var N=G<<24|G<<8&16711680|G>>>8&65280|G>>>24&240,G=C,I=0;I>>26,G=G<<2|G>>>26):(N=N<<1|N>>>27,G=G<<1|G>>>27); +var N=N&-15,G=G&-15,X=c[N>>>28]|d[N>>>24&15]|e[N>>>20&15]|g[N>>>16&15]|h[N>>>12&15]|m[N>>>8&15]|k[N>>>4&15],da=u[G>>>28]|r[G>>>24&15]|l[G>>>20&15]|x[G>>>16&15]|M[G>>>12&15]|v[G>>>8&15]|p[G>>>4&15];C=(da>>>16^X)&65535;q[B++]=X^C;q[B++]=da^C<<16}}this._keys=q;this._init=!0}};c("DES-ECB",a.cipher.modes.ecb);c("DES-CBC",a.cipher.modes.cbc);c("DES-CFB",a.cipher.modes.cfb);c("DES-OFB",a.cipher.modes.ofb);c("DES-CTR",a.cipher.modes.ctr);c("3DES-ECB",a.cipher.modes.ecb);c("3DES-CBC",a.cipher.modes.cbc);c("3DES-CFB", +a.cipher.modes.cfb);c("3DES-OFB",a.cipher.modes.ofb);c("3DES-CTR",a.cipher.modes.ctr);var l=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240, 0,65540,66560,0,16842756],p=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608, --2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],l=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320, -8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],g=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],I=[256,34078976,34078720,1107296512, +-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],k=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320, +8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],g=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],q=[256,34078976,34078720,1107296512, 524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080, 524288,0,1074266112,34078976,1073742080],u=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384, -4194320,536887312,0,541081600,536870912,4194320,536887312],D=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048, -67108866,67110912,2048,2097154],w=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208, -268435456,268701696]}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var p,h=function(a,c){c.exports=function(c){var e=p.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.des)return c.des;c.defined.des=!0;for(var m=0;mF)return h(null,A);E.start(null, -null);E.update(c);E.update(a.util.int32ToBytes(r));x=M=E.digest().getBytes();q=2;w()}function w(){if(q<=d)return E.start(null,null),E.update(M),C=E.digest().getBytes(),x=a.util.xorBytes(x,C,y),M=C,++q,a.util.setImmediate(w);A+=r4294967295*y){b=Error("Derived key is too long."); -if(h)return h(b);throw b;}var F=Math.ceil(g/y),G=g-(F-1)*y,E=a.hmac.create();E.start(m,b);var A="",x,C,M;if(!h){for(var r=1;r<=F;++r){E.start(null,null);E.update(c);E.update(a.util.int32ToBytes(r));x=M=E.digest().getBytes();for(var q=2;q<=d;++q)E.start(null,null),E.update(M),C=E.digest().getBytes(),x=a.util.xorBytes(x,C,y),M=C;A+=rc;++c)b=31===b?2147483648:b<<2,0===b%g.reseeds&&(a.update(g.pools[c].digest().getBytes()),g.pools[c].start());b=a.digest().getBytes();a.start();a.update(b);a=a.digest().getBytes();g.key=g.plugin.formatKey(b);g.seed=g.plugin.formatSeed(a);g.reseeds=4294967295===g.reseeds?0:g.reseeds+1;g.generated=0}function m(b){var c=null;if("undefined"!==typeof window){var d=window.crypto||window.msCrypto;d&&d.getRandomValues&&(c=function(a){return d.getRandomValues(a)})}var g= -a.util.createBuffer();if(c)for(;g.length()>16),e+=(c&32767)<<16,e+=c>>15,e=(e&2147483647)+(e>>31),c=e&4294967295,e=0;3>e;++e)k=c>>>(e<<3),k^=Math.floor(256*Math.random()), -g.putByte(String.fromCharCode(k&255));return g.getBytes(b)}var g={plugin:b,key:null,seed:null,time:null,reseeds:0,generated:0};b=b.md;for(var h=Array(32),u=0;32>u;++u)h[u]=b.create();g.pools=h;g.pool=0;g.generate=function(b,d){function e(C){if(C)return d(C);if(x.length()>=b)return d(null,x.getBytes(b));1048575p)return u(null,A);D.start(null, +null);D.update(c);D.update(a.util.int32ToBytes(U));y=L=D.digest().getBytes();r=2;x()}function x(){if(r<=d)return D.start(null,null),D.update(L),E=D.digest().getBytes(),y=a.util.xorBytes(y,E,w),L=E,++r,a.util.setImmediate(x);A+=U4294967295*w){b=Error("Derived key is too long."); +if(u)return u(b);throw b;}var p=Math.ceil(g/w),q=g-(p-1)*w,D=a.hmac.create();D.start(m,b);var A="",y,E,L;if(!u){for(var U=1;U<=p;++U){D.start(null,null);D.update(c);D.update(a.util.int32ToBytes(U));y=L=D.digest().getBytes();for(var r=2;r<=d;++r)D.start(null,null),D.update(L),E=D.digest().getBytes(),y=a.util.xorBytes(y,E,w),L=E;A+=Uc;++c)b=31===b?2147483648:b<<2,0===b%g.reseeds&&(a.update(g.pools[c].digest().getBytes()),g.pools[c].start());b=a.digest().getBytes();a.start();a.update(b);a=a.digest().getBytes();g.key=g.plugin.formatKey(b);g.seed=g.plugin.formatSeed(a);g.reseeds=4294967295===g.reseeds?0:g.reseeds+1;g.generated=0}function m(b){var c=null;if("undefined"!==typeof window){var d=window.crypto||window.msCrypto;d&&d.getRandomValues&&(c=function(a){return d.getRandomValues(a)})}var e= +a.util.createBuffer();if(c)for(;e.length()>16),g+=(c&32767)<<16,g+=c>>15,g=(g&2147483647)+(g>>31),c=g&4294967295,g=0;3>g;++g)h=c>>>(g<<3),h^=Math.floor(256*Math.random()), +e.putByte(String.fromCharCode(h&255));return e.getBytes(b)}var g={plugin:b,key:null,seed:null,time:null,reseeds:0,generated:0};b=b.md;for(var l=Array(32),u=0;32>u;++u)l[u]=b.create();g.pools=l;g.pool=0;g.generate=function(b,d){function e(E){if(E)return d(E);if(y.length()>=b)return d(null,y.getBytes(b));1048575>d&255);g.collect(c)};g.registerWorker=function(a){a===self?g.seedFile=function(a,b){function c(a){a=a.data;a.forge&&a.forge.prng&&(self.removeEventListener("message",c),b(a.forge.prng.err,a.forge.prng.bytes))}self.addEventListener("message",c);self.postMessage({forge:{prng:{needed:a}}})}:a.addEventListener("message",function(b){b=b.data;b.forge&&b.forge.prng&&g.seedFile(b.forge.prng.needed,function(b,c){a.postMessage({forge:{prng:{err:b,bytes:c}}})})})}; -return g}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var p,h=function(a,c){c.exports=function(c){var e=p.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.prng)return c.prng;c.defined.prng=!0;for(var m=0;m>(k&7),p;for(p=g;128>p;p++)e.putByte(c[e.at(p- -1)+e.at(p-g)&255]);e.setAt(128-h,c[e.at(128-h)&k]);for(p=127-h;0<=p;p--)e.setAt(p,c[e.at(p+1)^e.at(p+h)]);return e};var e=function(b,c,e){var g=!1,k=null,m=null,h=null,p,y,F,G,E=[];b=a.rc2.expandKey(b,c);for(F=0;64>F;F++)E.push(b.getInt16Le());e?(p=function(a){for(F=0;4>F;F++){a[F]+=E[G]+(a[(F+3)%4]&a[(F+2)%4])+(~a[(F+3)%4]&a[(F+1)%4]);var b=a[F],c=d[F];a[F]=b<>16-c;G++}},y=function(a){for(F=0;4>F;F++)a[F]+=E[a[(F+3)%4]&63]}):(p=function(a){for(F=3;0<=F;F--){var b=a[F],c=d[F];a[F]= -(b&65535)>>c|b<<16-c&65535;a[F]-=E[G]+(a[(F+3)%4]&a[(F+2)%4])+(~a[(F+3)%4]&a[(F+1)%4]);G--}},y=function(a){for(F=3;0<=F;F--)a[F]-=E[a[(F+3)%4]&63]});var A=null;return A={start:function(b,c){b&&"string"===typeof b&&(b=a.util.createBuffer(b));g=!1;k=a.util.createBuffer();m=c||new a.util.createBuffer;h=b;A.output=m},update:function(a){for(g||k.putBuffer(a);8<=k.length();){a=[[5,p],[1,y],[6,p],[1,y],[5,p]];var b=[];for(F=0;4>F;F++){var c=k.getInt16Le();null!==h&&(e?c^=h.getInt16Le():h.putInt16Le(c)); -b.push(c&65535)}G=e?0:63;for(c=0;cF;F++)null!==h&&(e?h.putInt16Le(b[F]):b[F]^=h.getInt16Le()),m.putInt16Le(b[F])}},finish:function(a){var b=!0;if(e)if(a)b=a(8,k,!e);else{var c=8===k.length()?8:8-k.length();k.fillWithByte(c,c)}b&&(g=!0,A.update());!e&&(b=0===k.length())&&(a?b=a(8,m,!e):(a=m.length(),c=m.at(a-1),c>a?b=!1:m.truncate(c)));return b}}};a.rc2.startEncrypting=function(b,c,d){b=a.rc2.createEncryptionCipher(b,128);b.start(c,d);return b}; -a.rc2.createEncryptionCipher=function(a,b){return e(a,b,!0)};a.rc2.startDecrypting=function(b,c,d){b=a.rc2.createDecryptionCipher(b,128);b.start(c,d);return b};a.rc2.createDecryptionCipher=function(a,b){return e(a,b,!1)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var p,h=function(a,c){c.exports=function(c){var e=p.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined|| -{};if(c.defined.rc2)return c.rc2;c.defined.rc2=!0;for(var m=0;m>=15;0<=--g;){var k=this.data[a]&32767,x=this.data[a++]>>15,A=b*k+x*n,k=n*k+((A&32767)<<15)+c.data[d]+(e&1073741823);e=(k>>>30)+(A>>>15)+b*x+(e>>>30);c.data[d++]=k&1073741823}return e}function p(a,b, -c,d,e,g){var n=b&16383;for(b>>=14;0<=--g;){var k=this.data[a]&16383,x=this.data[a++]>>14,A=b*k+x*n,k=n*k+((A&16383)<<14)+c.data[d]+e;e=(k>>28)+(A>>14)+b*x;c.data[d++]=k&268435455}return e}function l(a,b){var c=ba[a.charCodeAt(b)];return null==c?-1:c}function g(a){var b=d();b.fromInt(a);return b}function r(a){var b=1,c;0!=(c=a>>>16)&&(a=c,b+=16);0!=(c=a>>8)&&(a=c,b+=8);0!=(c=a>>4)&&(a=c,b+=4);0!=(c=a>>2)&&(a=c,b+=2);0!=a>>1&&(b+=1);return b}function u(a){this.m=a}function D(a){this.m=a;this.mp=a.invDigit(); -this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<=q;++q)ba[M++]=q;M=97;for(q=10;36>q;++q)ba[M++]=q;M=65;for(q=10;36>q;++q)ba[M++]=q;u.prototype.convert=function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m):a};u.prototype.revert=function(a){return a};u.prototype.reduce= -function(a){a.divRemTo(this.m,null,a)};u.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};u.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};D.prototype.convert=function(a){var b=d();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);0>a.s&&0>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a.data[c]+=this.m.am(0,d,a,b,0,this.m.t);a.data[c]>=a.DV;)a.data[c]-=a.DV,a.data[++c]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)};D.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};D.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};c.prototype.copyTo=function(a){for(var b=this.t-1;0<=b;--b)a.data[b]=this.data[b];a.t=this.t;a.s=this.s}; -c.prototype.fromInt=function(a){this.t=1;this.s=0>a?-1:0;0a?this.data[0]=a+this.DV:this.t=0};c.prototype.fromString=function(a,b){var d;if(16==b)d=4;else if(8==b)d=3;else if(256==b)d=8;else if(2==b)d=1;else if(32==b)d=5;else if(4==b)d=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var e=a.length,g=!1,n=0;0<=--e;){var k=8==d?a[e]&255:l(a,e);0>k?"-"==a.charAt(e)&&(g=!0):(g=!1,0==n?this.data[this.t++]=k:n+d>this.DB?(this.data[this.t-1]|=(k&(1<>this.DB-n):this.data[this.t-1]|=k<=this.DB&&(n-=this.DB))}8==d&&0!=(a[0]&128)&&(this.s=-1,0>d|n,n=(this.data[k]&e)<=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,g=(1<>d;for(var n= +175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],d=[1,2,3,5];a.rc2=a.rc2||{};a.rc2.expandKey=function(b,d){"string"===typeof b&&(b=a.util.createBuffer(b));d=d||128;var e=b,g=b.length(),h=d,u=Math.ceil(h/8),h=255>>(h&7),l;for(l=g;128>l;l++)e.putByte(c[e.at(l- +1)+e.at(l-g)&255]);e.setAt(128-u,c[e.at(128-u)&h]);for(l=127-u;0<=l;l--)e.setAt(l,c[e.at(l+1)^e.at(l+u)]);return e};var e=function(b,c,e){var g=!1,h=null,m=null,l=null,x,p,q,H,D=[];b=a.rc2.expandKey(b,c);for(q=0;64>q;q++)D.push(b.getInt16Le());e?(x=function(a){for(q=0;4>q;q++){a[q]+=D[H]+(a[(q+3)%4]&a[(q+2)%4])+(~a[(q+3)%4]&a[(q+1)%4]);var b=a[q],c=d[q];a[q]=b<>16-c;H++}},p=function(a){for(q=0;4>q;q++)a[q]+=D[a[(q+3)%4]&63]}):(x=function(a){for(q=3;0<=q;q--){var b=a[q],c=d[q];a[q]= +(b&65535)>>c|b<<16-c&65535;a[q]-=D[H]+(a[(q+3)%4]&a[(q+2)%4])+(~a[(q+3)%4]&a[(q+1)%4]);H--}},p=function(a){for(q=3;0<=q;q--)a[q]-=D[a[(q+3)%4]&63]});var A=null;return A={start:function(b,c){b&&"string"===typeof b&&(b=a.util.createBuffer(b));g=!1;h=a.util.createBuffer();m=c||new a.util.createBuffer;l=b;A.output=m},update:function(a){for(g||h.putBuffer(a);8<=h.length();){a=[[5,x],[1,p],[6,x],[1,p],[5,x]];var b=[];for(q=0;4>q;q++){var c=h.getInt16Le();null!==l&&(e?c^=l.getInt16Le():l.putInt16Le(c)); +b.push(c&65535)}H=e?0:63;for(c=0;cq;q++)null!==l&&(e?l.putInt16Le(b[q]):b[q]^=l.getInt16Le()),m.putInt16Le(b[q])}},finish:function(a){var b=!0;if(e)if(a)b=a(8,h,!e);else{var c=8===h.length()?8:8-h.length();h.fillWithByte(c,c)}b&&(g=!0,A.update());!e&&(b=0===h.length())&&(a?b=a(8,m,!e):(a=m.length(),c=m.at(a-1),c>a?b=!1:m.truncate(c)));return b}}};a.rc2.startEncrypting=function(b,c,d){b=a.rc2.createEncryptionCipher(b,128);b.start(c,d);return b}; +a.rc2.createEncryptionCipher=function(a,b){return e(a,b,!0)};a.rc2.startDecrypting=function(b,c,d){b=a.rc2.createDecryptionCipher(b,128);b.start(c,d);return b};a.rc2.createDecryptionCipher=function(a,b){return e(a,b,!1)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var l,p=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined|| +{};if(c.defined.rc2)return c.rc2;c.defined.rc2=!0;for(var m=0;m>=15;0<=--g;){var h=this.data[a]&32767,y=this.data[a++]>>15,k=b*h+y*n,h=n*h+((k&32767)<<15)+c.data[d]+(e&1073741823);e=(h>>>30)+(k>>>15)+b*y+(e>>>30);c.data[d++]=h&1073741823}return e}function q(a,b, +c,d,e,g){var n=b&16383;for(b>>=14;0<=--g;){var h=this.data[a]&16383,y=this.data[a++]>>14,k=b*h+y*n,h=n*h+((k&16383)<<14)+c.data[d]+e;e=(h>>28)+(k>>14)+b*y;c.data[d++]=h&268435455}return e}function k(a,b){var c=U[a.charCodeAt(b)];return null==c?-1:c}function g(a){var b=d();b.fromInt(a);return b}function p(a){var b=1,c;0!=(c=a>>>16)&&(a=c,b+=16);0!=(c=a>>8)&&(a=c,b+=8);0!=(c=a>>4)&&(a=c,b+=4);0!=(c=a>>2)&&(a=c,b+=2);0!=a>>1&&(b+=1);return b}function u(a){this.m=a}function C(a){this.m=a;this.mp=a.invDigit(); +this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<=r;++r)U[L++]=r;L=97;for(r=10;36>r;++r)U[L++]=r;L=65;for(r=10;36>r;++r)U[L++]=r;u.prototype.convert=function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m):a};u.prototype.revert=function(a){return a};u.prototype.reduce= +function(a){a.divRemTo(this.m,null,a)};u.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};u.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};C.prototype.convert=function(a){var b=d();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);0>a.s&&0>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a.data[c]+=this.m.am(0,d,a,b,0,this.m.t);a.data[c]>=a.DV;)a.data[c]-=a.DV,a.data[++c]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)};C.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};C.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};c.prototype.copyTo=function(a){for(var b=this.t-1;0<=b;--b)a.data[b]=this.data[b];a.t=this.t;a.s=this.s}; +c.prototype.fromInt=function(a){this.t=1;this.s=0>a?-1:0;0a?this.data[0]=a+this.DV:this.t=0};c.prototype.fromString=function(a,b){var d;if(16==b)d=4;else if(8==b)d=3;else if(256==b)d=8;else if(2==b)d=1;else if(32==b)d=5;else if(4==b)d=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var e=a.length,g=!1,n=0;0<=--e;){var h=8==d?a[e]&255:k(a,e);0>h?"-"==a.charAt(e)&&(g=!0):(g=!1,0==n?this.data[this.t++]=h:n+d>this.DB?(this.data[this.t-1]|=(h&(1<>this.DB-n):this.data[this.t-1]|=h<=this.DB&&(n-=this.DB))}8==d&&0!=(a[0]&128)&&(this.s=-1,0>d|n,n=(this.data[h]&e)<=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,g=(1<>d;for(var n= c+1;n>d;0>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d-=a.s}b.s=0>d?-1:0;-1>d?b.data[c++]=this.DV+d:0=b.DV&&(a.data[c+b.t]-=b.DV,a.data[c+b.t+1]=1)}0=g.t)){var n=this.abs();if(n.t>this.F2:0),C=this.FV/l,l=(1<x&&c.ZERO.subTo(e,e)}}}};c.prototype.invDigit=function(){if(1>this.t)return 0;var a=this.data[0];if(0==(a&1))return 0;var b=a&3,b=b*(2- -(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return 0a)return c.ONE;var e=d(),g=d(),n=b.convert(this),k=r(a)-1;for(n.copyTo(e);0<=--k;)if(b.sqrTo(e,g),0<(a&1<this.s)return"-"+this.negate().toString(a);if(16==a)a= +1]+=b.am(c,b.data[c],a,2*c,0,1));a.s=0;a.clamp()};c.prototype.divRemTo=function(a,b,e){var g=a.abs();if(!(0>=g.t)){var n=this.abs();if(n.t>this.F2:0),r=this.FV/A,A=(1<y&&c.ZERO.subTo(e,e)}}}};c.prototype.invDigit=function(){if(1>this.t)return 0;var a=this.data[0];if(0==(a&1))return 0;var b=a&3,b=b*(2- +(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return 0a)return c.ONE;var e=d(),g=d(),n=b.convert(this),h=p(a)-1;for(n.copyTo(e);0<=--h;)if(b.sqrTo(e,g),0<(a&1<this.s)return"-"+this.negate().toString(a);if(16==a)a= 4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<>n)&&(d=!0,e="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));0<=g;)n>(n+=this.DB-a)):(c=this.data[g]>>(n-=a)&b,0>=n&&(n+=this.DB,--g)),0this.s?this.negate():this};c.prototype.compareTo=function(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t,b=c-a.t;if(0!=b)return 0>this.s?-b:b;for(;0<=--c;)if(0!=(b=this.data[c]-a.data[c]))return b;return 0};c.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+r(this.data[this.t-1]^this.s&this.DM)};c.prototype.mod=function(a){var b=d();this.abs().divRemTo(a,null,b);0>this.s&&0a||b.isEven()?new u(b):new D(b);return this.exp(a,c)};c.ZERO=g(0);c.ONE=g(1);E.prototype.convert=A;E.prototype.revert=A;E.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c)};E.prototype.sqrTo=function(a,b){a.squareTo(b)};x.prototype.convert=function(a){if(0>a.s||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compareTo(this.m))return a;var b=d();a.copyTo(b);this.reduce(b);return b};x.prototype.revert=function(a){return a};x.prototype.reduce=function(a){a.drShiftTo(this.m.t- -1,this.r2);a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp());this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compareTo(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compareTo(this.m);)a.subTo(this.m,a)};x.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};x.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};var T=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109, -113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],U=67108864/T[T.length-1];c.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};c.prototype.toRadix=function(a){null==a&&(a=10);if(0==this.signum()||2>a||36A?"-"==a.charAt(x)&&0==this.signum()&&(g=!0):(k=b*k+A,++n>=d&&(this.dMultiply(e),this.dAddOffset(k,0),k=n=0))}0a)this.fromInt(1);else for(this.fromNumber(a,d),this.testBit(a-1)||this.bitwiseTo(c.ONE.shiftLeft(a-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(c.ONE.shiftLeft(a-1),this);else{d=[];var e=a&7;d.length=(a>>3)+1;b.nextBytes(d);d[0]=0this.s?this.negate():this};c.prototype.compareTo=function(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t,b=c-a.t;if(0!=b)return 0>this.s?-b:b;for(;0<=--c;)if(0!=(b=this.data[c]-a.data[c]))return b;return 0};c.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)};c.prototype.mod=function(a){var b=d();this.abs().divRemTo(a,null,b);0>this.s&&0a||b.isEven()?new u(b):new C(b);return this.exp(a,c)};c.ZERO=g(0);c.ONE=g(1);D.prototype.convert=A;D.prototype.revert=A;D.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c)};D.prototype.sqrTo=function(a,b){a.squareTo(b)};y.prototype.convert=function(a){if(0>a.s||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compareTo(this.m))return a;var b=d();a.copyTo(b);this.reduce(b);return b};y.prototype.revert=function(a){return a};y.prototype.reduce=function(a){a.drShiftTo(this.m.t- +1,this.r2);a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp());this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compareTo(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compareTo(this.m);)a.subTo(this.m,a)};y.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};y.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};var P=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109, +113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],T=67108864/P[P.length-1];c.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};c.prototype.toRadix=function(a){null==a&&(a=10);if(0==this.signum()||2>a||36A?"-"==a.charAt(y)&&0==this.signum()&&(g=!0):(h=b*h+A,++n>=d&&(this.dMultiply(e),this.dAddOffset(h,0),h=n=0))}0a)this.fromInt(1);else for(this.fromNumber(a,d),this.testBit(a-1)||this.bitwiseTo(c.ONE.shiftLeft(a-1),w,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(c.ONE.shiftLeft(a-1),this);else{d=[];var e=a&7;d.length=(a>>3)+1;b.nextBytes(d);d[0]=0>=this.DB;if(a.t>=this.DB;d+=this.s}else{for(d+=this.s;c>=this.DB;d+=a.s}b.s=0>d?-1:0;0d&&(b.data[c++]=this.DV+d);b.t=c;b.clamp()};c.prototype.dMultiply=function(a){this.data[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()};c.prototype.dAddOffset=function(a,b){if(0!=a){for(;this.t<=b;)this.data[this.t++]=0;for(this.data[b]+=a;this.data[b]>=this.DV;)this.data[b]-=this.DV,++b>=this.t&&(this.data[this.t++]= 0),++this.data[b]}};c.prototype.multiplyLowerTo=function(a,b,c){var d=Math.min(this.t+a.t,b);c.s=0;for(c.t=d;0=a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0=d)return!1;for(var e=b.shiftRight(d),g=C(),n,k=0;k=n.compareTo(c.ONE)||0<=n.compareTo(b));n=n.modPow(e,this);if(0!=n.compareTo(c.ONE)&&0!=n.compareTo(b)){for(var x=1;x++=a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0=d)return!1;for(var e=b.shiftRight(d),g=E(),n,h=0;h=n.compareTo(c.ONE)||0<=n.compareTo(b));n=n.modPow(e,this);if(0!=n.compareTo(c.ONE)&&0!=n.compareTo(b)){for(var y=1;y++this.s){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<>24};c.prototype.shortValue= function(){return 0==this.t?this.s:this.data[0]<<16>>16};c.prototype.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this.data[0]?0:1};c.prototype.toByteArray=function(){var a=this.t,b=[];b[0]=this.s;var c=this.DB-a*this.DB%8,d,e=0;if(0>c)!=(this.s&this.DM)>>c&&(b[e++]=d|this.s<c?(d=(this.data[a]&(1<>(c+=this.DB-8)):(d=this.data[a]>>(c-=8)&255,0>=c&&(c+=this.DB,--a)),0!=(d&128)&&(d|=-256),0==e&& -(this.s&128)!=(d&128)&&++e,0this.compareTo(a)?this:a};c.prototype.max=function(a){return 0a?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b};c.prototype.shiftRight=function(a){var b=d();0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b};c.prototype.getLowestSetBit=function(){for(var a=0;a>=16,c+=16); -0==(a&255)&&(a>>=8,c+=8);0==(a&15)&&(a>>=4,c+=4);0==(a&3)&&(a>>=2,c+=2);0==(a&1)&&++c;a=c}return b+a}return 0>this.s?this.t*this.DB:-1};c.prototype.bitCount=function(){for(var a=0,b=this.s&this.DM,c=0;c=this.t?0!=this.s:0!=(this.data[b]&1<=c)return n;e=18>c?1:48>c?3:144>c?4:768>c?5:6;k=8>c?new u(b):b.isEven()?new x(b):new D(b);var A=[],m=3,l=e-1,C=(1<=l?h=a.data[q]>>c-l&C:(h=(a.data[q]&(1<>this.DB+c-l));for(m=e;0==(h&1);)h>>=1,--m;0>(c-=m)&&(c+=this.DB,--q); -if(p)A[h].copyTo(n),p=!1;else{for(;1--c&&(c=this.DB-1,--q)}return k.revert(n)};c.prototype.modInverse=function(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return c.ZERO;for(var d=a.clone(),e=this.clone(),n=g(1),k=g(0),x=g(0),A=g(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),b?(n.isEven()&&k.isEven()||(n.addTo(this,n),k.subTo(a,k)),n.rShiftTo(1, -n)):k.isEven()||k.subTo(a,k),k.rShiftTo(1,k);for(;e.isEven();)e.rShiftTo(1,e),b?(x.isEven()&&A.isEven()||(x.addTo(this,x),A.subTo(a,A)),x.rShiftTo(1,x)):A.isEven()||A.subTo(a,A),A.rShiftTo(1,A);0<=d.compareTo(e)?(d.subTo(e,d),b&&n.subTo(x,n),k.subTo(A,k)):(e.subTo(d,e),b&&x.subTo(n,x),A.subTo(k,A))}if(0!=e.compareTo(c.ONE))return c.ZERO;if(0<=A.compareTo(a))return A.subtract(a);if(0>A.signum())A.addTo(a,A);else return A;return 0>A.signum()?A.add(a):A};c.prototype.pow=function(a){return this.exp(a, -new E)};c.prototype.gcd=function(a){var b=0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>b.compareTo(a)){var c=b,b=a;a=c}var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return b;c>24&255,h>>16&255,h>>8&255,h&255);e.start();e.update(b+u);m+=e.digest().getBytes()}return m.substring(0,d)}var d=a.pkcs1=a.pkcs1||{};d.encode_rsa_oaep=function(b,d,e,l,g){var h,u,p,w;"string"===typeof e?(h=e,u=l||void 0,p=g||void 0):e&&(h=e.label||void 0,u=e.seed||void 0,p=e.md||void 0,e.mgf1&&e.mgf1.md&&(w=e.mgf1.md));p?p.start():p=a.md.sha1.create(); -w||(w=p);b=Math.ceil(b.n.bitLength()/8);e=b-2*p.digestLength-2;if(d.length>e)throw w=Error("RSAES-OAEP input message length is too long."),w.length=d.length,w.maxLength=e,w;h||(h="");p.update(h,"raw");h=p.digest();l="";e-=d.length;for(g=0;gb&&(k=h(b,c));if(k.isProbablePrime(x))return g(null,k);k.dAddOffset(r[A++%8],0)}while(0>m||+new Date-lb&&(A=h(b,c));x=A.toString(16);e.target.postMessage({hex:x,workLoad:C}); -A.dAddOffset(p,0)}}x=Math.max(1,x);for(var d=[],e=0;e=a?27:150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if(!a.prime){var l=a.prime=a.prime||{},g=a.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],u=new g(null);u.fromInt(30);var D=function(a,b){return a|b};l.generateProbablePrime=function(b,d,e){"function"===typeof d&&(e=d,d={});d=d||{};var g=d.algorithm||"PRIMEINC";"string"===typeof g&&(g={name:g});g.options=g.options||{};var k=d.prng||a.random;d={nextBytes:function(a){for(var b=k.getBytesSync(a.length), -c=0;cd-11)throw g= -Error("Message is too long for PKCS#1 v1.5 padding."),g.length=b.length,g.max=d-11,g;g.putByte(0);g.putByte(e);d=d-3-b.length;if(0===e||1===e){e=0===e?0:255;for(var k=0;kb.p.compareTo(b.q)){var e=b.p;b.p=b.q;b.q=e}0!==b.p.subtract(l.ONE).gcd(b.e).compareTo(l.ONE)?(b.p=null,g()):0!==b.q.subtract(l.ONE).gcd(b.e).compareTo(l.ONE)?(b.q=null,k(b.qBits,m)):(b.p1=b.p.subtract(l.ONE),b.q1=b.q.subtract(l.ONE),b.phi=b.p1.multiply(b.q1),0!==b.phi.gcd(b.e).compareTo(l.ONE)?(b.p=b.q=null,g()):(b.n=b.p.multiply(b.q),b.n.bitLength()!==b.bits?(b.q=null,k(b.qBits,m)): -(e=b.e.modInverse(b.phi),b.keys={privateKey:r.rsa.setPrivateKey(b.n,b.e,e,b.p,b.q,e.mod(b.p1),e.mod(b.q1),b.q.modInverse(b.p)),publicKey:r.rsa.setPublicKey(b.n,b.e)},d(null,b.keys))))}"function"===typeof c&&(d=c,c={});c=c||{};var h={algorithm:{name:c.algorithm||"PRIMEINC",options:{workers:c.workers||2,workLoad:c.workLoad||100,workerScript:c.workerScript}}};"prng"in c&&(h.prng=c.prng);g()}function h(b){b=b.toString(16);"8"<=b[0]&&(b="00"+b);return a.util.hexToBytes(b)}function p(a){return 100>=a?27: -150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if("undefined"===typeof l)var l=a.jsbn.BigInteger;var g=a.asn1;a.pki=a.pki||{};a.pki.rsa=a.rsa=a.rsa||{};var r=a.pki,u=[6,4,2,4,2,4,6,2],D={name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:g.Class.UNIVERSAL, -type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},w={name:"RSAPrivateKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus", +(this.s&128)!=(d&128)&&++e,0this.compareTo(a)?this:a};c.prototype.max=function(a){return 0a?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b};c.prototype.shiftRight=function(a){var b=d();0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b};c.prototype.getLowestSetBit=function(){for(var a=0;a>=16,c+=16); +0==(a&255)&&(a>>=8,c+=8);0==(a&15)&&(a>>=4,c+=4);0==(a&3)&&(a>>=2,c+=2);0==(a&1)&&++c;a=c}return b+a}return 0>this.s?this.t*this.DB:-1};c.prototype.bitCount=function(){for(var a=0,b=this.s&this.DM,c=0;c=this.t?0!=this.s:0!=(this.data[b]&1<=c)return n;e=18>c?1:48>c?3:144>c?4:768>c?5:6;h=8>c?new u(b):b.isEven()?new y(b):new C(b);var k=[],A=3,m=e-1,r=(1<=m?l=a.data[E]>>c-m&r:(l=(a.data[E]&(1<>this.DB+c-m));for(A=e;0==(l&1);)l>>=1,--A;0>(c-=A)&&(c+=this.DB,--E); +if(x)k[l].copyTo(n),x=!1;else{for(;1--c&&(c=this.DB-1,--E)}return h.revert(n)};c.prototype.modInverse=function(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return c.ZERO;for(var d=a.clone(),e=this.clone(),n=g(1),h=g(0),y=g(0),k=g(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),b?(n.isEven()&&h.isEven()||(n.addTo(this,n),h.subTo(a,h)),n.rShiftTo(1, +n)):h.isEven()||h.subTo(a,h),h.rShiftTo(1,h);for(;e.isEven();)e.rShiftTo(1,e),b?(y.isEven()&&k.isEven()||(y.addTo(this,y),k.subTo(a,k)),y.rShiftTo(1,y)):k.isEven()||k.subTo(a,k),k.rShiftTo(1,k);0<=d.compareTo(e)?(d.subTo(e,d),b&&n.subTo(y,n),h.subTo(k,h)):(e.subTo(d,e),b&&y.subTo(n,y),k.subTo(h,k))}if(0!=e.compareTo(c.ONE))return c.ZERO;if(0<=k.compareTo(a))return k.subtract(a);if(0>k.signum())k.addTo(a,k);else return k;return 0>k.signum()?k.add(a):k};c.prototype.pow=function(a){return this.exp(a, +new D)};c.prototype.gcd=function(a){var b=0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>b.compareTo(a)){var c=b,b=a;a=c}var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return b;c>24&255,m>>16&255,m>>8&255,m&255);e.start();e.update(b+l);k+=e.digest().getBytes()}return k.substring(0,d)}var d=a.pkcs1=a.pkcs1||{};d.encode_rsa_oaep=function(b,d,e,k,g){var l,u,q,x;"string"===typeof e?(l=e,u=k||void 0,q=g||void 0):e&&(l=e.label||void 0,u=e.seed||void 0,q=e.md||void 0,e.mgf1&&e.mgf1.md&&(x=e.mgf1.md));q?q.start():q=a.md.sha1.create(); +x||(x=q);b=Math.ceil(b.n.bitLength()/8);e=b-2*q.digestLength-2;if(d.length>e)throw x=Error("RSAES-OAEP input message length is too long."),x.length=d.length,x.maxLength=e,x;l||(l="");q.update(l,"raw");l=q.digest();k="";e-=d.length;for(g=0;gb&&(h=l(b,c));if(h.isProbablePrime(y))return g(null,h);h.dAddOffset(p[k++%8],0)}while(0>m||+new Date-ub&&(A=l(b,c));y=A.toString(16);e.target.postMessage({hex:y,workLoad:E}); +A.dAddOffset(u,0)}}y=Math.max(1,y);for(var d=[],e=0;e=a?27:150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if(!a.prime){var k=a.prime=a.prime||{},g=a.jsbn.BigInteger,p=[6,4,2,4,2,4,6,2],u=new g(null);u.fromInt(30);var C=function(a,b){return a|b};k.generateProbablePrime=function(b,d,e){"function"===typeof d&&(e=d,d={});d=d||{};var g=d.algorithm||"PRIMEINC";"string"===typeof g&&(g={name:g});g.options=g.options||{};var h=d.prng||a.random;d={nextBytes:function(a){for(var b=h.getBytesSync(a.length), +c=0;cd-11)throw g= +Error("Message is too long for PKCS#1 v1.5 padding."),g.length=b.length,g.max=d-11,g;g.putByte(0);g.putByte(e);d=d-3-b.length;if(0===e||1===e){e=0===e?0:255;for(var h=0;hb.p.compareTo(b.q)){var e=b.p;b.p=b.q;b.q=e}0!==b.p.subtract(k.ONE).gcd(b.e).compareTo(k.ONE)?(b.p=null,g()):0!==b.q.subtract(k.ONE).gcd(b.e).compareTo(k.ONE)?(b.q=null,h(b.qBits,m)):(b.p1=b.p.subtract(k.ONE),b.q1=b.q.subtract(k.ONE),b.phi=b.p1.multiply(b.q1),0!==b.phi.gcd(b.e).compareTo(k.ONE)?(b.p=b.q=null,g()):(b.n=b.p.multiply(b.q),b.n.bitLength()!==b.bits?(b.q=null,h(b.qBits,m)): +(e=b.e.modInverse(b.phi),b.keys={privateKey:p.rsa.setPrivateKey(b.n,b.e,e,b.p,b.q,e.mod(b.p1),e.mod(b.q1),b.q.modInverse(b.p)),publicKey:p.rsa.setPublicKey(b.n,b.e)},d(null,b.keys))))}"function"===typeof c&&(d=c,c={});c=c||{};var l={algorithm:{name:c.algorithm||"PRIMEINC",options:{workers:c.workers||2,workLoad:c.workLoad||100,workerScript:c.workerScript}}};"prng"in c&&(l.prng=c.prng);g()}function l(b){b=b.toString(16);"8"<=b[0]&&(b="00"+b);return a.util.hexToBytes(b)}function q(a){return 100>=a?27: +150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if("undefined"===typeof k)var k=a.jsbn.BigInteger;var g=a.asn1;a.pki=a.pki||{};a.pki.rsa=a.rsa=a.rsa||{};var p=a.pki,u=[6,4,2,4,2,4,6,2],C={name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:g.Class.UNIVERSAL, +type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},x={name:"RSAPrivateKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus", tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2", -tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},y={name:"RSAPublicKey",tagClass:g.Class.UNIVERSAL, +tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},w={name:"RSAPublicKey",tagClass:g.Class.UNIVERSAL, type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},F=a.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL, -type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},G=function(a){var b;if(a.algorithm in r.oids)b=r.oids[a.algorithm]; -else throw b=Error("Unknown message digest algorithm."),b.algorithm=a.algorithm,b;var c=g.oidToDer(b).getBytes();b=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);var d=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);d.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,c));d.value.push(g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,""));a=g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,a.digest().getBytes());b.value.push(d);b.value.push(a);return g.toDer(b).getBytes()},E=function(b,c,d){if(d)return b.modPow(c.e, -c.n);if(!c.p||!c.q)return b.modPow(c.d,c.n);c.dP||(c.dP=c.d.mod(c.p.subtract(l.ONE)));c.dQ||(c.dQ=c.d.mod(c.q.subtract(l.ONE)));c.qInv||(c.qInv=c.q.modInverse(c.p));do d=new l(a.util.bytesToHex(a.random.getBytes(c.n.bitLength()/8)),16);while(0<=d.compareTo(c.n)||!d.gcd(c.n).equals(l.ONE));b=b.multiply(d.modPow(c.e,c.n)).mod(c.n);var e=b.mod(c.p).modPow(c.dP,c.p);for(b=b.mod(c.q).modPow(c.dQ,c.q);0>e.compareTo(b);)e=e.add(c.p);b=e.subtract(b).multiply(c.qInv).mod(c.p).multiply(c.q).add(b);return b= -b.multiply(d.modInverse(c.n)).mod(c.n)};r.rsa.encrypt=function(b,d,e){var g=e,k=Math.ceil(d.n.bitLength()/8);!1!==e&&!0!==e?(g=2===e,e=c(b,d,e)):(e=a.util.createBuffer(),e.putBytes(b));b=new l(e.toHex(),16);d=E(b,d,g).toString(16);g=a.util.createBuffer();for(k-=Math.ceil(d.length/2);0>1,pBits:b-(b>>1),pqState:0,num:null,keys:null},b.e.fromInt(b.eInt);else throw Error("Invalid key generation algorithm: "+d);return b};r.rsa.stepKeyPairGenerationState=function(a,b){"algorithm"in a||(a.algorithm="PRIMEINC");var c=new l(null);c.fromInt(30);for(var d=0,e=function(a,b){return a|b},g=+new Date,n,k=0;null===a.keys&& -(0>=b||kn?a.pqState=0:a.num.isProbablePrime(p(a.num.bitLength()))?++a.pqState:a.num.dAddOffset(u[d++%8],0):2===a.pqState?a.pqState=0===a.num.subtract(l.ONE).gcd(a.e).compareTo(l.ONE)?3:0:3===a.pqState&&(a.pqState=0,null===a.p?a.p=a.num:a.q=a.num, -null!==a.p&&null!==a.q&&++a.state,a.num=null)}else 1===a.state?(0>a.p.compareTo(a.q)&&(a.num=a.p,a.p=a.q,a.q=a.num),++a.state):2===a.state?(a.p1=a.p.subtract(l.ONE),a.q1=a.q.subtract(l.ONE),a.phi=a.p1.multiply(a.q1),++a.state):3===a.state?0===a.phi.gcd(a.e).compareTo(l.ONE)?++a.state:(a.p=null,a.q=null,a.state=0):4===a.state?(a.n=a.p.multiply(a.q),a.n.bitLength()===a.bits?++a.state:(a.q=null,a.state=0)):5===a.state&&(n=a.e.modInverse(a.phi),a.keys={privateKey:r.rsa.setPrivateKey(a.n,a.e,n,a.p,a.q, -n.mod(a.p1),n.mod(a.q1),a.q.modInverse(a.p)),publicKey:r.rsa.setPublicKey(a.n,a.e)});n=+new Date;k+=n-g;g=n}return null!==a.keys};r.rsa.generateKeyPair=function(a,b,c,d){1===arguments.length?"object"===typeof a?(c=a,a=void 0):"function"===typeof a&&(d=a,a=void 0):2===arguments.length?"number"===typeof a?"function"===typeof b?(d=b,b=void 0):"number"!==typeof b&&(c=b,b=void 0):(c=a,d=b,b=a=void 0):3===arguments.length&&("number"===typeof b?"function"===typeof c&&(d=c,c=void 0):(d=c,c=b,b=void 0));c= -c||{};void 0===a&&(a=c.bits||2048);void 0===b&&(b=c.e||65537);var g=r.rsa.createKeyPairGenerationState(a,b,c);if(!d)return r.rsa.stepKeyPairGenerationState(g,0),g.keys;e(g,c,d)};r.setRsaPublicKey=r.rsa.setPublicKey=function(b,e){var k={n:b,e:e,encrypt:function(b,d,e){"string"===typeof d?d=d.toUpperCase():void 0===d&&(d="RSAES-PKCS1-V1_5");if("RSAES-PKCS1-V1_5"===d)d={encode:function(a,b,d){return c(a,b,2).getBytes()}};else if("RSA-OAEP"===d||"RSAES-OAEP"===d)d={encode:function(b,c){return a.pkcs1.encode_rsa_oaep(c, -b,e)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(d))d={encode:function(a){return a}};else if("string"===typeof d)throw Error('Unsupported encryption scheme: "'+d+'".');b=d.encode(b,k,!0);return r.rsa.encrypt(b,k,!0)},verify:function(a,b,c){"string"===typeof c?c=c.toUpperCase():void 0===c&&(c="RSASSA-PKCS1-V1_5");if("RSASSA-PKCS1-V1_5"===c)c={verify:function(a,b){b=d(b,k,!0);var c=g.fromDer(b);return a===c.value[1].value}};else if("NONE"===c||"NULL"===c||null===c)c={verify:function(a,b){b=d(b, -k,!0);return a===b}};b=r.rsa.decrypt(b,k,!0,!1);return c.verify(a,b,k.n.bitLength())}};return k};r.setRsaPrivateKey=r.rsa.setPrivateKey=function(b,c,e,g,k,m,h,l){var p={n:b,e:c,d:e,p:g,q:k,dP:m,dQ:h,qInv:l,decrypt:function(b,c,e){"string"===typeof c?c=c.toUpperCase():void 0===c&&(c="RSAES-PKCS1-V1_5");b=r.rsa.decrypt(b,p,!1,!1);if("RSAES-PKCS1-V1_5"===c)c={decode:d};else if("RSA-OAEP"===c||"RSAES-OAEP"===c)c={decode:function(b,c){return a.pkcs1.decode_rsa_oaep(c,b,e)}};else if(-1!==["RAW","NONE", -"NULL",null].indexOf(c))c={decode:function(a){return a}};else throw Error('Unsupported encryption scheme: "'+c+'".');return c.decode(b,p,!1)},sign:function(a,b){var c=!1;"string"===typeof b&&(b=b.toUpperCase());if(void 0===b||"RSASSA-PKCS1-V1_5"===b)b={encode:G},c=1;else if("NONE"===b||"NULL"===b||null===b)b={encode:function(){return a}},c=1;var d=b.encode(a,p.n.bitLength());return r.rsa.encrypt(d,p,c)}};return p};r.wrapRsaPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0, -[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(r.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,g.toDer(a).getBytes())])};r.privateKeyFromAsn1=function(b){var c={},d=[];g.validate(b,D,c,d)&&(b=g.fromDer(a.util.createBuffer(c.privateKey)));c={};d=[];if(!g.validate(b,w,c,d))throw c=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."), -c.errors=d,c;var e,k,m,h,p,d=a.util.createBuffer(c.privateKeyModulus).toHex();b=a.util.createBuffer(c.privateKeyPublicExponent).toHex();e=a.util.createBuffer(c.privateKeyPrivateExponent).toHex();k=a.util.createBuffer(c.privateKeyPrime1).toHex();m=a.util.createBuffer(c.privateKeyPrime2).toHex();h=a.util.createBuffer(c.privateKeyExponent1).toHex();p=a.util.createBuffer(c.privateKeyExponent2).toHex();c=a.util.createBuffer(c.privateKeyCoefficient).toHex();return r.setRsaPrivateKey(new l(d,16),new l(b, -16),new l(e,16),new l(k,16),new l(m,16),new l(h,16),new l(p,16),new l(c,16))};r.privateKeyToAsn1=r.privateKeyToRSAPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.e)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.d)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.p)),g.create(g.Class.UNIVERSAL, -g.Type.INTEGER,!1,h(a.q)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.dP)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.dQ)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.qInv))])};r.publicKeyFromAsn1=function(b){var c={},d=[];if(g.validate(b,F,c,d)){d=g.derToOid(c.publicKeyOid);if(d!==r.oids.rsaEncryption)throw c=Error("Cannot read public key. Unknown OID."),c.oid=d,c;b=c.rsaPublicKey}d=[];if(!g.validate(b,y,c,d))throw c=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."), -c.errors=d,c;d=a.util.createBuffer(c.publicKeyModulus).toHex();c=a.util.createBuffer(c.publicKeyExponent).toHex();return r.setRsaPublicKey(new l(d,16),new l(c,16))};r.publicKeyToAsn1=r.publicKeyToSubjectPublicKeyInfo=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(r.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING, -!1,[r.publicKeyToRSAPublicKey(a)])])};r.publicKeyToRSAPublicKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.e))])}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var p,h=function(a,c){c.exports=function(c){var e=p.map(function(b){return a(b)}).concat(b);c=c|| -{};c.defined=c.defined||{};if(c.defined.rsa)return c.rsa;c.defined.rsa=!0;for(var m=0;me.compareTo(b);)e=e.add(c.p);b=e.subtract(b).multiply(c.qInv).mod(c.p).multiply(c.q).add(b);return b= +b.multiply(d.modInverse(c.n)).mod(c.n)};p.rsa.encrypt=function(b,d,e){var g=e,h=Math.ceil(d.n.bitLength()/8);!1!==e&&!0!==e?(g=2===e,e=c(b,d,e)):(e=a.util.createBuffer(),e.putBytes(b));b=new k(e.toHex(),16);d=D(b,d,g).toString(16);g=a.util.createBuffer();for(h-=Math.ceil(d.length/2);0>1,pBits:b-(b>>1),pqState:0,num:null,keys:null},b.e.fromInt(b.eInt);else throw Error("Invalid key generation algorithm: "+d);return b};p.rsa.stepKeyPairGenerationState=function(a,b){"algorithm"in a||(a.algorithm="PRIMEINC");var c=new k(null);c.fromInt(30);for(var d=0,e=function(a,b){return a|b},g=+new Date,n,h=0;null===a.keys&& +(0>=b||hn?a.pqState=0:a.num.isProbablePrime(q(a.num.bitLength()))?++a.pqState:a.num.dAddOffset(u[d++%8],0):2===a.pqState?a.pqState=0===a.num.subtract(k.ONE).gcd(a.e).compareTo(k.ONE)?3:0:3===a.pqState&&(a.pqState=0,null===a.p?a.p=a.num:a.q=a.num, +null!==a.p&&null!==a.q&&++a.state,a.num=null)}else 1===a.state?(0>a.p.compareTo(a.q)&&(a.num=a.p,a.p=a.q,a.q=a.num),++a.state):2===a.state?(a.p1=a.p.subtract(k.ONE),a.q1=a.q.subtract(k.ONE),a.phi=a.p1.multiply(a.q1),++a.state):3===a.state?0===a.phi.gcd(a.e).compareTo(k.ONE)?++a.state:(a.p=null,a.q=null,a.state=0):4===a.state?(a.n=a.p.multiply(a.q),a.n.bitLength()===a.bits?++a.state:(a.q=null,a.state=0)):5===a.state&&(n=a.e.modInverse(a.phi),a.keys={privateKey:p.rsa.setPrivateKey(a.n,a.e,n,a.p,a.q, +n.mod(a.p1),n.mod(a.q1),a.q.modInverse(a.p)),publicKey:p.rsa.setPublicKey(a.n,a.e)});n=+new Date;h+=n-g;g=n}return null!==a.keys};p.rsa.generateKeyPair=function(a,b,c,d){1===arguments.length?"object"===typeof a?(c=a,a=void 0):"function"===typeof a&&(d=a,a=void 0):2===arguments.length?"number"===typeof a?"function"===typeof b?(d=b,b=void 0):"number"!==typeof b&&(c=b,b=void 0):(c=a,d=b,b=a=void 0):3===arguments.length&&("number"===typeof b?"function"===typeof c&&(d=c,c=void 0):(d=c,c=b,b=void 0));c= +c||{};void 0===a&&(a=c.bits||2048);void 0===b&&(b=c.e||65537);var g=p.rsa.createKeyPairGenerationState(a,b,c);if(!d)return p.rsa.stepKeyPairGenerationState(g,0),g.keys;e(g,c,d)};p.setRsaPublicKey=p.rsa.setPublicKey=function(b,e){var h={n:b,e:e,encrypt:function(b,d,e){"string"===typeof d?d=d.toUpperCase():void 0===d&&(d="RSAES-PKCS1-V1_5");if("RSAES-PKCS1-V1_5"===d)d={encode:function(a,b,d){return c(a,b,2).getBytes()}};else if("RSA-OAEP"===d||"RSAES-OAEP"===d)d={encode:function(b,c){return a.pkcs1.encode_rsa_oaep(c, +b,e)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(d))d={encode:function(a){return a}};else if("string"===typeof d)throw Error('Unsupported encryption scheme: "'+d+'".');b=d.encode(b,h,!0);return p.rsa.encrypt(b,h,!0)},verify:function(a,b,c){"string"===typeof c?c=c.toUpperCase():void 0===c&&(c="RSASSA-PKCS1-V1_5");if("RSASSA-PKCS1-V1_5"===c)c={verify:function(a,b){b=d(b,h,!0);var c=g.fromDer(b);return a===c.value[1].value}};else if("NONE"===c||"NULL"===c||null===c)c={verify:function(a,b){b=d(b, +h,!0);return a===b}};b=p.rsa.decrypt(b,h,!0,!1);return c.verify(a,b,h.n.bitLength())}};return h};p.setRsaPrivateKey=p.rsa.setPrivateKey=function(b,c,e,g,h,k,m,l){var u={n:b,e:c,d:e,p:g,q:h,dP:k,dQ:m,qInv:l,decrypt:function(b,c,e){"string"===typeof c?c=c.toUpperCase():void 0===c&&(c="RSAES-PKCS1-V1_5");b=p.rsa.decrypt(b,u,!1,!1);if("RSAES-PKCS1-V1_5"===c)c={decode:d};else if("RSA-OAEP"===c||"RSAES-OAEP"===c)c={decode:function(b,c){return a.pkcs1.decode_rsa_oaep(c,b,e)}};else if(-1!==["RAW","NONE", +"NULL",null].indexOf(c))c={decode:function(a){return a}};else throw Error('Unsupported encryption scheme: "'+c+'".');return c.decode(b,u,!1)},sign:function(a,b){var c=!1;"string"===typeof b&&(b=b.toUpperCase());if(void 0===b||"RSASSA-PKCS1-V1_5"===b)b={encode:H},c=1;else if("NONE"===b||"NULL"===b||null===b)b={encode:function(){return a}},c=1;var d=b.encode(a,u.n.bitLength());return p.rsa.encrypt(d,u,c)}};return u};p.wrapRsaPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0, +[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(p.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,g.toDer(a).getBytes())])};p.privateKeyFromAsn1=function(b){var c={},d=[];g.validate(b,C,c,d)&&(b=g.fromDer(a.util.createBuffer(c.privateKey)));c={};d=[];if(!g.validate(b,x,c,d))throw c=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."), +c.errors=d,c;var e,h,m,l,u,d=a.util.createBuffer(c.privateKeyModulus).toHex();b=a.util.createBuffer(c.privateKeyPublicExponent).toHex();e=a.util.createBuffer(c.privateKeyPrivateExponent).toHex();h=a.util.createBuffer(c.privateKeyPrime1).toHex();m=a.util.createBuffer(c.privateKeyPrime2).toHex();l=a.util.createBuffer(c.privateKeyExponent1).toHex();u=a.util.createBuffer(c.privateKeyExponent2).toHex();c=a.util.createBuffer(c.privateKeyCoefficient).toHex();return p.setRsaPrivateKey(new k(d,16),new k(b, +16),new k(e,16),new k(h,16),new k(m,16),new k(l,16),new k(u,16),new k(c,16))};p.privateKeyToAsn1=p.privateKeyToRSAPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.e)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.d)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.p)),g.create(g.Class.UNIVERSAL, +g.Type.INTEGER,!1,l(a.q)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.dP)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.dQ)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.qInv))])};p.publicKeyFromAsn1=function(b){var c={},d=[];if(g.validate(b,F,c,d)){d=g.derToOid(c.publicKeyOid);if(d!==p.oids.rsaEncryption)throw c=Error("Cannot read public key. Unknown OID."),c.oid=d,c;b=c.rsaPublicKey}d=[];if(!g.validate(b,w,c,d))throw c=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."), +c.errors=d,c;d=a.util.createBuffer(c.publicKeyModulus).toHex();c=a.util.createBuffer(c.publicKeyExponent).toHex();return p.setRsaPublicKey(new k(d,16),new k(c,16))};p.publicKeyToAsn1=p.publicKeyToSubjectPublicKeyInfo=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(p.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING, +!1,[p.publicKeyToRSAPublicKey(a)])])};p.publicKeyToRSAPublicKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.e))])}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var l,p=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c|| +{};c.defined=c.defined||{};if(c.defined.rsa)return c.rsa;c.defined.rsa=!0;for(var m=0;m>=8,V+=I.at(h)+R.at(h),R.setAt(h,V&255);P.putBuffer(R)}v=P;p.putBuffer(z)}p.truncate(p.length()-g);return p};h.pbe.getCipher=function(a,b,c){switch(a){case h.oids.pkcs5PBES2:return h.pbe.getCipherForPBES2(a,b,c);case h.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case h.oids["pbewithSHAAnd40BitRC2-CBC"]:return h.pbe.getCipherForPKCS12PBE(a,b,c);default:throw b=Error("Cannot read encrypted PBE data block. Unsupported OID."),b.oid=a,b.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC", -"pbewithSHAAnd40BitRC2-CBC"],b;}};h.pbe.getCipherForPBES2=function(b,c,d){var m={};b=[];if(!e.validate(c,g,m,b)){var l=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");l.errors=b;throw l;}b=e.derToOid(m.kdfOid);if(b!==h.oids.pkcs5PBKDF2)throw l=Error("Cannot read encrypted private key. Unsupported key derivation function OID."),l.oid=b,l.supportedOids=["pkcs5PBKDF2"],l;b=e.derToOid(m.encOid);if(b!==h.oids["aes128-CBC"]&& -b!==h.oids["aes192-CBC"]&&b!==h.oids["aes256-CBC"]&&b!==h.oids["des-EDE3-CBC"]&&b!==h.oids.desCBC)throw l=Error("Cannot read encrypted private key. Unsupported encryption scheme OID."),l.oid=b,l.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],l;c=m.kdfSalt;var p=a.util.createBuffer(m.kdfIterationCount),p=p.getInt(p.length()<<3),E;switch(h.oids[b]){case "aes128-CBC":E=16;l=a.aes.createDecryptionCipher;break;case "aes192-CBC":E=24;l=a.aes.createDecryptionCipher;break; -case "aes256-CBC":E=32;l=a.aes.createDecryptionCipher;break;case "des-EDE3-CBC":E=24;l=a.des.createDecryptionCipher;break;case "desCBC":E=8,l=a.des.createDecryptionCipher}b=a.pkcs5.pbkdf2(d,c,p,E);m=m.encIv;l=l(b);l.start(m);return l};h.pbe.getCipherForPKCS12PBE=function(b,c,d){var g={},m=[];if(!e.validate(c,r,g,m))throw d=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=m,d;var m=a.util.createBuffer(g.salt),g=a.util.createBuffer(g.iterations), -g=g.getInt(g.length()<<3),l;switch(b){case h.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24;c=8;b=a.des.startDecrypting;break;case h.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5;c=8;b=function(b,c){var d=a.rc2.createDecryptionCipher(b,40);d.start(c,null);return d};break;default:throw d=Error("Cannot read PKCS #12 PBE data block. Unsupported OID."),d.oid=b,d;}l=h.pbe.generatePkcs12Key(d,m,1,g,l);d=h.pbe.generatePkcs12Key(d,m,2,g,c);return b(l,d)};h.pbe.opensslDeriveBytes=function(b,d,e,g){if("undefined"=== -typeof g||null===g)g=a.md.md5.create();null===d&&(d="");for(var k=[c(g,b+d)],h=16,l=1;h>=8,V+=B.at(m)+S.at(m),S.setAt(m,V&255);R.putBuffer(S)}p=R;q.putBuffer(z)}q.truncate(q.length()-g);return q};l.pbe.getCipher=function(a,b,c){switch(a){case l.oids.pkcs5PBES2:return l.pbe.getCipherForPBES2(a,b,c);case l.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case l.oids["pbewithSHAAnd40BitRC2-CBC"]:return l.pbe.getCipherForPKCS12PBE(a,b,c);default:throw b=Error("Cannot read encrypted PBE data block. Unsupported OID."),b.oid=a,b.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC", +"pbewithSHAAnd40BitRC2-CBC"],b;}};l.pbe.getCipherForPBES2=function(b,c,d){var k={};b=[];if(!e.validate(c,g,k,b)){var m=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");m.errors=b;throw m;}b=e.derToOid(k.kdfOid);if(b!==l.oids.pkcs5PBKDF2)throw m=Error("Cannot read encrypted private key. Unsupported key derivation function OID."),m.oid=b,m.supportedOids=["pkcs5PBKDF2"],m;b=e.derToOid(k.encOid);if(b!==l.oids["aes128-CBC"]&& +b!==l.oids["aes192-CBC"]&&b!==l.oids["aes256-CBC"]&&b!==l.oids["des-EDE3-CBC"]&&b!==l.oids.desCBC)throw m=Error("Cannot read encrypted private key. Unsupported encryption scheme OID."),m.oid=b,m.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],m;c=k.kdfSalt;var q=a.util.createBuffer(k.kdfIterationCount),q=q.getInt(q.length()<<3),p;switch(l.oids[b]){case "aes128-CBC":p=16;m=a.aes.createDecryptionCipher;break;case "aes192-CBC":p=24;m=a.aes.createDecryptionCipher;break; +case "aes256-CBC":p=32;m=a.aes.createDecryptionCipher;break;case "des-EDE3-CBC":p=24;m=a.des.createDecryptionCipher;break;case "desCBC":p=8,m=a.des.createDecryptionCipher}b=a.pkcs5.pbkdf2(d,c,q,p);k=k.encIv;m=m(b);m.start(k);return m};l.pbe.getCipherForPKCS12PBE=function(b,c,d){var g={},k=[];if(!e.validate(c,p,g,k))throw d=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=k,d;var k=a.util.createBuffer(g.salt),g=a.util.createBuffer(g.iterations), +g=g.getInt(g.length()<<3),m;switch(b){case l.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:m=24;c=8;b=a.des.startDecrypting;break;case l.oids["pbewithSHAAnd40BitRC2-CBC"]:m=5;c=8;b=function(b,c){var d=a.rc2.createDecryptionCipher(b,40);d.start(c,null);return d};break;default:throw d=Error("Cannot read PKCS #12 PBE data block. Unsupported OID."),d.oid=b,d;}m=l.pbe.generatePkcs12Key(d,k,1,g,m);d=l.pbe.generatePkcs12Key(d,k,2,g,c);return b(m,d)};l.pbe.opensslDeriveBytes=function(b,d,e,g){if("undefined"=== +typeof g||null===g)g=a.md.md5.create();null===d&&(d="");for(var h=[c(g,b+d)],k=16,l=1;k>8*y-w&255;G=String.fromCharCode(G.charCodeAt(0)&~w)+G.substr(1); -return G+r+String.fromCharCode(188)},verify:function(b,g,h){var m;m=h-1;h=Math.ceil(m/8);g=g.substr(-h);if(h>8*h-m&255;if(0!==(r.charCodeAt(0)&G))throw Error("Bits beyond keysize not zero as expected.");var E=d.generate(g,p),A="";for(m=0;m>8*w-p&255;H=String.fromCharCode(H.charCodeAt(0)&~p)+H.substr(1); +return H+F+String.fromCharCode(188)},verify:function(b,g,m){var l;l=m-1;m=Math.ceil(l/8);g=g.substr(-m);if(m>8*m-l&255;if(0!==(p.charCodeAt(0)&H))throw Error("Bits beyond keysize not zero as expected.");var D=d.generate(g,q),A="";for(l=0;ll.length)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime."); -q.validity.notBefore=l[0];q.validity.notAfter=l[1];q.tbsCertificate=h.tbsCertificate;if(d){q.md=null;if(q.signatureOid in u)switch(l=u[q.signatureOid],l){case "sha1WithRSAEncryption":q.md=a.md.sha1.create();break;case "md5WithRSAEncryption":q.md=a.md.md5.create();break;case "sha256WithRSAEncryption":q.md=a.md.sha256.create();break;case "sha512WithRSAEncryption":q.md=a.md.sha512.create();break;case "RSASSA-PSS":q.md=a.md.sha256.create()}if(null===q.md)throw h=Error("Could not compute certificate digest. Unknown signature OID."), -h.signatureOid=q.signatureOid,h;l=g.toDer(q.tbsCertificate);q.md.update(l.getBytes())}l=a.md.sha1.create();q.issuer.getField=function(a){return c(q.issuer,a)};q.issuer.addField=function(a){e([a]);q.issuer.attributes.push(a)};q.issuer.attributes=r.RDNAttributesAsArray(h.certIssuer,l);h.certIssuerUniqueId&&(q.issuer.uniqueId=h.certIssuerUniqueId);q.issuer.hash=l.digest().toHex();l=a.md.sha1.create();q.subject.getField=function(a){return c(q.subject,a)};q.subject.addField=function(a){e([a]);q.subject.attributes.push(a)}; -q.subject.attributes=r.RDNAttributesAsArray(h.certSubject,l);h.certSubjectUniqueId&&(q.subject.uniqueId=h.certSubjectUniqueId);q.subject.hash=l.digest().toHex();q.extensions=h.certExtensions?r.certificateExtensionsFromAsn1(h.certExtensions):[];q.publicKey=r.publicKeyFromAsn1(h.subjectPublicKeyInfo);return q};r.certificateExtensionsFromAsn1=function(a){for(var b=[],c=0;cl.length)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime."); +r.validity.notBefore=l[0];r.validity.notAfter=l[1];r.tbsCertificate=k.tbsCertificate;if(d){r.md=null;if(r.signatureOid in u)switch(l=u[r.signatureOid],l){case "sha1WithRSAEncryption":r.md=a.md.sha1.create();break;case "md5WithRSAEncryption":r.md=a.md.md5.create();break;case "sha256WithRSAEncryption":r.md=a.md.sha256.create();break;case "sha512WithRSAEncryption":r.md=a.md.sha512.create();break;case "RSASSA-PSS":r.md=a.md.sha256.create()}if(null===r.md)throw k=Error("Could not compute certificate digest. Unknown signature OID."), +k.signatureOid=r.signatureOid,k;l=g.toDer(r.tbsCertificate);r.md.update(l.getBytes())}l=a.md.sha1.create();r.issuer.getField=function(a){return c(r.issuer,a)};r.issuer.addField=function(a){e([a]);r.issuer.attributes.push(a)};r.issuer.attributes=p.RDNAttributesAsArray(k.certIssuer,l);k.certIssuerUniqueId&&(r.issuer.uniqueId=k.certIssuerUniqueId);r.issuer.hash=l.digest().toHex();l=a.md.sha1.create();r.subject.getField=function(a){return c(r.subject,a)};r.subject.addField=function(a){e([a]);r.subject.attributes.push(a)}; +r.subject.attributes=p.RDNAttributesAsArray(k.certSubject,l);k.certSubjectUniqueId&&(r.subject.uniqueId=k.certSubjectUniqueId);r.subject.hash=l.digest().toHex();r.extensions=k.certExtensions?p.certificateExtensionsFromAsn1(k.certExtensions):[];r.publicKey=p.publicKeyFromAsn1(k.subjectPublicKeyInfo);return r};p.certificateExtensionsFromAsn1=function(a){for(var b=[],c=0;cm.validity.notAfter)h={message:"Certificate is not valid yet or has expired.",error:r.certificateError.certificate_expired,notBefore:m.validity.notBefore,notAfter:m.validity.notAfter,now:g};if(null===h){p=c[0]||b.getIssuer(m);null===p&&m.isIssuer(m)&&(u=!0,p=m);if(p){var E=p;a.util.isArray(E)||(E=[E]);for(var w=!1;!w&&0k.pathLenConstraint&&(h={message:"Certificate basicConstraints pathLenConstraint violated.",error:r.certificateError.bad_certificate}));m=null===h?!0:h.error;k=d?d(m,l,e):m;if(!0===k)h=null;else{!0===m&&(h={message:"The application rejected the certificate.",error:r.certificateError.bad_certificate}); -if(k||0===k)"object"!==typeof k||a.util.isArray(k)?"string"===typeof k&&(h.error=k):(k.message&&(h.message=k.message),k.error&&(h.error=k.error));throw h;}k=!1;++l}while(0>1,k=h+(b.length&1),l=b.substr(0,k),k=b.substr(h,k);b=a.util.createBuffer();h=a.hmac.create();d=c+d;var m=Math.ceil(e/16);c=Math.ceil(e/20);h.start("MD5",l);l=a.util.createBuffer();b.putBytes(d); -for(var p=0;pd)b.error(b,{message:g?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});else{c=c.fragment;var k=c.length(),e={version:{major:c.getByte(),minor:c.getByte()},random:a.util.createBuffer(c.getBytes(32)),session_id:h(c,1),extensions:[]};g?(e.cipher_suite=c.getBytes(2),e.compression_method=c.getByte()):(e.cipher_suites=h(c,2),e.compression_methods= -h(c,1));k=d-(k-c.length());if(0c.version.minor)d=null,e="";0===e.length&&(e=a.random.getBytes(32));b.session.id=e;b.session.clientHelloVersion= -c.version;b.session.sp={};if(d)b.version=b.session.version=d.version,b.session.sp=d.sp;else{for(var g,e=1;ed)return b.error(b,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});d=h(c.fragment,3);var e,g;c=[];try{for(;0d)return b.error(b,{message:"Invalid key parameters. Only RSA is supported.", -send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});c=h(c.fragment,2).getBytes();d=null;if(b.getPrivateKey)try{d=b.getPrivateKey(b,b.session.serverCertificate),d=a.pki.privateKeyFromPem(d)}catch(e){b.error(b,{message:"Could not get private key.",cause:e,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}if(null===d)return b.error(b,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}); -try{var g=b.session.sp;g.pre_master_secret=d.decrypt(c);var k=b.session.clientHelloVersion;if(k.major!==g.pre_master_secret.charCodeAt(0)||k.minor!==g.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.");}catch(e){g.pre_master_secret=a.random.getBytes(48)}b.expect=C;null!==b.session.clientCertificate&&(b.expect=x);b.process()};l.handleCertificateRequest=function(a,b,c){if(3>c)return a.error(a,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal, -description:l.Alert.Description.illegal_parameter}});b=b.fragment;b={certificate_types:h(b,1),certificate_authorities:h(b,2)};a.session.certificateRequest=b;a.expect=D;a.process()};l.handleCertificateVerify=function(b,c,d){if(2>d)return b.error(b,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});d=c.fragment;d.read-=4;c=d.bytes();d.read+=4;d=h(d,2).getBytes();var e=a.util.createBuffer();e.putBuffer(b.session.md5.digest()); -e.putBuffer(b.session.sha1.digest());e=e.getBytes();try{if(!b.session.clientCertificate.publicKey.verify(e,d,"NONE"))throw Error("CertificateVerify signature does not match.");b.session.md5.update(c);b.session.sha1.update(c)}catch(g){return b.error(b,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure}})}b.expect=C;b.process()};l.handleServerHelloDone=function(b,c,d){if(0d.length())return b.fragmented=c,c.fragment=a.util.createBuffer(),d.read-=4,b.process();b.fragmented=null;d.read-=4;var h=d.bytes(g+ -4);d.read+=4;e in Z[b.entity][b.expect]?(b.entity!==l.ConnectionEnd.server||b.open||b.fail||(b.handshaking=!0,b.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),e!==l.HandshakeType.hello_request&&e!==l.HandshakeType.certificate_verify&&e!==l.HandshakeType.finished&&(b.session.md5.update(h),b.session.sha1.update(h)),Z[b.entity][b.expect][e](b,c,g)): -l.handleUnexpected(b,c)};l.handleApplicationData=function(a,b){a.data.putBuffer(b.fragment);a.dataReady(a);a.process()};l.handleHeartbeat=function(b,c){var d=c.fragment,e=d.getByte(),g=d.getInt16(),d=d.getBytes(g);if(e===l.HeartbeatMessageType.heartbeat_request){if(b.handshaking||g>d.length)return b.process();l.queue(b,l.createRecord(b,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_response,d)}));l.flush(b)}else if(e===l.HeartbeatMessageType.heartbeat_response){if(d!== -b.expectedHeartbeatPayload)return b.process();b.heartbeatReceived&&b.heartbeatReceived(b,a.util.createBuffer(d))}b.process()};var g=1,r=2,u=3,D=4,w=5,y=6,F=7,G=8,E=1,A=2,x=3,C=4,M=5,ba=6,q=l.handleUnexpected,T=l.handleChangeCipherSpec,U=l.handleAlert,S=l.handleHandshake,ca=l.handleApplicationData,P=l.handleHeartbeat,R=[];R[l.ConnectionEnd.client]=[[q,U,S,q,P],[q,U,S,q,P],[q,U,S,q,P],[q,U,S,q,P],[q,U,S,q,P],[T,U,q,q,P],[q,U,S,q,P],[q,U,S,ca,P],[q,U,S,q,P]];R[l.ConnectionEnd.server]=[[q,U,S,q,P],[q, -U,S,q,P],[q,U,S,q,P],[q,U,S,q,P],[T,U,q,q,P],[q,U,S,q,P],[q,U,S,ca,P],[q,U,S,q,P]];var T=l.handleHelloRequest,U=l.handleCertificate,S=l.handleServerKeyExchange,ca=l.handleCertificateRequest,P=l.handleServerHelloDone,V=l.handleFinished,Z=[];Z[l.ConnectionEnd.client]=[[q,q,l.handleServerHello,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[T,q,q,q,q,q,q,q,q,q,q,U,S,ca,P,q,q,q,q,q,q],[T,q,q,q,q,q,q,q,q,q,q,q,S,ca,P,q,q,q,q,q,q],[T,q,q,q,q,q,q,q,q,q,q,q,q,ca,P,q,q,q,q,q,q],[T,q,q,q,q,q,q,q,q,q,q,q,q,q,P,q,q,q, -q,q,q],[T,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[T,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,V],[T,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[T,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q]];Z[l.ConnectionEnd.server]=[[q,l.handleClientHello,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,U,q,q,q,q,q,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,l.handleClientKeyExchange,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,l.handleCertificateVerify,q,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[q,q, -q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,V],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q]];l.generateKeys=function(a,b){var d=b.client_random+b.server_random;a.session.resuming||(b.master_secret=c(b.pre_master_secret,"master secret",d,48).bytes(),b.pre_master_secret=null);var d=b.server_random+b.client_random,e=2*b.mac_key_length+2*b.enc_key_length,g=a.version.major===l.Versions.TLS_1_0.major&&a.version.minor===l.Versions.TLS_1_0.minor;g&&(e+=2*b.fixed_iv_length); -d=c(b.master_secret,"key expansion",d,e);e={client_write_MAC_key:d.getBytes(b.mac_key_length),server_write_MAC_key:d.getBytes(b.mac_key_length),client_write_key:d.getBytes(b.enc_key_length),server_write_key:d.getBytes(b.enc_key_length)};g&&(e.client_write_IV=d.getBytes(b.fixed_iv_length),e.server_write_IV=d.getBytes(b.fixed_iv_length));return e};l.createConnectionState=function(a){var b=a.entity===l.ConnectionEnd.client,c=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null, -cipherState:null,cipherFunction:function(a){return!0},compressionState:null,compressFunction:function(a){return!0},updateSequenceNumber:function(){4294967295===a.sequenceNumber[1]?(a.sequenceNumber[1]=0,++a.sequenceNumber[0]):++a.sequenceNumber[1]}};return a},g={read:c(),write:c()};g.read.update=function(a,b){g.read.cipherFunction(b,g.read)?g.read.compressFunction(a,b,g.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decompression_failure}}): -a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_record_mac}});return!a.fail};g.write.update=function(a,b){g.write.compressFunction(a,b,g.write)?g.write.cipherFunction(b,g.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}); -return!a.fail};if(a.session)switch(c=a.session.sp,a.session.cipherSuite.initSecurityParameters(c),c.keys=l.generateKeys(a,c),g.read.macKey=b?c.keys.server_write_MAC_key:c.keys.client_write_MAC_key,g.write.macKey=b?c.keys.client_write_MAC_key:c.keys.server_write_MAC_key,a.session.cipherSuite.initConnectionState(g,a,c),c.compression_algorithm){case l.CompressionMethod.none:break;case l.CompressionMethod.deflate:g.read.compressFunction=e;g.write.compressFunction=d;break;default:throw Error("Unsupported compression algorithm."); -}return g};l.createRandom=function(){var b=new Date,b=+b+6E4*b.getTimezoneOffset(),c=a.util.createBuffer();c.putInt32(b);c.putBytes(a.random.getBytes(28));return c};l.createRecord=function(a,b){return b.data?{type:b.type,version:{major:a.version.major,minor:a.version.minor},length:b.data.length(),fragment:b.data}:null};l.createAlert=function(b,c){var d=a.util.createBuffer();d.putByte(c.level);d.putByte(c.description);return l.createRecord(b,{type:l.ContentType.alert,data:d})};l.createClientHello= -function(b){b.session.clientHelloVersion={major:b.version.major,minor:b.version.minor};for(var c=a.util.createBuffer(),d=0;dl.MaxFragment;)d.push(l.createRecord(b,{type:c.type,data:a.util.createBuffer(e.slice(0,l.MaxFragment))})),e=e.slice(l.MaxFragment);0l.validity.notAfter)h={message:"Certificate is not valid yet or has expired.",error:p.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:g};if(null===h){u=c[0]||b.getIssuer(l);null===u&&l.isIssuer(l)&&(q=!0,u=l);if(u){var x=u;a.util.isArray(x)||(x=[x]);for(var w=!1;!w&&0k.pathLenConstraint&&(h={message:"Certificate basicConstraints pathLenConstraint violated.",error:p.certificateError.bad_certificate}));l=null===h?!0:h.error;k=d?d(l,m,e):l;if(!0===k)h=null;else{!0===l&&(h={message:"The application rejected the certificate.",error:p.certificateError.bad_certificate}); +if(k||0===k)"object"!==typeof k||a.util.isArray(k)?"string"===typeof k&&(h.error=k):(k.message&&(h.message=k.message),k.error&&(h.error=k.error));throw h;}k=!1;++m}while(0>1,h=k+(b.length&1),l=b.substr(0,h),h=b.substr(k,h);b=a.util.createBuffer();k=a.hmac.create();d=c+d;var m=Math.ceil(e/16);c=Math.ceil(e/20);k.start("MD5",l);l=a.util.createBuffer();b.putBytes(d); +for(var p=0;pd)b.error(b,{message:g?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});else{c=c.fragment;var h=c.length(),e={version:{major:c.getByte(),minor:c.getByte()},random:a.util.createBuffer(c.getBytes(32)),session_id:l(c,1),extensions:[]};g?(e.cipher_suite=c.getBytes(2),e.compression_method=c.getByte()):(e.cipher_suites=l(c,2),e.compression_methods= +l(c,1));h=d-(h-c.length());if(0c.version.minor)d=null,e="";0===e.length&&(e=a.random.getBytes(32));b.session.id=e;b.session.clientHelloVersion= +c.version;b.session.sp={};if(d)b.version=b.session.version=d.version,b.session.sp=d.sp;else{for(var g,e=1;ed)return b.error(b,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});d=l(c.fragment,3);var e,g;c=[];try{for(;0d)return b.error(b,{message:"Invalid key parameters. Only RSA is supported.", +send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.unsupported_certificate}});c=l(c.fragment,2).getBytes();d=null;if(b.getPrivateKey)try{d=b.getPrivateKey(b,b.session.serverCertificate),d=a.pki.privateKeyFromPem(d)}catch(e){b.error(b,{message:"Could not get private key.",cause:e,send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}})}if(null===d)return b.error(b,{message:"No private key set.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}}); +try{var g=b.session.sp;g.pre_master_secret=d.decrypt(c);var h=b.session.clientHelloVersion;if(h.major!==g.pre_master_secret.charCodeAt(0)||h.minor!==g.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.");}catch(e){g.pre_master_secret=a.random.getBytes(48)}b.expect=E;null!==b.session.clientCertificate&&(b.expect=y);b.process()};k.handleCertificateRequest=function(a,b,c){if(3>c)return a.error(a,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal, +description:k.Alert.Description.illegal_parameter}});b=b.fragment;b={certificate_types:l(b,1),certificate_authorities:l(b,2)};a.session.certificateRequest=b;a.expect=C;a.process()};k.handleCertificateVerify=function(b,c,d){if(2>d)return b.error(b,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});d=c.fragment;d.read-=4;c=d.bytes();d.read+=4;d=l(d,2).getBytes();var e=a.util.createBuffer();e.putBuffer(b.session.md5.digest()); +e.putBuffer(b.session.sha1.digest());e=e.getBytes();try{if(!b.session.clientCertificate.publicKey.verify(e,d,"NONE"))throw Error("CertificateVerify signature does not match.");b.session.md5.update(c);b.session.sha1.update(c)}catch(g){return b.error(b,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.handshake_failure}})}b.expect=E;b.process()};k.handleServerHelloDone=function(b,c,d){if(0d.length())return b.fragmented=c,c.fragment=a.util.createBuffer(),d.read-=4,b.process();b.fragmented=null;d.read-=4;var h=d.bytes(g+ +4);d.read+=4;e in Z[b.entity][b.expect]?(b.entity!==k.ConnectionEnd.server||b.open||b.fail||(b.handshaking=!0,b.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),e!==k.HandshakeType.hello_request&&e!==k.HandshakeType.certificate_verify&&e!==k.HandshakeType.finished&&(b.session.md5.update(h),b.session.sha1.update(h)),Z[b.entity][b.expect][e](b,c,g)): +k.handleUnexpected(b,c)};k.handleApplicationData=function(a,b){a.data.putBuffer(b.fragment);a.dataReady(a);a.process()};k.handleHeartbeat=function(b,c){var d=c.fragment,e=d.getByte(),g=d.getInt16(),d=d.getBytes(g);if(e===k.HeartbeatMessageType.heartbeat_request){if(b.handshaking||g>d.length)return b.process();k.queue(b,k.createRecord(b,{type:k.ContentType.heartbeat,data:k.createHeartbeat(k.HeartbeatMessageType.heartbeat_response,d)}));k.flush(b)}else if(e===k.HeartbeatMessageType.heartbeat_response){if(d!== +b.expectedHeartbeatPayload)return b.process();b.heartbeatReceived&&b.heartbeatReceived(b,a.util.createBuffer(d))}b.process()};var g=1,q=2,u=3,C=4,x=5,w=6,F=7,H=8,D=1,A=2,y=3,E=4,L=5,U=6,r=k.handleUnexpected,P=k.handleChangeCipherSpec,T=k.handleAlert,M=k.handleHandshake,ba=k.handleApplicationData,R=k.handleHeartbeat,S=[];S[k.ConnectionEnd.client]=[[r,T,M,r,R],[r,T,M,r,R],[r,T,M,r,R],[r,T,M,r,R],[r,T,M,r,R],[P,T,r,r,R],[r,T,M,r,R],[r,T,M,ba,R],[r,T,M,r,R]];S[k.ConnectionEnd.server]=[[r,T,M,r,R],[r, +T,M,r,R],[r,T,M,r,R],[r,T,M,r,R],[P,T,r,r,R],[r,T,M,r,R],[r,T,M,ba,R],[r,T,M,r,R]];var P=k.handleHelloRequest,T=k.handleCertificate,M=k.handleServerKeyExchange,ba=k.handleCertificateRequest,R=k.handleServerHelloDone,V=k.handleFinished,Z=[];Z[k.ConnectionEnd.client]=[[r,r,k.handleServerHello,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[P,r,r,r,r,r,r,r,r,r,r,T,M,ba,R,r,r,r,r,r,r],[P,r,r,r,r,r,r,r,r,r,r,r,M,ba,R,r,r,r,r,r,r],[P,r,r,r,r,r,r,r,r,r,r,r,r,ba,R,r,r,r,r,r,r],[P,r,r,r,r,r,r,r,r,r,r,r,r,r,R,r,r,r, +r,r,r],[P,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[P,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,V],[P,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[P,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r]];Z[k.ConnectionEnd.server]=[[r,k.handleClientHello,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,T,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,k.handleClientKeyExchange,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,k.handleCertificateVerify,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r, +r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,V],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r]];k.generateKeys=function(a,b){var d=b.client_random+b.server_random;a.session.resuming||(b.master_secret=c(b.pre_master_secret,"master secret",d,48).bytes(),b.pre_master_secret=null);var d=b.server_random+b.client_random,e=2*b.mac_key_length+2*b.enc_key_length,g=a.version.major===k.Versions.TLS_1_0.major&&a.version.minor===k.Versions.TLS_1_0.minor;g&&(e+=2*b.fixed_iv_length); +d=c(b.master_secret,"key expansion",d,e);e={client_write_MAC_key:d.getBytes(b.mac_key_length),server_write_MAC_key:d.getBytes(b.mac_key_length),client_write_key:d.getBytes(b.enc_key_length),server_write_key:d.getBytes(b.enc_key_length)};g&&(e.client_write_IV=d.getBytes(b.fixed_iv_length),e.server_write_IV=d.getBytes(b.fixed_iv_length));return e};k.createConnectionState=function(a){var b=a.entity===k.ConnectionEnd.client,c=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null, +cipherState:null,cipherFunction:function(a){return!0},compressionState:null,compressFunction:function(a){return!0},updateSequenceNumber:function(){4294967295===a.sequenceNumber[1]?(a.sequenceNumber[1]=0,++a.sequenceNumber[0]):++a.sequenceNumber[1]}};return a},g={read:c(),write:c()};g.read.update=function(a,b){g.read.cipherFunction(b,g.read)?g.read.compressFunction(a,b,g.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.decompression_failure}}): +a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.bad_record_mac}});return!a.fail};g.write.update=function(a,b){g.write.compressFunction(a,b,g.write)?g.write.cipherFunction(b,g.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}}); +return!a.fail};if(a.session)switch(c=a.session.sp,a.session.cipherSuite.initSecurityParameters(c),c.keys=k.generateKeys(a,c),g.read.macKey=b?c.keys.server_write_MAC_key:c.keys.client_write_MAC_key,g.write.macKey=b?c.keys.client_write_MAC_key:c.keys.server_write_MAC_key,a.session.cipherSuite.initConnectionState(g,a,c),c.compression_algorithm){case k.CompressionMethod.none:break;case k.CompressionMethod.deflate:g.read.compressFunction=e;g.write.compressFunction=d;break;default:throw Error("Unsupported compression algorithm."); +}return g};k.createRandom=function(){var b=new Date,b=+b+6E4*b.getTimezoneOffset(),c=a.util.createBuffer();c.putInt32(b);c.putBytes(a.random.getBytes(28));return c};k.createRecord=function(a,b){return b.data?{type:b.type,version:{major:a.version.major,minor:a.version.minor},length:b.data.length(),fragment:b.data}:null};k.createAlert=function(b,c){var d=a.util.createBuffer();d.putByte(c.level);d.putByte(c.description);return k.createRecord(b,{type:k.ContentType.alert,data:d})};k.createClientHello= +function(b){b.session.clientHelloVersion={major:b.version.major,minor:b.version.minor};for(var c=a.util.createBuffer(),d=0;dk.MaxFragment;)d.push(k.createRecord(b,{type:c.type,data:a.util.createBuffer(e.slice(0,k.MaxFragment))})),e=e.slice(k.MaxFragment);0d?c=5-d:(h.record={type:b.getByte(),version:{major:b.getByte(),minor:b.getByte()},length:b.getInt16(),fragment:a.util.createBuffer(),ready:!1},(b=h.record.version.major===h.version.major)&&h.session&&h.session.version&&(b=h.record.version.minor===h.version.minor),b||h.error(h,{message:"Incompatible TLS version.",send:!0, -alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}}))}if(!h.fail&&null!==h.record&&!h.record.ready){c=h;b=0;var d=c.input,e=d.length();e=l.Versions.TLS_1_1.minor&&m.output.putBytes(h);m.update(b.fragment);m.finish(e)&&(b.fragment=m.output,b.length=b.fragment.length(),g=!0);return g}function e(a,b,c){c||(a-=b.length()%a,b.fillWithByte(a-1,a));return!0}function h(a,b,c){a=!0;if(c){c=b.length();for(var d=b.last(),e=c-1- -d;e=k?(b.fragment=e.output.getBytes(r-k),m=e.output.getBytes(k)):b.fragment=e.output.getBytes();b.fragment=a.util.createBuffer(b.fragment);b.length= -b.fragment.length();k=c.macFunction(c.macKey,c.sequenceNumber,b);c.updateSequenceNumber();e=c.macKey;r=a.hmac.create();r.start("SHA1",e);r.update(m);m=r.digest().getBytes();r.start(null,null);r.update(k);k=r.digest().getBytes();return m===k&&d}var l=a.tls;l.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=l.BulkCipherAlgorithm.aes;a.cipher_type=l.CipherType.block;a.enc_key_length=16;a.block_length=16; -a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=l.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length=20},initConnectionState:c};l.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=l.BulkCipherAlgorithm.aes;a.cipher_type=l.CipherType.block;a.enc_key_length=32;a.block_length=16;a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=l.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length= -20},initConnectionState:c};var g=0}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var p,h=function(a,c){c.exports=function(c){var e=p.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.aesCipherSuites)return c.aesCipherSuites;c.defined.aesCipherSuites=!0;for(var h=0;h=k.Versions.TLS_1_1.minor&&m.output.putBytes(l);m.update(b.fragment);m.finish(e)&&(b.fragment=m.output,b.length=b.fragment.length(),g=!0);return g}function e(a,b,c){c||(a-=b.length()%a,b.fillWithByte(a-1,a));return!0}function l(a,b,c){a=!0;if(c){c=b.length();for(var d=b.last(),e=c-1- +d;e=h?(b.fragment=e.output.getBytes(q-h),m=e.output.getBytes(h)):b.fragment=e.output.getBytes();b.fragment=a.util.createBuffer(b.fragment);b.length= +b.fragment.length();h=c.macFunction(c.macKey,c.sequenceNumber,b);c.updateSequenceNumber();e=c.macKey;q=a.hmac.create();q.start("SHA1",e);q.update(m);m=q.digest().getBytes();q.start(null,null);q.update(h);h=q.digest().getBytes();return m===h&&d}var k=a.tls;k.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=k.BulkCipherAlgorithm.aes;a.cipher_type=k.CipherType.block;a.enc_key_length=16;a.block_length=16; +a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=k.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length=20},initConnectionState:c};k.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=k.BulkCipherAlgorithm.aes;a.cipher_type=k.CipherType.block;a.enc_key_length=32;a.block_length=16;a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=k.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length= +20},initConnectionState:c};var g=0}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var l,p=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.aesCipherSuites)return c.aesCipherSuites;c.defined.aesCipherSuites=!0;for(var m=0;m=c&&eb.contentInfo.value.length)throw Error("Could not sign PKCS#7 message; there is no content to sign.");var g=u.derToOid(b.contentInfo.value[0].value),d=b.contentInfo.value[1],d=d.value[0],k=u.toDer(d);k.getByte();u.getBerValueLength(k);var k=k.getBytes(),l;for(l in c)c[l].start().update(k);l=new Date;for(d=0;db.contentInfo.value.length)throw Error("Could not sign PKCS#7 message; there is no content to sign.");var g=u.derToOid(b.contentInfo.value[0].value),d=b.contentInfo.value[1],d=d.value[0],h=u.toDer(d);h.getByte();u.getBerValueLength(h);var h=h.getBytes(),k;for(k in c)c[k].start().update(h);k=new Date;for(d=0;db.length)return console.error("Invalid script length"),null;if(612182341!=ReadInt(b,0))return console.error("Invalid binary script"),null;if(1k){for(;1n;n++)c.push(a.getVar(r[n]));var B; -try{if(1E4>b)switch(b){case 0:break;case 1:if(c[2]){if("<"==c[2]&&c[1]="==c[2]&&c[1]>=c[3]||">"==c[2]&&c[1]>c[3])a.ip=c[0]}else a.ip=c[0];break;case 2:void 0==r[1]?delete a.variables[r[0]]:a.setVar(r[0],c[1]);break;case 3:if(a.onConsole)a.onConsole(a.toString(c[0]),a);else console.log(a.toString(c[0]));break;case 4:a.state=2;a.dialog=!0;setDialogMode(11,c[0],c[2],a.xxStepDialogOk,c[1],a);break;case 5:for(n in c[1])c[1][n][c[2]]== +a.timer=null;a.stepspeed=0};a.getVar=function(b){return void 0==b?void 0:a.getVarEx(b.split("."),a.variables)};a.getVarEx=function(b,c){try{return void 0==b?void 0:0==b.length?c:a.getVarEx(b.slice(1),c[b[0]])}catch(l){return null}};a.setVar=function(b,c){a.setVarEx(b.split("."),a.variables,c)};a.setVarEx=function(b,c,l){1==b.length?c[b[0]]=l:a.setVarEx(b.slice(1),c[b[0]],l)};a.step=function(){if(1==a.state){if(a.iph){for(;1n;n++)c.push(a.getVar(q[n]));var B; +try{if(1E4>b)switch(b){case 0:break;case 1:if(c[2]){if("<"==c[2]&&c[1]="==c[2]&&c[1]>=c[3]||">"==c[2]&&c[1]>c[3])a.ip=c[0]}else a.ip=c[0];break;case 2:void 0==q[1]?delete a.variables[q[0]]:a.setVar(q[0],c[1]);break;case 3:if(a.onConsole)a.onConsole(a.toString(c[0]),a);else console.log(a.toString(c[0]));break;case 4:a.state=2;a.dialog=!0;setDialogMode(11,c[0],c[2],a.xxStepDialogOk,c[1],a);break;case 5:for(n in c[1])c[1][n][c[2]]== c[3]&&(B=n);break;case 6:B=c[1].substr(c[2],c[3]);break;case 7:B=c[1].indexOf(c[2]);break;case 8:B=c[1].split(c[2]);break;case 9:B=c[1].join(c[2]);break;case 10:B=c[1].length;break;case 11:B=JSON.parse(c[1]);break;case 12:B=JSON.stringify(c[1]);break;case 13:B=c[1]+c[2];break;case 14:B=c[1]-c[2];break;case 15:B=parseInt(c[1]);break;case 16:a.state=2;a.amtstack.BatchEnum(c[0],c[1],a.xxWsmanReturn,a);break;case 17:a.state=2;a.amtstack.Put(c[0],c[1],a.xxWsmanReturn,a);break;case 18:a.state=2;a.amtstack.Create(c[0], c[1],a.xxWsmanReturn,a);break;case 19:a.state=2;a.amtstack.Delete(c[0],c[1],a.xxWsmanReturn,a);break;case 20:a.state=2;a.amtstack.Exec(c[0],c[1],c[2],a.xxWsmanReturn,a,0,c[3]);break;case 21:a.stepspeed=c[0];null!=a.timer&&(clearInterval(a.timer),a.timer=setInterval(function(){a.step()},a.stepspeed));break;case 22:a.state=2;a.amtstack.Subscribe(c[0],c[1],c[2],a.xxWsmanReturn,a,0,c[3],c[4],c[5],c[6]);break;case 23:a.state=2;a.amtstack.UnSubscribe(c[0],a.xxWsmanReturn,a,0,c[1]);break;case 24:console.log(c[1], -c[2],c[1].charCodeAt(c[2]));B=c[1].charCodeAt(c[2]);break;case 25:a.state=2;amtcert_signWithCaKey(c[0],null,c[1],{CN:"Untrusted Root Certificate"},a.xxSignWithDummyCaReturn);break;default:a.state=9,console.error("Script Error, unknown command: "+b)}else 2E4>b?B=script_functionTableX2[b-1E4](c[1],c[2],c[3],c[4],c[5],c[6]):script_functionTableX3&&script_functionTableX3[b-2E4]&&(B=script_functionTableX3[b-2E4](a,c[1],c[2],c[3],c[4],c[5],c[6]));void 0!=B&&a.setVar(r[0],B)}catch(l){"object"==typeof l&& -(l=l.message),a.setVar("_exception",l)}}1==a.state&&a.ip>=a.script.length&&(a.state=0,a.stop());if(a.onStep)a.onStep(a);return a}};a.xxStepDialogOk=function(b){a.variables.DialogSelect=b;a.state=1;a.dialog=!1;if(a.onStep)a.onStep(a)};a.xxWsmanReturn=function(b,c,p,h){a.setVar(c,p);a.setVar("wsman_result",h);a.setVar("wsman_result_str",httpErrorTable[h]?httpErrorTable[h]:"Error #"+h);a.state=1;if(a.onStep)a.onStep(a)};a.xxSignWithDummyCaReturn=function(b){a.setVar("signed_cert",btoa(_arrayBufferToString(b))); +c[2],c[1].charCodeAt(c[2]));B=c[1].charCodeAt(c[2]);break;case 25:a.state=2;amtcert_signWithCaKey(c[0],null,c[1],{CN:"Untrusted Root Certificate"},a.xxSignWithDummyCaReturn);break;default:a.state=9,console.error("Script Error, unknown command: "+b)}else 2E4>b?B=script_functionTableX2[b-1E4](c[1],c[2],c[3],c[4],c[5],c[6]):script_functionTableX3&&script_functionTableX3[b-2E4]&&(B=script_functionTableX3[b-2E4](a,c[1],c[2],c[3],c[4],c[5],c[6]));void 0!=B&&a.setVar(q[0],B)}catch(k){"object"==typeof k&& +(k=k.message),a.setVar("_exception",k)}}1==a.state&&a.ip>=a.script.length&&(a.state=0,a.stop());if(a.onStep)a.onStep(a);return a}};a.xxStepDialogOk=function(b){a.variables.DialogSelect=b;a.state=1;a.dialog=!1;if(a.onStep)a.onStep(a)};a.xxWsmanReturn=function(b,c,l,p){a.setVar(c,l);a.setVar("wsman_result",p);a.setVar("wsman_result_str",httpErrorTable[p]?httpErrorTable[p]:"Error #"+p);a.state=1;if(a.onStep)a.onStep(a)};a.xxSignWithDummyCaReturn=function(b){a.setVar("signed_cert",btoa(_arrayBufferToString(b))); a.state=1;if(a.onStep)a.onStep(a)};a.toString=function(a){return"object"==typeof a?JSON.stringify(a):a};a.reset();return a} -function script_compile(b,c){var a="",d=b.split("\n"),e={},p=[],h=[],r;for(r in d){var n=d[r];if(n.startsWith("##SWAP ")){var m=n.split(" ");3==m.length&&(h[m[1]]=m[2])}if("#"!=n[0]&&0!=n.length){for(m in h)n=n.split(m).join(h[m]);var z=n.match(/"[^"]*"|[^\s"]+/g);if(0!=z.length)if(":"==n[0])e[z[0].toUpperCase()]=a.length;else{n=script_functionTable1.indexOf(z[0].toLowerCase());-1==n&&(n=script_functionTable2.indexOf(z[0].toLowerCase()),0<=n&&(n+=1E4));-1==n&&(n=script_functionTable3.indexOf(z[0].toLowerCase()), -0<=n&&(n+=2E4));if(-1==n)return c&&c("Unabled to compile, unknown command: "+z[0]),"";var k=ShortToStr(z.length-1),v;for(v in z)if(0!=v)if(":"==z[v][0])p.push([z[v],a.length+k.length+7]),k+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295);else var B=parseInt(z[v]),k=B==z[v]?k+(ShortToStr(5)+String.fromCharCode(2)+IntToStr(B)):'"'==z[v][0]&&'"'==z[v][z[v].length-1]?k+(ShortToStr(z[v].length-1)+String.fromCharCode(1)+z[v].substring(1,z[v].length-1)):k+(ShortToStr(z[v].length+1)+String.fromCharCode(0)+ -z[v]);k=ShortToStr(n)+ShortToStr(k.length+4)+k;a+=k}}}for(r in p){d=p[r][0].toUpperCase();h=p[r][1];m=e[d];if(void 0==m)return c&&c("Unabled to compile, unknown label: "+d),"";a=a.substr(0,h)+IntToStr(m)+a.substr(h+4)}return IntToStr(612182341)+ShortToStr(1)+a} -function script_decompile(b,c){var a="",d=6,e={};if(0<=c)d=c;else{if(6>b.length)return"# Invalid script length";var p=ReadInt(b,0),h=ReadShort(b,4);if(612182341!=p)return"# Invalid binary script: "+p;if(1!=h)return"# Invalid script version"}for(;dp?a+(script_functionTable1[p]+m+"\n"):2E4<=p?a+(script_functionTable3[p-2E4]+m+"\n"):a+(script_functionTable2[p-1E4]+m+"\n");d+=h;if(0<=c)return a}d=a.split("\n");a="";for(z in d)p=d[z],":"!=p[0]?a+=p+"\n":e[p]&&(a+=p+"\n");return a} -var CreateAmtRemoteDesktop=function(b,c){function a(a,b,c,l,m,n,x,u){var B=a.charCodeAt(b++);u={};var D=0,q=0;if(0==B){if(2==g.bpp)for(m=0;m>8&248)+","+(B>>3&252)+","+((B&31)<<3))+")",a=z(c,l),l=k(c,l),g.canvas.fillRect(a,l,m,n);else if(1 -B){n=4;q=15;if(2==g.bpp){for(m=0;m=B&&(n=2,q=3);for(;D>m&q],D++)}else{for(m=0;m=B&&(n=2,q=3);for(;D>m&q],D++)}d(g.spare,c,l)}else if(128==B){if(2==g.bpp)for(;D>8&248;g.spare.data[c+1]=a>>3&252;g.spare.data[c+2]=(a&31)<<3}function h(a,b,c){b<<=2;var d=a&224,e=(a&28)<<3;for(a=v((a&3)<<6);0<=--c;)g.spare.data[b]=d,g.spare.data[b+1]=e,g.spare.data[b+2]=a,b+=4}function r(a,b,c){b<<=2;var d=a>>8&248,e=a>>3&252;for(a=(a&31)<<3;0<=--c;)g.spare.data[b]=d,g.spare.data[b+1]=e,g.spare.data[b+2]=a,b+=4}function n(a,b){return 0==g.rotation? -a:1==g.rotation?b:2==g.rotation?g.canvas.canvas.width-a:3==g.rotation?g.canvas.canvas.height-b:0}function m(a,b){return 0==g.rotation?b:1==g.rotation?g.canvas.canvas.width-a:2==g.rotation?g.canvas.canvas.height-b:3==g.rotation?a:0}function z(a,b){return 0==g.rotation||1==g.rotation?a:2==g.rotation?a-g.canvas.canvas.width:3==g.rotation?a-g.canvas.canvas.height:0}function k(a,b){return 0==g.rotation?b:1==g.rotation?b-g.canvas.canvas.width:2==g.rotation?b-g.canvas.canvas.height:3==g.rotation?b:0}function v(a){return 127< -a?a+32:a}function B(){1!=g.holding&&g.Send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(g.rwidth)+ShortToStr(g.rheight))}function l(a,b){b||(b=window.event);if(b.code){var c;c=b;c=c.code.startsWith("Key")&&4==c.code.length?c.code.charCodeAt(3)+(0==c.shiftKey?32:0):c.code.startsWith("Digit")&&6==c.code.length?c.code.charCodeAt(5):c.code.startsWith("Numpad")&&7==c.code.length?c.code.charCodeAt(6):I[c.code];null!=c&&g.sendkey(c,a)}else{c=b.keyCode;173==c&&(c=189);61==c&&(c=187);var d=c;0==b.shiftKey&& +function script_compile(b,c){var a="",d=b.split("\n"),e={},l=[],p=[],q;for(q in d){var n=d[q];if(n.startsWith("##SWAP ")){var m=n.split(" ");3==m.length&&(p[m[1]]=m[2])}if("#"!=n[0]&&0!=n.length){for(m in p)n=n.split(m).join(p[m]);var v=n.match(/"[^"]*"|[^\s"]+/g);if(0!=v.length)if(":"==n[0])e[v[0].toUpperCase()]=a.length;else{n=script_functionTable1.indexOf(v[0].toLowerCase());-1==n&&(n=script_functionTable2.indexOf(v[0].toLowerCase()),0<=n&&(n+=1E4));-1==n&&(n=script_functionTable3.indexOf(v[0].toLowerCase()), +0<=n&&(n+=2E4));if(-1==n)return c&&c("Unabled to compile, unknown command: "+v[0]),"";var h=ShortToStr(v.length-1),z;for(z in v)if(0!=z)if(":"==v[z][0])l.push([v[z],a.length+h.length+7]),h+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295);else var B=parseInt(v[z]),h=B==v[z]?h+(ShortToStr(5)+String.fromCharCode(2)+IntToStr(B)):'"'==v[z][0]&&'"'==v[z][v[z].length-1]?h+(ShortToStr(v[z].length-1)+String.fromCharCode(1)+v[z].substring(1,v[z].length-1)):h+(ShortToStr(v[z].length+1)+String.fromCharCode(0)+ +v[z]);h=ShortToStr(n)+ShortToStr(h.length+4)+h;a+=h}}}for(q in l){d=l[q][0].toUpperCase();p=l[q][1];m=e[d];if(void 0==m)return c&&c("Unabled to compile, unknown label: "+d),"";a=a.substr(0,p)+IntToStr(m)+a.substr(p+4)}return IntToStr(612182341)+ShortToStr(1)+a} +function script_decompile(b,c){var a="",d=6,e={};if(0<=c)d=c;else{if(6>b.length)return"# Invalid script length";var l=ReadInt(b,0),p=ReadShort(b,4);if(612182341!=l)return"# Invalid binary script: "+l;if(1!=p)return"# Invalid script version"}for(;dl?a+(script_functionTable1[l]+m+"\n"):2E4<=l?a+(script_functionTable3[l-2E4]+m+"\n"):a+(script_functionTable2[l-1E4]+m+"\n");d+=p;if(0<=c)return a}d=a.split("\n");a="";for(v in d)l=d[v],":"!=l[0]?a+=l+"\n":e[l]&&(a+=l+"\n");return a} +var CreateAmtRemoteDesktop=function(b,c){function a(a,b,c,k,m,n,y,u){var B=a.charCodeAt(b++);u={};var C=0,r=0;if(0==B){if(2==g.bpp)for(m=0;m>8&248)+","+(B>>3&252)+","+((B&31)<<3))+")",a=v(c,k),k=h(c,k),g.canvas.fillRect(a,k,m,n);else if(1 +B){n=4;r=15;if(2==g.bpp){for(m=0;m=B&&(n=2,r=3);for(;C>m&r],C++)}else{for(m=0;m=B&&(n=2,r=3);for(;C>m&r],C++)}d(g.spare,c,k)}else if(128==B){if(2==g.bpp)for(;C>8&248;g.spare.data[c+1]=a>>3&252;g.spare.data[c+2]=(a&31)<<3}function p(a,b,c){b<<=2;var d=a&224,e=(a&28)<<3;for(a=z((a&3)<<6);0<=--c;)g.spare.data[b]=d,g.spare.data[b+1]=e,g.spare.data[b+2]=a,b+=4}function q(a,b,c){b<<=2;var d=a>>8&248,e=a>>3&252;for(a=(a&31)<<3;0<=--c;)g.spare.data[b]=d,g.spare.data[b+1]=e,g.spare.data[b+2]=a,b+=4}function n(a,b){return 0==g.rotation? +a:1==g.rotation?b:2==g.rotation?g.canvas.canvas.width-a:3==g.rotation?g.canvas.canvas.height-b:0}function m(a,b){return 0==g.rotation?b:1==g.rotation?g.canvas.canvas.width-a:2==g.rotation?g.canvas.canvas.height-b:3==g.rotation?a:0}function v(a,b){return 0==g.rotation||1==g.rotation?a:2==g.rotation?a-g.canvas.canvas.width:3==g.rotation?a-g.canvas.canvas.height:0}function h(a,b){return 0==g.rotation?b:1==g.rotation?b-g.canvas.canvas.width:2==g.rotation?b-g.canvas.canvas.height:3==g.rotation?b:0}function z(a){return 127< +a?a+32:a}function B(){1!=g.holding&&g.Send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(g.rwidth)+ShortToStr(g.rheight))}function k(a,b){b||(b=window.event);if(b.code){var c;c=b;c=c.code.startsWith("Key")&&4==c.code.length?c.code.charCodeAt(3)+(0==c.shiftKey?32:0):c.code.startsWith("Digit")&&6==c.code.length?c.code.charCodeAt(5):c.code.startsWith("Numpad")&&7==c.code.length?c.code.charCodeAt(6):J[c.code];null!=c&&g.sendkey(c,a)}else{c=b.keyCode;173==c&&(c=189);61==c&&(c=187);var d=c;0==b.shiftKey&& 65<=c&&90>=c&&(d=c+32);112<=c&&124>=c&&(d=c+65358);8==c&&(d=65288);9==c&&(d=65289);13==c&&(d=65293);16==c&&(d=65505);17==c&&(d=65507);18==c&&(d=65513);27==c&&(d=65307);33==c&&(d=65365);34==c&&(d=65366);35==c&&(d=65367);36==c&&(d=65360);37==c&&(d=65361);38==c&&(d=65362);39==c&&(d=65363);40==c&&(d=65364);45==c&&(d=65379);46==c&&(d=65535);96<=c&&105>=c&&(d=c-48);106==c&&(d=42);107==c&&(d=43);109==c&&(d=45);110==c&&(d=46);111==c&&(d=47);186==c&&(d=59);187==c&&(d=61);188==c&&(d=44);189==c&&(d=45);190== c&&(d=46);191==c&&(d=47);192==c&&(d=96);219==c&&(d=91);220==c&&(d=92);221==c&&(d=93);222==c&&(d=39);g.sendkey(d,a)}return g.haltEvent(b)}var g={};g.canvasid=b;g.scrolldiv=c;g.canvas=Q(b).getContext("2d");g.protocol=2;g.state=0;g.acc="";g.ScreenWidth=960;g.ScreenHeight=700;g.width=0;g.height=0;g.rwidth=0;g.rheight=0;g.bpp=2;g.graymode=0;g.useZRLE=!0;g.showmouse=!0;g.buttonmask=0;g.spare=null;g.sparew=0;g.spareh=0;g.sparew2=0;g.spareh2=0;g.sparecache={};g.ZRLEfirst=1;g.onScreenSizeChange=null;g.frameRateDelay= 0;g.noMouseRotate=!1;g.rotation=0;g.kvmDataSupported=!1;g.onKvmData=null;g.onKvmDataPending=[];g.onKvmDataAck=-1;g.holding=!1;g.lastKeepAlive=Date.now();g.mNagleTimer=null;g.mx=0;g.my=0;g.inflate=ZLIB.inflateInit(-15);g.Debug=function(a){console.log(a)};g.xxStateChange=function(a){0==a?(g.canvas.fillStyle="#000000",g.canvas.fillRect(0,0,g.width,g.height),g.canvas.canvas.width=g.rwidth=g.width=640,g.canvas.canvas.height=g.rheight=g.height=400,QS(g.canvasid).cursor="auto",g.inflate=ZLIB.inflateInit(-15)): g.showmouse||(QS(g.canvasid).cursor="none")};g.ProcessData=function(b){if(b)for(g.acc+=b;0g.acc.length)return;g.state=100+ReadShort(g.acc,2);c=4;break;case 2:c=1;break;case 3:if(8>g.acc.length)return; -b=ReadInt(g.acc,4)+8;if(g.acc.lengthh.length)c=0;else if(b=ReadInt(g.acc,4)+8,h.lengthm){if(1>c||64k||64g.acc.length)break;n=ReadInt(g.acc,12);if(g.acc.length<16+n)break;m=16;5a;)a+=4;a%=4;if(1==g.holding)g.rotation=a;else{if(a==g.rotation)return!0;var b=g.canvas.canvas.width,c=g.canvas.canvas.height;if(1==g.rotation||3==g.rotation)b=g.canvas.canvas.height,c=g.canvas.canvas.width;null==g.tcanvas&&(g.tcanvas=document.createElement("canvas"));var d=g.tcanvas.getContext("2d");d.setTransform(1,0,0,1, -0,0);d.canvas.width=b;d.canvas.height=c;d.rotate(-90*g.rotation*Math.PI/180);0==g.rotation&&d.drawImage(g.canvas.canvas,0,0);1==g.rotation&&d.drawImage(g.canvas.canvas,-g.canvas.canvas.width,0);2==g.rotation&&d.drawImage(g.canvas.canvas,-g.canvas.canvas.width,-g.canvas.canvas.height);3==g.rotation&&d.drawImage(g.canvas.canvas,0,-g.canvas.canvas.height);if(0==g.rotation||2==g.rotation)g.canvas.canvas.height=b,g.canvas.canvas.width=c;if(1==g.rotation||3==g.rotation)g.canvas.canvas.height=c,g.canvas.canvas.width= -b;g.canvas.setTransform(1,0,0,1,0,0);g.canvas.rotate(90*a*Math.PI/180);g.rotation=a;g.canvas.drawImage(g.tcanvas,z(0,0),k(0,0));g.width=g.canvas.canvas.width;g.height=g.canvas.canvas.height;if(null!=g.onScreenResize)g.onScreenResize(g,g.width,g.height,g.CanvasId);return!0}};g.Start=function(){g.state=0;g.acc="";g.ZRLEfirst=1;g.inflate.inflateReset();g.onKvmDataPending=[];g.onKvmDataAck=-1;g.kvmDataSupported=!1;for(var a in g.sparecache)delete g.sparecache[a]};g.Stop=function(){g.UnGrabMouseInput(); -g.UnGrabKeyInput();g.parent.Stop()};g.Send=function(a){g.parent.Send(a)};var I={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};g.sendkey=function(a,b){if("object"==typeof a)for(var c in a)g.sendkey(a[c][0],a[c][1]);else g.Send(String.fromCharCode(4,b,0,0)+IntToStr(a))};g.sendKvmData=function(a){!0!== -g.onKvmDataAck?g.onKvmDataPending.push(a):(urlvars&&urlvars.kvmdatatrace&&console.log("KVM-Send("+a.length+"): "+a),a="\x00KvmDataChannel\x00"+a,g.Send(String.fromCharCode(6,0,0,0)+IntToStr(a.length)+a),g.onKvmDataAck=!1)};g.sendKeepAlive=function(){g.lastKeepAliveg.state)return!0;var d=g.getPositionOfControl(Q(g.canvasid));g.mx=(a.pageX-d[0])*(g.canvas.canvas.height/Q(g.canvasid).offsetHeight);g.my=(a.pageY-d[1]+(c?c.scrollTop:0))*(g.canvas.canvas.width/Q(g.canvasid).offsetWidth);1!=g.noMouseRotate&&(g.mx2=n(g.mx,g.my),g.my=m(g.mx,g.my),g.mx=g.mx2);1==b?(g.Send(String.fromCharCode(5,g.buttonmask)+ShortToStr(g.mx)+ShortToStr(g.my)),null!=g.mNagleTimer&&(clearTimeout(g.mNagleTimer),g.mNagleTimer=null)):null==g.mNagleTimer&&(g.mNagleTimer=setTimeout(function(){g.Send(String.fromCharCode(5, -g.buttonmask)+ShortToStr(g.mx)+ShortToStr(g.my));g.mNagleTimer=null},50));return g.haltEvent(a)};g.getPositionOfControl=function(a){var b=Array(2);for(b[0]=b[1]=0;a;)b[0]+=a.offsetLeft,b[1]+=a.offsetTop,a=a.offsetParent;return b};return g},CreateAgentRemoteDesktop=function(b,c){var a={};a.CanvasId=b;"string"===typeof b&&(a.CanvasId=Q(b));a.Canvas=a.CanvasId.getContext("2d");a.scrolldiv=c;a.State=0;a.PendingOperations=[];a.tilesReceived=0;a.TilesDrawn=0;a.KillDraw=0;a.ipad=!1;a.tabletKeyboardVisible= -!1;a.LastX=0;a.LastY=0;a.touchenabled=0;a.submenuoffset=0;a.touchtimer=null;a.TouchArray={};a.connectmode=0;a.connectioncount=0;a.rotation=0;a.protocol=2;a.debugmode=0;a.firstUpKeys=[];a.stopInput=!1;a.sessionid=0;a.username;a.oldie=!1;a.CompressionLevel=50;a.ScalingLevel=1024;a.FrameRateTimer=50;a.FirstDraw=!1;a.ScreenWidth=960;a.ScreenHeight=700;a.width=960;a.height=960;a.onScreenSizeChange=null;a.onMessage=null;a.onConnectCountChanged=null;a.onDebugMessage=null;a.onTouchEnabledChanged=null;a.onDisplayinfo= -null;a.Start=function(){a.State=0};a.Stop=function(){a.setRotation(0);a.UnGrabKeyInput();a.UnGrabMouseInput();a.touchenabled=0;if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);a.Canvas.clearRect(0,0,a.CanvasId.width,a.CanvasId.height)};a.xxStateChange=function(b){if(a.State!=b)switch(a.State=b,b){case 0:a.Stop()}};a.send=function(b){a.parent.send(b)};a.ProcessPictureMsg=function(b,c,d){var r=new Image;r.xcount=a.tilesReceived++;var n=a.tilesReceived;r.src= -"data:image/jpeg;base64,"+btoa(b.substring(4,b.length));r.onload=function(){if(null!=a.Canvas&&a.KillDrawb.length)){var c=null,d=0,r=0,n=ReadShort(b,0),m=ReadShort(b,2);m!=b.length&&1==a.debugmode&&console.log(m,b.length,m==b.length);if(18<=n)console.error("Invalid KVM command "+n+" of size "+m),console.log("Invalid KVM data",b.length,b,rstr2hex(b));else if(m>b.length)console.error("KVM invalid command size",m,b.length);else{if(3==n||4==n||7==n)c=b.substring(4,m),d=((c.charCodeAt(0)&255)<<8)+(c.charCodeAt(1)&255),r=((c.charCodeAt(2)&255)<<8)+(c.charCodeAt(3)&255);switch(n){case 3:if(a.FirstDraw)a.onResize(); -a.ProcessPictureMsg(c,d,r);break;case 4:if(a.FirstDraw)a.onResize();a.TilesDrawn==a.tilesReceived?a.ProcessCopyRectMsg(c):a.PendingOperations.push([++tilesReceived,1,c]);break;case 7:a.ProcessScreenMsg(d,r);a.SendKeyMsgKC(a.KeyAction.UP,16);a.SendKeyMsgKC(a.KeyAction.UP,17);a.SendKeyMsgKC(a.KeyAction.UP,18);a.SendKeyMsgKC(a.KeyAction.UP,91);a.SendKeyMsgKC(a.KeyAction.UP,92);a.SendKeyMsgKC(a.KeyAction.UP,16);a.send(String.fromCharCode(0,14,0,4));break;case 11:c=[];d=((b.charCodeAt(4)&255)<<8)+(b.charCodeAt(5)& -255);if(0>8,b&255))};a.intToStr=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};a.shortToStr=function(a){return String.fromCharCode(a>>8&255,a&255)};a.onResize=function(){if(0!=a.ScreenWidth&&0!=a.ScreenHeight&&(a.Canvas.canvas.width!=a.ScreenWidth||a.Canvas.canvas.height!=a.ScreenHeight)){if(a.FirstDraw&&(a.Canvas.canvas.width=a.ScreenWidth,a.Canvas.canvas.height= -a.ScreenHeight,a.Canvas.fillRect(0,0,a.ScreenWidth,a.ScreenHeight),null!=a.onScreenSizeChange))a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);a.FirstDraw=!1}};a.xxMouseInputGrab=!1;a.xxKeyInputGrab=!1;a.xxMouseMove=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.NONE,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxMouseUp=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.UP,b);b.preventDefault&&b.preventDefault();b.stopPropagation&& -b.stopPropagation();return!1};a.xxMouseDown=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.DOWN,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxDOMMouseScroll=function(b){return 3==a.State?(a.SendMouseMsg(a.KeyAction.SCROLL,b),!1):!0};a.xxMouseWheel=function(b){return 3==a.State?(a.SendMouseMsg(a.KeyAction.SCROLL,b),!1):!0};a.xxKeyUp=function(b){3==a.State&&a.SendKeyMsg(a.KeyAction.UP,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation(); -return!1};a.xxKeyDown=function(b){3==a.State&&a.SendKeyMsg(a.KeyAction.DOWN,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxKeyPress=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};a.handleKeys=function(b){return 1==a.stopInput||3!=desktop.State?!1:a.xxKeyPress(b)};a.handleKeyUp=function(b){if(1==a.stopInput||3!=desktop.State)return!1;if(5>a.firstUpKeys.length&&(a.firstUpKeys.push(b.keyCode),5==a.firstUpKeys.length)){var c= -a.firstUpKeys.join(",");if("16,17,91,91,16"==c||"16,17,18,91,92"==c)a.stopInput=!0}return a.xxKeyUp(b)};a.handleKeyDown=function(b){return 1==a.stopInput||3!=desktop.State?!1:a.xxKeyDown(b)};a.mousedown=function(b){return 1==a.stopInput?!1:a.xxMouseDown(b)};a.mouseup=function(b){return 1==a.stopInput?!1:a.xxMouseUp(b)};a.mousemove=function(b){return 1==a.stopInput?!1:a.xxMouseMove(b)};a.mousewheel=function(b){return 1==a.stopInput?!1:a.xxMouseWheel(b)};a.xxMsTouchEvent=function(b){if(4!=b.originalEvent.pointerType){b.preventDefault&& -b.preventDefault();b.stopPropagation&&b.stopPropagation();if("MSPointerDown"==b.type||"MSPointerMove"==b.type||"MSPointerUp"==b.type){var c=0,d=b.originalEvent.pointerId%256,r=Canvas.canvas.width/a.CanvasId.clientWidth*b.offsetX,n=Canvas.canvas.height/a.CanvasId.clientHeight*b.offsetY;"MSPointerDown"==b.type?c=65542:"MSPointerMove"==b.type?c=131078:"MSPointerUp"==b.type&&(c=262144);a.TouchArray[d]||(a.TouchArray[d]={x:r,y:n});a.SendTouchMsg2(d,c);"MSPointerUp"==b.type&&delete a.TouchArray[d]}else alert(b.type); -return!0}};a.xxTouchStart=function(b){if(3==a.State)if(b.preventDefault&&b.preventDefault(),0==a.touchenabled||1==a.touchenabled){if(!(1b;)b+=4;b%=4;if(b==a.rotation)return!0;var c=a.Canvas.canvas.width,d=a.Canvas.canvas.height;if(1==a.rotation||3==a.rotation)c=a.Canvas.canvas.height,d=a.Canvas.canvas.width; -null==a.tcanvas&&(a.tcanvas=document.createElement("canvas"));var r=a.tcanvas.getContext("2d");r.setTransform(1,0,0,1,0,0);r.canvas.width=c;r.canvas.height=d;r.rotate(-90*a.rotation*Math.PI/180);0==a.rotation&&r.drawImage(a.Canvas.canvas,0,0);1==a.rotation&&r.drawImage(a.Canvas.canvas,-a.Canvas.canvas.width,0);2==a.rotation&&r.drawImage(a.Canvas.canvas,-a.Canvas.canvas.width,-a.Canvas.canvas.height);3==a.rotation&&r.drawImage(a.Canvas.canvas,0,-a.Canvas.canvas.height);if(0==a.rotation||2==a.rotation)a.Canvas.canvas.height= -c,a.Canvas.canvas.width=d;if(1==a.rotation||3==a.rotation)a.Canvas.canvas.height=d,a.Canvas.canvas.width=c;a.Canvas.setTransform(1,0,0,1,0,0);a.Canvas.rotate(90*b*Math.PI/180);a.rotation=b;a.Canvas.drawImage(a.tcanvas,a.rotX(0,0),a.rotY(0,0));a.ScreenWidth=a.Canvas.canvas.width;a.ScreenHeight=a.Canvas.canvas.height;if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);return!0};a.MuchTheSame=function(a,b){return 4>Math.abs(a-b)};a.Debug=function(a){console.log(a)}; -a.getIEVersion=function(){var a=-1;"Microsoft Internet Explorer"==navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));return a};a.haltEvent=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};return a},CreateKvmDataChannel=function(b,c,a){var d={};d.m=c;c.parent=d;d.webchannel=b;d.State=0;d.protocol=c.protocol;d.onStateChanged=null;d.onControlMsg=null;d.debugmode=0;d.keepalive=a;d.rtcKeepAlive=null; -d.Start=function(){1==d.debugmode&&console.log("start");d.xxStateChange(3);d.webchannel.onmessage=d.xxOnMessage;d.rtcKeepAlive=setInterval(d.xxSendRtcKeepAlive,3E4)};var e=new FileReader,p=!1,h=[];e.readAsBinaryString?e.onload=function(a){d.xxOnSocketData(a.target.result);0==h.length?p=!1:e.readAsBinaryString(new Blob([h.shift()]))}:e.readAsArrayBuffer&&(e.onloadend=function(a){d.xxOnSocketData(a.target.result);0==h.length?p=!1:e.readAsArrayBuffer(h.shift())});d.xxOnMessage=function(a){if("string"== -typeof a.data){if(null!=d.onControlMsg)d.onControlMsg(a.data)}else if("object"==typeof a.data)if(1==p)h.push(a.data);else if(e.readAsBinaryString)p=!0,e.readAsBinaryString(new Blob([a.data]));else if(f.readAsArrayBuffer)p=!0,e.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,z=0;zh.width&&(v=h.width);B>h.height-1&&(B=h.height-1);switch(b){case "\b":0h.height-1&&(p(1),B=h.height-1);break;case "\r":v=0;break;default:v>=h.width&&(v=0,k&&B++,B>=h.height-1&&(p(1),B=h.height-1)),a(b),v++}}}function a(a){D[B][v]=a;u[B][v]=(m<<6)+(z<<12)+n}function d(){for(var a=z<<12,b=v;b=p){g[I]=g[I]?10*g[I]+(p-0):p-0;break}else if(";"==p){I++;break}else{g[0]||(g[0]=0);var r=g,w=I+1,y=void 0;switch(p){case "c":h.TermResetScreen();break;case "A":1==w&&(B-=r[0],0>B&&(B=0));break;case "B":1==w&&(B+=r[0],B>h.height&&(B=h.height));break;case "C":1==w&&(v+=r[0],v>h.width&&(v=h.width));break;case "D":1==w&&(v-=r[0],0>v&&(v=0));break;case "d":1==w&&(B=r[0]-1,B>h.height&&(B=h.height),0>B&&(B=0));break;case "G":1==w&&(v=r[0]-1,0>v&&(v=0),79r[0]&&(r[0]=1),1>r[1]&&(r[1]=1),r[0]>h.height&&(r[0]=h.height),r[1]>h.width&&(r[1]=h.width),B=r[0]-1,v=r[1]-1):v=B=0;break;case "m":for(y=0;ym&&(m+=8):2==r[y]||22==r[y]?8<=m&&(m-=8):7==r[y]?n=2:27==r[y]?n=0:30<=r[y]&&37>=r[y]?(p=8<=m,m=r[y]-30,p&&8>=m&&(m+=8)):40<=r[y]&&47>=r[y]?z=r[y]-40:90<= -r[y]&&99>=r[y]?m=r[y]-82:100<=r[y]&&109>=r[y]&&(z=r[y]-92):(z=0,m=7,n=0);break;case "K":if(0!=w&&(1!=w||r[0]&&0!=r[0])){if(1==w)if(1==r[0])for(p=z<<12,r=0;r=a.which&&1==a.ctrlKey)h.TermSendKey(a.which-64),a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation();else{if(27==a.which)return h.TermSendKeys(String.fromCharCode(27)), -!0;if(37==a.which)return h.TermSendKeys(String.fromCharCode(27,91,68)),!0;if(38==a.which)return h.TermSendKeys(String.fromCharCode(27,91,65)),!0;if(39==a.which)return h.TermSendKeys(String.fromCharCode(27,91,67)),!0;if(40==a.which)return h.TermSendKeys(String.fromCharCode(27,91,66)),!0;if(9==a.which)return h.TermSendKeys("\t"),a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),!0;var b=[80,81,119,120,116,117,113,114,112,77],c=[49,50,51,52,53,54,55,56,57,48,33,64],d=[80,81, -82,83,84,85,86,87,88,89,90,91];if(111a.which&&0==a.repeat){if(0==h.fxEmulation&&122>a.which)return h.TermSendKeys(String.fromCharCode(27,91,79,b[a.which-112])),!0;if(1==h.fxEmulation)return h.TermSendKeys(String.fromCharCode(27,c[a.which-112])),!0;if(2==h.fxEmulation)return h.TermSendKeys(String.fromCharCode(27,79,d[a.which-112])),!0}if(8!=a.which&&32!=a.which&&9!=a.which)return!0;h.TermSendKey(a.which);a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1}}; -h.TermDraw=function(){for(var a,b="",c="",d=1,e,g=0;g>e&63],a&1&&(b+=";text-decoration:underline"),b+=';">',c=""+c,d=a),a=D[g][k],a){case "&":b+="&";break;case "<":b+="<";break;case ">":b+=">";break;case " ":b+=" ";break;default:b+=a}g!=h.height-1&&(b+="
")}h.DivElement.innerHTML=""+ -b+c+""};h.TermInit=function(){h.TermResetScreen()};h.Init();return h},ZLIB=ZLIB||{}; +8,0,1)+ShortToStr(255)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)),2==g.graymode&&g.Send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(15)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)));g.state=4;g.parent&&g.parent.xxStateChange(3);B();if(null!=g.onScreenSizeChange)g.onScreenSizeChange(g,g.ScreenWidth,g.ScreenHeight)}else if(4==g.state)switch(g.acc.charCodeAt(0)){case 0:if(4>g.acc.length)return;g.state=100+ReadShort(g.acc,2);c=4;break;case 2:c=1;break;case 3:if(8> +g.acc.length)return;b=ReadInt(g.acc,4)+8;if(g.acc.lengthk.length)c=0;else if(b=ReadInt(g.acc,4)+8,k.lengthp){if(1>c||64h||64g.acc.length)break;n=ReadInt(g.acc,12);if(g.acc.length<16+n)break;p=16;5a;)a+=4;a%=4;if(1==g.holding)g.rotation=a;else{if(a==g.rotation)return!0;var b=g.canvas.canvas.width,c=g.canvas.canvas.height;if(1==g.rotation||3==g.rotation)b=g.canvas.canvas.height,c=g.canvas.canvas.width;null==g.tcanvas&&(g.tcanvas=document.createElement("canvas"));var d=g.tcanvas.getContext("2d"); +d.setTransform(1,0,0,1,0,0);d.canvas.width=b;d.canvas.height=c;d.rotate(-90*g.rotation*Math.PI/180);0==g.rotation&&d.drawImage(g.canvas.canvas,0,0);1==g.rotation&&d.drawImage(g.canvas.canvas,-g.canvas.canvas.width,0);2==g.rotation&&d.drawImage(g.canvas.canvas,-g.canvas.canvas.width,-g.canvas.canvas.height);3==g.rotation&&d.drawImage(g.canvas.canvas,0,-g.canvas.canvas.height);if(0==g.rotation||2==g.rotation)g.canvas.canvas.height=b,g.canvas.canvas.width=c;if(1==g.rotation||3==g.rotation)g.canvas.canvas.height= +c,g.canvas.canvas.width=b;g.canvas.setTransform(1,0,0,1,0,0);g.canvas.rotate(90*a*Math.PI/180);g.rotation=a;g.canvas.drawImage(g.tcanvas,v(0,0),h(0,0));g.width=g.canvas.canvas.width;g.height=g.canvas.canvas.height;if(null!=g.onScreenResize)g.onScreenResize(g,g.width,g.height,g.CanvasId);return!0}};g.Start=function(){g.state=0;g.acc="";g.ZRLEfirst=1;g.inflate.inflateReset();g.onKvmDataPending=[];g.onKvmDataAck=-1;g.kvmDataSupported=!1;for(var a in g.sparecache)delete g.sparecache[a]};g.Stop=function(){g.UnGrabMouseInput(); +g.UnGrabKeyInput();g.parent&&g.parent.Stop()};g.Send=function(a){g.parent&&g.parent.Send(a)};var J={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};g.sendkey=function(a,b){if("object"==typeof a)for(var c in a)g.sendkey(a[c][0],a[c][1]);else g.Send(String.fromCharCode(4,b,0,0)+IntToStr(a))};g.sendKvmData= +function(a){!0!==g.onKvmDataAck?g.onKvmDataPending.push(a):(urlvars&&urlvars.kvmdatatrace&&console.log("KVM-Send("+a.length+"): "+a),a="\x00KvmDataChannel\x00"+a,g.Send(String.fromCharCode(6,0,0,0)+IntToStr(a.length)+a),g.onKvmDataAck=!1)};g.sendKeepAlive=function(){g.lastKeepAliveg.state)return!0;var d=g.getPositionOfControl(Q(g.canvasid));g.mx=(a.pageX-d[0])*(g.canvas.canvas.height/Q(g.canvasid).offsetHeight);g.my=(a.pageY-d[1]+(c?c.scrollTop:0))*(g.canvas.canvas.width/Q(g.canvasid).offsetWidth);1!=g.noMouseRotate&&(g.mx2=n(g.mx,g.my),g.my=m(g.mx,g.my),g.mx=g.mx2);1==b?(g.Send(String.fromCharCode(5,g.buttonmask)+ShortToStr(g.mx)+ShortToStr(g.my)),null!=g.mNagleTimer&&(clearTimeout(g.mNagleTimer),g.mNagleTimer=null)):null==g.mNagleTimer&&(g.mNagleTimer= +setTimeout(function(){g.Send(String.fromCharCode(5,g.buttonmask)+ShortToStr(g.mx)+ShortToStr(g.my));g.mNagleTimer=null},50));return g.haltEvent(a)};g.getPositionOfControl=function(a){var b=Array(2);for(b[0]=b[1]=0;a;)b[0]+=a.offsetLeft,b[1]+=a.offsetTop,a=a.offsetParent;return b};return g},CreateAgentRemoteDesktop=function(b,c){var a={};a.CanvasId=b;"string"===typeof b&&(a.CanvasId=Q(b));a.Canvas=a.CanvasId.getContext("2d");a.scrolldiv=c;a.State=0;a.PendingOperations=[];a.tilesReceived=0;a.TilesDrawn= +0;a.KillDraw=0;a.ipad=!1;a.tabletKeyboardVisible=!1;a.LastX=0;a.LastY=0;a.touchenabled=0;a.submenuoffset=0;a.touchtimer=null;a.TouchArray={};a.connectmode=0;a.connectioncount=0;a.rotation=0;a.protocol=2;a.debugmode=0;a.firstUpKeys=[];a.stopInput=!1;a.localKeyMap=!0;a.altPressed=!1;a.ctrlPressed=!1;a.shiftPressed=!1;a.sessionid=0;a.username;a.oldie=!1;a.CompressionLevel=50;a.ScalingLevel=1024;a.FrameRateTimer=50;a.FirstDraw=!1;a.ScreenWidth=960;a.ScreenHeight=700;a.width=960;a.height=960;a.onScreenSizeChange= +null;a.onMessage=null;a.onConnectCountChanged=null;a.onDebugMessage=null;a.onTouchEnabledChanged=null;a.onDisplayinfo=null;a.accumulator=null;a.Start=function(){a.State=0;a.accumulator=null};a.Stop=function(){a.setRotation(0);a.UnGrabKeyInput();a.UnGrabMouseInput();a.touchenabled=0;if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);a.Canvas.clearRect(0,0,a.CanvasId.width,a.CanvasId.height)};a.xxStateChange=function(b){if(a.State!=b)switch(a.State=b,a.CanvasId.style.cursor= +"default",b){case 0:a.Stop()}};a.send=function(b){1b.length)){var c=null,d=0,q=0,n=ReadShort(b,0),m=ReadShort(b,2),v=0;if(27==n&&8==m){if(12>b.length)return;n=ReadShort(b,8);m=ReadInt(b,4);if(m+8>b.length){a.accumulator=b;return}b=b.substring(8);v=8}m!=b.length&&0b.length)a.accumulator=b;else{if(3==n||4==n||7==n)c=b.substring(4,m),d=((c.charCodeAt(0)& +255)<<8)+(c.charCodeAt(1)&255),q=((c.charCodeAt(2)&255)<<8)+(c.charCodeAt(3)&255),0>8,b&255))};a.intToStr=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};a.shortToStr=function(a){return String.fromCharCode(a>>8&255,a&255)};a.onResize=function(){if(0!=a.ScreenWidth&&0!=a.ScreenHeight&&(a.Canvas.canvas.width!=a.ScreenWidth||a.Canvas.canvas.height!=a.ScreenHeight)){if(a.FirstDraw&&(a.Canvas.canvas.width=a.ScreenWidth,a.Canvas.canvas.height=a.ScreenHeight,a.Canvas.fillRect(0,0,a.ScreenWidth,a.ScreenHeight),null!=a.onScreenSizeChange))a.onScreenSizeChange(a, +a.ScreenWidth,a.ScreenHeight,a.CanvasId);a.FirstDraw=!1}};a.xxMouseInputGrab=!1;a.xxKeyInputGrab=!1;a.xxMouseMove=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.NONE,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxMouseUp=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.UP,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxMouseDown=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.DOWN,b);b.preventDefault&& +b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxMouseDblClick=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.DBLCLICK,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxDOMMouseScroll=function(b){return 3==a.State?(a.SendMouseMsg(a.KeyAction.SCROLL,b),!1):!0};a.xxMouseWheel=function(b){return 3==a.State?(a.SendMouseMsg(a.KeyAction.SCROLL,b),!1):!0};a.xxKeyUp=function(b){3==a.State&&a.SendKeyMsg(a.KeyAction.UP,b);b.preventDefault&& +b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxKeyDown=function(b){3==a.State&&a.SendKeyMsg(a.KeyAction.DOWN,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxKeyPress=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};a.handleKeys=function(b){return 1==a.stopInput||3!=desktop.State?!1:a.xxKeyPress(b)};a.handleKeyUp=function(b){if(1==a.stopInput||3!=desktop.State)return!1;if(5>a.firstUpKeys.length&& +(a.firstUpKeys.push(b.keyCode),5==a.firstUpKeys.length)){var c=a.firstUpKeys.join(",");if("16,17,91,91,16"==c||"16,17,18,91,92"==c)a.stopInput=!0}16==b.keyCode&&(a.shiftPressed=!1);17==b.keyCode&&(a.ctrlPressed=!1);18==b.keyCode&&(a.altPressed=!1);return a.xxKeyUp(b)};a.handleKeyDown=function(b){if(1==a.stopInput||3!=desktop.State)return!1;16==b.keyCode&&(a.shiftPressed=!0);17==b.keyCode&&(a.ctrlPressed=!0);18==b.keyCode&&(a.altPressed=!0);return a.xxKeyDown(b)};a.handleReleaseKeys=function(){a.shiftPressed&& +a.SendKeyMsgKC(a.KeyAction.UP,16);a.ctrlPressed&&a.SendKeyMsgKC(a.KeyAction.UP,17);a.altPressed&&a.SendKeyMsgKC(a.KeyAction.UP,18);a.shiftPressed=a.ctrlPressed=a.altPressed=!1};a.mousedblclick=function(b){return 1==a.stopInput?!1:a.xxMouseDblClick(b)};a.mousedown=function(b){return 1==a.stopInput?!1:a.xxMouseDown(b)};a.mouseup=function(b){return 1==a.stopInput?!1:a.xxMouseUp(b)};a.mousemove=function(b){return 1==a.stopInput?!1:a.xxMouseMove(b)};a.mousewheel=function(b){return 1==a.stopInput?!1:a.xxMouseWheel(b)}; +a.xxMsTouchEvent=function(b){if(4!=b.originalEvent.pointerType){b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();if("MSPointerDown"==b.type||"MSPointerMove"==b.type||"MSPointerUp"==b.type){var c=0,d=b.originalEvent.pointerId%256,q=Canvas.canvas.width/a.CanvasId.clientWidth*b.offsetX,n=Canvas.canvas.height/a.CanvasId.clientHeight*b.offsetY;"MSPointerDown"==b.type?c=65542:"MSPointerMove"==b.type?c=131078:"MSPointerUp"==b.type&&(c=262144);a.TouchArray[d]||(a.TouchArray[d]= +{x:q,y:n});a.SendTouchMsg2(d,c);"MSPointerUp"==b.type&&delete a.TouchArray[d]}else alert(b.type);return!0}};a.xxTouchStart=function(b){if(3==a.State)if(b.preventDefault&&b.preventDefault(),0==a.touchenabled||1==a.touchenabled){if(!(1b;)b+=4;b%=4;if(b==a.rotation)return!0;var c=a.Canvas.canvas.width,d=a.Canvas.canvas.height;if(1==a.rotation|| +3==a.rotation)c=a.Canvas.canvas.height,d=a.Canvas.canvas.width;null==a.tcanvas&&(a.tcanvas=document.createElement("canvas"));var q=a.tcanvas.getContext("2d");q.setTransform(1,0,0,1,0,0);q.canvas.width=c;q.canvas.height=d;q.rotate(-90*a.rotation*Math.PI/180);0==a.rotation&&q.drawImage(a.Canvas.canvas,0,0);1==a.rotation&&q.drawImage(a.Canvas.canvas,-a.Canvas.canvas.width,0);2==a.rotation&&q.drawImage(a.Canvas.canvas,-a.Canvas.canvas.width,-a.Canvas.canvas.height);3==a.rotation&&q.drawImage(a.Canvas.canvas, +0,-a.Canvas.canvas.height);if(0==a.rotation||2==a.rotation)a.Canvas.canvas.height=c,a.Canvas.canvas.width=d;if(1==a.rotation||3==a.rotation)a.Canvas.canvas.height=d,a.Canvas.canvas.width=c;a.Canvas.setTransform(1,0,0,1,0,0);a.Canvas.rotate(90*b*Math.PI/180);a.rotation=b;a.Canvas.drawImage(a.tcanvas,a.rotX(0,0),a.rotY(0,0));a.ScreenWidth=a.Canvas.canvas.width;a.ScreenHeight=a.Canvas.canvas.height;if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);return!0}; +a.MuchTheSame=function(a,b){return 4>Math.abs(a-b)};a.Debug=function(a){console.log(a)};a.getIEVersion=function(){var a=-1;"Microsoft Internet Explorer"==navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));return a};a.haltEvent=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};return a},CreateKvmDataChannel=function(b,c,a){var d={};d.m=c;c.parent=d;d.webchannel=b;d.State=0;d.protocol=c.protocol; +d.onStateChanged=null;d.onControlMsg=null;d.debugmode=0;d.keepalive=a;d.rtcKeepAlive=null;d.Start=function(){1==d.debugmode&&console.log("start");d.xxStateChange(3);d.webchannel.onmessage=d.xxOnMessage;d.rtcKeepAlive=setInterval(d.xxSendRtcKeepAlive,3E4)};var e=new FileReader,l=!1,p=[];e.readAsBinaryString?e.onload=function(a){d.xxOnSocketData(a.target.result);0==p.length?l=!1:e.readAsBinaryString(new Blob([p.shift()]))}:e.readAsArrayBuffer&&(e.onloadend=function(a){d.xxOnSocketData(a.target.result); +0==p.length?l=!1:e.readAsArrayBuffer(p.shift())});d.xxOnMessage=function(a){if("string"==typeof a.data){if(null!=d.onControlMsg)d.onControlMsg(a.data)}else if("object"==typeof a.data)if(1==l)p.push(a.data);else if(e.readAsBinaryString)l=!0,e.readAsBinaryString(new Blob([a.data]));else if(f.readAsArrayBuffer)l=!0,e.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,v=0;vq.width&&(B=q.width);k>q.height-1&&(k=q.height-1);switch(b){case "\b":0y[1]&&(q.recordLineTobackBuffer(0),p(1),k=y[1]);q.lineFeed="\r";B=0;break;case "\r":B=0;break;default:B>=q.width&&(B=0,z&&k++,k>=q.height-1&&(p(1),k=q.height-1)),d(b),B++}}}function d(a){H[k][B]=a;F[k][B]=(v<<6)+(h<<12)+m}function e(){for(var a=(v<<6)+(h<<12)+m,b=B;b":E=!1;u=0;break;case "7":g=B;J=k;u=0;break;case "8":B=g;k=J;u=0;break;case "M":for(n=y[1];n>=y[0]+1;n--)for(var p=0;py[0]-1;n--)for(p= +0;p=d){C[x]=C[x]?10*C[x]+(d-0):d-0;break}else if(";"==d){x++;break}else if("?"==d){w=1;break}else{C[0]||(C[0]=0);var n=C,p=x+1,r=w;if(1==r)switch(d){case "l":25==n[0]&&(A=!1);break;case "h":25==n[0]&&(A=!0)}else if(0==r){var D=void 0;switch(d){case "c":q.TermResetScreen();break;case "A":1==p&&(0==n[0]?k--:k-=n[0],0>k&&(k=0));break;case "B":1==p&&(0==n[0]?k++:k+=n[0], +k>q.height&&(k=q.height));break;case "C":1==p&&(0==n[0]?B++:B+=n[0],B>q.width&&(B=q.width));break;case "D":1==p&&(0==n[0]?B--:B-=n[0],0>B&&(B=0));break;case "d":1==p&&(k=n[0]-1,k>q.height&&(k=q.height),0>k&&(k=0));break;case "G":1==p&&(B=n[0]-1,0>B&&(B=0),B>q.width-1&&(B=q.width-1));break;case "P":d=1;1==p&&(d=n[0]);for(D=B;D=k+D;n--)H[n]= +H[n-D],F[n]=F[n-D];for(n=k;nn[0]&&(n[0]=1),1>n[1]&&(n[1]=1),n[0]>q.height&&(n[0]=q.height),n[1]>q.width&&(n[1]=q.width),k=n[0]-1,B=n[1]-1):B=k=0;break;case "m":for(D=0;Dv&&(v+=8):2==n[D]||22==n[D]? +8<=v&&(v-=8):7==n[D]?m=2:27==n[D]?m=0:30<=n[D]&&37>=n[D]?(d=8<=v,v=n[D]-30,d&&8>=v&&(v+=8)):40<=n[D]&&47>=n[D]?h=n[D]-40:90<=n[D]&&99>=n[D]?v=n[D]-82:100<=n[D]&&109>=n[D]&&(h=n[D]-92):(h=0,v=7,m=0);break;case "K":if(0!=p&&(1!=p||n[0]&&0!=n[0])){if(1==p)if(1==n[0])for(n=(v<<6)+(h<<12)+m,p=0;py[0]&&(y[0]=0);y[0]>q.height-1&&(y[0]=q.height-1);0>y[1]&&(y[1]=0);y[1]> +q.height-1&&(y[1]=q.height-1);y[0]>y[1]&&(y[0]=y[1]);break;case "S":d=1;1==p&&(d=n[0]);for(n=y[0];n<=y[1]-d;n++)for(p=0;py[0]+d;n--)for(p=0;py[0];n--)for(p=0;p=a.which&&1==a.ctrlKey)q.TermSendKey(a.which-64),a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation();else{if(27==a.which)return q.TermSendKeys(String.fromCharCode(27)),!0;if(1==E){if(37==a.which)return q.TermSendKeys(String.fromCharCode(27,79,68)),!0;if(38==a.which)return q.TermSendKeys(String.fromCharCode(27,79,65)),!0; +if(39==a.which)return q.TermSendKeys(String.fromCharCode(27,79,67)),!0;if(40==a.which)return q.TermSendKeys(String.fromCharCode(27,79,66)),!0}else{if(37==a.which)return q.TermSendKeys(String.fromCharCode(27,91,68)),!0;if(38==a.which)return q.TermSendKeys(String.fromCharCode(27,91,65)),!0;if(39==a.which)return q.TermSendKeys(String.fromCharCode(27,91,67)),!0;if(40==a.which)return q.TermSendKeys(String.fromCharCode(27,91,66)),!0}if(33==a.which)return q.TermSendKeys(String.fromCharCode(27,91,53,126)), +!0;if(34==a.which)return q.TermSendKeys(String.fromCharCode(27,91,54,126)),!0;if(35==a.which)return q.TermSendKeys(String.fromCharCode(27,91,70)),!0;if(36==a.which)return q.TermSendKeys(String.fromCharCode(27,91,72)),!0;if(45==a.which)return q.TermSendKeys(String.fromCharCode(27,91,50,126)),!0;if(46==a.which)return q.TermSendKeys(String.fromCharCode(27,91,51,126)),!0;if(9==a.which)return q.TermSendKeys("\t"),a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),!0;var b=[80, +81,119,120,116,117,113,114,112,77],c=[49,50,51,52,53,54,55,56,57,48,33,64],d=[80,81,82,83,84,85,86,87,88,89,90,91];if(111a.which&&0==a.repeat){if(0==q.fxEmulation&&122>a.which)return q.TermSendKeys(String.fromCharCode(27,91,79,b[a.which-112])),!0;if(1==q.fxEmulation)return q.TermSendKeys(String.fromCharCode(27,c[a.which-112])),!0;if(2==q.fxEmulation)return q.TermSendKeys(String.fromCharCode(27,79,d[a.which-112])),!0}if(8!=a.which&&32!=a.which&&9!=a.which)return!0;q.TermSendKey(a.which); +a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1}};q.recordLineTobackBuffer=function(a){var b;b=q.TermDrawLine("",a,"");a=b[0];b=b[1];L.push(a+b+"
")};q.TermDrawLine=function(a,b,c){for(var d,e=1,g,h=0;h>g&63],d&1&&(a+=";text-decoration:underline"),a+=';">',c=""+c,e=d),d=H[b][h],d){case "&":a+="&"; +break;case "<":a+="<";break;case ">":a+=">";break;case " ":a+=" ";break;default:a+=d}return[a,c]};q.TermDraw=function(){for(var a="",b="",c=0;c");800"+c+b+a+"";q.DivElement.scrollTop=q.DivElement.scrollHeight};q.TermInit=function(){q.TermResetScreen()};null!=c&&null!=c.width&&null!=c.height?q.Init(c.width,c.height): +q.Init();return q},ZLIB=ZLIB||{}; "undefined"===typeof ZLIB.common_initialized&&(ZLIB.Z_NO_FLUSH=0,ZLIB.Z_PARTIAL_FLUSH=1,ZLIB.Z_SYNC_FLUSH=2,ZLIB.Z_FULL_FLUSH=3,ZLIB.Z_FINISH=4,ZLIB.Z_BLOCK=5,ZLIB.Z_TREES=6,ZLIB.Z_OK=0,ZLIB.Z_STREAM_END=1,ZLIB.Z_NEED_DICT=2,ZLIB.Z_ERRNO=-1,ZLIB.Z_STREAM_ERROR=-2,ZLIB.Z_DATA_ERROR=-3,ZLIB.Z_MEM_ERROR=-4,ZLIB.Z_BUF_ERROR=-5,ZLIB.Z_VERSION_ERROR=-6,ZLIB.Z_DEFLATED=8,ZLIB.z_stream=function(){this.total_out=this.avail_out=this.next_out=this.total_in=this.avail_in=this.next_in=0;this.state=this.msg=null; this.adler=this.data_type=0;this.output_data=this.input_data="";this.error=0;this.checksum_function=null},ZLIB.gz_header=function(){this.xflags=this.time=this.text=0;this.os=255;this.extra=null;this.extra_max=this.extra_len=0;this.name=null;this.name_max=0;this.comment=null;this.done=this.hcrc=this.comm_max=0},ZLIB.common_initialized=!0);"undefined"===typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js"); -(function(){function b(a,b){var c=a.next,d=2==b?a.distbits:a.lenbits,e=a.work,g=a.lens,h=2==b?a.nlen:0,k=a.codes,l;l=1==b?a.nlen:2==b?a.ndist:19;var m,n,p,r,v,z,y,B,F,G,H,J,X,da,fa,ga,ha,O,K=Array(16);v=Array(16);for(m=0;15>=m;m++)K[m]=0;for(n=0;np&&(r=p);if(0==p)return J={op:64,bits:1,val:0},k[c++]=J,k[c++]=J,2==b?a.distbits=1:a.lenbits=1,a.next=c,0;for(d=1;d=m;m++)if(z<<=1,z-=K[m],0>z)return-1;if(0m;m++)v[m+1]=v[m]+K[m];for(n=0;nO?(J.op=ga[ha+e[n]],J.val=da[fa+e[n]]):J.op=96;z=1<>>v)+F]=J;while(0!=F);for(z=1<>>= -1;0!=z?(B&=z-1,B+=z):B=0;n++;if(0==--K[m]){if(m==p)break;m=g[h+e[n]]}if(m>r&&(B&H)!=G){0==v&&(v=r);X+=d;l=m-v;for(z=1<=z)break;l++;z<<=1}y+=1<a;a++)this.codes[a]=b;this.was=this.back=this.sane=0}function p(a){var b;y||(y=eval("([ {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}])")); +(function(){function b(a,b){var c=a.next,d=2==b?a.distbits:a.lenbits,e=a.work,g=a.lens,k=2==b?a.nlen:0,h=a.codes,l;l=1==b?a.nlen:2==b?a.ndist:19;var m,n,p,q,v,w,z,B,F,H,G,I,X,da,fa,ga,ha,O,K=Array(16);v=Array(16);for(m=0;15>=m;m++)K[m]=0;for(n=0;np&&(q=p);if(0==p)return I={op:64,bits:1,val:0},h[c++]=I,h[c++]=I,2==b?a.distbits=1:a.lenbits=1,a.next=c,0;for(d=1;d=m;m++)if(w<<=1,w-=K[m],0>w)return-1;if(0m;m++)v[m+1]=v[m]+K[m];for(n=0;nO?(I.op=ga[ha+e[n]],I.val=da[fa+e[n]]):I.op=96;w=1<>>v)+F]=I;while(0!=F);for(w=1<>>= +1;0!=w?(B&=w-1,B+=w):B=0;n++;if(0==--K[m]){if(m==p)break;m=g[k+e[n]]}if(m>q&&(B&G)!=H){0==v&&(v=q);X+=d;l=m-v;for(w=1<=w)break;l++;w<<=1}z+=1<a;a++)this.codes[a]=b;this.was=this.back=this.sane=0}function l(a){var b;w||(w=eval("([ {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}])")); F||(F=eval("([ {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}])")); -a.lencode=0;a.distcode=512;for(b=0;512>b;b++)a.codes[b]=y[b];for(b=0;32>b;b++)a.codes[b+512]=F[b];a.lenbits=9;a.distbits=5}function h(a,b){a.state.check=a.checksum_function(a.state.check,[b&255,b>>>8&255],0,2)}function r(a,b){b.strm=a;b.left=a.avail_out;b.next=a.next_in;b.have=a.avail_in;b.hold=a.state.hold;b.bits=a.state.bits;return b}function n(a){var b=a.strm;b.next_in=a.next;b.avail_out=a.left;b.avail_in=a.have;b.state.hold=a.hold;b.state.bits=a.bits}function m(a){a.hold=0;a.bits=0}function z(a){if(0== -a.have)return!1;a.have--;a.hold+=(a.strm.input_data.charCodeAt(a.next++)&255)<>>=b;a.bits-=b}function l(a){a.hold>>>=a.bits&7;a.bits-=a.bits&7}function g(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}var 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],u=[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],D=[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],w=[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];ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ";ZLIB.inflateResetKeep=function(a){var b;if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;b=a.state;a.total_in=a.total_out=b.total=0;a.msg=null;b.wrap&&(a.adler= +a.lencode=0;a.distcode=512;for(b=0;512>b;b++)a.codes[b]=w[b];for(b=0;32>b;b++)a.codes[b+512]=F[b];a.lenbits=9;a.distbits=5}function p(a,b){a.state.check=a.checksum_function(a.state.check,[b&255,b>>>8&255],0,2)}function q(a,b){b.strm=a;b.left=a.avail_out;b.next=a.next_in;b.have=a.avail_in;b.hold=a.state.hold;b.bits=a.state.bits;return b}function n(a){var b=a.strm;b.next_in=a.next;b.avail_out=a.left;b.avail_in=a.have;b.state.hold=a.hold;b.state.bits=a.bits}function m(a){a.hold=0;a.bits=0}function v(a){if(0== +a.have)return!1;a.have--;a.hold+=(a.strm.input_data.charCodeAt(a.next++)&255)<>>=b;a.bits-=b}function k(a){a.hold>>>=a.bits&7;a.bits-=a.bits&7}function g(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}var J=[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],u=[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],C=[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],x=[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];ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ";ZLIB.inflateResetKeep=function(a){var b;if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;b=a.state;a.total_in=a.total_out=b.total=0;a.msg=null;b.wrap&&(a.adler= b.wrap&1);b.mode=0;b.last=0;b.havedict=0;b.dmax=32768;b.head=null;b.hold=0;b.bits=0;b.lencode=0;b.distcode=0;b.next=0;b.sane=1;b.back=-1;return ZLIB.Z_OK};ZLIB.inflateReset=function(a,b){var c,e;if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;e=a.state;"undefined"===typeof b&&(b=15);0>b?(c=0,b=-b):(c=(b>>>4)+1,48>b&&(b&=15));a.checksum_function=1==c&&"function"===typeof ZLIB.adler32?ZLIB.adler32:2==c&&"function"===typeof ZLIB.crc32?ZLIB.crc32:d;if(b&&(8>b||15b)return a.hold=0,a.bits=0,ZLIB.Z_OK;if(16>>8))%31){a.msg="incorrect header check"; -d.mode=29;break}if(v(e,4)!=ZLIB.Z_DEFLATED){a.msg="unknown compression method";d.mode=29;break}B(e,4);w=v(e,4)+8;if(0==d.wbits)d.wbits=w;else if(w>d.wbits){a.msg="invalid window size";d.mode=29;break}d.dmax=1<>>8&1);d.flags&512&&h(a,e.hold);m(e);d.mode=2;case 2:if(!k(e,32))break a;null!==d.head&&(d.head.time=e.hold);d.flags&512&&(q=e.hold,a.state.check=a.checksum_function(a.state.check,[q&255,q>>>8&255,q>>>16&255,q>>>24&255],0,4));m(e);d.mode=3;case 3:if(!k(e,16))break a;null!==d.head&&(d.head.xflags=e.hold&255,d.head.os=e.hold>>>8);d.flags&512&&h(a,e.hold);m(e);d.mode=4;case 4:if(d.flags&1024){if(!k(e,16))break a;d.length=e.hold;null!==d.head&&(d.head.extra_len=e.hold);d.flags&512&& -h(a,e.hold);m(e);d.head.extra=""}else null!==d.head&&(d.head.extra=null);d.mode=5;case 5:if(d.flags&1024&&(q=d.length,q>e.have&&(q=e.have),q&&(null!==d.head&&null!==d.head.extra&&(w=d.head.extra_len-d.length,d.head.extra+=a.input_data.substring(e.next,e.next+(w+q>d.head.extra_max?d.head.extra_max-w:q))),d.flags&512&&(d.check=a.checksum_function(d.check,a.input_data,e.next,q)),e.have-=q,e.next+=q,d.length-=q),d.length))break a;d.length=0;d.mode=6;case 6:if(d.flags&2048){if(0==e.have)break a;null!== -d.head&&null===d.head.name&&(d.head.name="");q=0;do{w=a.input_data.charAt(e.next+q);q++;if("\x00"===w)break;null!==d.head&&d.length>>9&1,d.head.done=1);a.adler=d.check=a.checksum_function(0,null, -0,0);d.mode=11;break;case 9:if(!k(e,32))break a;a.adler=d.check=g(e.hold);m(e);d.mode=10;case 10:if(0==d.havedict)return n(e),ZLIB.Z_NEED_DICT;a.adler=d.check=a.checksum_function(0,null,0,0);d.mode=11;case 11:if(c==ZLIB.Z_BLOCK||c==ZLIB.Z_TREES)break a;case 12:if(d.last){l(e);d.mode=26;break}if(!k(e,3))break a;d.last=v(e,1);B(e,1);switch(v(e,2)){case 0:d.mode=13;break;case 1:p(d);d.mode=19;if(c==ZLIB.Z_TREES){B(e,2);break a}break;case 2:d.mode=16;break;case 3:a.msg="invalid block type",d.mode=29}B(e, -2);break;case 13:l(e);if(!k(e,32))break a;if((e.hold&65535)!=(e.hold>>>16&65535^65535)){a.msg="invalid stored block lengths";d.mode=29;break}d.length=e.hold&65535;m(e);d.mode=14;if(c==ZLIB.Z_TREES)break a;case 14:d.mode=15;case 15:if(q=d.length){q>e.have&&(q=e.have);q>e.left&&(q=e.left);if(0==q)break a;a.output_data+=a.input_data.substring(e.next,e.next+q);a.next_out+=q;e.have-=q;e.next+=q;e.left-=q;d.length-=q;break}d.mode=11;break;case 16:if(!k(e,14))break a;d.nlen=v(e,5)+257;B(e,5);d.ndist=v(e, -5)+1;B(e,5);d.ncode=v(e,4)+4;B(e,4);if(286d.have;)d.lens[G[d.have++]]=0;d.next=0;d.lencode=0;d.lenbits=7;if(F=b(d,0)){a.msg="invalid code lengths set";d.mode=29;break}d.have=0;d.mode=18;case 18:for(;d.have -q.val)B(e,q.bits),d.lens[d.have++]=q.val;else{if(16==q.val){if(!k(e,q.bits+2))break a;B(e,q.bits);if(0==d.have){a.msg="invalid bit length repeat";d.mode=29;break}w=d.lens[d.have-1];q=3+v(e,2);B(e,2)}else if(17==q.val){if(!k(e,q.bits+3))break a;B(e,q.bits);w=0;q=3+v(e,3);B(e,3)}else{if(!k(e,q.bits+7))break a;B(e,q.bits);w=0;q=11+v(e,7);B(e,7)}if(d.have+q>d.nlen+d.ndist){a.msg="invalid bit length repeat";d.mode=29;break}for(;q--;)d.lens[d.have++]=w}}if(29==d.mode)break;if(0==d.lens[256]){a.msg="invalid code -- missing end-of-block"; -d.mode=29;break}d.next=0;d.lencode=d.next;d.lenbits=9;if(F=b(d,1)){a.msg="invalid literal/lengths set";d.mode=29;break}d.distcode=d.next;d.distbits=6;if(F=b(d,2)){a.msg="invalid distances set";d.mode=29;break}d.mode=19;if(c==ZLIB.Z_TREES)break a;case 19:d.mode=20;case 20:if(6<=e.have&&258<=e.left){n(e);q=a;var I=D=w=void 0,P=void 0,R=void 0,V=void 0,Z=void 0,aa=void 0,N=void 0,Y=void 0,L=void 0,H=void 0,J=void 0,X=void 0,da=void 0,fa=void 0,ga=void 0,ha=void 0,O=void 0,K=void 0,W=void 0,ia=void 0, -ea=-1,O=-1,w=q.state,D=q.input_data,I=q.next_in,P=I+q.avail_in-5,R=q.next_out,V=R-(y-q.avail_out),Z=R+(q.avail_out-257),aa=w.wsize,N=w.whave,Y=w.wnext,L=w.window,H=w.hold,J=w.bits,X=w.codes,da=w.lencode,fa=w.distcode,ga=(1<J&&(H+=(D.charCodeAt(I++)&255)<>>=K;J-=K;K=O.op;if(0==K)q.output_data+=String.fromCharCode(O.val),R++;else if(K&16){W=O.val;if(K&=15)J>>=K,J-=K;15>J&&(H+=(D.charCodeAt(I++)&255)<>>=K;J-=K;K=O.op;if(K&16){ia=O.val;K&=15;J>>=K;J-=K;K=R-V;if(ia>K){K=ia-K;if(K>N&&w.sane){q.msg="invalid distance too far back";w.mode=29;break b}ea=0;O=-1;ea=0==Y?ea+(aa-K):ea+(Y-K);KR-O&&(K=R-O);q.output_data+=q.output_data.substring(O,O+K);R+=K;W-=K;O+=K;for(R+=W;2>>3;I-=W;J-=W<<3;H&=(1<>> -w.bits)];if(w.bits+q.bits<=e.bits)break;if(!z(e))break a}B(e,w.bits);d.back+=w.bits}B(e,q.bits);d.back+=q.bits;d.length=q.val;if(0==q.op){d.mode=25;break}if(q.op&32){d.back=-1;d.mode=11;break}if(q.op&64){a.msg="invalid literal/length code";d.mode=29;break}d.extra=q.op&15;d.mode=21;case 21:if(d.extra){if(!k(e,d.extra))break a;d.length+=v(e,d.extra);B(e,d.extra);d.back+=d.extra}d.was=d.length;d.mode=22;case 22:for(;;){q=d.codes[d.distcode+v(e,d.distbits)];if(q.bits<=e.bits)break;if(!z(e))break a}if(0== -(q.op&240)){for(w=q;;){q=d.codes[d.distcode+w.val+(v(e,w.bits+w.op)>>>w.bits)];if(w.bits+q.bits<=e.bits)break;if(!z(e))break a}B(e,w.bits);d.back+=w.bits}B(e,q.bits);d.back+=q.bits;if(q.op&64){a.msg="invalid distance code";d.mode=29;break}d.offset=q.val;d.extra=q.op&15;d.mode=23;case 23:if(d.extra){if(!k(e,d.extra))break a;d.offset+=v(e,d.extra);B(e,d.extra);d.back+=d.extra}d.mode=24;case 24:if(0==e.left)break a;q=y-e.left;if(d.offset>q){q=d.offset-q;if(q>d.whave&&d.sane){a.msg="invalid distance too far back"; -d.mode=29;break}q>d.wnext?(q-=d.wnext,w=d.wsize-q):w=d.wnext-q;D=-1;q>d.length&&(q=d.length)}else w=-1,D=a.next_out-d.offset,q=d.length;q>e.left&&(q=e.left);e.left-=q;d.length-=q;if(0<=w)a.output_data+=d.window.substring(w,w+q),a.next_out+=q;else{a.next_out+=q;do a.output_data+=a.output_data.charAt(D++);while(--q)}0==d.length&&(d.mode=20);break;case 25:if(0==e.left)break a;a.output_data+=String.fromCharCode(d.length);a.next_out++;e.left--;d.mode=20;break;case 26:if(d.wrap){if(!k(e,32))break a;y-= -e.left;a.total_out+=y;d.total+=y;y&&(a.adler=d.check=a.checksum_function(d.check,a.output_data,a.output_data.length-y,y));y=e.left;if((d.flags?e.hold:g(e.hold))!=d.check){a.msg="incorrect data check";d.mode=29;break}m(e)}d.mode=27;case 27:if(d.wrap&&d.flags){if(!k(e,32))break a;if(e.hold!=(d.total&4294967295)){a.msg="incorrect length check";d.mode=29;break}m(e)}d.mode=28;case 28:F=ZLIB.Z_STREAM_END;break a;case 29:F=ZLIB.Z_DATA_ERROR;break a;case 30:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}n(e); -if(d.wsize||y!=a.avail_out&&29>d.mode&&(26>d.mode||c!=ZLIB.Z_FINISH))e=a.state,q=a.output_data.length,null===e.window&&(e.window=""),0==e.wsize&&(e.wsize=1<=e.wsize?a.output_data.substring(q-e.wsize):e.whave+qb)return a.hold=0,a.bits=0,ZLIB.Z_OK;if(16>>8))%31){a.msg="incorrect header check"; +d.mode=29;break}if(z(e,4)!=ZLIB.Z_DEFLATED){a.msg="unknown compression method";d.mode=29;break}B(e,4);x=z(e,4)+8;if(0==d.wbits)d.wbits=x;else if(x>d.wbits){a.msg="invalid window size";d.mode=29;break}d.dmax=1<>>8&1);d.flags&512&&p(a,e.hold);m(e);d.mode=2;case 2:if(!h(e,32))break a;null!==d.head&&(d.head.time=e.hold);d.flags&512&&(r=e.hold,a.state.check=a.checksum_function(a.state.check,[r&255,r>>>8&255,r>>>16&255,r>>>24&255],0,4));m(e);d.mode=3;case 3:if(!h(e,16))break a;null!==d.head&&(d.head.xflags=e.hold&255,d.head.os=e.hold>>>8);d.flags&512&&p(a,e.hold);m(e);d.mode=4;case 4:if(d.flags&1024){if(!h(e,16))break a;d.length=e.hold;null!==d.head&&(d.head.extra_len=e.hold);d.flags&512&& +p(a,e.hold);m(e);d.head.extra=""}else null!==d.head&&(d.head.extra=null);d.mode=5;case 5:if(d.flags&1024&&(r=d.length,r>e.have&&(r=e.have),r&&(null!==d.head&&null!==d.head.extra&&(x=d.head.extra_len-d.length,d.head.extra+=a.input_data.substring(e.next,e.next+(x+r>d.head.extra_max?d.head.extra_max-x:r))),d.flags&512&&(d.check=a.checksum_function(d.check,a.input_data,e.next,r)),e.have-=r,e.next+=r,d.length-=r),d.length))break a;d.length=0;d.mode=6;case 6:if(d.flags&2048){if(0==e.have)break a;null!== +d.head&&null===d.head.name&&(d.head.name="");r=0;do{x=a.input_data.charAt(e.next+r);r++;if("\x00"===x)break;null!==d.head&&d.length>>9&1,d.head.done=1);a.adler=d.check=a.checksum_function(0,null, +0,0);d.mode=11;break;case 9:if(!h(e,32))break a;a.adler=d.check=g(e.hold);m(e);d.mode=10;case 10:if(0==d.havedict)return n(e),ZLIB.Z_NEED_DICT;a.adler=d.check=a.checksum_function(0,null,0,0);d.mode=11;case 11:if(c==ZLIB.Z_BLOCK||c==ZLIB.Z_TREES)break a;case 12:if(d.last){k(e);d.mode=26;break}if(!h(e,3))break a;d.last=z(e,1);B(e,1);switch(z(e,2)){case 0:d.mode=13;break;case 1:l(d);d.mode=19;if(c==ZLIB.Z_TREES){B(e,2);break a}break;case 2:d.mode=16;break;case 3:a.msg="invalid block type",d.mode=29}B(e, +2);break;case 13:k(e);if(!h(e,32))break a;if((e.hold&65535)!=(e.hold>>>16&65535^65535)){a.msg="invalid stored block lengths";d.mode=29;break}d.length=e.hold&65535;m(e);d.mode=14;if(c==ZLIB.Z_TREES)break a;case 14:d.mode=15;case 15:if(r=d.length){r>e.have&&(r=e.have);r>e.left&&(r=e.left);if(0==r)break a;a.output_data+=a.input_data.substring(e.next,e.next+r);a.next_out+=r;e.have-=r;e.next+=r;e.left-=r;d.length-=r;break}d.mode=11;break;case 16:if(!h(e,14))break a;d.nlen=z(e,5)+257;B(e,5);d.ndist=z(e, +5)+1;B(e,5);d.ncode=z(e,4)+4;B(e,4);if(286d.have;)d.lens[H[d.have++]]=0;d.next=0;d.lencode=0;d.lenbits=7;if(F=b(d,0)){a.msg="invalid code lengths set";d.mode=29;break}d.have=0;d.mode=18;case 18:for(;d.have +r.val)B(e,r.bits),d.lens[d.have++]=r.val;else{if(16==r.val){if(!h(e,r.bits+2))break a;B(e,r.bits);if(0==d.have){a.msg="invalid bit length repeat";d.mode=29;break}x=d.lens[d.have-1];r=3+z(e,2);B(e,2)}else if(17==r.val){if(!h(e,r.bits+3))break a;B(e,r.bits);x=0;r=3+z(e,3);B(e,3)}else{if(!h(e,r.bits+7))break a;B(e,r.bits);x=0;r=11+z(e,7);B(e,7)}if(d.have+r>d.nlen+d.ndist){a.msg="invalid bit length repeat";d.mode=29;break}for(;r--;)d.lens[d.have++]=x}}if(29==d.mode)break;if(0==d.lens[256]){a.msg="invalid code -- missing end-of-block"; +d.mode=29;break}d.next=0;d.lencode=d.next;d.lenbits=9;if(F=b(d,1)){a.msg="invalid literal/lengths set";d.mode=29;break}d.distcode=d.next;d.distbits=6;if(F=b(d,2)){a.msg="invalid distances set";d.mode=29;break}d.mode=19;if(c==ZLIB.Z_TREES)break a;case 19:d.mode=20;case 20:if(6<=e.have&&258<=e.left){n(e);r=a;var J=C=x=void 0,R=void 0,S=void 0,V=void 0,Z=void 0,aa=void 0,ca=void 0,Y=void 0,N=void 0,G=void 0,I=void 0,X=void 0,da=void 0,fa=void 0,ga=void 0,ha=void 0,O=void 0,K=void 0,W=void 0,ia=void 0, +ea=-1,O=-1,x=r.state,C=r.input_data,J=r.next_in,R=J+r.avail_in-5,S=r.next_out,V=S-(w-r.avail_out),Z=S+(r.avail_out-257),aa=x.wsize,ca=x.whave,Y=x.wnext,N=x.window,G=x.hold,I=x.bits,X=x.codes,da=x.lencode,fa=x.distcode,ga=(1<I&&(G+=(C.charCodeAt(J++)&255)<>>=K;I-=K;K=O.op;if(0==K)r.output_data+=String.fromCharCode(O.val),S++;else if(K&16){W=O.val;if(K&=15)I>>=K,I-=K;15>I&&(G+=(C.charCodeAt(J++)&255)<>>=K;I-=K;K=O.op;if(K&16){ia=O.val;K&=15;I>>=K;I-=K;K=S-V;if(ia>K){K=ia-K;if(K>ca&&x.sane){r.msg="invalid distance too far back";x.mode=29;break b}ea=0;O=-1;ea=0==Y?ea+(aa-K):ea+(Y-K);KS-O&&(K=S-O);r.output_data+=r.output_data.substring(O,O+K);S+=K;W-=K;O+=K;for(S+=W;2>>3;J-=W;I-=W<<3;G&=(1<>> +x.bits)];if(x.bits+r.bits<=e.bits)break;if(!v(e))break a}B(e,x.bits);d.back+=x.bits}B(e,r.bits);d.back+=r.bits;d.length=r.val;if(0==r.op){d.mode=25;break}if(r.op&32){d.back=-1;d.mode=11;break}if(r.op&64){a.msg="invalid literal/length code";d.mode=29;break}d.extra=r.op&15;d.mode=21;case 21:if(d.extra){if(!h(e,d.extra))break a;d.length+=z(e,d.extra);B(e,d.extra);d.back+=d.extra}d.was=d.length;d.mode=22;case 22:for(;;){r=d.codes[d.distcode+z(e,d.distbits)];if(r.bits<=e.bits)break;if(!v(e))break a}if(0== +(r.op&240)){for(x=r;;){r=d.codes[d.distcode+x.val+(z(e,x.bits+x.op)>>>x.bits)];if(x.bits+r.bits<=e.bits)break;if(!v(e))break a}B(e,x.bits);d.back+=x.bits}B(e,r.bits);d.back+=r.bits;if(r.op&64){a.msg="invalid distance code";d.mode=29;break}d.offset=r.val;d.extra=r.op&15;d.mode=23;case 23:if(d.extra){if(!h(e,d.extra))break a;d.offset+=z(e,d.extra);B(e,d.extra);d.back+=d.extra}d.mode=24;case 24:if(0==e.left)break a;r=w-e.left;if(d.offset>r){r=d.offset-r;if(r>d.whave&&d.sane){a.msg="invalid distance too far back"; +d.mode=29;break}r>d.wnext?(r-=d.wnext,x=d.wsize-r):x=d.wnext-r;C=-1;r>d.length&&(r=d.length)}else x=-1,C=a.next_out-d.offset,r=d.length;r>e.left&&(r=e.left);e.left-=r;d.length-=r;if(0<=x)a.output_data+=d.window.substring(x,x+r),a.next_out+=r;else{a.next_out+=r;do a.output_data+=a.output_data.charAt(C++);while(--r)}0==d.length&&(d.mode=20);break;case 25:if(0==e.left)break a;a.output_data+=String.fromCharCode(d.length);a.next_out++;e.left--;d.mode=20;break;case 26:if(d.wrap){if(!h(e,32))break a;w-= +e.left;a.total_out+=w;d.total+=w;w&&(a.adler=d.check=a.checksum_function(d.check,a.output_data,a.output_data.length-w,w));w=e.left;if((d.flags?e.hold:g(e.hold))!=d.check){a.msg="incorrect data check";d.mode=29;break}m(e)}d.mode=27;case 27:if(d.wrap&&d.flags){if(!h(e,32))break a;if(e.hold!=(d.total&4294967295)){a.msg="incorrect length check";d.mode=29;break}m(e)}d.mode=28;case 28:F=ZLIB.Z_STREAM_END;break a;case 29:F=ZLIB.Z_DATA_ERROR;break a;case 30:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}n(e); +if(d.wsize||w!=a.avail_out&&29>d.mode&&(26>d.mode||c!=ZLIB.Z_FINISH))e=a.state,r=a.output_data.length,null===e.window&&(e.window=""),0==e.wsize&&(e.wsize=1<=e.wsize?a.output_data.substring(r-e.wsize):e.whave+r>>16&65535;a&=65535;if(1==p)return a+=b.charCodeAt(c)&255,65521<=a&&(a-=65521),h+=a,65521<=h&&(h-=65521),a|h<<16;if(null===b)return 1;if(16>p){for(;p--;)a+=b.charCodeAt(c++)&255,h+=a;65521<=a&&(a-=65521);return a|h%65521<<16}for(;5552<=p;){p-=5552;r=347;do a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)& -255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a;while(--r);a%=65521;h%=65521}if(p){for(;16<=p;)p-=16,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)& -255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a;for(;p--;)a+=b.charCodeAt(c++)&255,h+=a;a%=65521;h%=65521}return a|h<<16}function c(a,b,c,p){var h,r;h=a>>>16&65535;a&=65535;if(1==p)return a+=b[c],65521<=a&&(a-=65521),h+=a,65521<=h&&(h-=65521), -a|h<<16;if(null===b)return 1;if(16>p){for(;p--;)a+=b[c++],h+=a;65521<=a&&(a-=65521);return a|h%65521<<16}for(;5552<=p;){p-=5552;r=347;do a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a;while(--r);a%=65521;h%=65521}if(p){for(;16<=p;)p-=16,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+= -a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a;for(;p--;)a+=b[c++],h+=a;a%=65521;h%=65521}return a|h<<16}ZLIB.adler32=function(a,d,e,p){return"string"===typeof d?b(a,d,e,p):c(a,d,e,p)};ZLIB.adler32_combine=function(a,b,c){var p,h;if(0>c)return 4294967295;h=c%65521;c=a&65535;p=h*c%65521;c+=(b&65535)+65521-1;p+=(a>>16&65535)+(b>>16&65535)+65521-h;65521<=c&&(c-=65521);65521<=c&&(c-= -65521);131042<=p&&(p-=131042);65521<=p&&(p-=65521);return c|p<<16}})();"undefined"===typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js"); -(function(){function b(a,b){var c,h=0;for(c=0;b;)b&1&&(c^=a[h]),b>>=1,h++;return c}function c(a,c){var p;for(p=0;32>p;p++)a[p]=b(c,c[p])}var a=[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, +(function(){function b(a,b,c,l){var p,q;p=a>>>16&65535;a&=65535;if(1==l)return a+=b.charCodeAt(c)&255,65521<=a&&(a-=65521),p+=a,65521<=p&&(p-=65521),a|p<<16;if(null===b)return 1;if(16>l){for(;l--;)a+=b.charCodeAt(c++)&255,p+=a;65521<=a&&(a-=65521);return a|p%65521<<16}for(;5552<=l;){l-=5552;q=347;do a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)& +255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a;while(--q);a%=65521;p%=65521}if(l){for(;16<=l;)l-=16,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)& +255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a,a+=b.charCodeAt(c++)&255,p+=a;for(;l--;)a+=b.charCodeAt(c++)&255,p+=a;a%=65521;p%=65521}return a|p<<16}function c(a,b,c,l){var p,q;p=a>>>16&65535;a&=65535;if(1==l)return a+=b[c],65521<=a&&(a-=65521),p+=a,65521<=p&&(p-=65521), +a|p<<16;if(null===b)return 1;if(16>l){for(;l--;)a+=b[c++],p+=a;65521<=a&&(a-=65521);return a|p%65521<<16}for(;5552<=l;){l-=5552;q=347;do a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a;while(--q);a%=65521;p%=65521}if(l){for(;16<=l;)l-=16,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+= +a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a,a+=b[c++],p+=a;for(;l--;)a+=b[c++],p+=a;a%=65521;p%=65521}return a|p<<16}ZLIB.adler32=function(a,d,e,l){return"string"===typeof d?b(a,d,e,l):c(a,d,e,l)};ZLIB.adler32_combine=function(a,b,c){var l,p;if(0>c)return 4294967295;p=c%65521;c=a&65535;l=p*c%65521;c+=(b&65535)+65521-1;l+=(a>>16&65535)+(b>>16&65535)+65521-p;65521<=c&&(c-=65521);65521<=c&&(c-= +65521);131042<=l&&(l-=131042);65521<=l&&(l-=65521);return c|l<<16}})();"undefined"===typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js"); +(function(){function b(a,b){var c,p=0;for(c=0;b;)b&1&&(c^=a[p]),b>>=1,p++;return c}function c(a,c){var l;for(l=0;32>l;l++)a[l]=b(c,c[l])}var a=[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(b,c,p,h){if("string"===typeof c){if(null==c)c=0;else{for(b^=4294967295;8<=h;)b=a[(b^c.charCodeAt(p++))&255]^b>>>8,b= -a[(b^c.charCodeAt(p++))&255]^b>>>8,b=a[(b^c.charCodeAt(p++))&255]^b>>>8,b=a[(b^c.charCodeAt(p++))&255]^b>>>8,b=a[(b^c.charCodeAt(p++))&255]^b>>>8,b=a[(b^c.charCodeAt(p++))&255]^b>>>8,b=a[(b^c.charCodeAt(p++))&255]^b>>>8,b=a[(b^c.charCodeAt(p++))&255]^b>>>8,h-=8;if(h){do b=a[(b^c.charCodeAt(p++))&255]^b>>>8;while(--h)}c=b^4294967295}return c}if(null==c)c=0;else{for(b^=4294967295;8<=h;)b=a[(b^c[p++])&255]^b>>>8,b=a[(b^c[p++])&255]^b>>>8,b=a[(b^c[p++])&255]^b>>>8,b=a[(b^c[p++])&255]^b>>>8,b=a[(b^c[p++])& -255]^b>>>8,b=a[(b^c[p++])&255]^b>>>8,b=a[(b^c[p++])&255]^b>>>8,b=a[(b^c[p++])&255]^b>>>8,h-=8;if(h){do b=a[(b^c[p++])&255]^b>>>8;while(--h)}c=b^4294967295}return c};ZLIB.crc32_combine=function(a,e,p){var h,r,n,m;if(0>=p)return a;n=Array(32);m=Array(32);m[0]=3988292384;for(h=r=1;32>h;h++)m[h]=r,r<<=1;c(n,m);c(m,n);do{c(n,m);p&1&&(a=b(n,a));p>>=1;if(0==p)break;c(m,n);p&1&&(a=b(m,a));p>>=1}while(0!=p);return a^e}})(); -var saveAs=saveAs||function(b){if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var c=b.document.createElementNS("http://www.w3.org/1999/xhtml","a"),a="download"in c,d=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),e=b.webkitRequestFileSystem,p=b.requestFileSystem||e||b.mozRequestFileSystem,h=function(a){(b.setImmediate||b.setTimeout)(function(){throw a;},0)},r=0,n=function(a){var c=function(){"string"===typeof a?(b.URL||b.webkitURL||b).revokeObjectURL(a):a.remove()}; -b.chrome?c():setTimeout(c,500)},m=function(a,b,c){b=[].concat(b);for(var d=b.length;d--;){var e=a["on"+b[d]];if("function"===typeof e)try{e.call(a,c||a)}catch(k){h(k)}}},z=function(a){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\ufeff",a],{type:a.type}):a},k=function(h,k,g){g||(h=z(h));var v=this;g=h.type;var u=!1,D,w,y=function(){m(v,["writestart","progress","write","writeend"])},F=function(){if(w&&d&&"undefined"!==typeof FileReader){var a= -new FileReader;a.onloadend=function(){var b=a.result;w.location.href="data:attachment/file"+b.slice(b.search(/[,;]/));v.readyState=v.DONE;y()};a.readAsDataURL(h);v.readyState=v.INIT}else{if(u||!D)D=(b.URL||b.webkitURL||b).createObjectURL(h);w?w.location.href=D:void 0==b.open(D,"_blank")&&d&&(b.location.href=D);v.readyState=v.DONE;y();n(D)}},G=function(a){return function(){if(v.readyState!==v.DONE)return a.apply(this,arguments)}},E={create:!0,exclusive:!1},A;v.readyState=v.INIT;k||(k="download");if(a)D= -(b.URL||b.webkitURL||b).createObjectURL(h),c.href=D,c.download=k,setTimeout(function(){var a=new MouseEvent("click");c.dispatchEvent(a);y();n(D);v.readyState=v.DONE});else{b.chrome&&g&&"application/octet-stream"!==g&&(A=h.slice||h.webkitSlice,h=A.call(h,0,h.size,"application/octet-stream"),u=!0);e&&"download"!==k&&(k+=".download");if("application/octet-stream"===g||e)w=b;p?(r+=h.size,p(b.TEMPORARY,r,G(function(a){a.root.getDirectory("saved",E,G(function(a){var b=function(){a.getFile(k,E,G(function(a){a.createWriter(G(function(b){b.onwriteend= -function(b){w.location.href=a.toURL();v.readyState=v.DONE;m(v,"writeend",b);n(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&F()};["writestart","progress","write","abort"].forEach(function(a){b["on"+a]=v["on"+a]});b.write(h);v.abort=function(){b.abort();v.readyState=v.DONE};v.readyState=v.WRITING}),F)}),F)};a.getFile(k,{create:!1},G(function(a){a.remove();b()}),G(function(a){a.code===a.NOT_FOUND_ERR?b():F()}))}),F)}),F)):F()}},v=k.prototype;if("undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob)return function(a, -b,c){c||(a=z(a));return navigator.msSaveOrOpenBlob(a,b||"download")};v.abort=function(){this.readyState=this.DONE;m(this,"abort")};v.readyState=v.INIT=0;v.WRITING=1;v.DONE=2;v.error=v.onwritestart=v.onprogress=v.onwrite=v.onabort=v.onerror=v.onwriteend=null;return function(a,b,c){return new k(a,b,c)}}}("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content); +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(b,c,l,p){if("string"===typeof c){if(null==c)c=0;else{for(b^=4294967295;8<=p;)b=a[(b^c.charCodeAt(l++))&255]^b>>>8,b= +a[(b^c.charCodeAt(l++))&255]^b>>>8,b=a[(b^c.charCodeAt(l++))&255]^b>>>8,b=a[(b^c.charCodeAt(l++))&255]^b>>>8,b=a[(b^c.charCodeAt(l++))&255]^b>>>8,b=a[(b^c.charCodeAt(l++))&255]^b>>>8,b=a[(b^c.charCodeAt(l++))&255]^b>>>8,b=a[(b^c.charCodeAt(l++))&255]^b>>>8,p-=8;if(p){do b=a[(b^c.charCodeAt(l++))&255]^b>>>8;while(--p)}c=b^4294967295}return c}if(null==c)c=0;else{for(b^=4294967295;8<=p;)b=a[(b^c[l++])&255]^b>>>8,b=a[(b^c[l++])&255]^b>>>8,b=a[(b^c[l++])&255]^b>>>8,b=a[(b^c[l++])&255]^b>>>8,b=a[(b^c[l++])& +255]^b>>>8,b=a[(b^c[l++])&255]^b>>>8,b=a[(b^c[l++])&255]^b>>>8,b=a[(b^c[l++])&255]^b>>>8,p-=8;if(p){do b=a[(b^c[l++])&255]^b>>>8;while(--p)}c=b^4294967295}return c};ZLIB.crc32_combine=function(a,e,l){var p,q,n,m;if(0>=l)return a;n=Array(32);m=Array(32);m[0]=3988292384;for(p=q=1;32>p;p++)m[p]=q,q<<=1;c(n,m);c(m,n);do{c(n,m);l&1&&(a=b(n,a));l>>=1;if(0==l)break;c(m,n);l&1&&(a=b(m,a));l>>=1}while(0!=l);return a^e}})(); +var saveAs=saveAs||function(b){if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var c=b.document.createElementNS("http://www.w3.org/1999/xhtml","a"),a="download"in c,d=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),e=b.webkitRequestFileSystem,l=b.requestFileSystem||e||b.mozRequestFileSystem,p=function(a){(b.setImmediate||b.setTimeout)(function(){throw a;},0)},q=0,n=function(a){var c=function(){"string"===typeof a?(b.URL||b.webkitURL||b).revokeObjectURL(a):a.remove()}; +b.chrome?c():setTimeout(c,500)},m=function(a,b,c){b=[].concat(b);for(var d=b.length;d--;){var e=a["on"+b[d]];if("function"===typeof e)try{e.call(a,c||a)}catch(h){p(h)}}},v=function(a){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\ufeff",a],{type:a.type}):a},h=function(h,k,g){g||(h=v(h));var p=this;g=h.type;var u=!1,z,x,w=function(){m(p,["writestart","progress","write","writeend"])},F=function(){if(x&&d&&"undefined"!==typeof FileReader){var a= +new FileReader;a.onloadend=function(){var b=a.result;x.location.href="data:attachment/file"+b.slice(b.search(/[,;]/));p.readyState=p.DONE;w()};a.readAsDataURL(h);p.readyState=p.INIT}else{if(u||!z)z=(b.URL||b.webkitURL||b).createObjectURL(h);x?x.location.href=z:void 0==b.open(z,"_blank")&&d&&(b.location.href=z);p.readyState=p.DONE;w();n(z)}},H=function(a){return function(){if(p.readyState!==p.DONE)return a.apply(this,arguments)}},D={create:!0,exclusive:!1},A;p.readyState=p.INIT;k||(k="download");if(a)z= +(b.URL||b.webkitURL||b).createObjectURL(h),c.href=z,c.download=k,setTimeout(function(){var a=new MouseEvent("click");c.dispatchEvent(a);w();n(z);p.readyState=p.DONE});else{b.chrome&&g&&"application/octet-stream"!==g&&(A=h.slice||h.webkitSlice,h=A.call(h,0,h.size,"application/octet-stream"),u=!0);e&&"download"!==k&&(k+=".download");if("application/octet-stream"===g||e)x=b;l?(q+=h.size,l(b.TEMPORARY,q,H(function(a){a.root.getDirectory("saved",D,H(function(a){var b=function(){a.getFile(k,D,H(function(a){a.createWriter(H(function(b){b.onwriteend= +function(b){x.location.href=a.toURL();p.readyState=p.DONE;m(p,"writeend",b);n(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&F()};["writestart","progress","write","abort"].forEach(function(a){b["on"+a]=p["on"+a]});b.write(h);p.abort=function(){b.abort();p.readyState=p.DONE};p.readyState=p.WRITING}),F)}),F)};a.getFile(k,{create:!1},H(function(a){a.remove();b()}),H(function(a){a.code===a.NOT_FOUND_ERR?b():F()}))}),F)}),F)):F()}},z=h.prototype;if("undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob)return function(a, +b,c){c||(a=v(a));return navigator.msSaveOrOpenBlob(a,b||"download")};z.abort=function(){this.readyState=this.DONE;m(this,"abort")};z.readyState=z.INIT=0;z.WRITING=1;z.DONE=2;z.error=z.onwritestart=z.onprogress=z.onwrite=z.onabort=z.onerror=z.onwriteend=null;return function(a,b,c){return new h(a,b,c)}}}("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content); "undefined"!==typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!==typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs}); -var version="0.7.8",urlvars={},amtstack,wsstack=null,AllWsman="AMT_8021xCredentialContext AMT_8021XProfile AMT_ActiveFilterStatistics AMT_AgentPresenceCapabilities AMT_AgentPresenceInterfacePolicy AMT_AgentPresenceService AMT_AgentPresenceWatchdog AMT_AgentPresenceWatchdogAction AMT_AlarmClockService IPS_AlarmClockOccurrence AMT_AssetTable AMT_AssetTableService AMT_AuditLog AMT_AuditPolicyRule AMT_AuthorizationService AMT_BootCapabilities AMT_BootSettingData AMT_ComplexFilterEntryBase AMT_CRL AMT_CryptographicCapabilities AMT_EACCredentialContext AMT_EndpointAccessControlService AMT_EnvironmentDetectionInterfacePolicy AMT_EnvironmentDetectionSettingData AMT_EthernetPortSettings AMT_EventLogEntry AMT_EventManagerService AMT_EventSubscriber AMT_FilterEntryBase AMT_FilterInSystemDefensePolicy AMT_GeneralSettings AMT_GeneralSystemDefenseCapabilities AMT_Hdr8021Filter AMT_HeuristicPacketFilterInterfacePolicy AMT_HeuristicPacketFilterSettings AMT_HeuristicPacketFilterStatistics AMT_InterfacePolicy AMT_IPHeadersFilter AMT_KerberosSettingData AMT_ManagementPresenceRemoteSAP AMT_MessageLog AMT_MPSUsernamePassword AMT_NetworkFilter AMT_NetworkPortDefaultSystemDefensePolicy AMT_NetworkPortSystemDefenseCapabilities AMT_NetworkPortSystemDefensePolicy AMT_PCIDevice AMT_PETCapabilities AMT_PETFilterForTarget AMT_PETFilterSetting AMT_ProvisioningCertificateHash AMT_PublicKeyCertificate AMT_PublicKeyManagementCapabilities AMT_PublicKeyManagementService AMT_PublicPrivateKeyPair AMT_RedirectionService AMT_RemoteAccessCapabilities AMT_RemoteAccessCredentialContext AMT_RemoteAccessPolicyAppliesToMPS AMT_RemoteAccessPolicyRule AMT_RemoteAccessService AMT_SetupAndConfigurationService AMT_SNMPEventSubscriber AMT_StateTransitionCondition AMT_SystemDefensePolicy AMT_SystemDefensePolicyInService AMT_SystemDefenseService AMT_SystemPowerScheme AMT_ThirdPartyDataStorageAdministrationService AMT_ThirdPartyDataStorageService AMT_TimeSynchronizationService AMT_TLSCredentialContext AMT_TLSProtocolEndpoint AMT_TLSProtocolEndpointCollection AMT_TLSSettingData AMT_TrapTargetForService AMT_UserInitiatedConnectionService AMT_WebUIService AMT_WiFiPortConfigurationService CIM_AbstractIndicationSubscription CIM_Account CIM_AccountManagementCapabilities CIM_AccountManagementService CIM_AccountOnSystem CIM_AdminDomain CIM_AlertIndication CIM_AssignedIdentity CIM_AssociatedPowerManagementService CIM_AuthenticationService CIM_AuthorizationService CIM_BIOSElement CIM_BIOSFeature CIM_BIOSFeatureBIOSElements CIM_BootConfigSetting CIM_BootService CIM_BootSettingData CIM_BootSourceSetting CIM_Capabilities CIM_Card CIM_Chassis CIM_Chip CIM_Collection CIM_Component CIM_ComputerSystem CIM_ComputerSystemPackage CIM_ConcreteComponent CIM_ConcreteDependency CIM_Controller CIM_CoolingDevice CIM_Credential CIM_CredentialContext CIM_CredentialManagementService CIM_Dependency CIM_DeviceSAPImplementation CIM_ElementCapabilities CIM_ElementConformsToProfile CIM_ElementLocation CIM_ElementSettingData CIM_ElementSoftwareIdentity CIM_ElementStatisticalData CIM_EnabledLogicalElement CIM_EnabledLogicalElementCapabilities CIM_EthernetPort CIM_Fan CIM_FilterCollection CIM_FilterCollectionSubscription CIM_HostedAccessPoint CIM_HostedDependency CIM_HostedService CIM_Identity CIM_IEEE8021xCapabilities CIM_IEEE8021xSettings CIM_Indication CIM_IndicationService CIM_InstalledSoftwareIdentity CIM_KVMRedirectionSAP CIM_LANEndpoint CIM_ListenerDestination CIM_ListenerDestinationWSManagement CIM_Location CIM_Log CIM_LogEntry CIM_LogicalDevice CIM_LogicalElement CIM_LogicalPort CIM_LogicalPortCapabilities CIM_LogManagesRecord CIM_ManagedCredential CIM_ManagedElement CIM_ManagedSystemElement CIM_MediaAccessDevice CIM_MemberOfCollection CIM_Memory CIM_MessageLog CIM_NetworkPort CIM_NetworkPortCapabilities CIM_NetworkPortConfigurationService CIM_OrderedComponent CIM_OwningCollectionElement CIM_OwningJobElement CIM_PCIController CIM_PhysicalComponent CIM_PhysicalElement CIM_PhysicalElementLocation CIM_PhysicalFrame CIM_PhysicalMemory CIM_PhysicalPackage CIM_Policy CIM_PolicyAction CIM_PolicyCondition CIM_PolicyInSystem CIM_PolicyRule CIM_PolicyRuleInSystem CIM_PolicySet CIM_PolicySetAppliesToElement CIM_PolicySetInSystem CIM_PowerManagementCapabilities CIM_PowerManagementService CIM_PowerSupply CIM_Privilege CIM_PrivilegeManagementCapabilities CIM_PrivilegeManagementService CIM_ProcessIndication CIM_Processor CIM_ProtocolEndpoint CIM_ProvidesServiceToElement CIM_Realizes CIM_RecordForLog CIM_RecordLog CIM_RedirectionService CIM_ReferencedProfile CIM_RegisteredProfile CIM_RemoteAccessAvailableToElement CIM_RemoteIdentity CIM_RemotePort CIM_RemoteServiceAccessPoint CIM_Role CIM_RoleBasedAuthorizationService CIM_RoleBasedManagementCapabilities CIM_RoleLimitedToTarget CIM_SAPAvailableForElement CIM_SecurityService CIM_Sensor CIM_Service CIM_ServiceAccessBySAP CIM_ServiceAccessPoint CIM_ServiceAffectsElement CIM_ServiceAvailableToElement CIM_ServiceSAPDependency CIM_ServiceServiceDependency CIM_SettingData CIM_SharedCredential CIM_SoftwareElement CIM_SoftwareFeature CIM_SoftwareFeatureSoftwareElements CIM_SoftwareIdentity CIM_StatisticalData CIM_StorageExtent CIM_System CIM_SystemBIOS CIM_SystemComponent CIM_SystemDevice CIM_SystemPackaging CIM_UseOfLog CIM_Watchdog CIM_WiFiEndpoint CIM_WiFiEndpointCapabilities CIM_WiFiEndpointSettings CIM_WiFiPort CIM_WiFiPortCapabilities IPS_AdminProvisioningRecord IPS_ClientProvisioningRecord IPS_HostBasedSetupService IPS_HostIPSettings IPS_HTTPProxyService IPS_HTTPProxyAccessPoint IPS_IderSessionUsingPort IPS_IPv6PortSettings IPS_KVMRedirectionSettingData IPS_KvmSessionUsingPort IPS_ManualProvisioningRecord IPS_OptInService IPS_ProvisioningAuditRecord IPS_ProvisioningRecordLog IPS_RasSessionUsingPort IPS_ScreenConfigurationService IPS_ScreenSettingData IPS_SecIOService IPS_SessionUsingPort IPS_SolSessionUsingPort IPS_TLSProvisioningRecord IPS_WatchDogAction".split(" "),disconnecturl= +var version="0.7.9",urlvars={},amtstack,wsstack=null,AllWsman="AMT_8021xCredentialContext AMT_8021XProfile AMT_ActiveFilterStatistics AMT_AgentPresenceCapabilities AMT_AgentPresenceInterfacePolicy AMT_AgentPresenceService AMT_AgentPresenceWatchdog AMT_AgentPresenceWatchdogAction AMT_AlarmClockService IPS_AlarmClockOccurrence AMT_AssetTable AMT_AssetTableService AMT_AuditLog AMT_AuditPolicyRule AMT_AuthorizationService AMT_BootCapabilities AMT_BootSettingData AMT_ComplexFilterEntryBase AMT_CRL AMT_CryptographicCapabilities AMT_EACCredentialContext AMT_EndpointAccessControlService AMT_EnvironmentDetectionInterfacePolicy AMT_EnvironmentDetectionSettingData AMT_EthernetPortSettings AMT_EventLogEntry AMT_EventManagerService AMT_EventSubscriber AMT_FilterEntryBase AMT_FilterInSystemDefensePolicy AMT_GeneralSettings AMT_GeneralSystemDefenseCapabilities AMT_Hdr8021Filter AMT_HeuristicPacketFilterInterfacePolicy AMT_HeuristicPacketFilterSettings AMT_HeuristicPacketFilterStatistics AMT_InterfacePolicy AMT_IPHeadersFilter AMT_KerberosSettingData AMT_ManagementPresenceRemoteSAP AMT_MessageLog AMT_MPSUsernamePassword AMT_NetworkFilter AMT_NetworkPortDefaultSystemDefensePolicy AMT_NetworkPortSystemDefenseCapabilities AMT_NetworkPortSystemDefensePolicy AMT_PCIDevice AMT_PETCapabilities AMT_PETFilterForTarget AMT_PETFilterSetting AMT_ProvisioningCertificateHash AMT_PublicKeyCertificate AMT_PublicKeyManagementCapabilities AMT_PublicKeyManagementService AMT_PublicPrivateKeyPair AMT_RedirectionService AMT_RemoteAccessCapabilities AMT_RemoteAccessCredentialContext AMT_RemoteAccessPolicyAppliesToMPS AMT_RemoteAccessPolicyRule AMT_RemoteAccessService AMT_SetupAndConfigurationService AMT_SNMPEventSubscriber AMT_StateTransitionCondition AMT_SystemDefensePolicy AMT_SystemDefensePolicyInService AMT_SystemDefenseService AMT_SystemPowerScheme AMT_ThirdPartyDataStorageAdministrationService AMT_ThirdPartyDataStorageService AMT_TimeSynchronizationService AMT_TLSCredentialContext AMT_TLSProtocolEndpoint AMT_TLSProtocolEndpointCollection AMT_TLSSettingData AMT_TrapTargetForService AMT_UserInitiatedConnectionService AMT_WebUIService AMT_WiFiPortConfigurationService CIM_AbstractIndicationSubscription CIM_Account CIM_AccountManagementCapabilities CIM_AccountManagementService CIM_AccountOnSystem CIM_AdminDomain CIM_AlertIndication CIM_AssignedIdentity CIM_AssociatedPowerManagementService CIM_AuthenticationService CIM_AuthorizationService CIM_BIOSElement CIM_BIOSFeature CIM_BIOSFeatureBIOSElements CIM_BootConfigSetting CIM_BootService CIM_BootSettingData CIM_BootSourceSetting CIM_Capabilities CIM_Card CIM_Chassis CIM_Chip CIM_Collection CIM_Component CIM_ComputerSystem CIM_ComputerSystemPackage CIM_ConcreteComponent CIM_ConcreteDependency CIM_Controller CIM_CoolingDevice CIM_Credential CIM_CredentialContext CIM_CredentialManagementService CIM_Dependency CIM_DeviceSAPImplementation CIM_ElementCapabilities CIM_ElementConformsToProfile CIM_ElementLocation CIM_ElementSettingData CIM_ElementSoftwareIdentity CIM_ElementStatisticalData CIM_EnabledLogicalElement CIM_EnabledLogicalElementCapabilities CIM_EthernetPort CIM_Fan CIM_FilterCollection CIM_FilterCollectionSubscription CIM_HostedAccessPoint CIM_HostedDependency CIM_HostedService CIM_Identity CIM_IEEE8021xCapabilities CIM_IEEE8021xSettings CIM_Indication CIM_IndicationService CIM_InstalledSoftwareIdentity CIM_KVMRedirectionSAP CIM_LANEndpoint CIM_ListenerDestination CIM_ListenerDestinationWSManagement CIM_Location CIM_Log CIM_LogEntry CIM_LogicalDevice CIM_LogicalElement CIM_LogicalPort CIM_LogicalPortCapabilities CIM_LogManagesRecord CIM_ManagedCredential CIM_ManagedElement CIM_ManagedSystemElement CIM_MediaAccessDevice CIM_MemberOfCollection CIM_Memory CIM_MessageLog CIM_NetworkPort CIM_NetworkPortCapabilities CIM_NetworkPortConfigurationService CIM_OrderedComponent CIM_OwningCollectionElement CIM_OwningJobElement CIM_PCIController CIM_PhysicalComponent CIM_PhysicalElement CIM_PhysicalElementLocation CIM_PhysicalFrame CIM_PhysicalMemory CIM_PhysicalPackage CIM_Policy CIM_PolicyAction CIM_PolicyCondition CIM_PolicyInSystem CIM_PolicyRule CIM_PolicyRuleInSystem CIM_PolicySet CIM_PolicySetAppliesToElement CIM_PolicySetInSystem CIM_PowerManagementCapabilities CIM_PowerManagementService CIM_PowerSupply CIM_Privilege CIM_PrivilegeManagementCapabilities CIM_PrivilegeManagementService CIM_ProcessIndication CIM_Processor CIM_ProtocolEndpoint CIM_ProvidesServiceToElement CIM_Realizes CIM_RecordForLog CIM_RecordLog CIM_RedirectionService CIM_ReferencedProfile CIM_RegisteredProfile CIM_RemoteAccessAvailableToElement CIM_RemoteIdentity CIM_RemotePort CIM_RemoteServiceAccessPoint CIM_Role CIM_RoleBasedAuthorizationService CIM_RoleBasedManagementCapabilities CIM_RoleLimitedToTarget CIM_SAPAvailableForElement CIM_SecurityService CIM_Sensor CIM_Service CIM_ServiceAccessBySAP CIM_ServiceAccessPoint CIM_ServiceAffectsElement CIM_ServiceAvailableToElement CIM_ServiceSAPDependency CIM_ServiceServiceDependency CIM_SettingData CIM_SharedCredential CIM_SoftwareElement CIM_SoftwareFeature CIM_SoftwareFeatureSoftwareElements CIM_SoftwareIdentity CIM_StatisticalData CIM_StorageExtent CIM_System CIM_SystemBIOS CIM_SystemComponent CIM_SystemDevice CIM_SystemPackaging CIM_UseOfLog CIM_Watchdog CIM_WiFiEndpoint CIM_WiFiEndpointCapabilities CIM_WiFiEndpointSettings CIM_WiFiPort CIM_WiFiPortCapabilities IPS_AdminProvisioningRecord IPS_ClientProvisioningRecord IPS_HostBasedSetupService IPS_HostIPSettings IPS_HTTPProxyService IPS_HTTPProxyAccessPoint IPS_IderSessionUsingPort IPS_IPv6PortSettings IPS_KVMRedirectionSettingData IPS_KvmSessionUsingPort IPS_ManualProvisioningRecord IPS_OptInService IPS_ProvisioningAuditRecord IPS_ProvisioningRecordLog IPS_RasSessionUsingPort IPS_ScreenConfigurationService IPS_ScreenSettingData IPS_SecIOService IPS_SessionUsingPort IPS_SolSessionUsingPort IPS_TLSProvisioningRecord IPS_WatchDogAction".split(" "),disconnecturl= null,terminal,currentView=0,LoadingHtml="
Loading...
",amtversion=0,amtversionmin=0,amtFirstPull=0,amtwirelessif=-1,desktop,desktopsettings={encoding:1,showfocus:!1,showmouse:!0,showcad:!0,limitFrameRate:!1,noMouseRotate:!1},currentMeshNode=null,webcompilerfeatures="AgentPresence Alarms AuditLog Certificates ComputerSelectorToolbar Desktop DesktopInband DesktopInbandFiles Desktop-Multi DesktopRotation Desktop-Settings DesktopType EventLog EventSubscriptions FileSaver HardwareInfo IDER IDERDebug IDERStats Inflate Look-MeshCentral Mode-MeshCentral2 NetworkSettings PowerControl PowerControl-Advanced RemoteAccess Scripting Scripting-Editor Storage SystemDefense Terminal Terminal-Enumation-All Terminal-FxEnumation-All TerminalSize VersionWarning Wireless WsmanBrowser".split(" "), StatusStrs=["Disconnected","Connecting...","Setup...","Connected"],scriptstate,t,t2,rsepass=null; function startup(){var b=document.getElementsByTagName("input");for(t=0;tcurrentView&&(1==b.dataTransfer.files.length||2==b.dataTransfer.files.length)){var c=null,a=null;b.dataTransfer.files[0].name.toLowerCase().endsWith(".iso")&&(a=b.dataTransfer.files[0]);b.dataTransfer.files[0].name.toLowerCase().endsWith(".img")&&(c=b.dataTransfer.files[0]);2==b.dataTransfer.files.length&&(b.dataTransfer.files[1].name.toLowerCase().endsWith(".iso")&&(a=b.dataTransfer.files[1]),b.dataTransfer.files[1].name.toLowerCase().endsWith(".img")&& @@ -910,7 +920,7 @@ function setUrlVar(b,c){urlvars||(urlvars={});urlvars[b]=c}function cleanup(){c3 function handleKeyUp(b){if(!xxdialogMode){if(14==currentView&&3==desktop.State){if(Q(50).checked)return;if(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop)webRtcDesktop.softdesktop.m.handleKeyUp(b),desktop.m.sendKeepAlive();else return desktop.m.handleKeyUp(b)}if(13==currentView&&3==terminal.State)return terminal.m.TermHandleKeyUp(b)}} function handleKeyDown(b){if(!xxdialogMode){if(14==currentView&&3==desktop.State){if(Q(50).checked)return;if(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop)webRtcDesktop.softdesktop.m.handleKeyDown(b),desktop.m.sendKeepAlive();else return desktop.m.handleKeyDown(b)}if(13==currentView&&3==terminal.State)return terminal.m.TermHandleKeyDown(b)}} function handleKeyPress(b){if(!xxdialogMode){if(14==currentView&&3==desktop.State){if(Q(50).checked)return;if(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop)webRtcDesktop.softdesktop.m.handleKeys(b),desktop.m.sendKeepAlive();else return desktop.m.handleKeys(b)}if(13==currentView&&3==terminal.State)return terminal.m.TermHandleKeys(b)}}var connectFunc=null,connectFuncTag=null; -function connect(b,c,a,d,e,p,h){go(0);fullscreenonly=!1;connectFunc=p;connectFuncTag=h;1==urlvars.kvm&&go(14);if(1==urlvars.kvmfull||1==urlvars.kvmonly)go(14),deskToggleFull(1==urlvars.kvmonly);1==urlvars.sol&&go(13);wsstack=WsmanStackCreateService(b,c,a,d,e);amtstack=AmtStackCreateService(wsstack);amtstack.onProcessChanged=onProcessChanged;for(b=2;25>b;b++)QV("go"+b,!1);QV("go8",!0);QV("go13",!1);QV("go12",!0);QV("go20",!0);QH(30,"");QH(41,"");amtversion=amtversionmin=amtFirstPull= +function connect(b,c,a,d,e,l,p){go(0);fullscreenonly=!1;connectFunc=l;connectFuncTag=p;1==urlvars.kvm&&go(14);if(1==urlvars.kvmfull||1==urlvars.kvmonly)go(14),deskToggleFull(1==urlvars.kvmonly);1==urlvars.sol&&go(13);wsstack=WsmanStackCreateService(b,c,a,d,e);amtstack=AmtStackCreateService(wsstack);amtstack.onProcessChanged=onProcessChanged;for(b=2;25>b;b++)QV("go"+b,!1);QV("go8",!0);QV("go13",!1);QV("go12",!0);QV("go20",!0);QH(30,"");QH(41,"");amtversion=amtversionmin=amtFirstPull= 0;amtsysstate=amtdeltatime=amtlogicalelements=HardwareInventory=void 0;amtPowerBootCapabilities=null;xxAccountFetch=999;QH(17,LoadingHtml);QH(21,LoadingHtml);amtwirelessif=-1;xxWireless=void 0;QH(22,"");QH(18,LoadingHtml);xxAccountAdminName=null;xxAccountRealmInfo={};QH(23,LoadingHtml);eventmessages=null;QH(19,"");QH(20,LoadingHtml);auditLog=null;QH(51,""); QH(52,LoadingHtml);xxCertificates=null;QH(53,LoadingHtml);QH(26,"");iderStop();xxPolicies=xxMPSUserPass=xxRemoteAccessCredentiaLinks=xxUserInitiatedCira=xxCiraServers=xxEnvironementDetection=xxRemoteAccess=null;QH(54,LoadingHtml);QH(56,LoadingHtml);xxSystemDefense=null;xxSystemDefenceLinkedPolicy={};xxUpdatingDefenseStats=!1;xxFilterStatistics=[{},{}];xxFilterStatisticsTimer=null;xxFilterStatisticsTimerActive= !1;QH(55,LoadingHtml);QE(45,!1);QE("DeskWD",!1);QE("deskkeys",!1);urlvars.kvmviewonly&&(QE(50,!1),Q(50).checked=!0);QE(46,!1);desktopScreenInfo=null;amtstack.BatchEnum("",["CIM_SoftwareIdentity","*AMT_SetupAndConfigurationService"],processSystemVersion);QV(13,!1);fupdatescript()} @@ -920,32 +930,34 @@ function checkAmtVersion(b){var c=b.split(".");b=parseInt(c[0]);var a=parseInt(c function processSystemVersion(b,c,a,d){if(200==d||400==d){if(200==d){amtlogicalelements=[];null!=a&&null!=a.CIM_SoftwareIdentity&&null!=a.CIM_SoftwareIdentity.responses&&(amtlogicalelements=a.CIM_SoftwareIdentity.responses,null!=a.AMT_SetupAndConfigurationService&&null!=a.AMT_SetupAndConfigurationService.response&&amtlogicalelements.push(a.AMT_SetupAndConfigurationService.response));if(0==amtlogicalelements.length){console.error("ERROR: Could not get Intel AMT version.");disconnect();return}c=getInstance(amtlogicalelements, "AMT").VersionString}else if(c=b.wsman.comm.amtVersion,!c){errcheck(400,b);return}amtversion=parseInt(c.split(".")[0]);amtversionmin=parseInt(c.split(".")[1]);QV(13,checkAmtVersion(c));PullSystemStatus();updateSystemStatus();1!=urlvars.kvmonly&&0==fullscreenonly&&(PullUserInfo(),8<=amtversion&&PullAlarms());connectFunc&&(connectFunc(connectFuncTag),connectFuncTag=connectFunc=null);1==urlvars.kvm&&(go(14),connectDesktop());if(1==urlvars.kvmfull||1==urlvars.kvmonly)go(14),connectDesktop(); 1==urlvars.sol&&(go(13),connectTerminal())}else errcheck(d,b)}var refreshButtonsState=!0;function refreshButtons(b){if(refreshButtonsState!=b){refreshButtonsState=b;for(var c=0,a=document.getElementsByTagName("input");cd&&(d=a[e].status);400!=d&&errcheck(d,b)||(amtsysstate=a,updateSystemStatus())}function syncClock(){xxdialogMode||setDialogMode(11,"Synchronize Clock",3,syncClockEx,"Synchronize Intel AMT clock with this computer?")} function syncClockEx(){amtstack.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch(function(b,c,a,d){200!=d?messagebox("","Failed to set time, status = "+d):0!=a.Body.ReturnValue?messagebox("","Failed to set time, error: "+a.Body.ReturnValueStr):(b=new Date,b=Math.round((b.getTime()-6E4*b.getTimezoneOffset())/1E3),amtstack.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch(a.Body.Ta0,b,b,function(){amtstack.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch(processSystemTime)}))})} var DMTFPowerStates=";;Power on;Light sleep;Deep sleep;Power cycle (Soft off);Off - Hard;Hibernate (Off soft);Soft off;Power cycle (Off-hard);Master bus reset;Diagnostic interrupt (NMI);Not applicable;Off - Soft graceful;Off - Hard graceful;Master bus reset graceful;Power cycle (Off - Soft graceful);Power cycle (Off - Hard graceful);Diagnostic interrupt (INIT)".split(";"); -function updateSystemStatus(){if(amtsysstate&&!(99Unknown";null!=amtsysstate.CIM_ServiceAvailableToElement&&null!=amtsysstate.CIM_ServiceAvailableToElement.responses&&0None":EscapeHtml(c);d+=TableEntry("Name & Domain",addLinkConditional(c,"showEditNameDlg()",xxAccountAdminName));HardwareInventory&&(d+=TableEntry("System ID",guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase()))); -if(amtlogicalelements){var h="",r=getItem(amtlogicalelements,"CreationClassName","AMT_SetupAndConfigurationService");2==r.ProvisioningState&&5h.DefaultScreen&&(e=["Primary display","Secondary display","3rd display"][h.DefaultScreen]),e=''+e+"",1==h.Is5900PortEnabled&&(e+=", Port 5900 enabled"),1==h.OptInPolicy&& -(e+=", "+h.OptInPolicyTimeout+" second"+(0"+ -TableEnd("
 "+AddRefreshButton("PullSystemStatus(1)")+" Changing network settings may cause this page to becaume unavailable.");d=d+"

General Settings

"+TableStart();e="";"None"!=c&&(1==p.SharedFQDN&&(e=", shared with OS"),0==p.SharedFQDN&&(e=", different from OS"));d+=TableEntry("Name & Domain",addLinkConditional(c+e,"showEditNameDlg(1)",xxAccountAdminName));c="Disabled";1==p.DDNSUpdateEnabled?c="Enabled each "+p.DDNSPeriodicUpdateInterval+" minutes, TTL is "+p.DDNSTTL+ -" minutes":1==p.DDNSUpdateByDHCPServerEnabled&&(c="Update by DHCP server");d+=TableEntry("Dynamic DNS",addLinkConditional(c,"showEditDnsDlg()",xxAccountAdminName));d+=TableEnd();for(a in amtsysstate.AMT_EthernetPortSettings.responses){c=amtsysstate.AMT_EthernetPortSettings.responses[a];if(c.WLANLinkProtectionLevel||1==a)amtwirelessif=a;if(0!=a||amtwirelessif==a||"00-00-00-00-00-00"!=c.MACAddress){0==a&&b++;d+="

"+(amtwirelessif==a?"Wireless":"Wired")+" Interface

";d+=TableStart();d+=TableEntry("Link state", -1==c.LinkIsUp?"Link is up":"Link is down");if(c.LinkPolicy){c.LinkPolicy=MakeToArray(c.LinkPolicy);e=[];for(k in c.LinkPolicy)1==c.LinkPolicy[k]&&e.push("S0/AC"),14==c.LinkPolicy[k]&&e.push("Sx/AC"),16==c.LinkPolicy[k]&&e.push("S0/DC"),224==c.LinkPolicy[k]&&e.push("Sx/DC");0==e.length&&e.push("");d+=TableEntry("Link policy",addLinkConditional(0==e.length?"Not available":"Available in: "+e.join(", "),"showLinkPolicyDlg("+a+")",xxAccountAdminName))}"00-00-00-00-00-00"!=c.MACAddress&&(d+=TableEntry("MAC address", -c.MACAddress));amtwirelessif==a&&xxWireless&&xxWireless.CIM_WiFiPortCapabilities.response&&(d+=TableEntry("State",addLinkConditional(xxWifiState[xxWireless.CIM_WiFiPort.response.EnabledState],"showWifiStateDlg()",xxAccountAdminName)),s=xxWireless.CIM_WiFiEndpoint.response.LANID,d+=TableEntry("Radio State",xxRadioState[xxWireless.CIM_WiFiEndpoint.response.EnabledState]+", SSID: "+(s?s:"None")));amtwirelessif!=a&&(d+=TableEntry("Respond to ping",addLinkConditional(["Disabled","ICMP response", -"RMCP response","ICMP & RMCP response"][p.PingResponseEnabled+(p.RmcpPingResponseEnabled<<1)],"showPingActionDlg()",xxAccountAdminName)),e=1==c.DHCPEnabled?"Automatic using DHCP server":"Static IP address",1==c.IpSyncEnabled&&(e+=", IP sync with OS"),d+=TableEntry("IPv4 state",addLinkConditional(e,"showIPSetupDlg()",xxAccountAdminName)));d+=TableEntry("IPv4 address",isIpAddress(c.IPAddress,"None"));isIpAddress(c.DefaultGateway)&&(d+=TableEntry("IPv4 gateway / Mask",c.DefaultGateway+" / "+isIpAddress(c.SubnetMask, -"None")));e=c.PrimaryDNS;isIpAddress(e)&&(c.SecondaryDNS&&(e+=" / "+c.SecondaryDNS),d+=TableEntry("IPv4 domain name server",e));if(200==amtsysstate.IPS_IPv6PortSettings.status&&5Unknown";if(null!=amtsysstate.CIM_ServiceAvailableToElement&&null!=amtsysstate.CIM_ServiceAvailableToElement.responses&&0None":EscapeHtml(c);d+=TableEntry("Name & Domain",addLinkConditional(c,"showEditNameDlg()",xxAccountAdminName));HardwareInventory&&(d+=TableEntry("System ID",guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));if(amtlogicalelements){var q="",n=getItem(amtlogicalelements,"CreationClassName","AMT_SetupAndConfigurationService");2==n.ProvisioningState&&5 +q.DefaultScreen&&(e=["Primary display","Secondary display","3rd display"][q.DefaultScreen]),e=''+e+"",1==q.Is5900PortEnabled&&(e+=", Port 5900 enabled"),1==q.OptInPolicy&&(e+=", "+q.OptInPolicyTimeout+" second"+(0"+TableEnd("
 "+AddRefreshButton("PullSystemStatus(1)")+" Changing network settings may cause this page to becaume unavailable.");d=d+"

General Settings

"+TableStart();e="";"None"!= +c&&(1==l.SharedFQDN&&(e=", shared with OS"),0==l.SharedFQDN&&(e=", different from OS"));d+=TableEntry("Name & Domain",addLinkConditional(c+e,"showEditNameDlg(1)",xxAccountAdminName));c="Disabled";1==l.DDNSUpdateEnabled?c="Enabled each "+l.DDNSPeriodicUpdateInterval+" minutes, TTL is "+l.DDNSTTL+" minutes":1==l.DDNSUpdateByDHCPServerEnabled&&(c="Update by DHCP server");d+=TableEntry("Dynamic DNS",addLinkConditional(c,"showEditDnsDlg()",xxAccountAdminName));d+=TableEnd();for(a in amtsysstate.AMT_EthernetPortSettings.responses){c= +amtsysstate.AMT_EthernetPortSettings.responses[a];if(c.WLANLinkProtectionLevel||1==a)amtwirelessif=a;if(0!=a||amtwirelessif==a||"00-00-00-00-00-00"!=c.MACAddress){0==a&&b++;d+="

"+(amtwirelessif==a?"Wireless":"Wired")+" Interface

";d+=TableStart();d+=TableEntry("Link state",1==c.LinkIsUp?"Link is up":"Link is down");if(c.LinkPolicy){c.LinkPolicy=MakeToArray(c.LinkPolicy);e=[];for(p in c.LinkPolicy)1==c.LinkPolicy[p]&&e.push("S0/AC"),14==c.LinkPolicy[p]&&e.push("Sx/AC"),16==c.LinkPolicy[p]&& +e.push("S0/DC"),224==c.LinkPolicy[p]&&e.push("Sx/DC");0==e.length&&e.push("");d+=TableEntry("Link policy",addLinkConditional(0==e.length?"Not available":"Available in: "+e.join(", "),"showLinkPolicyDlg("+a+")",xxAccountAdminName))}"00-00-00-00-00-00"!=c.MACAddress&&(d+=TableEntry("MAC address",c.MACAddress));amtwirelessif==a&&xxWireless&&xxWireless.CIM_WiFiPortCapabilities.response&&(d+=TableEntry("State",addLinkConditional(xxWifiState[xxWireless.CIM_WiFiPort.response.EnabledState],"showWifiStateDlg()", +xxAccountAdminName)),s=xxWireless.CIM_WiFiEndpoint.response.LANID,d+=TableEntry("Radio State",xxRadioState[xxWireless.CIM_WiFiEndpoint.response.EnabledState]+", SSID: "+(s?s:"None")));amtwirelessif!=a&&(d+=TableEntry("Respond to ping",addLinkConditional(["Disabled","ICMP response","RMCP response","ICMP & RMCP response"][l.PingResponseEnabled+(l.RmcpPingResponseEnabled<<1)],"showPingActionDlg()",xxAccountAdminName)),e=1==c.DHCPEnabled?"Automatic using DHCP server":"Static IP address",1==c.IpSyncEnabled&& +(e+=", IP sync with OS"),d+=TableEntry("IPv4 state",addLinkConditional(e,"showIPSetupDlg()",xxAccountAdminName)));d+=TableEntry("IPv4 address",isIpAddress(c.IPAddress,"None"));isIpAddress(c.DefaultGateway)&&(d+=TableEntry("IPv4 gateway / Mask",c.DefaultGateway+" / "+isIpAddress(c.SubnetMask,"None")));e=c.PrimaryDNS;isIpAddress(e)&&(c.SecondaryDNS&&(e+=" / "+c.SecondaryDNS),d+=TableEntry("IPv4 domain name server",e));if(200==amtsysstate.IPS_IPv6PortSettings.status&&5Available in S0/AC - Powered on & plugged in
");a+="
";a+="
";a+="
";setDialogMode(11,"Link Policy",3,showLinkPolicyDlgEx,a,b)}} function showLinkPolicyDlgEx(b,c){var a=Clone(amtsysstate.AMT_EthernetPortSettings.responses[c]);a.DHCPEnabled&&(delete a.IPAddress,delete a.SubnetMask,delete a.DefaultGateway,delete a.PrimaryDNS,delete a.SecondaryDNS);a.LinkPolicy=[];Q("d11p1").checked&&a.LinkPolicy.push(1);Q("d11p2").checked&&a.LinkPolicy.push(14);Q("d11p3").checked&&a.LinkPolicy.push(16);Q("d11p4").checked&&a.LinkPolicy.push(224);amtstack.Put("AMT_EthernetPortSettings",a,showLinkPolicyDlgExDone,0,1,a)} @@ -964,8 +976,8 @@ function showDesktopSettingsDlgOk3(b,c,a,d){200!=d?messagebox("Error","Screen Bl var processMessageLog0responses=null; function processMessageLog0(b,c,a,d){200==d&&(d&&QV("go6",!0),a&&(processMessageLog0responses=a),b="",c="",null!=processMessageLog0responses&&(b=1==processMessageLog0responses[0].IsFrozen?AddButton("Un-freeze Log","FreezeLog(0)"):AddButton("Freeze Log","FreezeLog(1)")),c+=TableEnd("
 
 "+AddRefreshButton("PullEventLog(1)")+ AddButton("Clear Log","ClearLog()")+AddButton("Save...","SaveEventLog()")+b),QH(19,c+"
"))}function SaveEventLog(){xxdialogMode||null==eventmessages||SaveJsonFile("IntelAmtEventlog","events","Intel AMT Event Log",eventmessages)}var eventmessages=null; -function processMessageLog1(b,c){eventmessages=c;var a,d=0,e;e="

  EventTimeSourceDescription";for(a in c){d++;var p=1,h=c[a];8<=h.EventSeverity&&(p=2);16<=h.EventSeverity&&(p=3);e+="

"+(parseInt(a)+1)+"
"+h.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"
"+h.Time.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"
"+h.EntityStr.replace("(r)","®")+""+h.Desc}e+=TableEnd(0==d?" ":"");QH(20,e+"
");processMessageLog0()} +function processMessageLog1(b,c){eventmessages=c;var a,d=0,e;e="

  EventTimeSourceDescription";for(a in c){d++;var l=1,p=c[a];8<=p.EventSeverity&&(l=2);16<=p.EventSeverity&&(l=3);e+="

"+(parseInt(a)+1)+"
"+p.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"
"+p.Time.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"
"+p.EntityStr.replace("(r)","®")+""+p.Desc}e+=TableEnd(0==d?" ":"");QH(20,e+"
");processMessageLog0()} function FreezeLog(b){xxdialogMode||amtstack.AMT_MessageLog_FreezeLog(b,function(){amtstack.Enum("AMT_MessageLog",processMessageLog0)})}function ClearLog(b){xxdialogMode||(QH(62,"Clear event log?"),setDialogMode(1,"Event Log",3,ClearLogEx))}function ClearLogEx(){amtstack.AMT_MessageLog_ClearLog(function(b,c,a,d){200!=d?messagebox("Event Log","Unable to clear, Error: "+d):PullEventLog()})} function showEventDetails(b){if(!xxdialogMode){var c=eventmessages[b],a;a="
"+addHtmlValue("Time",c.Time.toLocaleString());a+=addHtmlValue("Source",c.EntityStr.replace("(r)","®"));a+=addHtmlValue("Description",c.Desc);a+=MoreStart();a+=addHtmlValue("Device Address",c.DeviceAddress);a+=addHtmlValue("Entity",c.Entity);a+=addHtmlValue("Entity Instance",c.EntityInstance);var d="",e;for(e in c.EventData)0")}} @@ -986,8 +998,8 @@ function newSubscriptionButtonOk(){var b=0==Q("subuser").value.length?void 0:Q(" function PullAuditLog(b){1==b&&xxdialogMode||(amtFirstPull|=32,amtstack.Enum("AMT_AuditLog",processAuditLog0))}var auditLog=null,auditLogEnabledStates="Unknown;Other;Enabled;Disabled;Shutting Down;Not Applicable;Enabled but Offline;In Test;Deferred;Quiesce;Starting".split(";"); function processAuditLog0(b,c,a,d){200==d&&(QV("go15",!0),c=a[0].AuditState,b=c&1?"Disabled":"Enabled",c&2&&(b+=", Locked"),c&4&&(b+=", Almost Full"),c&8&&(b+=", Full"),c&16&&(b+=", NoKey"),c="

Audit Log Settings

"+TableStart(),c+=TableEntry("State",b),c+=TableEntry("Storage",a[0].CurrentNumberOfRecords+" record(s), "+a[0].PercentageFree+"% free"),c+=TableEntry("Overwrite policy",2==a[0].OverwritePolicy?"Wraps when full":"Never overwrites"),c+=TableEnd(),QH(51,c),amtstack.GetAuditLog(processAuditLog1))} function processAuditLog1(b,c){auditLog=c;var a,d;d=""+(TableEnd("
 
"+AddRefreshButton("PullAuditLog(1)")+AddButton("Save...","SaveAuditLog()")+AddButton("Clear Log","ClearAuditLog()"))+"
");if(0==c.length)d="No audit log events found.";else{var e=0;d+="

  TimeInitiatorAction"; -for(a in c){var p=c[a],h=p.AuditApp,r=p.Initiator;e++;var n="";0  "+p.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"
  "+p.Time.toLocaleTimeString("en", -{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"
"+r+n+""+h}d+=TableEnd(0==e?" ":"")+"
"}QH(52,d)}function auditFilter(){var b=Q("auditFilter").value.toLowerCase(),c;for(c in auditLog)QV("xamtaudit"+c,""==b||0<=JSON.stringify(auditLog[c]).toLowerCase().indexOf(b))}function SaveAuditLog(){xxdialogMode||null==auditLog||SaveJsonFile("IntelAmtAuditlog","auditevents","Intel AMT Audit Log",auditLog)} +for(a in c){var l=c[a],p=l.AuditApp,q=l.Initiator;e++;var n="";0
  "+l.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"
  "+l.Time.toLocaleTimeString("en", +{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"
"+q+n+""+p}d+=TableEnd(0==e?" ":"")+"
"}QH(52,d)}function auditFilter(){var b=Q("auditFilter").value.toLowerCase(),c;for(c in auditLog)QV("xamtaudit"+c,""==b||0<=JSON.stringify(auditLog[c]).toLowerCase().indexOf(b))}function SaveAuditLog(){xxdialogMode||null==auditLog||SaveJsonFile("IntelAmtAuditlog","auditevents","Intel AMT Audit Log",auditLog)} function ClearAuditLog(b){QH(62,"Clear audit log?");setDialogMode(1,"Audit Log",3,ClearAuditLogEx)}function ClearAuditLogEx(){var b=amtstack.AMT_AuditLog_SetAuditLock(1,0,b,function(){amtstack.AMT_AuditLog_ClearLog(function(){amtstack.AMT_AuditLog_SetAuditLock(0,2,b,function(){setTimeout(PullAuditLog,1E3)})})})}function ShowAuditLogSettings(){xxdialogMode||amtstack.AMT_AuditLog_RequestStateChange(2,0,AuditLogSettingsCompleted)} function AuditLogSettingsCompleted(b,c,a,d){200==d?PullAuditLog():messagebox("Audit Log","Error: "+d)} function showAuditDetails(b){if(!xxdialogMode){var c,a=auditLog[b],d;d="
"+addHtmlValue("Time",a.Time.toLocaleString());""!=a.Initiator&&(d+=addHtmlValue("Initiator",a.Initiator));""!=a.NetAddress&&(d+=addHtmlValue("Address",a.NetAddress));d+=addHtmlValue("Application",a.AuditApp);d+=addHtmlValue("Event",a.Event);if(null!=a.ExStr)d+=addHtmlValue("Extended Data",a.ExStr);else if(0"+xxCertificates[c].XSubject.CN+"");b+="
Certificate

Manage Intel® AMT agent presence watchdogs.

";if(null==xxWatchdog.AMT_AgentPresenceWatchdog.responses|| 0==xxWatchdog.AMT_AgentPresenceWatchdog.responses.length)b+="
No agent presence watchdog found.

";else for(var c in xxWatchdog.AMT_AgentPresenceWatchdog.responses){var a=xxWatchdog.AMT_AgentPresenceWatchdog.responses[c],d=guidToStr(rstr2hex(atob(a.DeviceID)));a.MonitoredEntityDescription&&""!=a.MonitoredEntityDescription&&(d=EscapeHtml(a.MonitoredEntityDescription));b+="
";a.transitions&&(b+="");b+="
"+d+", "+amtstack.WatchdogCurrentStates[a.CurrentState]+"
";var d="",e;for(e in a.transitions){var p=a.transitions[e];""!=d&&(d+="
");d+=getWatchdogTransitionStr(p.OldState)+" → "+getWatchdogTransitionStr(p.NewState);p.actions&&1==p.actions[0].EventOnTransition&&(d+=" : Event to log")}""!=d&&(b+="
"+ +c+")>";a.transitions&&(b+="");b+="
"+d+", "+amtstack.WatchdogCurrentStates[a.CurrentState]+"
";var d="",e;for(e in a.transitions){var l=a.transitions[e];""!=d&&(d+="
");d+=getWatchdogTransitionStr(l.OldState)+" → "+getWatchdogTransitionStr(l.NewState);l.actions&&1==l.actions[0].EventOnTransition&&(d+=" : Event to log")}""!=d&&(b+="
"+ d+"
");b+="
"}b=b+"
"+TableEnd(AddRefreshButton("PullWatchdog()")+AddButton("Add Watchdog...","AddWatchdog()"));b+="
";QH(56,b)}}function getWatchdogTransitionStr(b){if(31==b)return"Any State";var c="",a;for(a in amtstack.WatchdogCurrentStates)0!=(b&a)&&(c+=", "+amtstack.WatchdogCurrentStates[a]);return c.substring(2)} function showWatchdogDetails(b){b=xxWatchdog.AMT_AgentPresenceWatchdog.responses[b];var c="";b.MonitoredEntityDescription&&""!=b.MonitoredEntityDescription&&(c+=addHtmlValue("Description",EscapeHtml(b.MonitoredEntityDescription)));c+=addHtmlValue("Monitored Entity",watchdogMonitoredEntity[b.MonitoredEntity]);c+=addHtmlValue("Current State",amtstack.WatchdogCurrentStates[b.CurrentState]);c+=addHtmlValue("Enabled State",watchdogEnabledStates[b.EnabledState]);c+=addHtmlValue("Startup Interval",b.StartupInterval+ " second(s)");c+=addHtmlValue("Timeout Interval",b.TimeoutInterval+" second(s)");setDialogMode(11,"Watchdog "+guidToStr(rstr2hex(atob(b.DeviceID))),5,showWatchdogDetailsOk,c,b)}function showWatchdogDetailsOk(b,c){2==b&&amtstack.Delete("AMT_AgentPresenceWatchdog",{DeviceID:c.DeviceID},PullWatchdog)} @@ -1057,11 +1069,11 @@ a}b+=TableStart();c="None";xxSystemDefenceLinkedPolicy[0]&&(c=xxSystemDef "
No system defense policies found.

";else for(c in xxSystemDefense.AMT_SystemDefensePolicy.responses)a=xxSystemDefense.AMT_SystemDefensePolicy.responses[c],d="",a.FilterCreationHandles&&(a.FilterCreationHandles=MakeToArray(a.FilterCreationHandles),d=a.FilterCreationHandles.length,d=", "+d+" filter"+(1
"+EscapeHtml(a.PolicyName)+""+d+"
";b+="

Manage Intel® AMT system defense filters.

"; if(0==xxSystemDefense.AMT_Hdr8021Filter.responses.length&&0==xxSystemDefense.AMT_IPHeadersFilter.responses.length)b+="
No system defense filters found.

";else{for(c in xxSystemDefense.AMT_Hdr8021Filter.responses)a=xxSystemDefense.AMT_Hdr8021Filter.responses[c],(d=xxSystemDefenceFilterEthernetTypes[a.HdrProtocolID8021])||(d="All Ethernet Protocol "+a.HdrProtocolID8021),d+=", "+xxSystemDefenceFilterDesc[a.FilterProfile],2==a.FilterProfile&&(d+=" at "+a.FilterProfileData+ " packet / sec"),1==a.ActionEventOnMatch&&(d+=", Event on match"),b+="
"+(0==a.FilterDirection?"← ":"→ ")+EscapeHtml(a.Name)+", "+d+"
";for(c in xxSystemDefense.AMT_IPHeadersFilter.responses){a=xxSystemDefense.AMT_IPHeadersFilter.responses[c];(d=xxSystemDefenceFilterIPTypes[a.HdrIPVersion])||(d="All Ethernet Protocol "+a.HdrIPVersion);d+=", "+xxSystemDefenceFilterDesc[a.FilterProfile];2== -a.FilterProfile&&(d+=" at "+a.FilterProfileData+" packet / sec");1==a.ActionEventOnMatch&&(d+=", Event on match");var p=0;for(e in xxSystemDefenceFilters)a[e]&&p++;0
"+(0==a.FilterDirection?"← ":"→ ")+EscapeHtml(a.Name)+", "+d+"
"}}b+="
"+TableEnd(AddRefreshButton("PullSystemDefense()")+AddButton("Add Filter...","AddDefenseFilter()")+ +a.FilterProfile&&(d+=" at "+a.FilterProfileData+" packet / sec");1==a.ActionEventOnMatch&&(d+=", Event on match");var l=0;for(e in xxSystemDefenceFilters)a[e]&&l++;0
"+(0==a.FilterDirection?"← ":"→ ")+EscapeHtml(a.Name)+", "+d+"
"}}b+="
"+TableEnd(AddRefreshButton("PullSystemDefense()")+AddButton("Add Filter...","AddDefenseFilter()")+ AddButton("Add Policy...","AddDefensePolicy()"));QH(55,b);null==xxFilterStatisticsTimer&&(UpdateDefenseStats(),xxFilterStatisticsTimerActive=!1,urlvars.norefresh||(xxFilterStatisticsTimer=setInterval(UpdateDefenseStats,5E3)))}}function StopDefenseStatsTimer(){null!=xxFilterStatisticsTimer&&(clearInterval(xxFilterStatisticsTimer),xxFilterStatisticsTimer=null);xxFilterStatisticsTimerActive=!1} function UpdateDefenseStats(b){if(b||1!=xxFilterStatisticsTimerActive)xxFilterStatisticsTimerActive=!0,b=b?b:0,xxSystemDefenceLinkedPolicy[b]?amtstack.AMT_SystemDefensePolicy_UpdateStatistics('http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_EthernetPortIntel(r) AMT Ethernet Port '+b+"",!1,UpdateDefenseStats2,b,0,{InstanceID:xxSystemDefenceLinkedPolicy[b].InstanceID}): (xxFilterStatistics[b]={},updateSystemDefense(),StopDefenseStatsTimer())}function UpdateDefenseStats2(b,c,a,d,e){200==d?amtstack.Enum("AMT_ActiveFilterStatistics",UpdateDefenseStats3,e):StopDefenseStatsTimer()} -function UpdateDefenseStats3(b,c,a,d,e){b=0;if(200==d){xxFilterStatistics[e]={};for(var p in a)d=a[p].ReadCount,c=getItem(a[p].Dependent.ReferenceParameters.SelectorSet.Selector[1].Value.EndpointReference.ReferenceParameters.SelectorSet.Selector,"@Name","Name").Value,xxFilterStatistics[e][c]=d,b++;updateSystemDefense()}xxFilterStatisticsTimerActive=!1;0==b&&StopDefenseStatsTimer()} +function UpdateDefenseStats3(b,c,a,d,e){b=0;if(200==d){xxFilterStatistics[e]={};for(var l in a)d=a[l].ReadCount,c=getItem(a[l].Dependent.ReferenceParameters.SelectorSet.Selector[1].Value.EndpointReference.ReferenceParameters.SelectorSet.Selector,"@Name","Name").Value,xxFilterStatistics[e][c]=d,b++;updateSystemDefense()}xxFilterStatisticsTimerActive=!1;0==b&&StopDefenseStatsTimer()} function changeDefaultPolicy(b){if(!xxdialogMode){var c;c="
Default Policy
",b)}} function changeDefaultPolicyOk(b,c){var a=Q("policySelection").value,d=xxSystemDefenceLinkedPolicy[c];d&&amtstack.Delete("AMT_NetworkPortSystemDefensePolicy",'http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymoushttp://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_EthernetPortCIM_EthernetPortIntel(r) AMT Ethernet Port '+c+ @@ -1074,12 +1086,12 @@ function AddDefenseFilter(){if(!xxdialogMode){var b;b="
=Q("filtertype").value){var b=0==Q("filtertype").value?2048:2054,c={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrProtocolID8021:b,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value};2==Q("filterprofile").value&&(c.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_Hdr8021Filter",c,AddDefenseFilterOk2)}else{var b=2==Q("filtertype").value? -4:6,c={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrIPVersion:b,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value},a=Q("ipfilter").value.split(","),d;for(d in a){var e=a[d].indexOf("="),p=a[d].substring(0,e),e=a[d].substring(e+1),h=xxSystemDefenceFilters[p];h||(p="Hdr"+p,h=xxSystemDefenceFilters[p]);h&&(2==h&&4==b?(e=e.split("."),4==e.length&&(c[p]=rstr2hex(String.fromCharCode(parseInt(e[0]), -parseInt(e[1]),parseInt(e[2]),parseInt(e[3]))))):c[p]=e)}2==Q("filterprofile").value&&(c.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_IPHeadersFilter",c,AddDefenseFilterOk2)}}function AddDefenseFilterUpdate(){var b=0b);QE("c48",b);QV("filterdatadiv",2==Q("filterprofile").value);QV("ipfilterdiv",2<=Q("filtertype").value)} +4:6,c={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrIPVersion:b,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value},a=Q("ipfilter").value.split(","),d;for(d in a){var e=a[d].indexOf("="),l=a[d].substring(0,e),e=a[d].substring(e+1),p=xxSystemDefenceFilters[l];p||(l="Hdr"+l,p=xxSystemDefenceFilters[l]);p&&(2==p&&4==b?(e=e.split("."),4==e.length&&(c[l]=rstr2hex(String.fromCharCode(parseInt(e[0]), +parseInt(e[1]),parseInt(e[2]),parseInt(e[3]))))):c[l]=e)}2==Q("filterprofile").value&&(c.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_IPHeadersFilter",c,AddDefenseFilterOk2)}}function AddDefenseFilterUpdate(){var b=0b);QE("c48",b);QV("filterdatadiv",2==Q("filterprofile").value);QV("ipfilterdiv",2<=Q("filtertype").value)} function AddDefenseFilterOk2(b,c,a,d){200!=d?messagebox("Add System Defense Filter","Unable to add filter, error #"+d):PullSystemDefense()} -function showFilterDetails(b,c){if(!xxdialogMode){var a,d,e,p;0==b?(p="AMT_Hdr8021Filter",e="Ethernet Traffic",d=xxSystemDefense[p].responses[c],(a=xxSystemDefenceFilterEthernetTypes[d.HdrProtocolID8021])||(a="All Ethernet Protocol "+d.HdrProtocolID8021)):(p="AMT_IPHeadersFilter",e="IP Traffic",d=xxSystemDefense[p].responses[c],(a=xxSystemDefenceFilterIPTypes[d.HdrIPVersion])||(a="All IP Protocol "+d.HdrIPVersion));var h;h=""+addHtmlValue("Name",EscapeHtml(d.Name));h+=addHtmlValue("Type",e);h+=addHtmlValue("Matching Traffic", -a);h+=addHtmlValue("Direction",0==d.FilterDirection?"Outbound / Transmit":"Inbound / Receive");if(1==b)for(var r in xxSystemDefenceFilters)d[r]&&(a=r,e=d[r],b=xxSystemDefenceFilters[r],2==b&&4==e.length&&(e=hex2rstr(e),e=e.charCodeAt(0)+"."+e.charCodeAt(1)+"."+e.charCodeAt(2)+"."+e.charCodeAt(3)),a.startsWith("Hdr")&&(a=a.substring(3)),h+=addHtmlValue("Filter "+a,e));h+=addHtmlValue("Event on match",1==d.ActionEventOnMatch?"Yes":"No");setDialogMode(11,"Ethernet Filter #"+d.InstanceID,5,showFilterDetailsOk, -h,[p,d])}}function showFilterDetailsOk(b,c){2==b&&amtstack.Delete(c[0],c[1],deleteDefenseFilter)}function deleteDefenseFilter(b,c,a,d){200!=d?messagebox("Remove Filter","Unable to remove filter, make sure it's not in use."):PullSystemDefense()}var xxAddDefensePolicyFilters; +function showFilterDetails(b,c){if(!xxdialogMode){var a,d,e,l;0==b?(l="AMT_Hdr8021Filter",e="Ethernet Traffic",d=xxSystemDefense[l].responses[c],(a=xxSystemDefenceFilterEthernetTypes[d.HdrProtocolID8021])||(a="All Ethernet Protocol "+d.HdrProtocolID8021)):(l="AMT_IPHeadersFilter",e="IP Traffic",d=xxSystemDefense[l].responses[c],(a=xxSystemDefenceFilterIPTypes[d.HdrIPVersion])||(a="All IP Protocol "+d.HdrIPVersion));var p;p=""+addHtmlValue("Name",EscapeHtml(d.Name));p+=addHtmlValue("Type",e);p+=addHtmlValue("Matching Traffic", +a);p+=addHtmlValue("Direction",0==d.FilterDirection?"Outbound / Transmit":"Inbound / Receive");if(1==b)for(var q in xxSystemDefenceFilters)d[q]&&(a=q,e=d[q],b=xxSystemDefenceFilters[q],2==b&&4==e.length&&(e=hex2rstr(e),e=e.charCodeAt(0)+"."+e.charCodeAt(1)+"."+e.charCodeAt(2)+"."+e.charCodeAt(3)),a.startsWith("Hdr")&&(a=a.substring(3)),p+=addHtmlValue("Filter "+a,e));p+=addHtmlValue("Event on match",1==d.ActionEventOnMatch?"Yes":"No");setDialogMode(11,"Ethernet Filter #"+d.InstanceID,5,showFilterDetailsOk, +p,[l,d])}}function showFilterDetailsOk(b,c){2==b&&amtstack.Delete(c[0],c[1],deleteDefenseFilter)}function deleteDefenseFilter(b,c,a,d){200!=d?messagebox("Remove Filter","Unable to remove filter, make sure it's not in use."):PullSystemDefense()}var xxAddDefensePolicyFilters; function AddDefensePolicy(){if(!xxdialogMode){xxAddDefensePolicyFilters=[];var b;b="
Name
Default TX / RX
";b+= "
";if(0
Add Filter
"}setDialogMode(11,"Add System Defense Policy",3,AddDefensePolicyOk,b);AddDefensePolicyUpdate()}}function addFilterButton(){0<=xxAddDefensePolicyFilters.indexOf(Q("xfilter").value)||(xxAddDefensePolicyFilters.push(Q("xfilter").value),AddDefensePolicyUpdate())} @@ -1106,8 +1118,8 @@ function updateWifiDialog(){var b=!0,c=c25.value,a=c26.value;QV(68,4>c);QV(67,3< c28.value)}function PullHardware(){amtstack.BatchEnum("","*CIM_ComputerSystemPackage CIM_SystemPackaging *CIM_Chassis CIM_Chip *CIM_Card *CIM_BIOSElement CIM_Processor CIM_PhysicalMemory CIM_MediaAccessDevice CIM_PhysicalPackage".split(" "),processHardware);amtFirstPull|=1} var DMTFCPUStatus="Unknown;Enabled;Disabled by User;Disabled By BIOS (POST Error);Idle;Other".split(";"),DMTFMemType="Unknown;Other;DRAM;Synchronous DRAM;Cache DRAM;EDO;EDRAM;VRAM;SRAM;RAM;ROM;Flash;EEPROM;FEPROM;EPROM;CDRAM;3DRAM;SDRAM;SGRAM;RDRAM;DDR;DDR-2;BRAM;FB-DIMM;DDR3;FBD2;DDR4;LPDDR;LPDDR2;LPDDR3;LPDDR4".split(";"),DMTFMemFormFactor=";Other;Unknown;SIMM;SIP;Chip;DIP;ZIP;Proprietary Card;DIMM;TSOP;Row of chips;RIMM;SODIMM;SRIMM;FB-DIM".split(";"),DMTFProcFamilly={191:"Intel® Core™ 2 Duo Processor", 192:"Intel® Core™ 2 Solo processor",193:"Intel® Core™ 2 Extreme processor",194:"Intel® Core™ 2 Quad processor",195:"Intel® Core™ 2 Extreme mobile processor",196:"Intel® Core™ 2 Duo mobile processor",197:"Intel® Core™ 2 Solo mobile processor",198:"Intel® Core™ i7 processor",199:"Dual-Core Intel® Celeron® processor"},HardwareInventory; -function processHardware(b,c,a,d){if(200==d){var e;b="";HardwareInventory=a;QV("go2",!0);b+=TableEnd("
 "+AddRefreshButton("PullHardware(1)")+AddButton("Save...","SaveHardwareLog()")+" Hardware information is gathered at system boot time.");c=a.CIM_Chassis.response;d=a.CIM_Card.response;var p=a.CIM_BIOSElement.response.SoftwareElementID;b=b+"

Platform

"+FullTable({"Computer model":c.Model,Manufacturer:c.Manufacturer, -Version:c.Version,"Serial number":c.SerialNumber,"System ID":guidToStr(a.CIM_SystemPackaging.responses[0].PlatformGUID).toLowerCase()},"");b+="

Baseboard

";b+=FullTable({Manufacturer:d.Manufacturer,"Product name":d.Model,Version:d.Version,"Serial number":d.SerialNumber,"Asset tag":d.Tag,"Replaceable?":1==d.CanBeFRUed?"Yes":"No"},"");b+="

BIOS

";b+=FullTable({Vendor:a.CIM_BIOSElement.response.Manufacturer,Version:p,"Release date":(new Date(a.CIM_BIOSElement.response.ReleaseDate.Datetime)).toLocaleDateString("en", +function processHardware(b,c,a,d){if(200==d){var e;b="
";HardwareInventory=a;QV("go2",!0);b+=TableEnd("
 "+AddRefreshButton("PullHardware(1)")+AddButton("Save...","SaveHardwareLog()")+" Hardware information is gathered at system boot time.");c=a.CIM_Chassis.response;d=a.CIM_Card.response;var l=a.CIM_BIOSElement.response.SoftwareElementID;b=b+"

Platform

"+FullTable({"Computer model":c.Model,Manufacturer:c.Manufacturer, +Version:c.Version,"Serial number":c.SerialNumber,"System ID":guidToStr(a.CIM_SystemPackaging.responses[0].PlatformGUID).toLowerCase()},"");b+="

Baseboard

";b+=FullTable({Manufacturer:d.Manufacturer,"Product name":d.Model,Version:d.Version,"Serial number":d.SerialNumber,"Asset tag":d.Tag,"Replaceable?":1==d.CanBeFRUed?"Yes":"No"},"");b+="

BIOS

";b+=FullTable({Vendor:a.CIM_BIOSElement.response.Manufacturer,Version:l,"Release date":(new Date(a.CIM_BIOSElement.response.ReleaseDate.Datetime)).toLocaleDateString("en", {timeZone:"UTC"})},"");b+="
";for(e in a.CIM_Processor.responses)c=a.CIM_Processor.responses[e],d=a.CIM_Chip.responses[e],b+="

Processor "+(parseInt(e)+1)+"

",b+=FullTable({Manufacturer:trademarks(d.Manufacturer),Family:DMTFProcFamilly[c.Family],Version:trademarks(d.Version),"Maximum socket speed":c.MaxClockSpeed+" MHz",Status:DMTFCPUStatus[c.CPUStatus]},"");b+="
";for(e in a.CIM_PhysicalMemory.responses)c=a.CIM_PhysicalMemory.responses[e],b+="

Memory Module "+(+e+1)+"

",b+=FullTable({"Bank Label":c.BankLabel, Manufacturer:c.Manufacturer,"Serial Number":c.SerialNumber,Size:parseInt(c.Capacity/1048576)+" MB","Form factor":DMTFMemFormFactor[c.FormFactor],Type:DMTFMemType[c.MemoryType],"Asset tag":c.Tag,"Part number":c.PartNumber},"");b+="
";for(e in a.CIM_MediaAccessDevice.responses)c=a.CIM_MediaAccessDevice.responses[e],d=a.CIM_PhysicalPackage.responses[+e+1],b+="

Storage Media "+(parseInt(e)+1)+"

",b+=FullTable({Model:d.Model,"Serial number":""==d.SerialNumber?"Unknown":d.SerialNumber,Size:parseInt(Math.round(1E3* c.MaxMediaSize/1048576))+" MB"},"");b+="
";QH(18,b);updateSystemStatus()}}function SaveHardwareLog(){!xxdialogMode&&HardwareInventory&&SaveJsonFile("IntelAmtHardware","hardware","Intel AMT Hardware Information",HardwareInventory)}var AmtSystemPowerSchemes=null;function PullPowerPolicy(){amtstack.Enum("AMT_SystemPowerScheme",powerPolicyResponse)}function powerPolicyResponse(b,c,a,d){AmtSystemPowerSchemes=a;updateSystemStatus()} @@ -1116,24 +1128,24 @@ function showPowerPolicyDlgOk(){for(var b=null,c=0,a=document.getElementsByTagNa function PullUserInfo(){xxAccountFetch=1;delete xxAccountAdminName;xxAccountRealmInfo={};amtstack.AMT_AuthorizationService_GetAdminAclEntry(getAdminAclEntryResponse);amtstack.AMT_AuthorizationService_EnumerateUserAclEntries(1,enumerateUserAclEntriesResponse)}function getAdminAclEntryResponse(b,c,a,d){200==d&&(xxAccountRealmInfo[-1]={AccessPermission:999,DigestUsername:a.Body.Username,Realms:null},xxAccountAdminName=a.Body.Username,updateAccounts())} function enumerateUserAclEntriesResponse(b,c,a,d){if(200==d){methodcheck(a);QV("go11",!0);xxAccountFetch=a.Body.Handles.length;for(var e in a.Body.Handles)b=a.Body.Handles[e],amtstack.AMT_AuthorizationService_GetAclEnabledState(b,getAclEnabledStateResponse,b),amtstack.AMT_AuthorizationService_GetUserAclEntryEx(b,getUserAclEntryExResponse,b);updateAccounts()}} function getUserAclEntryExResponse(b,c,a,d,e){xxAccountFetch--;200==d&&(a.Body.Handle=e,a.Body.Realms?Array.isArray(a.Body.Realms)||(a.Body.Realms=[a.Body.Realms]):a.Body.Realms=[],xxAccountRealmInfo[e]=a.Body,updateAccounts())}function getAclEnabledStateResponse(b,c,a,d,e){200==d&&(xxAccountEnabledInfo[e]=a.Body,updateAccounts())}function setAclEnabledStateResponse(b,c,a,d,e){errcheck(d,b)||(methodcheck(a),amtstack.AMT_AuthorizationService_GetAclEnabledState(e,getAclEnabledStateResponse,e))} -function updateAccounts(){if(!(0

Manage the Intel® AMT user accounts for this computer.

",c;for(c in xxAccountRealmInfo){var a=xxAccountRealmInfo[c],d,e=!1,p=0;a.DigestUsername?(d=a.DigestUsername,e="$"==d[0]&&"$"==d[1]):d=GetSidString(atob(a.KerberosUserSid));xxAccountEnabledInfo[c]&&"$$OsAdmin"!=d&&(p=1==xxAccountEnabledInfo[c].Enabled?1:2);if(showHiddenAccounts||!e){var h="";if(999!=a.AccessPermission){2== -p&&(h+="Disabled, ");var r=0;for(c in a.Realms)""!=amtstack.RealmNames[a.Realms[c]]&&r++;0<=a.Realms.indexOf(20)&&(h+="Auditor, ");h=0<=a.Realms.indexOf(3)?h+"Administrator":1==r?h+"1 realm":h+(r+" realms")}else h+="Administrator",a.Handle=-1;b+="
";0"+d+"
"+h+"
"}}c="
 "+AddRefreshButton("xxAccountFetch=999;PullUserInfo()");xxAccountAdminName&&(c+=AddButton("New Account", +function updateAccounts(){if(!(0

Manage the Intel® AMT user accounts for this computer.

",c;for(c in xxAccountRealmInfo){var a=xxAccountRealmInfo[c],d,e=!1,l=0;a.DigestUsername?(d=a.DigestUsername,e="$"==d[0]&&"$"==d[1]):d=GetSidString(atob(a.KerberosUserSid));xxAccountEnabledInfo[c]&&"$$OsAdmin"!=d&&(l=1==xxAccountEnabledInfo[c].Enabled?1:2);if(showHiddenAccounts||!e){var p="";if(999!=a.AccessPermission){2== +l&&(p+="Disabled, ");var q=0;for(c in a.Realms)""!=amtstack.RealmNames[a.Realms[c]]&&q++;0<=a.Realms.indexOf(20)&&(p+="Auditor, ");p=0<=a.Realms.indexOf(3)?p+"Administrator":1==q?p+"1 realm":p+(q+" realms")}else p+="Administrator",a.Handle=-1;b+="
";0"+d+"
"+p+"
"}}c="
 "+AddRefreshButton("xxAccountFetch=999;PullUserInfo()");xxAccountAdminName&&(c+=AddButton("New Account", "newAccountButton()"));b+="
"+TableEnd(c+"");QH(23,b)}}function toggleAccountButton(){showHiddenAccounts=!showHiddenAccounts;updateAccounts()}function removeUserAclEntryResponse(b,c,a,d,e){methodcheck(a)||PullUserInfo()}function changeAccountStateButton(b,c,a){haltEvent(b);xxdialogMode||amtstack.AMT_AuthorizationService_SetAclEnabledState(c,1==a?!1:!0,setAclEnabledStateResponse,c)} function changeAccountButton(b,c){haltEvent(b);xxdialogMode||(updateRealms(xxAccountRealmInfo[c].Realms),d2username.value=xxAccountRealmInfo[c].DigestUsername?xxAccountRealmInfo[c].DigestUsername:GetSidString(atob(xxAccountRealmInfo[c].KerberosUserSid)),d2password1.value=d2password2.value="",d2permission.value=xxAccountRealmInfo[c].AccessPermission,setDialogMode(2,"Edit Account",-1==c?3:7,function(a){changeAccountButtonEx(c,a)}),updateAccountDialog())} function newAccountButton(){xxdialogMode||(updateRealms([]),d2username.value=d2password1.value=d2password2.value="",d2permission.value=2,setDialogMode(2,"New Account",3,function(){changeAccountButtonEx(null,1)}),updateAccountDialog())} -function changeAccountButtonEx(b,c){if(1==c){var a=[],d=d2username.value,e=d2permission.value,p=d2password1.value,h=GetSidByteArray(Q("d2username").value),r=null;if(0==d.length||p!=d2password2.value){messagebox("Account Error","Invalid Parameters");return}null==h?r=window.btoa(rstr_md5(d+":"+amtsysstate.AMT_GeneralSettings.response.DigestRealm+":"+p)):(d=null,h=btoa(h));if(-1!=b)for(var n in amtstack.RealmNames)(amtstack.RealmNames[n]||3==n)&&Q("rx"+n).checked&&a.push(n);null==b?amtstack.AMT_AuthorizationService_AddUserAclEntryEx(d, -r,h,e,a,userAclEntryExResponse):-1==b?amtstack.AMT_AuthorizationService_SetAdminAclEntryEx(d,r,userAclEntryExResponse):amtstack.AMT_AuthorizationService_UpdateUserAclEntryEx(b,d,r,h,e,a,userAclEntryExResponse)}2==c&&amtstack.AMT_AuthorizationService_RemoveUserAclEntry(b,removeUserAclEntryResponse)}function userAclEntryExResponse(b,c,a,d,e){methodcheck(a)||PullUserInfo()} +function changeAccountButtonEx(b,c){if(1==c){var a=[],d=d2username.value,e=d2permission.value,l=d2password1.value,p=GetSidByteArray(Q("d2username").value),q=null;if(0==d.length||l!=d2password2.value){messagebox("Account Error","Invalid Parameters");return}null==p?q=window.btoa(rstr_md5(d+":"+amtsysstate.AMT_GeneralSettings.response.DigestRealm+":"+l)):(d=null,p=btoa(p));if(-1!=b)for(var n in amtstack.RealmNames)(amtstack.RealmNames[n]||3==n)&&Q("rx"+n).checked&&a.push(n);null==b?amtstack.AMT_AuthorizationService_AddUserAclEntryEx(d, +q,p,e,a,userAclEntryExResponse):-1==b?amtstack.AMT_AuthorizationService_SetAdminAclEntryEx(d,q,userAclEntryExResponse):amtstack.AMT_AuthorizationService_UpdateUserAclEntryEx(b,d,q,p,e,a,userAclEntryExResponse)}2==c&&amtstack.AMT_AuthorizationService_RemoveUserAclEntry(b,removeUserAclEntryResponse)}function userAclEntryExResponse(b,c,a,d,e){methodcheck(a)||PullUserInfo()} function updateRealms(b){QV(63,null!=b);if(null!=b){var c="

  • ",a;for(a in amtstack.RealmNames){var d="";0<=b.indexOf(parseInt(a))&&(d=" checked");amtstack.RealmNames[a]&&(c+="
  • ")}QH(64,c)}} function updateAccountDialog(){var b=!0;if("none"!=Q(63).style.display){var b=!1,c;for(c in amtstack.RealmNames)(amtstack.RealmNames[c]||3==c)&&Q("rx"+c).checked&&(b=!0)}b&&(b=0",d,e=c.DigestUsername;e||(e=GetSidString(atob(c.KerberosUserSid)));a+=addHtmlValue("Name",e);xxAccountEnabledInfo[b]&&(a+=addHtmlValue("State",1==xxAccountEnabledInfo[b].Enabled?"Enabled":"Disabled"));if(e==xxAccountAdminName)a+=addHtmlValue("Permission","Administrator");else{var a=a+addHtmlValue("Permission",xxUserPermissions[c.AccessPermission]),p="";if(0<=c.Realms.indexOf(3))p="Administrator", -0<=c.Realms.indexOf(20)&&(p+=", Auditor");else for(d in xxAccountRealmInfo[b].Realms)""!=amtstack.RealmNames[c.Realms[d]]&&(0"+p+""}messagebox("Account "+e,a+"")}} +function showUserDetails(b){if(!xxdialogMode){var c=xxAccountRealmInfo[b],a="
    ",d,e=c.DigestUsername;e||(e=GetSidString(atob(c.KerberosUserSid)));a+=addHtmlValue("Name",e);xxAccountEnabledInfo[b]&&(a+=addHtmlValue("State",1==xxAccountEnabledInfo[b].Enabled?"Enabled":"Disabled"));if(e==xxAccountAdminName)a+=addHtmlValue("Permission","Administrator");else{var a=a+addHtmlValue("Permission",xxUserPermissions[c.AccessPermission]),l="";if(0<=c.Realms.indexOf(3))l="Administrator", +0<=c.Realms.indexOf(20)&&(l+=", Auditor");else for(d in xxAccountRealmInfo[b].Realms)""!=amtstack.RealmNames[c.Realms[d]]&&(0"+l+""}messagebox("Account "+e,a+"
    ")}} function wsmanQuery(){QH(26,"");var b=getSelectedOptions(Q(24)),c=[],a;for(a in b)""==QS("WSB-"+b[a]).display&&c.push(b[a]);0!=c.length&&(QE(25,!1),c&&0"+e+"
    ",b=200==c.status?0==c.responses.length?b+"
    (Empty)":b+ObjectToString(c.responses).replace(/Intel\(r\)/g,"Intel®"):b+("
    Error #"+c.status+"
    "),b+="

    ";QH(26,b)} function wsmanFilter(){var b=c0.value.toLowerCase(),c;for(c in AllWsman)QV("WSB-"+AllWsman[c],""==b||0<=AllWsman[c].toLowerCase().indexOf(b))}function connectTerminal(){terminal&&(0==terminal.State?(terminal.tlsv1only=amtstack.wsman.comm.tlsv1only,terminal.Start(currentMeshNode._id,16994,"*","*",0)):terminal.Stop())} function onTerminalStateChange(b,c){c4.value=0==c?"Connect":"Disconnect";Q(31).textContent=StatusStrs[c];QE(36,3==c);switch(c){case 0:b.m.TermResetScreen();b.m.TermDraw();3==xxdialogMode&&setDialogMode();QV("termRecordIcon",!1);break;case 3:1==b.serverIsRecording&&QV("termRecordIcon",!0)}}function termPaste(){terminal.m.TermSendKeys(d3pastetextarea.value)}function termSendKey(b){terminal.m.TermSendKey(b)} function termToggleSize(){80==terminal.m.width?(Q(33).value="100x30",terminal.m.Init(100,30)):(Q(33).value="80x25",terminal.m.Init(80,25))}var terminalEmulations=["UTF8 Terminal","Extended ASCII","Intel ASCII"];function termToggleType(){terminal.m.terminalEmulation=(terminal.m.terminalEmulation+1)%3;Q(35).value=terminalEmulations[terminal.m.terminalEmulation]} -function termToggleFx(){Q(34).value=["Intel (F10 = ESC+[OM)","Alternate (F10 = ESC+0)","VT100+ (F10 = ESC+[OY)"][terminal.m.fxEmulation=(terminal.m.fxEmulation+1)%3]}function termToggleCr(){Q(32).value=["CR+LF","LF"][terminal.m.fxLineBreak=(terminal.m.fxLineBreak+1)%2]} +function termToggleFx(){Q(34).value=["Intel (F10 = ESC+[OM)","Alternate (F10 = ESC+0)","VT100+ (F10 = ESC+[OY)"][terminal.m.fxEmulation=(terminal.m.fxEmulation+1)%3]}function termToggleCr(){"\r\n"==terminal.m.lineFeed?(Q(32).value="LF",terminal.m.lineFeed="\n"):(Q(32).value="CR+LF",terminal.m.lineFeed="\r\n")} function terminalCaptureToggle(){if(void 0==terminal.m.capture)terminal.m.capture="",c3.value="Stop Capture";else{if(0"+p24filetreelocation[p]+"";var e=p24filetreelocation.join("/"),h=p24sort_files(p24filetree.dir);for(p in h){var r=h[p],n=r.n,m;m=70'+EscapeHtml(n.substring(0, -70))+"...":EscapeHtml(n);var n=EscapeHtml(n),z="";null!=r.d&&(z=new Date(r.d),z=z.getMonth()+1+"/"+z.getDate()+"/"+z.getFullYear()+" "+z.toLocaleTimeString()+" ");var k="";null!=r.s&&(k=getFileSizeStr(r.s));var v="";3>r.t?v="":(v=m,0'+m+""),v="
     "+z+""+k+"
    "+v+"
    "); -3>r.t?c+=v:a+=v}QH("p24files",c+a);QH("p24currentpath",d);QE("p24FolderUp",0!=p24filetreelocation.length);if(null!=b)for(c=document.getElementsByName("fd"),p=0;p"+p24filetreelocation[l]+"";var e=p24filetreelocation.join("/"),p=p24sort_files(p24filetree.dir);for(l in p){var q=p[l],n=q.n,m;m=70'+EscapeHtml(n.substring(0, +70))+"...":EscapeHtml(n);var n=EscapeHtml(n),v="";null!=q.d&&(v=new Date(q.d),v=v.getMonth()+1+"/"+v.getDate()+"/"+v.getFullYear()+" "+v.toLocaleTimeString()+" ");var h="";null!=q.s&&(h=getFileSizeStr(q.s));var z="";3>q.t?z="":(z=m,0'+m+""),z="
     "+v+""+h+"
    "+z+"
    "); +3>q.t?c+=z:a+=z}QH("p24files",c+a);QH("p24currentpath",d);QE("p24FolderUp",0!=p24filetreelocation.length);if(null!=b)for(c=document.getElementsByName("fd"),l=0;lb;)p24filetreelocation.pop();p24targetpath=p24filetreelocation.join("/");p24files.sendCtrlMsg(JSON.stringify({action:"ls",reqid:1,path:p24targetpath}))}var p24sortorder;function p24sort_filename(b,c){return b.ln>c.ln?1*p24sortorder:b.lnc.d?1*p24sortorder:b.d"+(ider.m.server?"Server ":"")+"IDE-R Session, Connected, "+ider.m.bytesFromAmt+" in, "+ider.m.bytesToAmt+" out.")}var heatMapWidth=600,heatMapDividor={}; -function iderSectorStats(b,c,a,d,e){var p=c?Q("cdromHeatMapCanvas"):Q("floppyHeatMapCanvas"),h=p.getContext("2d");if(0==b){heatMapDividor[c]=1;if(0CDROM, blocks are "+2048*heatMapDividor[c]+" bytes.")):(QV("floppyHeatMap",a),QH("floppyHeatMapText","Floppy, blocks are "+512*heatMapDividor[c]+" bytes."))}c=heatMapDividor[c];a/=c;d/=c;e/=c;if(0==b)p.height=6*(Math.floor(a/(heatMapWidth/ -6))+(a%heatMapWidth?1:0)),h.fillStyle="rgba(225,250,225,1)",h.fillRect(0,0,heatMapWidth,6*Math.floor(a/(heatMapWidth/6))),a%heatMapWidth&&h.fillRect(0,6*Math.floor(a/(heatMapWidth/6)),a%(heatMapWidth/6)*6,6),h.fillStyle="rgba(0,0,0,0.3)";else for(b=d;bCDROM, blocks are "+2048*heatMapDividor[c]+" bytes.")):(QV("floppyHeatMap",a),QH("floppyHeatMapText","Floppy, blocks are "+512*heatMapDividor[c]+" bytes."))}c=heatMapDividor[c];a/=c;d/=c;e/=c;if(0==b)l.height=6*(Math.floor(a/(heatMapWidth/ +6))+(a%heatMapWidth?1:0)),p.fillStyle="rgba(225,250,225,1)",p.fillRect(0,0,heatMapWidth,6*Math.floor(a/(heatMapWidth/6))),a%heatMapWidth&&p.fillRect(0,6*Math.floor(a/(heatMapWidth/6)),a%(heatMapWidth/6)*6,6),p.fillStyle="rgba(0,0,0,0.3)";else for(b=d;bp&&(p="0"+p),c+=", at "+e+":"+p+" daily")}b+=TableEntry("Periodic connection",addLinkConditional(c,'editMpsPolicy("Periodic")',xxAccountAdminName));b+=TableEnd();b=b+"
    "+TableStart2();b+="

    Manage Intel® AMT remote management servers.

    ";if(0==xxCiraServers.length)b+="

    No remote servers found.

    "; +(c+=", "),c+=xxPolicies.Alert[d].AccessInfo,1==xxPolicies.Alert[d].MpsType&&(c+=" (CILA)");b+=TableEntry("Alert initiated connection",addLinkConditional(c,'editMpsPolicy("Alert")',xxAccountAdminName));c="None";if(0l&&(l="0"+l),c+=", at "+e+":"+l+" daily")}b+=TableEntry("Periodic connection",addLinkConditional(c,'editMpsPolicy("Periodic")',xxAccountAdminName));b+=TableEnd();b=b+"
    "+TableStart2();b+="

    Manage Intel® AMT remote management servers.

    ";if(0==xxCiraServers.length)b+="

    No remote servers found.

    "; else for(d in xxCiraServers)c=":"+xxCiraServers[d].Port,xxCiraServers[d].CN&&(c+=", "+xxCiraServers[d].CN),b+="
    "+xxCiraServers[d].AccessInfo+""+EscapeHtml(c)+"
    ";if(a)if(b+="
    Manage HTTP proxies used for management connections.

    ",c=xxRemoteAccess.IPS_HTTPProxyAccessPoint.responses,0==c.length)b+="

    No proxies configured.

    ";else for(d in c)b+="
    "+EscapeHtml(c[d].AccessInfo)+":"+c[d].Port+" / "+EscapeHtml(c[d].NetworkDnsSuffix)+"
    ";d="";xxAccountAdminName&&(d=AddButton("Add Server...","AddRemoteAccessServer()"),a&&(d+=AddButton("Add Proxy...","AddRemoteAccessProxy()")));b+="
    "+TableEnd(AddRefreshButton("PullRemoteAccess()")+d);QH(54,b)}}var xxEditMpsPolicyType; function editMpsPolicy(b){var c="",a=11"); 1==b?QH(65,c):setDialogMode(11,"Environment Detection",xxAccountAdminName?3:1,editEnvironmentDetectionDlg,c);edInputChg()}function editEnvironmentDetectionDlg(){if(xxAccountAdminName){var b=Clone(xxEnvironementDetection);b.DetectionStrings=editEnvironmentDetectionTmp;amtstack.Put("AMT_EnvironmentDetectionSettingData",b,editEnvironmentDetectionDlg2,0,1)}} @@ -1303,11 +1315,11 @@ function powerActionResponse3(b,c,a,d){console.log("powerActionResponse3("+c+"," function checkConsentDisplay(){amtstack.Get("IPS_SecIOService",checkConsentDisplayResponse1)}var xxchangeConsentDisplay=!1; function checkConsentDisplayResponse1(b,c,a,d){200==d&&(a.Body.DefaultScreen&&(a.Body.DefaultScreen=parseInt(a.Body.DefaultScreen)),a.Body.NumberOfScreens&&(a.Body.NumberOfScreens=parseInt(a.Body.NumberOfScreens)),1==xxchangeConsentDisplay?(xxchangeConsentDisplay=!1,a.Body.DefaultScreen=d6Display.value,amtstack.Put("IPS_SecIOService",a.Body,checkConsentDisplayResponse1)):(d6Display.value=a.Body.DefaultScreen,QV("d6ThirdDisplay",2c;c++){do a=b.length,b=b.replace(String.fromCharCode(c),"");while(a>b.length)}try{xxStorage=JSON.parse(b)}catch(v){return}xxStorageVendors=[];xxStorageApplications=[];b=xxStorage.content;if(Array.isArray(b)){a={};for(c in b){var d=b[c].vendor?b[c].vendor:"";a[d]||(a[d]={});var e=b[c].app?b[c].app:"";a[d][e]||(a[d][e]={});b[c].name&&(a[d][e][b[c].name]=b[c])}xxStorage.content= -b=a}else{if(b["index.htm"]||b["logon.htm"])b[""]={"":{}};b["index.htm"]&&(b[""][""]["index.htm"]=b["index.htm"],delete b["index.htm"]);b["logon.htm"]&&(b[""][""]["logon.htm"]=b["logon.htm"],delete b["logon.htm"])}a=0;var d=TableStart2()+"

    Manage Intel® AMT storage for this computer.

    ",p,h,e="";for(c in b){var r=0,n;for(n in b[c]){r++;var m=0,z;for(z in b[c][n]){m++;if(c!=p||n!=h)""!=e&&(d+=e,e="
    "),p=c,h=n,e=""!=c?e+EscapeHtml(c+" / "+n):e+ -"Root";var k='"'+c+(""!=c?"/":"")+n+(""!=n?"/":"")+z+'"',e=e+('
    "),e=e+(" "+AddButton2("Download","DownloadFromStorage("+k+',"'+z+'",event)')),e=e+("
    "+EscapeHtml(z)+", "+b[c][n][z].size+" bytes
    ");a++;-1==xxStorageVendors.indexOf(c)&&xxStorageVendors.push(c);-1==xxStorageApplications.indexOf(n)&&xxStorageApplications.push(n)}0==m&&(wsstack.comm.PerformAjax("", -function(){},null,0,"/amt-storage/"+c+"/"+n,"DELETE"),wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+c,"DELETE"))}0==r&&wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+c,"DELETE")}""!=e&&(d+=e);0==a&&(d+="

    No files found.

    ");d+="
    "+TableEnd(AddRefreshButton("PullStorage()")+AddButton("Upload...","UploadToStorage()"));QH(57,d)}else QH(57,"Unable to load storage data...
    "+ -AddButton("Refresh","PullStorage()"))}function showStorageDetails(b,c,a,d){if(!xxdialogMode){var e="",p=xxStorage.content[b][c][a];""!=b&&(e+=addHtmlValue("Vendor",b));""!=c&&(e+=addHtmlValue("Application",c));e+=addHtmlValue("Name",a);e+=addHtmlValue("Size",p.size+" bytes");p.link&&(e+=addHtmlValue("Link",p.link));setDialogMode(11,"Storage Item",5,showStorageDetailsEx,e,d)}} +function PullStorageResponse(b,c,a){0==amtstack.PendingBatchOperations&&refreshButtons(!0);if(200==c){QV("go21",!0);for(c=0;32>c;c++){do a=b.length,b=b.replace(String.fromCharCode(c),"");while(a>b.length)}try{xxStorage=JSON.parse(b)}catch(z){return}xxStorageVendors=[];xxStorageApplications=[];b=xxStorage.content;if(Array.isArray(b)){a={};for(c in b){var d=b[c].vendor?b[c].vendor:"";a[d]||(a[d]={});var e=b[c].app?b[c].app:"";a[d][e]||(a[d][e]={});b[c].name&&(a[d][e][b[c].name]=b[c])}xxStorage.content= +b=a}else{if(b["index.htm"]||b["logon.htm"])b[""]={"":{}};b["index.htm"]&&(b[""][""]["index.htm"]=b["index.htm"],delete b["index.htm"]);b["logon.htm"]&&(b[""][""]["logon.htm"]=b["logon.htm"],delete b["logon.htm"])}a=0;var d=TableStart2()+"

    Manage Intel® AMT storage for this computer.

    ",l,p,e="";for(c in b){var q=0,n;for(n in b[c]){q++;var m=0,v;for(v in b[c][n]){m++;if(c!=l||n!=p)""!=e&&(d+=e,e="
    "),l=c,p=n,e=""!=c?e+EscapeHtml(c+" / "+n):e+ +"Root";var h='"'+c+(""!=c?"/":"")+n+(""!=n?"/":"")+v+'"',e=e+('
    "),e=e+(" "+AddButton2("Download","DownloadFromStorage("+h+',"'+v+'",event)')),e=e+("
    "+EscapeHtml(v)+", "+b[c][n][v].size+" bytes
    ");a++;-1==xxStorageVendors.indexOf(c)&&xxStorageVendors.push(c);-1==xxStorageApplications.indexOf(n)&&xxStorageApplications.push(n)}0==m&&(wsstack.comm.PerformAjax("", +function(){},null,0,"/amt-storage/"+c+"/"+n,"DELETE"),wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+c,"DELETE"))}0==q&&wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+c,"DELETE")}""!=e&&(d+=e);0==a&&(d+="

    No files found.

    ");d+="
    "+TableEnd(AddRefreshButton("PullStorage()")+AddButton("Upload...","UploadToStorage()"));QH(57,d)}else QH(57,"Unable to load storage data...
    "+ +AddButton("Refresh","PullStorage()"))}function showStorageDetails(b,c,a,d){if(!xxdialogMode){var e="",l=xxStorage.content[b][c][a];""!=b&&(e+=addHtmlValue("Vendor",b));""!=c&&(e+=addHtmlValue("Application",c));e+=addHtmlValue("Name",a);e+=addHtmlValue("Size",l.size+" bytes");l.link&&(e+=addHtmlValue("Link",l.link));setDialogMode(11,"Storage Item",5,showStorageDetailsEx,e,d)}} function showStorageDetailsEx(b,c){2==b&&wsstack.comm.PerformAjax("",storageDeleteResponse,null,0,"/amt-storage/"+c,"DELETE")}function storageDeleteResponse(b,c){200!=c?messagebox("Storage","Unable to delete file (ERR"+c+"), check that the computer is powered on."):PullStorage()}function DownloadFromStorage(b,c,a){xxdialogMode||(haltEvent(a),wsstack.comm.PerformAjax("",DownloadFromStorageEx,c,0,"/amt-storage/"+b,"GET"))} function DownloadFromStorageEx(b,c,a){200!=c||null==b?console.log(c,"Data = null"):saveAs(data2blob(b),a)}function OpenFromStorage(b,c){if(!xxdialogMode){haltEvent(c);var a=window.open("http://"+wsstack.comm.host+":"+wsstack.comm.port+"/amt-storage/"+b,"_blank");a.opener=null;a.focus()}}function PushToStorage(b,c,a){var d=null;7E3'+b+''+a+''+d+""+ -e+""}function RemoveAllAlarms(){setDialogMode(1,"Remove all wake alarms",3,RemoveAllAlarmsEx,"Confirm removal of all wake alarms?")}function RemoveAllAlarmsEx(){var b=xxAlarms.length,c;for(c in xxAlarms)amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[c],function(a,c,e,p){0==--b&&PullAlarms()})} +e+""}function RemoveAllAlarms(){setDialogMode(1,"Remove all wake alarms",3,RemoveAllAlarmsEx,"Confirm removal of all wake alarms?")}function RemoveAllAlarmsEx(){var b=xxAlarms.length,c;for(c in xxAlarms)amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[c],function(a,c,e,l){0==--b&&PullAlarms()})} function showAddAlarm(b){if(!xxdialogMode){QE("d25alarm_name",!b);if(void 0!=b){var c=xxAlarms[b],a=convertAmtDataStr(c.StartTime.Datetime);Q("d25alarm_name").value=c.ElementName;Q("d25alarm_sdate").value=a.getFullYear()+"-"+_fmttimepad(a.getMonth()+1)+"-"+_fmttimepad(a.getDate());Q("d25alarm_stime").value=a.getHours()+":"+_fmttimepad(a.getMinutes())+":"+_fmttimepad(a.getSeconds());if(c.Interval){var a=c.Interval.Interval.replace("P","").replace("T","").replace("D","D,").replace("H","H,").replace("M", -"M,").split(","),d=[0,0,0],e;for(e in a){var p=a[e].length-1;"D"==a[e][p]&&(d[0]=parseInt(a[e].substring(0,p)));"H"==a[e][p]&&(d[1]=parseInt(a[e].substring(0,p)));"M"==a[e][p]&&(d[2]=parseInt(a[e].substring(0,p)))}Q("d25alarm_interval").value=d.join("-")}else Q("d25alarm_interval").value="";Q("d25alarm_doc").value=1==c.DeleteOnCompletion?1:0}else c=new Date,c.setDate((new Date).getDate()+1),Q("d25alarm_name").value="",Q("d25alarm_sdate").value=c.getFullYear()+"-"+_fmttimepad(c.getMonth()+1)+"-"+_fmttimepad(c.getDate()), +"M,").split(","),d=[0,0,0],e;for(e in a){var l=a[e].length-1;"D"==a[e][l]&&(d[0]=parseInt(a[e].substring(0,l)));"H"==a[e][l]&&(d[1]=parseInt(a[e].substring(0,l)));"M"==a[e][l]&&(d[2]=parseInt(a[e].substring(0,l)))}Q("d25alarm_interval").value=d.join("-")}else Q("d25alarm_interval").value="";Q("d25alarm_doc").value=1==c.DeleteOnCompletion?1:0}else c=new Date,c.setDate((new Date).getDate()+1),Q("d25alarm_name").value="",Q("d25alarm_sdate").value=c.getFullYear()+"-"+_fmttimepad(c.getMonth()+1)+"-"+_fmttimepad(c.getDate()), Q("d25alarm_stime").value=c.getHours()+":"+_fmttimepad(c.getMinutes())+":00",Q("d25alarm_interval").value="",Q("d25alarm_doc").value=0;setDialogMode(25,"Add new alarm",void 0!=b?7:3,showAddAlarmOk,"",b);alertDialogUpdate()}}function alertDialogUpdate(){var b=Q("d25alarm_interval").value.split("-").length,b=0Verify the alarm is for a future time."):0!=c.Body.ReturnValue?messagebox("Add alarm","Failed to add alarm, "+c.Body.ReturnValueStr+".
    Verify the alarm is for a future time."):PullAlarms()}):(a=Clone(xxAlarms[c]),a.StartTime=''+ -d+"",a.Interval=''+e+"",a.DeleteOnCompletion=p,amtstack.Put("IPS_AlarmClockOccurrence",a,function(a,b,c,d){200!=d?messagebox("Edit alarm","Failed to change alarm. Status: "+d+".
    Verify the alarm for at a future time."):PullAlarms()},null,null,{InstanceID:a.InstanceID}))}} +e[1]+"H"+e[2]+"M",l=1==Q("d25alarm_doc").value,a=prepareAlarmOccurenceTemplate(a,a,d,e,l);void 0==c?wsstack.ExecMethodXml(amtstack.CompleteName("AMT_AlarmClockService"),"AddAlarm",a,function(a,b,c,d){200!=d?messagebox("Add alarm","Failed to add alarm. Status: "+d+".
    Verify the alarm is for a future time."):0!=c.Body.ReturnValue?messagebox("Add alarm","Failed to add alarm, "+c.Body.ReturnValueStr+".
    Verify the alarm is for a future time."):PullAlarms()}):(a=Clone(xxAlarms[c]),a.StartTime=''+ +d+"",a.Interval=''+e+"",a.DeleteOnCompletion=l,amtstack.Put("IPS_AlarmClockOccurrence",a,function(a,b,c,d){200!=d?messagebox("Edit alarm","Failed to change alarm. Status: "+d+".
    Verify the alarm for at a future time."):PullAlarms()},null,null,{InstanceID:a.InstanceID}))}} function showAlertDetails(b){if(!xxdialogMode){var c=xxAlarms[b],a=convertAmtDataStr(c.StartTime.Datetime),a="
    "+addHtmlValue("Name",c.ElementName)+addHtmlValue("Wake time",a.toLocaleString().replace(", "," at "));void 0!=c.Interval&&(a+=addHtmlValue("Internal",_fmtinterval(c.Interval.Interval)));a+=addHtmlValue("After wake",1==c.DeleteOnCompletion?"Delete Alarm":"Keep Alarm")+"
    ";messagebox("Alarm "+c.ElementName,a);setDialogMode(11,"Alarm "+c.ElementName,5,showAlertDetailsDelete, -a,b)}}function showAlertDetailsDelete(b,c){2==b&&amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[c],function(a,b,c,p){PullAlarms()})}function script_runScriptDlg(){xxdialogMode||scriptstate||setDialogMode(11,"Run Script",3,script_runScriptDlgOk,"
    ")}function script_runScriptDlgOk(b){if(1==b&&(b=Q("scriptopen"),1==b.files.length)){var c=new FileReader;c.onload=script_onScriptRead;c.readAsBinaryString(b.files[0])}} +a,b)}}function showAlertDetailsDelete(b,c){2==b&&amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[c],function(a,b,c,l){PullAlarms()})}function script_runScriptDlg(){xxdialogMode||scriptstate||setDialogMode(11,"Run Script",3,script_runScriptDlgOk,"
    ")}function script_runScriptDlgOk(b){if(1==b&&(b=Q("scriptopen"),1==b.files.length)){var c=new FileReader;c.onload=script_onScriptRead;c.readAsBinaryString(b.files[0])}} function script_onScriptRead(b){var c;try{c=JSON.parse(b.target.result)}catch(e){}if(20==currentView){c.scriptText&&(Q("scriptarea").value=c.scriptText);c.mescript&&(Q("compiledarea").value=rstr2hex(atob(c.mescript)));c.blocks?(script_setBuildBlocks(c.blocks),scriptViewButton(1)):(script_setBuildBlocks(),scriptViewButton(0));c.scriptBlocks?script_BlockScript=c.scriptBlocks:script_BuildingBlocks||(script_BlockScript=[]);for(var a in script_BlockScript)if(c=script_BlockScript[a],b=script_BuildingBlocks[c.xname]){b= Clone(b);b.id=c.id;b.xname=c.xname;for(var d in b.vars)c.vars[d]&&(b.vars[d].value=c.vars[d].value);script_BlockScript[a]=b}fupdatescript();delete scriptstate;resetScriptButton()}else a={_interactive:1,_certificates:1,_mode:"Firmware"},c&&c.mescript&&(scriptstate=script_setup(atob(c.mescript),a)),scriptstate?(scriptstate.wsstack=wsstack,scriptstate.amtstack=amtstack,scriptstate.onStep=script_updateScriptState,scriptstate.onConsole=script_console,scriptstate.start(100)):messagebox("Run Script","Invalid script file.")} function script_updateScriptState(){scriptstate&&(QV(11,0");QH("blocks",c);script_fonfilterchanged();scriptViewButton(script_BuildingBlocks?1:0)} function script_faddblock(b){var c=Clone(script_BuildingBlocks[b]);c.id=Math.random();c.xname=b;script_BlockScript.push(c);script_BlockScriptSelectedId=script_BlockScript.length-1;fupdatescript()}function script_feditblock(b){xxdialogMode||setDialogMode(11,"Edit "+script_BuildingBlocks[b].name,3,script_feditblockEx,"Edit this block? This operation will reset the block editor and load the block code into the code editor.",b)} -function script_feditblockEx(b,c){script_newScriptDlgOk();scriptViewButton(0);var a,d=script_BuildingBlocks[c];a=""+("##!BLOCK!##\r\n#id="+c+"\r\n#name="+d.name+"\r\n#desc="+d.desc+"\r\n##!BLOCK!##\r\n");for(var e in d.vars){var p=d.vars[e];a+="##!VAR!##\r\n#id="+e+"\r\n#name="+p.name+"\r\n#desc="+p.desc+"\r\n#type="+p.type+"\r\n";p.maxlength&&(a+="#maxlength="+p.maxlength+"\r\n");if(p.values)for(var h in p.values)a+="#values-"+h+"="+p.values[h]+"\r\n";a+="#value="+p.value+"\r\n##SWAP %%%"+e+"%%% "+ -p.value+"\r\n"}a+="##!VAR!##\r\n##SWAP %%%~%%% 0\r\n\r\n##!BLOCK!##\r\n"+d.code+"\r\n##!BLOCK!##\r\n";Q("scriptarea").value=a} -function script_fConvertScriptToJsonBlock(b){var c={};b=b.split("##!BLOCK!##\n");var a=b[1].split("\n"),d;for(d in a){var e=a[d].split("=");2==e.length&&(c[e[0].substring(1)]=e[1])}c.vars={};scriptvariables=b[2].split("##!VAR!##\n");for(d in scriptvariables){var a=scriptvariables[d].split("\n"),p={},h={},r=0,n;for(n in a)e=a[n].split("="),2==e.length&&e[1]&&e[0]&&0(new Date).getTime()-script_fonclickDblClickDetectTime)return script_foneditclick(script_BlockScriptSelectedId);script_fonclickDblClickDetectIndex=script_BlockScriptSelectedId;script_fonclickDblClickDetectTime=(new Date).getTime()}} function script_fondragstart(b,c){xxdialogMode||(c=fgetParentWithId(c),c.style.opacity="0.4",b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("scriptbuilder/block",c.id))}function script_fondragend(b,c){xxdialogMode||(c=fgetParentWithId(c),c.style.opacity="1.0")}function script_fondragenter(b,c){xxdialogMode||(fgetParentWithId(c).style["border-top"]="solid 2px black")} function script_fondragleave(b,c){if(!xxdialogMode){b=b.originalEvent||b;var a=document.elementFromPoint(b.pageX,b.pageY);c.contains(a)||(fgetParentWithId(c).style["border-top"]="none")}} function script_fondrop(b,c){if(!xxdialogMode){c=fgetParentWithId(c);var a,d=b.dataTransfer.getData("scriptbuilder/block"),e=parseInt(c.id.substring(7));""==d?documentFileSelectHandler(b):(d.startsWith("sblock_")?(a=Clone(script_BuildingBlocks[d.substring(7)]),a.id=Math.random(),a.xname=d.substring(7)):(d=parseInt(d.substring(7)),a=script_BlockScript[d],script_BlockScript.splice(d,1),e>d&&e--),"scriptblocks"==c.id?(a&&script_BlockScript.push(a),script_BlockScriptSelectedId=script_BlockScript.length- 1):(script_BlockScript.splice(e,0,a),script_BlockScriptSelectedId=e),fupdatescript(),haltEvent(b))}} -function script_foneditclick(b){if(!xxdialogMode){var c=script_BlockScript[b];script_BlockScriptSelectedId=b;fupdatescript();if(null!=c){var a=c.vars?7:5,d=c.desc+"

    ";if(c.vars)for(var e in c.vars){var p=c.vars[e].value,h="";c.vars[e].maxlength&&(h+=" maxlength="+c.vars[e].maxlength);2==c.vars[e].type&&(h+=" onkeypress='return numbersOnly(event)'");if(1==c.vars[e].type||2==c.vars[e].type)p=""; -if(3==c.vars[e].type){var p=""}4==c.vars[e].type&&(p="");5==c.vars[e].type&&(p="");6==c.vars[e].type&&(p="");d+='
    '+c.vars[e].name+""+p+"
    ";if(5==c.vars[e].type){var d=d+("
      '),n;for(n in c.vars[e].values)p="",0<=c.vars[e].value.indexOf(n)&&(p=" checked"),d+="
    • ";d+="
    "}}}setDialogMode(11,c.name,a,script_foneditclickEx,d,b)}} -function script_foneditclickEx(b,c){if(!xxdialogMode){if(2==b)script_BlockScript.splice(c,1),script_BlockScriptSelectedId==c&&(script_BlockScriptSelectedId=null);else{var a=script_BlockScript[c];if(a.vars)for(var d in a.vars)if(5==a.vars[d].type){a.vars[d].value=[];for(var e in a.vars[d].values)Q("scriptXvaluex_"+d+"-"+e).checked&&a.vars[d].value.push(e)}else if(6==a.vars[d].type){var p=Q("scriptXvalue_"+d);if(1==p.files.length){var h=new FileReader;h.onload=function(b){a.vars[d].value=btoa(b.target.result); -fupdatescript()};h.readAsBinaryString(p.files[0])}}else a.vars[d].value=Q("scriptXvalue_"+d).value}fupdatescript()}}function fgetParentWithId(b){for(;!b.id;)b=b.parentElement;return b} +function script_foneditclick(b){if(!xxdialogMode){var c=script_BlockScript[b];script_BlockScriptSelectedId=b;fupdatescript();if(null!=c){var a=c.vars?7:5,d=c.desc+"

    ";if(c.vars)for(var e in c.vars){var l=c.vars[e].value,p="";c.vars[e].maxlength&&(p+=" maxlength="+c.vars[e].maxlength);2==c.vars[e].type&&(p+=" onkeypress='return numbersOnly(event)'");if(1==c.vars[e].type||2==c.vars[e].type)l=""; +if(3==c.vars[e].type){var l=""}4==c.vars[e].type&&(l="");5==c.vars[e].type&&(l="");6==c.vars[e].type&&(l="");d+='
    '+c.vars[e].name+""+l+"
    ";if(5==c.vars[e].type){var d=d+("
      '),n;for(n in c.vars[e].values)l="",0<=c.vars[e].value.indexOf(n)&&(l=" checked"),d+="
    • ";d+="
    "}}}setDialogMode(11,c.name,a,script_foneditclickEx,d,b)}} +function script_foneditclickEx(b,c){if(!xxdialogMode){if(2==b)script_BlockScript.splice(c,1),script_BlockScriptSelectedId==c&&(script_BlockScriptSelectedId=null);else{var a=script_BlockScript[c];if(a.vars)for(var d in a.vars)if(5==a.vars[d].type){a.vars[d].value=[];for(var e in a.vars[d].values)Q("scriptXvaluex_"+d+"-"+e).checked&&a.vars[d].value.push(e)}else if(6==a.vars[d].type){var l=Q("scriptXvalue_"+d);if(1==l.files.length){var p=new FileReader;p.onload=function(b){a.vars[d].value=btoa(b.target.result); +fupdatescript()};p.readAsBinaryString(l.files[0])}}else a.vars[d].value=Q("scriptXvalue_"+d).value}fupdatescript()}}function fgetParentWithId(b){for(;!b.id;)b=b.parentElement;return b} function fupdatescript(){var b="",c;for(c in script_BlockScript){b+="
    "+script_BlockScript[c].name+"";if(script_BlockScript[c].vars){var a=0,b=b+"",d;for(d in script_BlockScript[c].vars){var e=script_BlockScript[c].vars[d].value;4==script_BlockScript[c].vars[d].type&&0

    "+script_BlockScript[c].vars[d].name+"

    "+e;a++}b+="
    "}b+= @@ -1371,16 +1383,16 @@ function editscript_updateScriptState(b){var c="";if(b&&null!=b){var a=[],d;for( 50)+"...");QH("EditScriptStatus",c)}function script_toString(b){return"object"==typeof b?JSON.stringify(b):b} function script_saveScript(b){xxdialogMode||scriptstate||(b&&1==b.shiftKey?(setDialogMode(11,"Script Block",1,null,"