@dcloudio/uni-push 3.0.0-alpha-3080520230616001 → 3.0.0-alpha-3080720230627001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/uni-push.es.js +1 -1
- package/lib/gtpush-min.js +1 -1
- package/package.json +2 -2
package/dist/uni-push.es.js
CHANGED
@@ -96,7 +96,7 @@ var gtpushMin = {
|
|
96
96
|
// #ifndef MP-ALIPAY
|
97
97
|
null===e||void 0===e||e.onClose(t);
|
98
98
|
// #endif
|
99
|
-
}}}}e["default"]=r;},4486:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(3854));class s{constructor(){this.systemInfo=wx.getSystemInfoSync();}os(){return n.default.getStr(this.systemInfo,"platform")}osVersion(){return n.default.getStr(this.systemInfo,"system")}model(){return n.default.getStr(this.systemInfo,"model")}brand(){return n.default.getStr(this.systemInfo,"brand")}platform(){return "MP-WEIXIN"}platformVersion(){return n.default.getStr(this.systemInfo,"version")}language(){return n.default.getStr(this.systemInfo,"language")}platformId(){if(wx.canIUse("getAccountInfoSync"))return wx.getAccountInfoSync().miniProgram.appId;return ""}getNetworkType(t){wx.getNetworkType({success:e=>{var r;null===(r=t.success)||void 0===r||r.call(t.success,{networkType:e.networkType});},fail:t.fail});}onNetworkStatusChange(t){wx.onNetworkStatusChange(t);}}e["default"]=s;},5867:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{set(t){wx.setStorage(t);}setSync(t,e){wx.setStorageSync(t,e);}get(t){wx.getStorage(t);}getSync(t){return wx.getStorageSync(t)}}e["default"]=r;},7006:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{connect(t){let e=wx.connectSocket({url:t.url,header:t.header,protocols:t.protocols,success:t.success,fail:t.fail,complete:t.complete});return {onOpen:e.onOpen,send:e.send,onMessage:e.onMessage,onError:e.onError,onClose:e.onClose,close:e.close}}}e["default"]=r;},6893:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});var r;(function(t){t.SDK_VERSION="GTMP-2.0.4.dcloud";t.DEFAULT_SOCKET_URL="wss://wshzn.getui.net:5223/nws";t.SOCKET_PROTOCOL_VERSION="1.0";t.SERVER_PUBLIC_KEY="MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAJp1rROuvBF7sBSnvLaesj2iFhMcY8aXyLvpnNLKs2wjL3JmEnyr++SlVa35liUlzi83tnAFkn3A9GB7pHBNzawyUkBh8WUhq5bnFIkk2RaDa6+5MpG84DEv52p7RR+aWwIDAQAB";t.SERVER_PUBLIC_KEY_ID="69d747c4b9f641baf4004be4297e9f3b";t.ID_U_2_G=true;})(r||(r={}));e["default"]=r;},7555:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7002));const s=i(r(529));const a=i(r(6379));class o{static init(t){var e;if(this.inited)return;try{this.checkAppid(t.appid);this.inited=true;s.default.info(`init: appid=${t.appid}`);a.default.init(t);n.default.connect();}catch(r){this.inited=false;null===(e=t.onError)||void 0===e||e.call(t.onError,{error:r});throw r}}static enableSocket(t){this.checkInit();n.default.enableSocket(t);}static checkInit(){if(!this.inited)throw new Error(`not init, please invoke init method firstly`)}static checkAppid(t){if(null==t||void 0==t||""==t.trim())throw new Error(`invalid appid ${t}`)}}o.inited=false;e["default"]=o;},6379:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));const s=i(r(8506));const a=i(r(6893));const o=i(r(7002));const u=i(r(529));const c=i(r(4685));const l=i(r(2323));class f{static init(t){var e;if(a.default.ID_U_2_G)this.appid=l.default.to_getui(t.appid);else this.appid=t.appid;this.onError=t.onError;this.onClientId=t.onClientId;this.onlineState=t.onlineState;this.onPushMsg=t.onPushMsg;if(this.appid!=s.default.getSync(s.default.KEY_APPID,this.appid)){u.default.info("appid changed, clear session and cid");s.default.setSync(s.default.KEY_CID,"");s.default.setSync(s.default.KEY_SESSION,"");}s.default.setSync(s.default.KEY_APPID,this.appid);this.cid=s.default.getSync(s.default.KEY_CID,this.cid);if(this.cid)null===(e=this.onClientId)||void 0===e||e.call(this.onClientId,{cid:f.cid});this.session=s.default.getSync(s.default.KEY_SESSION,this.session);this.deviceId=s.default.getSync(s.default.KEY_DEVICE_ID,this.deviceId);this.regId=s.default.getSync(s.default.KEY_REGID,this.regId);if(!this.regId){this.regId=this.createRegId();s.default.set({key:s.default.KEY_REGID,data:this.regId});}this.socketUrl=s.default.getSync(s.default.KEY_SOCKET_URL,this.socketUrl);let r=this;c.default.getNetworkType({success:t=>{r.networkType=t.networkType;r.networkConnected="none"!=r.networkType&&""!=r.networkType;}});c.default.onNetworkStatusChange((t=>{r.networkConnected=t.isConnected;r.networkType=t.networkType;if(r.networkConnected)o.default.reconnect(100);}));}static createRegId(){return `M-V${n.default.md5Hex(this.getUuid())}-${(new Date).getTime()}`}static getUuid(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){let e=16*Math.random()|0,r="x"===t?e:3&e|8;return r.toString(16)}))}}f.appid="";f.cid="";f.regId="";f.session="";f.deviceId="";f.packetId=1;f.online=false;f.socketUrl=a.default.DEFAULT_SOCKET_URL;f.publicKeyId=a.default.SERVER_PUBLIC_KEY_ID;f.publicKey=a.default.SERVER_PUBLIC_KEY;f.lastAliasTime=0;f.networkConnected=true;f.networkType="none";e["default"]=f;},9586:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n,s;Object.defineProperty(e,"__esModule",{value:true});const a=i(r(661));const o=r(4198);const u=i(r(6379));class c extends a.default{constructor(){super(...arguments);this.actionMsgData=new l;}static initActionMsg(t,...e){super.initMsg(t);t.command=a.default.Command.CLIENT_MSG;t.data=t.actionMsgData=l.create();return t}static parseActionMsg(t,e){super.parseMsg(t,e);t.actionMsgData=l.parse(t.data);return t}send(){setTimeout((()=>{var t;if(c.waitingLoginMsgMap.has(this.actionMsgData.msgId)||c.waitingResponseMsgMap.has(this.actionMsgData.msgId)){c.waitingLoginMsgMap.delete(this.actionMsgData.msgId);c.waitingResponseMsgMap.delete(this.actionMsgData.msgId);null===(t=this.callback)||void 0===t||t.call(this.callback,{resultCode:o.ErrorCode.TIME_OUT,message:"waiting time out"});}}),1e4);if(!u.default.online){c.waitingLoginMsgMap.set(this.actionMsgData.msgId,this);return}if(this.actionMsgData.msgAction!=c.ClientAction.RECEIVED)c.waitingResponseMsgMap.set(this.actionMsgData.msgId,this);super.send();}receive(){}static sendWaitingMessages(){let t=this.waitingLoginMsgMap.keys();let e;while(e=t.next(),!e.done){let t=this.waitingLoginMsgMap.get(e.value);this.waitingLoginMsgMap.delete(e.value);null===t||void 0===t||t.send();}}static getWaitingResponseMessage(t){return c.waitingResponseMsgMap.get(t)}static removeWaitingResponseMessage(t){let e=c.waitingResponseMsgMap.get(t);if(e)c.waitingResponseMsgMap.delete(t);return e}}c.ServerAction=(n=class{},n.PUSH_MESSAGE="pushmessage",n.REDIRECT_SERVER="redirect_server",n.ADD_PHONE_INFO_RESULT="addphoneinfo",n.SET_MODE_RESULT="set_mode_result",n.SET_TAG_RESULT="settag_result",n.BIND_ALIAS_RESULT="response_bind",n.UNBIND_ALIAS_RESULT="response_unbind",n.FEED_BACK_RESULT="pushmessage_feedback",n.RECEIVED="received",n);c.ClientAction=(s=class{},s.ADD_PHONE_INFO="addphoneinfo",s.SET_MODE="set_mode",s.FEED_BACK="pushmessage_feedback",s.SET_TAGS="set_tag",s.BIND_ALIAS="bind_alias",s.UNBIND_ALIAS="unbind_alias",s.RECEIVED="received",s);c.waitingLoginMsgMap=new Map;c.waitingResponseMsgMap=new Map;class l{constructor(){this.appId="";this.cid="";this.msgId="";this.msgAction="";this.msgData="";this.msgExtraData="";}static create(){let t=new l;t.appId=u.default.appid;t.cid=u.default.cid;t.msgId=(2147483647&(new Date).getTime()).toString();return t}static parse(t){let e=new l;let r=JSON.parse(t);e.appId=r.appId;e.cid=r.cid;e.msgId=r.msgId;e.msgAction=r.msgAction;e.msgData=r.msgData;e.msgExtraData=r.msgExtraData;return e}}e["default"]=c;},4516:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(4685));const s=i(r(8506));const a=i(r(6893));const o=r(4198);const u=i(r(9586));const c=i(r(6379));class l extends u.default{constructor(){super(...arguments);this.addPhoneInfoData=new f;}static create(){let t=new l;super.initActionMsg(t);t.callback=e=>{if(e.resultCode!=o.ErrorCode.SUCCESS&&e.resultCode!=o.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){t.send();}),30*1e3);else s.default.set({key:s.default.KEY_ADD_PHONE_INFO_TIME,data:(new Date).getTime()});};t.actionMsgData.msgAction=u.default.ClientAction.ADD_PHONE_INFO;t.addPhoneInfoData=f.create();t.actionMsgData.msgData=JSON.stringify(t.addPhoneInfoData);return t}send(){let t=(new Date).getTime();let e=s.default.getSync(s.default.KEY_ADD_PHONE_INFO_TIME,0);if(t-e<24*60*60*1e3)return;super.send();}}class f{constructor(){this.model="";this.brand="";this.system_version="";this.version="";this.deviceid="";this.type="";}static create(){let t=new f;t.model=n.default.model();t.brand=n.default.brand();t.system_version=n.default.osVersion();t.version=a.default.SDK_VERSION;t.device_token="";t.imei="";t.oaid="";t.mac="";t.idfa="";t.type="MINIPROGRAM";t.deviceid=`${t.type}-${c.default.deviceId}`;t.extra={os:n.default.os(),platform:n.default.platform(),platformVersion:n.default.platformVersion(),platformId:n.default.platformId(),language:n.default.language(),userAgent:n.default.userAgent()};return t}}e["default"]=l;},8723:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n,s;Object.defineProperty(e,"__esModule",{value:true});const a=i(r(6379));const o=r(4198);const u=i(r(9586));class c extends u.default{constructor(){super(...arguments);this.feedbackData=new l;}static create(t,e){let r=new c;super.initActionMsg(r);r.callback=t=>{if(t.resultCode!=o.ErrorCode.SUCCESS&&t.resultCode!=o.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){r.send();}),30*1e3);};r.feedbackData=l.create(t,e);r.actionMsgData.msgAction=u.default.ClientAction.FEED_BACK;r.actionMsgData.msgData=JSON.stringify(r.feedbackData);return r}send(){super.send();}}c.ActionId=(n=class{},n.RECEIVE="0",n.MP_RECEIVE="210000",n.WEB_RECEIVE="220000",n.BEGIN="1",n);c.RESULT=(s=class{},s.OK="ok",s);class l{constructor(){this.messageid="";this.appkey="";this.appid="";this.taskid="";this.actionid="";this.result="";this.timestamp="";}static create(t,e){let r=new l;r.messageid=t.pushMessageData.messageid;r.appkey=t.pushMessageData.appKey;r.appid=a.default.appid;r.taskid=t.pushMessageData.taskId;r.actionid=e;r.result=c.RESULT.OK;r.timestamp=(new Date).getTime().toString();return r}}e["default"]=c;},6362:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));class s extends n.default{static create(){let t=new s;super.initMsg(t);t.command=n.default.Command.HEART_BEAT;return t}}e["default"]=s;},1386:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));const s=i(r(6379));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.keyNegotiateData=new u;}static create(){let t=new o;super.initMsg(t);t.command=a.default.Command.KEY_NEGOTIATE;n.default.resetKey();t.data=t.keyNegotiateData=u.create();return t}send(){super.send();}}class u{constructor(){this.appId="";this.rsaPublicKeyId="";this.algorithm="";this.secretKey="";this.iv="";}static create(){let t=new u;t.appId=s.default.appid;t.rsaPublicKeyId=s.default.publicKeyId;t.algorithm="AES";t.secretKey=n.default.getEncryptedSecretKey();t.iv=n.default.getEncryptedIV();return t}}e["default"]=o;},1280:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));const s=i(r(6667));const a=i(r(8858));const o=i(r(529));const u=i(r(6379));class c extends n.default{constructor(){super(...arguments);this.keyNegotiateResultData=new l;}static parse(t){let e=new c;super.parseMsg(e,t);e.keyNegotiateResultData=l.parse(e.data);return e}receive(){var t,e;if(0!=this.keyNegotiateResultData.errorCode){o.default.error(`key negotiate fail: ${this.data}`);null===(t=u.default.onError)||void 0===t||t.call(u.default.onError,{error:`key negotiate fail: ${this.data}`});return}let r=this.keyNegotiateResultData.encryptType.split("/");if(!s.default.algorithmMap.has(r[0].trim().toLowerCase())||!s.default.modeMap.has(r[1].trim().toLowerCase())||!s.default.paddingMap.has(r[2].trim().toLowerCase())){o.default.error(`key negotiate fail: ${this.data}`);null===(e=u.default.onError)||void 0===e||e.call(u.default.onError,{error:`key negotiate fail: ${this.data}`});return}s.default.setEncryptParams(r[0].trim().toLowerCase(),r[1].trim().toLowerCase(),r[2].trim().toLowerCase());a.default.create().send();}}class l{constructor(){this.errorCode=-1;this.errorMsg="";this.encryptType="";}static parse(t){let e=new l;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.encryptType=r.encryptType;return e}}e["default"]=c;},8858:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6379));const s=i(r(6667));const a=i(r(661));const o=i(r(4534));class u extends a.default{constructor(){super(...arguments);this.loginData=new c;}static create(){let t=new u;super.initMsg(t);t.command=a.default.Command.LOGIN;t.data=t.loginData=c.create();return t}send(){if(!this.loginData.session||n.default.cid!=s.default.md5Hex(this.loginData.session)){o.default.create().send();return}super.send();}}class c{constructor(){this.appId="";this.session="";}static create(){let t=new c;t.appId=n.default.appid;t.session=n.default.session;return t}}e["default"]=u;},1606:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(661));const a=i(r(6379));const o=i(r(9586));const u=i(r(4516));const c=i(r(8858));class l extends s.default{constructor(){super(...arguments);this.loginResultData=new f;}static parse(t){let e=new l;super.parseMsg(e,t);e.loginResultData=f.parse(e.data);return e}receive(){var t;if(0!=this.loginResultData.errorCode){this.data;a.default.session=a.default.cid="";n.default.setSync(n.default.KEY_CID,"");n.default.setSync(n.default.KEY_SESSION,"");c.default.create().send();return}if(!a.default.online){a.default.online=true;null===(t=a.default.onlineState)||void 0===t||t.call(a.default.onlineState,{online:a.default.online});}o.default.sendWaitingMessages();u.default.create().send();}}class f{constructor(){this.errorCode=-1;this.errorMsg="";this.session="";}static parse(t){let e=new f;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.session=r.session;return e}}e["default"]=l;},661:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(9593));const a=i(r(7002));const o=i(r(6893));const u=i(r(6379));class c{constructor(){this.version="";this.command=0;this.packetId=0;this.timeStamp=0;this.data="";this.signature="";}static initMsg(t,...e){t.version=o.default.SOCKET_PROTOCOL_VERSION;t.command=0;t.timeStamp=(new Date).getTime();return t}static parseMsg(t,e){let r=JSON.parse(e);t.version=r.version;t.command=r.command;t.packetId=r.packetId;t.timeStamp=r.timeStamp;t.data=r.data;t.signature=r.signature;return t}stringify(){return JSON.stringify(this,["version","command","packetId","timeStamp","data","signature"])}send(){if(!a.default.isAvailable())return;this.packetId=u.default.packetId++;if(this.temp)this.data=this.temp;else this.temp=this.data;this.data=JSON.stringify(this.data);this.stringify();if(this.command!=c.Command.HEART_BEAT){s.default.sign(this);if(this.data&&this.command!=c.Command.KEY_NEGOTIATE)s.default.encrypt(this);}a.default.send(this.stringify());}}c.Command=(n=class{},n.HEART_BEAT=0,n.KEY_NEGOTIATE=1,n.KEY_NEGOTIATE_RESULT=16,n.REGISTER=2,n.REGISTER_RESULT=32,n.LOGIN=3,n.LOGIN_RESULT=48,n.LOGOUT=4,n.LOGOUT_RESULT=64,n.CLIENT_MSG=5,n.SERVER_MSG=80,n.SERVER_CLOSE=96,n.REDIRECT_SERVER=112,n);e["default"]=c;},9593:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));var s;(function(t){function e(t){t.data=n.default.encrypt(t.data);}t.encrypt=e;function r(t){t.data=n.default.decrypt(t.data);}t.decrypt=r;function i(t){t.signature=n.default.sha256(`${t.timeStamp}${t.packetId}${t.command}${t.data}`);}t.sign=i;function s(t){let e=n.default.sha256(`${t.timeStamp}${t.packetId}${t.command}${t.data}`);if(t.signature!=e)throw new Error(`msg signature vierfy failed`)}t.verify=s;})(s||(s={}));e["default"]=s;},4054:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(1280));const s=i(r(1606));const a=i(r(661));const o=i(r(1277));const u=i(r(910));const c=i(r(9538));const l=i(r(9479));const f=i(r(6755));const h=i(r(2918));const d=i(r(9586));const v=i(r(9510));const p=i(r(4626));const g=i(r(7562));const y=i(r(9593));const m=i(r(9586));const w=i(r(9519));const S=i(r(8947));class _{static receiveMessage(t){let e=a.default.parseMsg(new a.default,t);if(e.command==a.default.Command.HEART_BEAT)return;if(e.command!=a.default.Command.KEY_NEGOTIATE_RESULT&&e.command!=a.default.Command.SERVER_CLOSE&&e.command!=a.default.Command.REDIRECT_SERVER)y.default.decrypt(e);if(e.command!=a.default.Command.SERVER_CLOSE&&e.command!=a.default.Command.REDIRECT_SERVER)y.default.verify(e);switch(e.command){case a.default.Command.KEY_NEGOTIATE_RESULT:n.default.parse(e.stringify()).receive();break;case a.default.Command.REGISTER_RESULT:o.default.parse(e.stringify()).receive();break;case a.default.Command.LOGIN_RESULT:s.default.parse(e.stringify()).receive();break;case a.default.Command.SERVER_MSG:this.receiveActionMsg(e.stringify());break;case a.default.Command.SERVER_CLOSE:S.default.parse(e.stringify()).receive();break;case a.default.Command.REDIRECT_SERVER:h.default.parse(e.stringify()).receive();break;}}static receiveActionMsg(t){let e=m.default.parseActionMsg(new m.default,t);if(e.actionMsgData.msgAction!=d.default.ServerAction.RECEIVED&&e.actionMsgData.msgAction!=d.default.ServerAction.REDIRECT_SERVER){let t=JSON.parse(e.actionMsgData.msgData);w.default.create(t.id).send();}switch(e.actionMsgData.msgAction){case d.default.ServerAction.PUSH_MESSAGE:f.default.parse(t).receive();break;case d.default.ServerAction.ADD_PHONE_INFO_RESULT:u.default.parse(t).receive();break;case d.default.ServerAction.SET_MODE_RESULT:v.default.parse(t).receive();break;case d.default.ServerAction.SET_TAG_RESULT:p.default.parse(t).receive();break;case d.default.ServerAction.BIND_ALIAS_RESULT:c.default.parse(t).receive();break;case d.default.ServerAction.UNBIND_ALIAS_RESULT:g.default.parse(t).receive();break;case d.default.ServerAction.FEED_BACK_RESULT:l.default.parse(t).receive();break;case d.default.ServerAction.RECEIVED:w.default.parse(t).receive();break}}}e["default"]=_;},9519:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=r(4198);const s=i(r(6379));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.receivedData=new u;}static create(t){let e=new o;super.initActionMsg(e);e.callback=t=>{if(t.resultCode!=n.ErrorCode.SUCCESS&&t.resultCode!=n.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){e.send();}),3*1e3);};e.actionMsgData.msgAction=a.default.ClientAction.RECEIVED;e.receivedData=u.create(t);e.actionMsgData.msgData=JSON.stringify(e.receivedData);return e}static parse(t){let e=new o;super.parseActionMsg(e,t);e.receivedData=u.parse(e.data);return e}receive(){var t;let e=a.default.getWaitingResponseMessage(this.actionMsgData.msgId);if(e&&e.actionMsgData.msgAction==a.default.ClientAction.ADD_PHONE_INFO||e&&e.actionMsgData.msgAction==a.default.ClientAction.FEED_BACK){a.default.removeWaitingResponseMessage(e.actionMsgData.msgId);null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:n.ErrorCode.SUCCESS,message:"received"});}}send(){super.send();}}class u{constructor(){this.msgId="";this.cid="";}static create(t){let e=new u;e.cid=s.default.cid;e.msgId=t;return e}static parse(t){let e=new u;let r=JSON.parse(t);e.cid=r.cid;e.msgId=r.msgId;return e}}e["default"]=o;},2918:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.RedirectServerData=void 0;const n=i(r(7002));const s=i(r(8506));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.redirectServerData=new u;}static parse(t){let e=new o;super.parseMsg(e,t);e.redirectServerData=u.parse(e.data);return e}receive(){this.redirectServerData;s.default.setSync(s.default.KEY_REDIRECT_SERVER,JSON.stringify(this.redirectServerData));n.default.close("redirect server");n.default.reconnect(this.redirectServerData.delay);}}class u{constructor(){this.addressList=[];this.delay=0;this.loc="";this.conf="";this.time=0;}static parse(t){let e=new u;let r=JSON.parse(t);e.addressList=r.addressList;e.delay=r.delay;e.loc=r.loc;e.conf=r.conf;e.time=r.time?r.time:(new Date).getTime();return e}}e.RedirectServerData=u;e["default"]=o;},4534:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6379));const s=i(r(661));class a extends s.default{constructor(){super(...arguments);this.registerData=new o;}static create(){let t=new a;super.initMsg(t);t.command=s.default.Command.REGISTER;t.data=t.registerData=o.create();return t}send(){super.send();}}class o{constructor(){this.appId="";this.regId="";}static create(){let t=new o;t.appId=n.default.appid;t.regId=n.default.regId;return t}}e["default"]=a;},1277:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));const s=i(r(8506));const a=i(r(6379));const o=i(r(8858));const u=i(r(529));class c extends n.default{constructor(){super(...arguments);this.registerResultData=new l;}static parse(t){let e=new c;super.parseMsg(e,t);e.registerResultData=l.parse(e.data);return e}receive(){var t,e;if(0!=this.registerResultData.errorCode||!this.registerResultData.cid||!this.registerResultData.session){u.default.error(`register fail: ${this.data}`);null===(t=a.default.onError)||void 0===t||t.call(a.default.onError,{error:`register fail: ${this.data}`});return}if(a.default.cid!=this.registerResultData.cid)s.default.setSync(s.default.KEY_ADD_PHONE_INFO_TIME,0);a.default.cid=this.registerResultData.cid;null===(e=a.default.onClientId)||void 0===e||e.call(a.default.onClientId,{cid:a.default.cid});s.default.set({key:s.default.KEY_CID,data:a.default.cid});a.default.session=this.registerResultData.session;s.default.set({key:s.default.KEY_SESSION,data:a.default.session});a.default.deviceId=this.registerResultData.deviceId;s.default.set({key:s.default.KEY_DEVICE_ID,data:a.default.deviceId});o.default.create().send();}}class l{constructor(){this.errorCode=-1;this.errorMsg="";this.cid="";this.session="";this.deviceId="";this.regId="";}static parse(t){let e=new l;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.cid=r.cid;e.session=r.session;e.deviceId=r.deviceId;e.regId=r.regId;return e}}e["default"]=c;},8947:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7002));const s=i(r(529));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.serverCloseData=new u;}static parse(t){let e=new o;super.parseMsg(e,t);e.serverCloseData=u.parse(e.data);return e}receive(){JSON.stringify(this.serverCloseData);let t=`server close ${this.serverCloseData.code}`;if(20==this.serverCloseData.code||23==this.serverCloseData.code||24==this.serverCloseData.code){n.default.allowReconnect=false;n.default.close(t);}else if(21==this.serverCloseData.code)this.safeClose21(t);else {n.default.allowReconnect=true;n.default.close(t);n.default.reconnect(10);}}safeClose21(t){try{if("undefined"!=typeof document)if(document.hasFocus()&&"visible"==document.visibilityState){n.default.allowReconnect=true;n.default.close(t);n.default.reconnect(10);return}n.default.allowReconnect=false;n.default.close(t);}catch(e){s.default.error(`ServerClose t1`,e);n.default.allowReconnect=false;n.default.close(`${t} error`);}}}class u{constructor(){this.code=-1;this.msg="";}static parse(t){let e=new u;let r=JSON.parse(t);e.code=r.code;e.msg=r.msg;return e}}e["default"]=o;},910:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(9586));class a extends s.default{constructor(){super(...arguments);this.addPhoneInfoResultData=new o;}static parse(t){let e=new a;super.parseActionMsg(e,t);e.addPhoneInfoResultData=o.parse(e.actionMsgData.msgData);return e}receive(){var t;this.addPhoneInfoResultData;let e=s.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.addPhoneInfoResultData.errorCode,message:this.addPhoneInfoResultData.errorMsg});n.default.set({key:n.default.KEY_ADD_PHONE_INFO_TIME,data:(new Date).getTime()});}}class o{constructor(){this.errorCode=-1;this.errorMsg="";}static parse(t){let e=new o;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=a;},9538:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.bindAliasResultData=new u;}static parse(t){let e=new o;super.parseActionMsg(e,t);e.bindAliasResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`bind alias result`,this.bindAliasResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.bindAliasResultData.errorCode,message:this.bindAliasResultData.errorMsg});n.default.set({key:n.default.KEY_BIND_ALIAS_TIME,data:(new Date).getTime()});}}class u{constructor(){this.errorCode=-1;this.errorMsg="";}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o;},9479:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=r(4198);const s=i(r(9586));class a extends s.default{constructor(){super(...arguments);this.feedbackResultData=new o;}static parse(t){let e=new a;super.parseActionMsg(e,t);e.feedbackResultData=o.parse(e.actionMsgData.msgData);return e}receive(){var t;this.feedbackResultData;let e=s.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:n.ErrorCode.SUCCESS,message:"received"});}}class o{constructor(){this.actionId="";this.taskId="";this.result="";}static parse(t){let e=new o;let r=JSON.parse(t);e.actionId=r.actionId;e.taskId=r.taskId;e.result=r.result;return e}}e["default"]=a;},6755:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(6379));const a=i(r(9586));const o=i(r(8723));class u extends a.default{constructor(){super(...arguments);this.pushMessageData=new c;}static parse(t){let e=new u;super.parseActionMsg(e,t);e.pushMessageData=c.parse(e.actionMsgData.msgData);return e}receive(){var t;this.pushMessageData;if(this.pushMessageData.appId!=s.default.appid||!this.pushMessageData.messageid||!this.pushMessageData.taskId)this.stringify();o.default.create(this,o.default.ActionId.RECEIVE).send();o.default.create(this,o.default.ActionId.MP_RECEIVE).send();if(this.actionMsgData.msgExtraData&&s.default.onPushMsg)null===(t=s.default.onPushMsg)||void 0===t||t.call(s.default.onPushMsg,{message:this.actionMsgData.msgExtraData});}}class c{constructor(){this.id="";this.appKey="";this.appId="";this.messageid="";this.taskId="";this.actionChain=[];this.cdnType="";}static parse(t){let e=new c;let r=JSON.parse(t);e.id=r.id;e.appKey=r.appKey;e.appId=r.appId;e.messageid=r.messageid;e.taskId=r.taskId;e.actionChain=r.actionChain;e.cdnType=r.cdnType;return e}}(n=class{},n.GO_TO="goto",n.TRANSMIT="transmit",n);e["default"]=u;},9510:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(9586));class s extends n.default{constructor(){super(...arguments);this.setModeResultData=new a;}static parse(t){let e=new s;super.parseActionMsg(e,t);e.setModeResultData=a.parse(e.actionMsgData.msgData);return e}receive(){var t;this.setModeResultData;let e=n.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.setModeResultData.errorCode,message:this.setModeResultData.errorMsg});}}class a{constructor(){this.errorCode=-1;this.errorMsg="";}static parse(t){let e=new a;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=s;},4626:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.setTagResultData=new u;}static parse(t){let e=new o;super.parseActionMsg(e,t);e.setTagResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`set tag result`,this.setTagResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.setTagResultData.errorCode,message:this.setTagResultData.errorMsg});n.default.set({key:n.default.KEY_SET_TAG_TIME,data:(new Date).getTime()});}}class u{constructor(){this.errorCode=0;this.errorMsg="";}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o;},7562:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.unbindAliasResultData=new u;}static parse(t){let e=new o;super.parseActionMsg(e,t);e.unbindAliasResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`unbind alias result`,this.unbindAliasResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.unbindAliasResultData.errorCode,message:this.unbindAliasResultData.errorMsg});n.default.set({key:n.default.KEY_BIND_ALIAS_TIME,data:(new Date).getTime()});}}class u{constructor(){this.errorCode=-1;this.errorMsg="";}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o;},8227:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{constructor(t){this.delay=10;this.delay=t;}start(){this.cancel();let t=this;this.timer=setInterval((function(){t.run();}),this.delay);}cancel(){if(this.timer)clearInterval(this.timer);}}e["default"]=r;},7167:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(6362));const a=i(r(8227));class o extends a.default{static getInstance(){return o.InstanceHolder.instance}run(){s.default.create().send();}refresh(){this.delay=60*1e3;this.start();}}o.INTERVAL=60*1e3;o.InstanceHolder=(n=class{},n.instance=new o(o.INTERVAL),n);e["default"]=o;},2323:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(4736));const s=i(r(6667));var a;(function(t){let e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let r=(0, n.default)("9223372036854775808");function i(t){let e=a(t);let r=o(e);let i=r[1];let n=r[0];return u(i)+u(n)}t.to_getui=i;function a(t){let e=s.default.md5Hex(t);let r=c(e);r[6]&=15;r[6]|=48;r[8]&=63;r[8]|=128;return r}function o(t){let e=(0, n.default)(0);let r=(0, n.default)(0);for(let r=0;r<8;r++)e=e.multiply(256).plus((0, n.default)(255&t[r]));for(let e=8;e<16;e++)r=r.multiply(256).plus((0, n.default)(255&t[e]));return [e,r]}function u(t){if(t>=r)t=r.multiply(2).minus(t);let i="";for(;t>(0, n.default)(0);t=t.divide(62))i+=e.charAt(Number(t.divmod(62).remainder));return i}function c(t){let e=t.length;if(e%2!=0)return [];let r=new Array;for(let i=0;i<e;i+=2)r.push(parseInt(t.substring(i,i+2),16));return r}})(a||(a={}));e["default"]=a;},6667:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(2620));const s=i(r(1354));const a=i(r(6379));var o;(function(t){let e;let r;let i;let o;let u=new n.default;let c=s.default.mode.CBC;let l=s.default.pad.Pkcs7;let f=s.default.AES;t.algorithmMap=new Map([["aes",s.default.AES]]);t.modeMap=new Map([["cbc",s.default.mode.CBC],["cfb",s.default.mode.CFB],["cfb128",s.default.mode.CFB],["ecb",s.default.mode.ECB],["ofb",s.default.mode.OFB]]);t.paddingMap=new Map([["nopadding",s.default.pad.NoPadding],["pkcs7",s.default.pad.Pkcs7]]);function h(){e=s.default.MD5((new Date).getTime().toString());r=s.default.MD5(e);u.setPublicKey(a.default.publicKey);e.toString(s.default.enc.Hex);r.toString(s.default.enc.Hex);i=u.encrypt(e.toString(s.default.enc.Hex));o=u.encrypt(r.toString(s.default.enc.Hex));}t.resetKey=h;function d(e,r,i){f=t.algorithmMap.get(e);c=t.modeMap.get(r);l=t.paddingMap.get(i);}t.setEncryptParams=d;function v(t){return f.encrypt(t,e,{iv:r,mode:c,padding:l}).toString()}t.encrypt=v;function p(t){return f.decrypt(t,e,{iv:r,mode:c,padding:l}).toString(s.default.enc.Utf8)}t.decrypt=p;function g(t){return s.default.SHA256(t).toString(s.default.enc.Base64)}t.sha256=g;function y(t){return s.default.MD5(t).toString(s.default.enc.Hex)}t.md5Hex=y;function m(){return i?i:""}t.getEncryptedSecretKey=m;function w(){return o?o:""}t.getEncryptedIV=w;})(o||(o={}));e["default"]=o;},529:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{static info(...t){if(this.debugMode)console.info(`[GtPush]`,t);}static warn(...t){console.warn(`[GtPush]`,t);}static error(...t){console.error(`[GtPush]`,t);}}r.debugMode=false;e["default"]=r;},3854:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{static getStr(t,e){try{if(!t||void 0===t[e])return "";return t[e]}catch(t){}return ""}}e["default"]=r;},2620:(t,e,r)=>{r.r(e);r.d(e,{JSEncrypt:()=>wt,default:()=>St});var i="0123456789abcdefghijklmnopqrstuvwxyz";function n(t){return i.charAt(t)}function s(t,e){return t&e}function a(t,e){return t|e}function o(t,e){return t^e}function u(t,e){return t&~e}function c(t){if(0==t)return -1;var e=0;if(0==(65535&t)){t>>=16;e+=16;}if(0==(255&t)){t>>=8;e+=8;}if(0==(15&t)){t>>=4;e+=4;}if(0==(3&t)){t>>=2;e+=2;}if(0==(1&t))++e;return e}function l(t){var e=0;while(0!=t){t&=t-1;++e;}return e}var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var h="=";function d(t){var e;var r;var i="";for(e=0;e+3<=t.length;e+=3){r=parseInt(t.substring(e,e+3),16);i+=f.charAt(r>>6)+f.charAt(63&r);}if(e+1==t.length){r=parseInt(t.substring(e,e+1),16);i+=f.charAt(r<<2);}else if(e+2==t.length){r=parseInt(t.substring(e,e+2),16);i+=f.charAt(r>>2)+f.charAt((3&r)<<4);}while((3&i.length)>0)i+=h;return i}function v(t){var e="";var r;var i=0;var s=0;for(r=0;r<t.length;++r){if(t.charAt(r)==h)break;var a=f.indexOf(t.charAt(r));if(a<0)continue;if(0==i){e+=n(a>>2);s=3&a;i=1;}else if(1==i){e+=n(s<<2|a>>4);s=15&a;i=2;}else if(2==i){e+=n(s);e+=n(a>>2);s=3&a;i=3;}else {e+=n(s<<2|a>>4);e+=n(15&a);i=0;}}if(1==i)e+=n(s<<2);return e}var g;var y={decode:function(t){var e;if(void 0===g){var r="0123456789ABCDEF";var i=" \f\n\r\t \u2028\u2029";g={};for(e=0;e<16;++e)g[r.charAt(e)]=e;r=r.toLowerCase();for(e=10;e<16;++e)g[r.charAt(e)]=e;for(e=0;e<i.length;++e)g[i.charAt(e)]=-1;}var n=[];var s=0;var a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;o=g[o];if(-1==o)continue;if(void 0===o)throw new Error("Illegal character at offset "+e);s|=o;if(++a>=2){n[n.length]=s;s=0;a=0;}else s<<=4;}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return n}};var m;var w={decode:function(t){var e;if(void 0===m){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var i="= \f\n\r\t \u2028\u2029";m=Object.create(null);for(e=0;e<64;++e)m[r.charAt(e)]=e;m["-"]=62;m["_"]=63;for(e=0;e<i.length;++e)m[i.charAt(e)]=-1;}var n=[];var s=0;var a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;o=m[o];if(-1==o)continue;if(void 0===o)throw new Error("Illegal character at offset "+e);s|=o;if(++a>=4){n[n.length]=s>>16;n[n.length]=s>>8&255;n[n.length]=255&s;s=0;a=0;}else s<<=6;}switch(a){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=s>>10;break;case 3:n[n.length]=s>>16;n[n.length]=s>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=w.re.exec(t);if(e)if(e[1])t=e[1];else if(e[2])t=e[2];else throw new Error("RegExp out of sync");return w.decode(t)}};var S=1e13;var _=function(){function t(t){this.buf=[+t||0];}t.prototype.mulAdd=function(t,e){var r=this.buf;var i=r.length;var n;var s;for(n=0;n<i;++n){s=r[n]*t+e;if(s<S)e=0;else {e=0|s/S;s-=e*S;}r[n]=s;}if(e>0)r[n]=e;};t.prototype.sub=function(t){var e=this.buf;var r=e.length;var i;var n;for(i=0;i<r;++i){n=e[i]-t;if(n<0){n+=S;t=1;}else t=0;e[i]=n;}while(0===e[e.length-1])e.pop();};t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");var e=this.buf;var r=e[e.length-1].toString();for(var i=e.length-2;i>=0;--i)r+=(S+e[i]).toString().substring(1);return r};t.prototype.valueOf=function(){var t=this.buf;var e=0;for(var r=t.length-1;r>=0;--r)e=e*S+t[r];return e};t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this};return t}();var b="…";var E=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;var D=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function M(t,e){if(t.length>e)t=t.substring(0,e)+b;return t}var T=function(){function t(e,r){this.hexDigits="0123456789ABCDEF";if(e instanceof t){this.enc=e.enc;this.pos=e.pos;}else {this.enc=e;this.pos=r;}}t.prototype.get=function(t){if(void 0===t)t=this.pos++;if(t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return "string"===typeof this.enc?this.enc.charCodeAt(t):this.enc[t]};t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)};t.prototype.hexDump=function(t,e,r){var i="";for(var n=t;n<e;++n){i+=this.hexByte(this.get(n));if(true!==r)switch(15&n){case 7:i+=" ";break;case 15:i+="\n";break;default:i+=" ";}}return i};t.prototype.isASCII=function(t,e){for(var r=t;r<e;++r){var i=this.get(r);if(i<32||i>176)return false}return true};t.prototype.parseStringISO=function(t,e){var r="";for(var i=t;i<e;++i)r+=String.fromCharCode(this.get(i));return r};t.prototype.parseStringUTF=function(t,e){var r="";for(var i=t;i<e;){var n=this.get(i++);if(n<128)r+=String.fromCharCode(n);else if(n>191&&n<224)r+=String.fromCharCode((31&n)<<6|63&this.get(i++));else r+=String.fromCharCode((15&n)<<12|(63&this.get(i++))<<6|63&this.get(i++));}return r};t.prototype.parseStringBMP=function(t,e){var r="";var i;var n;for(var s=t;s<e;){i=this.get(s++);n=this.get(s++);r+=String.fromCharCode(i<<8|n);}return r};t.prototype.parseTime=function(t,e,r){var i=this.parseStringISO(t,e);var n=(r?E:D).exec(i);if(!n)return "Unrecognized time: "+i;if(r){n[1]=+n[1];n[1]+=+n[1]<70?2e3:1900;}i=n[1]+"-"+n[2]+"-"+n[3]+" "+n[4];if(n[5]){i+=":"+n[5];if(n[6]){i+=":"+n[6];if(n[7])i+="."+n[7];}}if(n[8]){i+=" UTC";if("Z"!=n[8]){i+=n[8];if(n[9])i+=":"+n[9];}}return i};t.prototype.parseInteger=function(t,e){var r=this.get(t);var i=r>127;var n=i?255:0;var s;var a="";while(r==n&&++t<e)r=this.get(t);s=e-t;if(0===s)return i?-1:0;if(s>4){a=r;s<<=3;while(0==(128&(+a^n))){a=+a<<1;--s;}a="("+s+" bit)\n";}if(i)r-=256;var o=new _(r);for(var u=t+1;u<e;++u)o.mulAdd(256,this.get(u));return a+o.toString()};t.prototype.parseBitString=function(t,e,r){var i=this.get(t);var n=(e-t-1<<3)-i;var s="("+n+" bit)\n";var a="";for(var o=t+1;o<e;++o){var u=this.get(o);var c=o==e-1?i:0;for(var l=7;l>=c;--l)a+=u>>l&1?"1":"0";if(a.length>r)return s+M(a,r)}return s+a};t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return M(this.parseStringISO(t,e),r);var i=e-t;var n="("+i+" byte)\n";r/=2;if(i>r)e=t+r;for(var s=t;s<e;++s)n+=this.hexByte(this.get(s));if(i>r)n+=b;return n};t.prototype.parseOID=function(t,e,r){var i="";var n=new _;var s=0;for(var a=t;a<e;++a){var o=this.get(a);n.mulAdd(128,127&o);s+=7;if(!(128&o)){if(""===i){n=n.simplify();if(n instanceof _){n.sub(80);i="2."+n.toString();}else {var u=n<80?n<40?0:1:2;i=u+"."+(n-40*u);}}else i+="."+n.toString();if(i.length>r)return M(i,r);n=new _;s=0;}}if(s>0)i+=".incomplete";return i};return t}();var I=function(){function t(t,e,r,i,n){if(!(i instanceof A))throw new Error("Invalid tag value.");this.stream=t;this.header=e;this.length=r;this.tag=i;this.sub=n;}t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return "EOC";case 1:return "BOOLEAN";case 2:return "INTEGER";case 3:return "BIT_STRING";case 4:return "OCTET_STRING";case 5:return "NULL";case 6:return "OBJECT_IDENTIFIER";case 7:return "ObjectDescriptor";case 8:return "EXTERNAL";case 9:return "REAL";case 10:return "ENUMERATED";case 11:return "EMBEDDED_PDV";case 12:return "UTF8String";case 16:return "SEQUENCE";case 17:return "SET";case 18:return "NumericString";case 19:return "PrintableString";case 20:return "TeletexString";case 21:return "VideotexString";case 22:return "IA5String";case 23:return "UTCTime";case 24:return "GeneralizedTime";case 25:return "GraphicString";case 26:return "VisibleString";case 27:return "GeneralString";case 28:return "UniversalString";case 30:return "BMPString"}return "Universal_"+this.tag.tagNumber.toString();case 1:return "Application_"+this.tag.tagNumber.toString();case 2:return "["+this.tag.tagNumber.toString()+"]";case 3:return "Private_"+this.tag.tagNumber.toString()}};t.prototype.content=function(t){if(void 0===this.tag)return null;if(void 0===t)t=1/0;var e=this.posContent();var r=Math.abs(this.length);if(!this.tag.isUniversal()){if(null!==this.sub)return "("+this.sub.length+" elem)";return this.stream.parseOctetString(e,e+r,t)}switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:if(null!==this.sub)return "("+this.sub.length+" elem)";else return "(no elem)";case 12:return M(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return M(this.stream.parseStringISO(e,e+r),t);case 30:return M(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null};t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"};t.prototype.toPrettyString=function(t){if(void 0===t)t="";var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0)e+="+";e+=this.length;if(this.tag.tagConstructed)e+=" (constructed)";else if(this.tag.isUniversal()&&(3==this.tag.tagNumber||4==this.tag.tagNumber)&&null!==this.sub)e+=" (encapsulates)";e+="\n";if(null!==this.sub){t+=" ";for(var r=0,i=this.sub.length;r<i;++r)e+=this.sub[r].toPrettyString(t);}return e};t.prototype.posStart=function(){return this.stream.pos};t.prototype.posContent=function(){return this.stream.pos+this.header};t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)};t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),true)};t.decodeLength=function(t){var e=t.get();var r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var i=0;i<r;++i)e=256*e+t.get();return e};t.prototype.getHexStringValue=function(){var t=this.toHexString();var e=2*this.header;var r=2*this.length;return t.substr(e,r)};t.decode=function(e){var r;if(!(e instanceof T))r=new T(e,0);else r=e;var i=new T(r);var n=new A(r);var s=t.decodeLength(r);var a=r.pos;var o=a-i.pos;var u=null;var c=function(){var e=[];if(null!==s){var i=a+s;while(r.pos<i)e[e.length]=t.decode(r);if(r.pos!=i)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var n=t.decode(r);if(n.tag.isEOC())break;e[e.length]=n;}s=a-r.pos;}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(n.tagConstructed)u=c();else if(n.isUniversal()&&(3==n.tagNumber||4==n.tagNumber))try{if(3==n.tagNumber)if(0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=c();for(var l=0;l<u.length;++l)if(u[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){u=null;}if(null===u){if(null===s)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);r.pos=a+Math.abs(s);}return new t(i,o,s,n,u)};return t}();var A=function(){function t(t){var e=t.get();this.tagClass=e>>6;this.tagConstructed=0!==(32&e);this.tagNumber=31&e;if(31==this.tagNumber){var r=new _;do{e=t.get();r.mulAdd(128,127&e);}while(128&e);this.tagNumber=r.simplify();}}t.prototype.isUniversal=function(){return 0===this.tagClass};t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber};return t}();var x;var R=0xdeadbeefcafe;var B=15715070==(16777215&R);var O=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];var k=(1<<26)/O[O.length-1];var C=function(){function t(t,e,r){if(null!=t)if("number"==typeof t)this.fromNumber(t,e,r);else if(null==e&&"string"!=typeof t)this.fromString(t,256);else this.fromString(t,e);}t.prototype.toString=function(t){if(this.s<0)return "-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else if(4==t)e=2;else return this.toRadix(t);var r=(1<<e)-1;var i;var s=false;var a="";var o=this.t;var u=this.DB-o*this.DB%e;if(o-- >0){if(u<this.DB&&(i=this[o]>>u)>0){s=true;a=n(i);}while(o>=0){if(u<e){i=(this[o]&(1<<u)-1)<<e-u;i|=this[--o]>>(u+=this.DB-e);}else {i=this[o]>>(u-=e)&r;if(u<=0){u+=this.DB;--o;}}if(i>0)s=true;if(s)a+=n(i);}}return s?a:"0"};t.prototype.negate=function(){var e=H();t.ZERO.subTo(this,e);return e};t.prototype.abs=function(){return this.s<0?this.negate():this};t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;e=r-t.t;if(0!=e)return this.s<0?-e:e;while(--r>=0)if(0!=(e=this[r]-t[r]))return e;return 0};t.prototype.bitLength=function(){if(this.t<=0)return 0;return this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM)};t.prototype.mod=function(e){var r=H();this.abs().divRemTo(e,null,r);if(this.s<0&&r.compareTo(t.ZERO)>0)e.subTo(r,r);return r};t.prototype.modPowInt=function(t,e){var r;if(t<256||e.isEven())r=new P(e);else r=new V(e);return this.exp(t,r)};t.prototype.clone=function(){var t=H();this.copyTo(t);return t};t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;else if(0==this.t)return -1}else if(1==this.t)return this[0];else if(0==this.t)return 0;return (this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]};t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24};t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16};t.prototype.signum=function(){if(this.s<0)return -1;else if(this.t<=0||1==this.t&&this[0]<=0)return 0;else return 1};t.prototype.toByteArray=function(){var t=this.t;var e=[];e[0]=this.s;var r=this.DB-t*this.DB%8;var i;var n=0;if(t-- >0){if(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r)e[n++]=i|this.s<<this.DB-r;while(t>=0){if(r<8){i=(this[t]&(1<<r)-1)<<8-r;i|=this[--t]>>(r+=this.DB-8);}else {i=this[t]>>(r-=8)&255;if(r<=0){r+=this.DB;--t;}}if(0!=(128&i))i|=-256;if(0==n&&(128&this.s)!=(128&i))++n;if(n>0||i!=this.s)e[n++]=i;}}return e};t.prototype.equals=function(t){return 0==this.compareTo(t)};t.prototype.min=function(t){return this.compareTo(t)<0?this:t};t.prototype.max=function(t){return this.compareTo(t)>0?this:t};t.prototype.and=function(t){var e=H();this.bitwiseTo(t,s,e);return e};t.prototype.or=function(t){var e=H();this.bitwiseTo(t,a,e);return e};t.prototype.xor=function(t){var e=H();this.bitwiseTo(t,o,e);return e};t.prototype.andNot=function(t){var e=H();this.bitwiseTo(t,u,e);return e};t.prototype.not=function(){var t=H();for(var e=0;e<this.t;++e)t[e]=this.DM&~this[e];t.t=this.t;t.s=~this.s;return t};t.prototype.shiftLeft=function(t){var e=H();if(t<0)this.rShiftTo(-t,e);else this.lShiftTo(t,e);return e};t.prototype.shiftRight=function(t){var e=H();if(t<0)this.lShiftTo(-t,e);else this.rShiftTo(t,e);return e};t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+c(this[t]);if(this.s<0)return this.t*this.DB;return -1};t.prototype.bitCount=function(){var t=0;var e=this.s&this.DM;for(var r=0;r<this.t;++r)t+=l(this[r]^e);return t};t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);if(e>=this.t)return 0!=this.s;return 0!=(this[e]&1<<t%this.DB)};t.prototype.setBit=function(t){return this.changeBit(t,a)};t.prototype.clearBit=function(t){return this.changeBit(t,u)};t.prototype.flipBit=function(t){return this.changeBit(t,o)};t.prototype.add=function(t){var e=H();this.addTo(t,e);return e};t.prototype.subtract=function(t){var e=H();this.subTo(t,e);return e};t.prototype.multiply=function(t){var e=H();this.multiplyTo(t,e);return e};t.prototype.divide=function(t){var e=H();this.divRemTo(t,e,null);return e};t.prototype.remainder=function(t){var e=H();this.divRemTo(t,null,e);return e};t.prototype.divideAndRemainder=function(t){var e=H();var r=H();this.divRemTo(t,e,r);return [e,r]};t.prototype.modPow=function(t,e){var r=t.bitLength();var i;var n=Y(1);var s;if(r<=0)return n;else if(r<18)i=1;else if(r<48)i=3;else if(r<144)i=4;else if(r<768)i=5;else i=6;if(r<8)s=new P(e);else if(e.isEven())s=new L(e);else s=new V(e);var a=[];var o=3;var u=i-1;var c=(1<<i)-1;a[1]=s.convert(this);if(i>1){var l=H();s.sqrTo(a[1],l);while(o<=c){a[o]=H();s.mulTo(l,a[o-2],a[o]);o+=2;}}var f=t.t-1;var h;var d=true;var v=H();var p;r=W(t[f])-1;while(f>=0){if(r>=u)h=t[f]>>r-u&c;else {h=(t[f]&(1<<r+1)-1)<<u-r;if(f>0)h|=t[f-1]>>this.DB+r-u;}o=i;while(0==(1&h)){h>>=1;--o;}if((r-=o)<0){r+=this.DB;--f;}if(d){a[h].copyTo(n);d=false;}else {while(o>1){s.sqrTo(n,v);s.sqrTo(v,n);o-=2;}if(o>0)s.sqrTo(n,v);else {p=n;n=v;v=p;}s.mulTo(v,a[h],n);}while(f>=0&&0==(t[f]&1<<r)){s.sqrTo(n,v);p=n;n=v;v=p;if(--r<0){r=this.DB-1;--f;}}}return s.revert(n)};t.prototype.modInverse=function(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;var i=e.clone();var n=this.clone();var s=Y(1);var a=Y(0);var o=Y(0);var u=Y(1);while(0!=i.signum()){while(i.isEven()){i.rShiftTo(1,i);if(r){if(!s.isEven()||!a.isEven()){s.addTo(this,s);a.subTo(e,a);}s.rShiftTo(1,s);}else if(!a.isEven())a.subTo(e,a);a.rShiftTo(1,a);}while(n.isEven()){n.rShiftTo(1,n);if(r){if(!o.isEven()||!u.isEven()){o.addTo(this,o);u.subTo(e,u);}o.rShiftTo(1,o);}else if(!u.isEven())u.subTo(e,u);u.rShiftTo(1,u);}if(i.compareTo(n)>=0){i.subTo(n,i);if(r)s.subTo(o,s);a.subTo(u,a);}else {n.subTo(i,n);if(r)o.subTo(s,o);u.subTo(a,u);}}if(0!=n.compareTo(t.ONE))return t.ZERO;if(u.compareTo(e)>=0)return u.subtract(e);if(u.signum()<0)u.addTo(e,u);else return u;if(u.signum()<0)return u.add(e);else return u};t.prototype.pow=function(t){return this.exp(t,new N)};t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone();var r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r;r=i;}var n=e.getLowestSetBit();var s=r.getLowestSetBit();if(s<0)return e;if(n<s)s=n;if(s>0){e.rShiftTo(s,e);r.rShiftTo(s,r);}while(e.signum()>0){if((n=e.getLowestSetBit())>0)e.rShiftTo(n,e);if((n=r.getLowestSetBit())>0)r.rShiftTo(n,r);if(e.compareTo(r)>=0){e.subTo(r,e);e.rShiftTo(1,e);}else {r.subTo(e,r);r.rShiftTo(1,r);}}if(s>0)r.lShiftTo(s,r);return r};t.prototype.isProbablePrime=function(t){var e;var r=this.abs();if(1==r.t&&r[0]<=O[O.length-1]){for(e=0;e<O.length;++e)if(r[0]==O[e])return true;return false}if(r.isEven())return false;e=1;while(e<O.length){var i=O[e];var n=e+1;while(n<O.length&&i<k)i*=O[n++];i=r.modInt(i);while(e<n)if(i%O[e++]==0)return false}return r.millerRabin(t)};t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t;t.s=this.s;};t.prototype.fromInt=function(t){this.t=1;this.s=t<0?-1:0;if(t>0)this[0]=t;else if(t<-1)this[0]=t+this.DV;else this.t=0;};t.prototype.fromString=function(e,r){var i;if(16==r)i=4;else if(8==r)i=3;else if(256==r)i=8;else if(2==r)i=1;else if(32==r)i=5;else if(4==r)i=2;else {this.fromRadix(e,r);return}this.t=0;this.s=0;var n=e.length;var s=false;var a=0;while(--n>=0){var o=8==i?255&+e[n]:G(e,n);if(o<0){if("-"==e.charAt(n))s=true;continue}s=false;if(0==a)this[this.t++]=o;else if(a+i>this.DB){this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a;this[this.t++]=o>>this.DB-a;}else this[this.t-1]|=o<<a;a+=i;if(a>=this.DB)a-=this.DB;}if(8==i&&0!=(128&+e[0])){this.s=-1;if(a>0)this[this.t-1]|=(1<<this.DB-a)-1<<a;}this.clamp();if(s)t.ZERO.subTo(this,this);};t.prototype.clamp=function(){var t=this.s&this.DM;while(this.t>0&&this[this.t-1]==t)--this.t;};t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t;e.s=this.s;};t.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0);e.s=this.s;};t.prototype.lShiftTo=function(t,e){var r=t%this.DB;var i=this.DB-r;var n=(1<<i)-1;var s=Math.floor(t/this.DB);var a=this.s<<r&this.DM;for(var o=this.t-1;o>=0;--o){e[o+s+1]=this[o]>>i|a;a=(this[o]&n)<<r;}for(var o=s-1;o>=0;--o)e[o]=0;e[s]=a;e.t=this.t+s+1;e.s=this.s;e.clamp();};t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var i=t%this.DB;var n=this.DB-i;var s=(1<<i)-1;e[0]=this[r]>>i;for(var a=r+1;a<this.t;++a){e[a-r-1]|=(this[a]&s)<<n;e[a-r]=this[a]>>i;}if(i>0)e[this.t-r-1]|=(this.s&s)<<n;e.t=this.t-r;e.clamp();};t.prototype.subTo=function(t,e){var r=0;var i=0;var n=Math.min(t.t,this.t);while(r<n){i+=this[r]-t[r];e[r++]=i&this.DM;i>>=this.DB;}if(t.t<this.t){i-=t.s;while(r<this.t){i+=this[r];e[r++]=i&this.DM;i>>=this.DB;}i+=this.s;}else {i+=this.s;while(r<t.t){i-=t[r];e[r++]=i&this.DM;i>>=this.DB;}i-=t.s;}e.s=i<0?-1:0;if(i<-1)e[r++]=this.DV+i;else if(i>0)e[r++]=i;e.t=r;e.clamp();};t.prototype.multiplyTo=function(e,r){var i=this.abs();var n=e.abs();var s=i.t;r.t=s+n.t;while(--s>=0)r[s]=0;for(s=0;s<n.t;++s)r[s+i.t]=i.am(0,n[s],r,s,0,i.t);r.s=0;r.clamp();if(this.s!=e.s)t.ZERO.subTo(r,r);};t.prototype.squareTo=function(t){var e=this.abs();var r=t.t=2*e.t;while(--r>=0)t[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e[r],t,2*r,0,1);if((t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,i,e.t-r-1))>=e.DV){t[r+e.t]-=e.DV;t[r+e.t+1]=1;}}if(t.t>0)t[t.t-1]+=e.am(r,e[r],t,2*r,0,1);t.s=0;t.clamp();};t.prototype.divRemTo=function(e,r,i){var n=e.abs();if(n.t<=0)return;var s=this.abs();if(s.t<n.t){if(null!=r)r.fromInt(0);if(null!=i)this.copyTo(i);return}if(null==i)i=H();var a=H();var o=this.s;var u=e.s;var c=this.DB-W(n[n.t-1]);if(c>0){n.lShiftTo(c,a);s.lShiftTo(c,i);}else {n.copyTo(a);s.copyTo(i);}var l=a.t;var f=a[l-1];if(0==f)return;var h=f*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0);var d=this.FV/h;var v=(1<<this.F1)/h;var p=1<<this.F2;var g=i.t;var y=g-l;var m=null==r?H():r;a.dlShiftTo(y,m);if(i.compareTo(m)>=0){i[i.t++]=1;i.subTo(m,i);}t.ONE.dlShiftTo(l,m);m.subTo(a,a);while(a.t<l)a[a.t++]=0;while(--y>=0){var w=i[--g]==f?this.DM:Math.floor(i[g]*d+(i[g-1]+p)*v);if((i[g]+=a.am(0,w,i,y,0,l))<w){a.dlShiftTo(y,m);i.subTo(m,i);while(i[g]<--w)i.subTo(m,i);}}if(null!=r){i.drShiftTo(l,r);if(o!=u)t.ZERO.subTo(r,r);}i.t=l;i.clamp();if(c>0)i.rShiftTo(c,i);if(o<0)t.ZERO.subTo(i,i);};t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;e=e*(2-(15&t)*e)&15;e=e*(2-(255&t)*e)&255;e=e*(2-((65535&t)*e&65535))&65535;e=e*(2-t*e%this.DV)%this.DV;return e>0?this.DV-e:-e};t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)};t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var i=H();var n=H();var s=r.convert(this);var a=W(e)-1;s.copyTo(i);while(--a>=0){r.sqrTo(i,n);if((e&1<<a)>0)r.mulTo(n,s,i);else {var o=i;i=n;n=o;}}return r.revert(i)};t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))};t.prototype.toRadix=function(t){if(null==t)t=10;if(0==this.signum()||t<2||t>36)return "0";var e=this.chunkSize(t);var r=Math.pow(t,e);var i=Y(r);var n=H();var s=H();var a="";this.divRemTo(i,n,s);while(n.signum()>0){a=(r+s.intValue()).toString(t).substr(1)+a;n.divRemTo(i,n,s);}return s.intValue().toString(t)+a};t.prototype.fromRadix=function(e,r){this.fromInt(0);if(null==r)r=10;var i=this.chunkSize(r);var n=Math.pow(r,i);var s=false;var a=0;var o=0;for(var u=0;u<e.length;++u){var c=G(e,u);if(c<0){if("-"==e.charAt(u)&&0==this.signum())s=true;continue}o=r*o+c;if(++a>=i){this.dMultiply(n);this.dAddOffset(o,0);a=0;o=0;}}if(a>0){this.dMultiply(Math.pow(r,a));this.dAddOffset(o,0);}if(s)t.ZERO.subTo(this,this);};t.prototype.fromNumber=function(e,r,i){if("number"==typeof r)if(e<2)this.fromInt(1);else {this.fromNumber(e,i);if(!this.testBit(e-1))this.bitwiseTo(t.ONE.shiftLeft(e-1),a,this);if(this.isEven())this.dAddOffset(1,0);while(!this.isProbablePrime(r)){this.dAddOffset(2,0);if(this.bitLength()>e)this.subTo(t.ONE.shiftLeft(e-1),this);}}else {var n=[];var s=7&e;n.length=(e>>3)+1;r.nextBytes(n);if(s>0)n[0]&=(1<<s)-1;else n[0]=0;this.fromString(n,256);}};t.prototype.bitwiseTo=function(t,e,r){var i;var n;var s=Math.min(t.t,this.t);for(i=0;i<s;++i)r[i]=e(this[i],t[i]);if(t.t<this.t){n=t.s&this.DM;for(i=s;i<this.t;++i)r[i]=e(this[i],n);r.t=this.t;}else {n=this.s&this.DM;for(i=s;i<t.t;++i)r[i]=e(n,t[i]);r.t=t.t;}r.s=e(this.s,t.s);r.clamp();};t.prototype.changeBit=function(e,r){var i=t.ONE.shiftLeft(e);this.bitwiseTo(i,r,i);return i};t.prototype.addTo=function(t,e){var r=0;var i=0;var n=Math.min(t.t,this.t);while(r<n){i+=this[r]+t[r];e[r++]=i&this.DM;i>>=this.DB;}if(t.t<this.t){i+=t.s;while(r<this.t){i+=this[r];e[r++]=i&this.DM;i>>=this.DB;}i+=this.s;}else {i+=this.s;while(r<t.t){i+=t[r];e[r++]=i&this.DM;i>>=this.DB;}i+=t.s;}e.s=i<0?-1:0;if(i>0)e[r++]=i;else if(i<-1)e[r++]=this.DV+i;e.t=r;e.clamp();};t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t);++this.t;this.clamp();};t.prototype.dAddOffset=function(t,e){if(0==t)return;while(this.t<=e)this[this.t++]=0;this[e]+=t;while(this[e]>=this.DV){this[e]-=this.DV;if(++e>=this.t)this[this.t++]=0;++this[e];}};t.prototype.multiplyLowerTo=function(t,e,r){var i=Math.min(this.t+t.t,e);r.s=0;r.t=i;while(i>0)r[--i]=0;for(var n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(var n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp();};t.prototype.multiplyUpperTo=function(t,e,r){--e;var i=r.t=this.t+t.t-e;r.s=0;while(--i>=0)r[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)r[this.t+i-e]=this.am(e-i,t[i],r,0,0,this.t+i-e);r.clamp();r.drShiftTo(1,r);};t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t;var r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r};t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE);var i=r.getLowestSetBit();if(i<=0)return false;var n=r.shiftRight(i);e=e+1>>1;if(e>O.length)e=O.length;var s=H();for(var a=0;a<e;++a){s.fromInt(O[Math.floor(Math.random()*O.length)]);var o=s.modPow(n,this);if(0!=o.compareTo(t.ONE)&&0!=o.compareTo(r)){var u=1;while(u++<i&&0!=o.compareTo(r)){o=o.modPowInt(2,this);if(0==o.compareTo(t.ONE))return false}if(0!=o.compareTo(r))return false}}return true};t.prototype.square=function(){var t=H();this.squareTo(t);return t};t.prototype.gcda=function(t,e){var r=this.s<0?this.negate():this.clone();var i=t.s<0?t.negate():t.clone();if(r.compareTo(i)<0){var n=r;r=i;i=n;}var s=r.getLowestSetBit();var a=i.getLowestSetBit();if(a<0){e(r);return}if(s<a)a=s;if(a>0){r.rShiftTo(a,r);i.rShiftTo(a,i);}var o=function(){if((s=r.getLowestSetBit())>0)r.rShiftTo(s,r);if((s=i.getLowestSetBit())>0)i.rShiftTo(s,i);if(r.compareTo(i)>=0){r.subTo(i,r);r.rShiftTo(1,r);}else {i.subTo(r,i);i.rShiftTo(1,i);}if(!(r.signum()>0)){if(a>0)i.lShiftTo(a,i);setTimeout((function(){e(i);}),0);}else setTimeout(o,0);};setTimeout(o,10);};t.prototype.fromNumberAsync=function(e,r,i,n){if("number"==typeof r)if(e<2)this.fromInt(1);else {this.fromNumber(e,i);if(!this.testBit(e-1))this.bitwiseTo(t.ONE.shiftLeft(e-1),a,this);if(this.isEven())this.dAddOffset(1,0);var s=this;var o=function(){s.dAddOffset(2,0);if(s.bitLength()>e)s.subTo(t.ONE.shiftLeft(e-1),s);if(s.isProbablePrime(r))setTimeout((function(){n();}),0);else setTimeout(o,0);};setTimeout(o,0);}else {var u=[];var c=7&e;u.length=(e>>3)+1;r.nextBytes(u);if(c>0)u[0]&=(1<<c)-1;else u[0]=0;this.fromString(u,256);}};return t}();var N=function(){function t(){}t.prototype.convert=function(t){return t};t.prototype.revert=function(t){return t};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);};t.prototype.sqrTo=function(t,e){t.squareTo(e);};return t}();var P=function(){function t(t){this.m=t;}t.prototype.convert=function(t){if(t.s<0||t.compareTo(this.m)>=0)return t.mod(this.m);else return t};t.prototype.revert=function(t){return t};t.prototype.reduce=function(t){t.divRemTo(this.m,null,t);};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r);};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e);};return t}();var V=function(){function t(t){this.m=t;this.mp=t.invDigit();this.mpl=32767&this.mp;this.mph=this.mp>>15;this.um=(1<<t.DB-15)-1;this.mt2=2*t.t;}t.prototype.convert=function(t){var e=H();t.abs().dlShiftTo(this.m.t,e);e.divRemTo(this.m,null,e);if(t.s<0&&e.compareTo(C.ZERO)>0)this.m.subTo(e,e);return e};t.prototype.revert=function(t){var e=H();t.copyTo(e);this.reduce(e);return e};t.prototype.reduce=function(t){while(t.t<=this.mt2)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e];var i=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;r=e+this.m.t;t[r]+=this.m.am(0,i,t,e,0,this.m.t);while(t[r]>=t.DV){t[r]-=t.DV;t[++r]++;}}t.clamp();t.drShiftTo(this.m.t,t);if(t.compareTo(this.m)>=0)t.subTo(this.m,t);};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r);};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e);};return t}();var L=function(){function t(t){this.m=t;this.r2=H();this.q3=H();C.ONE.dlShiftTo(2*t.t,this.r2);this.mu=this.r2.divide(t);}t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);else if(t.compareTo(this.m)<0)return t;else {var e=H();t.copyTo(e);this.reduce(e);return e}};t.prototype.revert=function(t){return t};t.prototype.reduce=function(t){t.drShiftTo(this.m.t-1,this.r2);if(t.t>this.m.t+1){t.t=this.m.t+1;t.clamp();}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(t.compareTo(this.r2)<0)t.dAddOffset(1,this.m.t+1);t.subTo(this.r2,t);while(t.compareTo(this.m)>=0)t.subTo(this.m,t);};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r);};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e);};return t}();function H(){return new C(null)}function U(t,e){return new C(t,e)}var K="undefined"!==typeof navigator;if(K&&B&&"Microsoft Internet Explorer"==navigator.appName){C.prototype.am=function t(e,r,i,n,s,a){var o=32767&r;var u=r>>15;while(--a>=0){var c=32767&this[e];var l=this[e++]>>15;var f=u*c+l*o;c=o*c+((32767&f)<<15)+i[n]+(1073741823&s);s=(c>>>30)+(f>>>15)+u*l+(s>>>30);i[n++]=1073741823&c;}return s};x=30;}else if(K&&B&&"Netscape"!=navigator.appName){C.prototype.am=function t(e,r,i,n,s,a){while(--a>=0){var o=r*this[e++]+i[n]+s;s=Math.floor(o/67108864);i[n++]=67108863&o;}return s};x=26;}else {C.prototype.am=function t(e,r,i,n,s,a){var o=16383&r;var u=r>>14;while(--a>=0){var c=16383&this[e];var l=this[e++]>>14;var f=u*c+l*o;c=o*c+((16383&f)<<14)+i[n]+s;s=(c>>28)+(f>>14)+u*l;i[n++]=268435455&c;}return s};x=28;}C.prototype.DB=x;C.prototype.DM=(1<<x)-1;C.prototype.DV=1<<x;var j=52;C.prototype.FV=Math.pow(2,j);C.prototype.F1=j-x;C.prototype.F2=2*x-j;var q=[];var F;var z;F="0".charCodeAt(0);for(z=0;z<=9;++z)q[F++]=z;F="a".charCodeAt(0);for(z=10;z<36;++z)q[F++]=z;F="A".charCodeAt(0);for(z=10;z<36;++z)q[F++]=z;function G(t,e){var r=q[t.charCodeAt(e)];return null==r?-1:r}function Y(t){var e=H();e.fromInt(t);return e}function W(t){var e=1;var r;if(0!=(r=t>>>16)){t=r;e+=16;}if(0!=(r=t>>8)){t=r;e+=8;}if(0!=(r=t>>4)){t=r;e+=4;}if(0!=(r=t>>2)){t=r;e+=2;}if(0!=(r=t>>1)){t=r;e+=1;}return e}C.ZERO=Y(0);C.ONE=Y(1);var J=function(){function t(){this.i=0;this.j=0;this.S=[];}t.prototype.init=function(t){var e;var r;var i;for(e=0;e<256;++e)this.S[e]=e;r=0;for(e=0;e<256;++e){r=r+this.S[e]+t[e%t.length]&255;i=this.S[e];this.S[e]=this.S[r];this.S[r]=i;}this.i=0;this.j=0;};t.prototype.next=function(){var t;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;t=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=t;return this.S[t+this.S[this.i]&255]};return t}();function Z(){return new J}var $=256;var X;var Q=null;var tt;if(null==Q){Q=[];tt=0;}function nt(){if(null==X){X=Z();while(tt<$){var t=Math.floor(65536*Math.random());Q[tt++]=255&t;}X.init(Q);for(tt=0;tt<Q.length;++tt)Q[tt]=0;tt=0;}return X.next()}var st=function(){function t(){}t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=nt();};return t}();function at(t,e){if(e<t.length+22){console.error("Message too long for RSA");return null}var r=e-t.length-6;var i="";for(var n=0;n<r;n+=2)i+="ff";var s="0001"+i+"00"+t;return U(s,16)}function ot(t,e){if(e<t.length+11){console.error("Message too long for RSA");return null}var r=[];var i=t.length-1;while(i>=0&&e>0){var n=t.charCodeAt(i--);if(n<128)r[--e]=n;else if(n>127&&n<2048){r[--e]=63&n|128;r[--e]=n>>6|192;}else {r[--e]=63&n|128;r[--e]=n>>6&63|128;r[--e]=n>>12|224;}}r[--e]=0;var s=new st;var a=[];while(e>2){a[0]=0;while(0==a[0])s.nextBytes(a);r[--e]=a[0];}r[--e]=2;r[--e]=0;return new C(r)}var ut=function(){function t(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null;}t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)};t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);var e=t.mod(this.p).modPow(this.dmp1,this.p);var r=t.mod(this.q).modPow(this.dmq1,this.q);while(e.compareTo(r)<0)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)};t.prototype.setPublic=function(t,e){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);}else console.error("Invalid RSA public key");};t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3;var r=ot(t,e);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var n=i.toString(16);var s=n.length;for(var a=0;a<2*e-s;a++)n="0"+n;return n};t.prototype.setPrivate=function(t,e,r){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);this.d=U(r,16);}else console.error("Invalid RSA private key");};t.prototype.setPrivateEx=function(t,e,r,i,n,s,a,o){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);this.d=U(r,16);this.p=U(i,16);this.q=U(n,16);this.dmp1=U(s,16);this.dmq1=U(a,16);this.coeff=U(o,16);}else console.error("Invalid RSA private key");};t.prototype.generate=function(t,e){var r=new st;var i=t>>1;this.e=parseInt(e,16);var n=new C(e,16);for(;;){for(;;){this.p=new C(t-i,1,r);if(0==this.p.subtract(C.ONE).gcd(n).compareTo(C.ONE)&&this.p.isProbablePrime(10))break}for(;;){this.q=new C(i,1,r);if(0==this.q.subtract(C.ONE).gcd(n).compareTo(C.ONE)&&this.q.isProbablePrime(10))break}if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q;this.q=s;}var a=this.p.subtract(C.ONE);var o=this.q.subtract(C.ONE);var u=a.multiply(o);if(0==u.gcd(n).compareTo(C.ONE)){this.n=this.p.multiply(this.q);this.d=n.modInverse(u);this.dmp1=this.d.mod(a);this.dmq1=this.d.mod(o);this.coeff=this.q.modInverse(this.p);break}}};t.prototype.decrypt=function(t){var e=U(t,16);var r=this.doPrivate(e);if(null==r)return null;return ct(r,this.n.bitLength()+7>>3)};t.prototype.generateAsync=function(t,e,r){var i=new st;var n=t>>1;this.e=parseInt(e,16);var s=new C(e,16);var a=this;var o=function(){var e=function(){if(a.p.compareTo(a.q)<=0){var t=a.p;a.p=a.q;a.q=t;}var e=a.p.subtract(C.ONE);var i=a.q.subtract(C.ONE);var n=e.multiply(i);if(0==n.gcd(s).compareTo(C.ONE)){a.n=a.p.multiply(a.q);a.d=s.modInverse(n);a.dmp1=a.d.mod(e);a.dmq1=a.d.mod(i);a.coeff=a.q.modInverse(a.p);setTimeout((function(){r();}),0);}else setTimeout(o,0);};var u=function(){a.q=H();a.q.fromNumberAsync(n,1,i,(function(){a.q.subtract(C.ONE).gcda(s,(function(t){if(0==t.compareTo(C.ONE)&&a.q.isProbablePrime(10))setTimeout(e,0);else setTimeout(u,0);}));}));};var c=function(){a.p=H();a.p.fromNumberAsync(t-n,1,i,(function(){a.p.subtract(C.ONE).gcda(s,(function(t){if(0==t.compareTo(C.ONE)&&a.p.isProbablePrime(10))setTimeout(u,0);else setTimeout(c,0);}));}));};setTimeout(c,0);};setTimeout(o,0);};t.prototype.sign=function(t,e,r){var i=ht(r);var n=i+e(t).toString();var s=at(n,this.n.bitLength()/4);if(null==s)return null;var a=this.doPrivate(s);if(null==a)return null;var o=a.toString(16);if(0==(1&o.length))return o;else return "0"+o};t.prototype.verify=function(t,e,r){var i=U(e,16);var n=this.doPublic(i);if(null==n)return null;var s=n.toString(16).replace(/^1f+00/,"");var a=dt(s);return a==r(t).toString()};t.prototype.encryptLong=function(t){var e=this;var r="";var i=(this.n.bitLength()+7>>3)-11;var n=this.setSplitChn(t,i);n.forEach((function(t){r+=e.encrypt(t);}));return r};t.prototype.decryptLong=function(t){var e="";var r=this.n.bitLength()+7>>3;var i=2*r;if(t.length>i){var n=t.match(new RegExp(".{1,"+i+"}","g"))||[];var s=[];for(var a=0;a<n.length;a++){var o=U(n[a],16);var u=this.doPrivate(o);if(null==u)return null;s.push(u);}e=lt(s,r);}else e=this.decrypt(t);return e};t.prototype.setSplitChn=function(t,e,r){if(void 0===r)r=[];var i=t.split("");var n=0;for(var s=0;s<i.length;s++){var a=i[s].charCodeAt(0);if(a<=127)n+=1;else if(a<=2047)n+=2;else if(a<=65535)n+=3;else n+=4;if(n>e){var o=t.substring(0,s);r.push(o);return this.setSplitChn(t.substring(s),e,r)}}r.push(t);return r};return t}();function ct(t,e){var r=t.toByteArray();var i=0;while(i<r.length&&0==r[i])++i;if(r.length-i!=e-1||2!=r[i])return null;++i;while(0!=r[i])if(++i>=r.length)return null;var n="";while(++i<r.length){var s=255&r[i];if(s<128)n+=String.fromCharCode(s);else if(s>191&&s<224){n+=String.fromCharCode((31&s)<<6|63&r[i+1]);++i;}else {n+=String.fromCharCode((15&s)<<12|(63&r[i+1])<<6|63&r[i+2]);i+=2;}}return n}function lt(t,e){var r=[];for(var i=0;i<t.length;i++){var n=t[i];var s=n.toByteArray();var a=0;while(a<s.length&&0==s[a])++a;if(s.length-a!=e-1||2!=s[a])return null;++a;while(0!=s[a])if(++a>=s.length)return null;r=r.concat(s.slice(a+1));}var o=r;var u=-1;var c="";while(++u<o.length){var l=255&o[u];if(l<128)c+=String.fromCharCode(l);else if(l>191&&l<224){c+=String.fromCharCode((31&l)<<6|63&o[u+1]);++u;}else {c+=String.fromCharCode((15&l)<<12|(63&o[u+1])<<6|63&o[u+2]);u+=2;}}return c}var ft={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function ht(t){return ft[t]||""}function dt(t){for(var e in ft)if(ft.hasOwnProperty(e)){var r=ft[e];var i=r.length;if(t.substr(0,i)==r)return t.substr(i)}return t}var vt={};vt.lang={extend:function(t,e,r){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");var i=function(){};i.prototype=e.prototype;t.prototype=new i;t.prototype.constructor=t;t.superclass=e.prototype;if(e.prototype.constructor==Object.prototype.constructor)e.prototype.constructor=e;if(r){var n;for(n in r)t.prototype[n]=r[n];var s=function(){},a=["toString","valueOf"];try{if(/MSIE/.test(navigator.userAgent))s=function(t,e){for(n=0;n<a.length;n+=1){var r=a[n],i=e[r];if("function"===typeof i&&i!=Object.prototype[r])t[r]=i;}};}catch(t){}s(t.prototype,r);}}};var pt={};if("undefined"==typeof pt.asn1||!pt.asn1)pt.asn1={};pt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);if(e.length%2==1)e="0"+e;return e};this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1)){if(e.length%2==1)e="0"+e;else if(!e.match(/^[0-7]/))e="00"+e;}else {var r=e.substr(1);var i=r.length;if(i%2==1)i+=1;else if(!e.match(/^[0-7]/))i+=2;var n="";for(var s=0;s<i;s++)n+="f";var a=new C(n,16);var o=a.xor(t).add(C.ONE);e=o.toString(16).replace(/^-/,"");}return e};this.getPEMStringFromHex=function(t,e){return hextopem(t,e)};this.newObject=function(t){var e=pt,r=e.asn1,i=r.DERBoolean,n=r.DERInteger,s=r.DERBitString,a=r.DEROctetString,o=r.DERNull,u=r.DERObjectIdentifier,c=r.DEREnumerated,l=r.DERUTF8String,f=r.DERNumericString,h=r.DERPrintableString,d=r.DERTeletexString,v=r.DERIA5String,p=r.DERUTCTime,g=r.DERGeneralizedTime,y=r.DERSequence,m=r.DERSet,w=r.DERTaggedObject,S=r.ASN1Util.newObject;var _=Object.keys(t);if(1!=_.length)throw "key of param shall be only one.";var b=_[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+b+":"))throw "undefined key: "+b;if("bool"==b)return new i(t[b]);if("int"==b)return new n(t[b]);if("bitstr"==b)return new s(t[b]);if("octstr"==b)return new a(t[b]);if("null"==b)return new o(t[b]);if("oid"==b)return new u(t[b]);if("enum"==b)return new c(t[b]);if("utf8str"==b)return new l(t[b]);if("numstr"==b)return new f(t[b]);if("prnstr"==b)return new h(t[b]);if("telstr"==b)return new d(t[b]);if("ia5str"==b)return new v(t[b]);if("utctime"==b)return new p(t[b]);if("gentime"==b)return new g(t[b]);if("seq"==b){var E=t[b];var D=[];for(var M=0;M<E.length;M++){var T=S(E[M]);D.push(T);}return new y({array:D})}if("set"==b){var E=t[b];var D=[];for(var M=0;M<E.length;M++){var T=S(E[M]);D.push(T);}return new m({array:D})}if("tag"==b){var I=t[b];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var A=S(I[2]);return new w({tag:I[0],explicit:I[1],obj:A})}else {var x={};if(void 0!==I.explicit)x.explicit=I.explicit;if(void 0!==I.tag)x.tag=I.tag;if(void 0===I.obj)throw "obj shall be specified for 'tag'.";x.obj=S(I.obj);return new w(x)}}};this.jsonToASN1HEX=function(t){var e=this.newObject(t);return e.getEncodedHex()};};pt.asn1.ASN1Util.oidHexToInt=function(t){var e="";var r=parseInt(t.substr(0,2),16);var i=Math.floor(r/40);var n=r%40;var e=i+"."+n;var s="";for(var a=2;a<t.length;a+=2){var o=parseInt(t.substr(a,2),16);var u=("00000000"+o.toString(2)).slice(-8);s+=u.substr(1,7);if("0"==u.substr(0,1)){var c=new C(s,2);e=e+"."+c.toString(10);s="";}}return e};pt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);if(1==e.length)e="0"+e;return e};var r=function(t){var r="";var i=new C(t,10);var n=i.toString(2);var s=7-n.length%7;if(7==s)s=0;var a="";for(var o=0;o<s;o++)a+="0";n=a+n;for(var o=0;o<n.length-1;o+=7){var u=n.substr(o,7);if(o!=n.length-7)u="1"+u;r+=e(parseInt(u,2));}return r};if(!t.match(/^[0-9.]+$/))throw "malformed oid string: "+t;var i="";var n=t.split(".");var s=40*parseInt(n[0])+parseInt(n[1]);i+=e(s);n.splice(0,2);for(var a=0;a<n.length;a++)i+=r(n[a]);return i};pt.asn1.ASN1Object=function(){var n="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw "this.hV is null or undefined.";if(this.hV.length%2==1)throw "value hex must be even length: n="+n.length+",v="+this.hV;var t=this.hV.length/2;var e=t.toString(16);if(e.length%2==1)e="0"+e;if(t<128)return e;else {var r=e.length/2;if(r>15)throw "ASN.1 length too long to represent by 8x: n = "+t.toString(16);var i=128+r;return i.toString(16)+e}};this.getEncodedHex=function(){if(null==this.hTLV||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false;}return this.hTLV};this.getValueHex=function(){this.getEncodedHex();return this.hV};this.getFreshValueHex=function(){return ""};};pt.asn1.DERAbstractString=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s};this.setString=function(t){this.hTLV=null;this.isModified=true;this.s=t;this.hV=stohex(this.s);};this.setStringHex=function(t){this.hTLV=null;this.isModified=true;this.s=null;this.hV=t;};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("string"==typeof t)this.setString(t);else if("undefined"!=typeof t["str"])this.setString(t["str"]);else if("undefined"!=typeof t["hex"])this.setStringHex(t["hex"]);};vt.lang.extend(pt.asn1.DERAbstractString,pt.asn1.ASN1Object);pt.asn1.DERAbstractTime=function(t){pt.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e};this.formatDate=function(t,e,r){var i=this.zeroPadding;var n=this.localDateToUTC(t);var s=String(n.getFullYear());if("utc"==e)s=s.substr(2,2);var a=i(String(n.getMonth()+1),2);var o=i(String(n.getDate()),2);var u=i(String(n.getHours()),2);var c=i(String(n.getMinutes()),2);var l=i(String(n.getSeconds()),2);var f=s+a+o+u+c+l;if(true===r){var h=n.getMilliseconds();if(0!=h){var d=i(String(h),3);d=d.replace(/[0]+$/,"");f=f+"."+d;}}return f+"Z"};this.zeroPadding=function(t,e){if(t.length>=e)return t;return new Array(e-t.length+1).join("0")+t};this.getString=function(){return this.s};this.setString=function(t){this.hTLV=null;this.isModified=true;this.s=t;this.hV=stohex(t);};this.setByDateValue=function(t,e,r,i,n,s){var a=new Date(Date.UTC(t,e-1,r,i,n,s,0));this.setByDate(a);};this.getFreshValueHex=function(){return this.hV};};vt.lang.extend(pt.asn1.DERAbstractTime,pt.asn1.ASN1Object);pt.asn1.DERAbstractStructured=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null;this.isModified=true;this.asn1Array=t;};this.appendASN1Object=function(t){this.hTLV=null;this.isModified=true;this.asn1Array.push(t);};this.asn1Array=new Array;if("undefined"!=typeof t)if("undefined"!=typeof t["array"])this.asn1Array=t["array"];};vt.lang.extend(pt.asn1.DERAbstractStructured,pt.asn1.ASN1Object);pt.asn1.DERBoolean=function(){pt.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff";};vt.lang.extend(pt.asn1.DERBoolean,pt.asn1.ASN1Object);pt.asn1.DERInteger=function(t){pt.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(t){this.hTLV=null;this.isModified=true;this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);};this.setByInteger=function(t){var e=new C(String(t),10);this.setByBigInteger(e);};this.setValueHex=function(t){this.hV=t;};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t["bigint"])this.setByBigInteger(t["bigint"]);else if("undefined"!=typeof t["int"])this.setByInteger(t["int"]);else if("number"==typeof t)this.setByInteger(t);else if("undefined"!=typeof t["hex"])this.setValueHex(t["hex"]);};vt.lang.extend(pt.asn1.DERInteger,pt.asn1.ASN1Object);pt.asn1.DERBitString=function(t){if(void 0!==t&&"undefined"!==typeof t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex();}pt.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null;this.isModified=true;this.hV=t;};this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw "unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null;this.isModified=true;this.hV=r+e;};this.setByBinaryString=function(t){t=t.replace(/0+$/,"");var e=8-t.length%8;if(8==e)e=0;for(var r=0;r<=e;r++)t+="0";var i="";for(var r=0;r<t.length-1;r+=8){var n=t.substr(r,8);var s=parseInt(n,2).toString(16);if(1==s.length)s="0"+s;i+=s;}this.hTLV=null;this.isModified=true;this.hV="0"+e+i;};this.setByBooleanArray=function(t){var e="";for(var r=0;r<t.length;r++)if(true==t[r])e+="1";else e+="0";this.setByBinaryString(e);};this.newFalseArray=function(t){var e=new Array(t);for(var r=0;r<t;r++)e[r]=false;return e};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/))this.setHexValueIncludingUnusedBits(t);else if("undefined"!=typeof t["hex"])this.setHexValueIncludingUnusedBits(t["hex"]);else if("undefined"!=typeof t["bin"])this.setByBinaryString(t["bin"]);else if("undefined"!=typeof t["array"])this.setByBooleanArray(t["array"]);};vt.lang.extend(pt.asn1.DERBitString,pt.asn1.ASN1Object);pt.asn1.DEROctetString=function(t){if(void 0!==t&&"undefined"!==typeof t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex();}pt.asn1.DEROctetString.superclass.constructor.call(this,t);this.hT="04";};vt.lang.extend(pt.asn1.DEROctetString,pt.asn1.DERAbstractString);pt.asn1.DERNull=function(){pt.asn1.DERNull.superclass.constructor.call(this);this.hT="05";this.hTLV="0500";};vt.lang.extend(pt.asn1.DERNull,pt.asn1.ASN1Object);pt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);if(1==e.length)e="0"+e;return e};var r=function(t){var r="";var i=new C(t,10);var n=i.toString(2);var s=7-n.length%7;if(7==s)s=0;var a="";for(var o=0;o<s;o++)a+="0";n=a+n;for(var o=0;o<n.length-1;o+=7){var u=n.substr(o,7);if(o!=n.length-7)u="1"+u;r+=e(parseInt(u,2));}return r};pt.asn1.DERObjectIdentifier.superclass.constructor.call(this);this.hT="06";this.setValueHex=function(t){this.hTLV=null;this.isModified=true;this.s=null;this.hV=t;};this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw "malformed oid string: "+t;var i="";var n=t.split(".");var s=40*parseInt(n[0])+parseInt(n[1]);i+=e(s);n.splice(0,2);for(var a=0;a<n.length;a++)i+=r(n[a]);this.hTLV=null;this.isModified=true;this.s=null;this.hV=i;};this.setValueName=function(t){var e=pt.asn1.x509.OID.name2oid(t);if(""!==e)this.setValueOidString(e);else throw "DERObjectIdentifier oidName undefined: "+t};this.getFreshValueHex=function(){return this.hV};if(void 0!==t)if("string"===typeof t)if(t.match(/^[0-2].[0-9.]+$/))this.setValueOidString(t);else this.setValueName(t);else if(void 0!==t.oid)this.setValueOidString(t.oid);else if(void 0!==t.hex)this.setValueHex(t.hex);else if(void 0!==t.name)this.setValueName(t.name);};vt.lang.extend(pt.asn1.DERObjectIdentifier,pt.asn1.ASN1Object);pt.asn1.DEREnumerated=function(t){pt.asn1.DEREnumerated.superclass.constructor.call(this);this.hT="0a";this.setByBigInteger=function(t){this.hTLV=null;this.isModified=true;this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);};this.setByInteger=function(t){var e=new C(String(t),10);this.setByBigInteger(e);};this.setValueHex=function(t){this.hV=t;};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t["int"])this.setByInteger(t["int"]);else if("number"==typeof t)this.setByInteger(t);else if("undefined"!=typeof t["hex"])this.setValueHex(t["hex"]);};vt.lang.extend(pt.asn1.DEREnumerated,pt.asn1.ASN1Object);pt.asn1.DERUTF8String=function(t){pt.asn1.DERUTF8String.superclass.constructor.call(this,t);this.hT="0c";};vt.lang.extend(pt.asn1.DERUTF8String,pt.asn1.DERAbstractString);pt.asn1.DERNumericString=function(t){pt.asn1.DERNumericString.superclass.constructor.call(this,t);this.hT="12";};vt.lang.extend(pt.asn1.DERNumericString,pt.asn1.DERAbstractString);pt.asn1.DERPrintableString=function(t){pt.asn1.DERPrintableString.superclass.constructor.call(this,t);this.hT="13";};vt.lang.extend(pt.asn1.DERPrintableString,pt.asn1.DERAbstractString);pt.asn1.DERTeletexString=function(t){pt.asn1.DERTeletexString.superclass.constructor.call(this,t);this.hT="14";};vt.lang.extend(pt.asn1.DERTeletexString,pt.asn1.DERAbstractString);pt.asn1.DERIA5String=function(t){pt.asn1.DERIA5String.superclass.constructor.call(this,t);this.hT="16";};vt.lang.extend(pt.asn1.DERIA5String,pt.asn1.DERAbstractString);pt.asn1.DERUTCTime=function(t){pt.asn1.DERUTCTime.superclass.constructor.call(this,t);this.hT="17";this.setByDate=function(t){this.hTLV=null;this.isModified=true;this.date=t;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s);};this.getFreshValueHex=function(){if("undefined"==typeof this.date&&"undefined"==typeof this.s){this.date=new Date;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s);}return this.hV};if(void 0!==t)if(void 0!==t.str)this.setString(t.str);else if("string"==typeof t&&t.match(/^[0-9]{12}Z$/))this.setString(t);else if(void 0!==t.hex)this.setStringHex(t.hex);else if(void 0!==t.date)this.setByDate(t.date);};vt.lang.extend(pt.asn1.DERUTCTime,pt.asn1.DERAbstractTime);pt.asn1.DERGeneralizedTime=function(t){pt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t);this.hT="18";this.withMillis=false;this.setByDate=function(t){this.hTLV=null;this.isModified=true;this.date=t;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=stohex(this.s);};this.getFreshValueHex=function(){if(void 0===this.date&&void 0===this.s){this.date=new Date;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=stohex(this.s);}return this.hV};if(void 0!==t){if(void 0!==t.str)this.setString(t.str);else if("string"==typeof t&&t.match(/^[0-9]{14}Z$/))this.setString(t);else if(void 0!==t.hex)this.setStringHex(t.hex);else if(void 0!==t.date)this.setByDate(t.date);if(true===t.millis)this.withMillis=true;}};vt.lang.extend(pt.asn1.DERGeneralizedTime,pt.asn1.DERAbstractTime);pt.asn1.DERSequence=function(t){pt.asn1.DERSequence.superclass.constructor.call(this,t);this.hT="30";this.getFreshValueHex=function(){var t="";for(var e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t+=r.getEncodedHex();}this.hV=t;return this.hV};};vt.lang.extend(pt.asn1.DERSequence,pt.asn1.DERAbstractStructured);pt.asn1.DERSet=function(t){pt.asn1.DERSet.superclass.constructor.call(this,t);this.hT="31";this.sortFlag=true;this.getFreshValueHex=function(){var t=new Array;for(var e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex());}if(true==this.sortFlag)t.sort();this.hV=t.join("");return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t.sortflag&&false==t.sortflag)this.sortFlag=false;};vt.lang.extend(pt.asn1.DERSet,pt.asn1.DERAbstractStructured);pt.asn1.DERTaggedObject=function(t){pt.asn1.DERTaggedObject.superclass.constructor.call(this);this.hT="a0";this.hV="";this.isExplicit=true;this.asn1Object=null;this.setASN1Object=function(t,e,r){this.hT=e;this.isExplicit=t;this.asn1Object=r;if(this.isExplicit){this.hV=this.asn1Object.getEncodedHex();this.hTLV=null;this.isModified=true;}else {this.hV=null;this.hTLV=r.getEncodedHex();this.hTLV=this.hTLV.replace(/^../,e);this.isModified=false;}};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t){if("undefined"!=typeof t["tag"])this.hT=t["tag"];if("undefined"!=typeof t["explicit"])this.isExplicit=t["explicit"];if("undefined"!=typeof t["obj"]){this.asn1Object=t["obj"];this.setASN1Object(this.isExplicit,this.hT,this.asn1Object);}}};vt.lang.extend(pt.asn1.DERTaggedObject,pt.asn1.ASN1Object);var gt=function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r];};return t(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e;}e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i);}}();var yt=function(t){gt(e,t);function e(r){var i=t.call(this)||this;if(r)if("string"===typeof r)i.parseKey(r);else if(e.hasPrivateKeyProperty(r)||e.hasPublicKeyProperty(r))i.parsePropertiesFrom(r);return i}e.prototype.parseKey=function(t){try{var e=0;var r=0;var i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/;var n=i.test(t)?y.decode(t):w.unarmor(t);var s=I.decode(n);if(3===s.sub.length)s=s.sub[2].sub[0];if(9===s.sub.length){e=s.sub[1].getHexStringValue();this.n=U(e,16);r=s.sub[2].getHexStringValue();this.e=parseInt(r,16);var a=s.sub[3].getHexStringValue();this.d=U(a,16);var o=s.sub[4].getHexStringValue();this.p=U(o,16);var u=s.sub[5].getHexStringValue();this.q=U(u,16);var c=s.sub[6].getHexStringValue();this.dmp1=U(c,16);var l=s.sub[7].getHexStringValue();this.dmq1=U(l,16);var f=s.sub[8].getHexStringValue();this.coeff=U(f,16);}else if(2===s.sub.length){var h=s.sub[1];var d=h.sub[0];e=d.sub[0].getHexStringValue();this.n=U(e,16);r=d.sub[1].getHexStringValue();this.e=parseInt(r,16);}else return false;return true}catch(t){return false}};e.prototype.getPrivateBaseKey=function(){var t={array:[new pt.asn1.DERInteger({int:0}),new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e}),new pt.asn1.DERInteger({bigint:this.d}),new pt.asn1.DERInteger({bigint:this.p}),new pt.asn1.DERInteger({bigint:this.q}),new pt.asn1.DERInteger({bigint:this.dmp1}),new pt.asn1.DERInteger({bigint:this.dmq1}),new pt.asn1.DERInteger({bigint:this.coeff})]};var e=new pt.asn1.DERSequence(t);return e.getEncodedHex()};e.prototype.getPrivateBaseKeyB64=function(){return d(this.getPrivateBaseKey())};e.prototype.getPublicBaseKey=function(){var t=new pt.asn1.DERSequence({array:[new pt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new pt.asn1.DERNull]});var e=new pt.asn1.DERSequence({array:[new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e})]});var r=new pt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});var i=new pt.asn1.DERSequence({array:[t,r]});return i.getEncodedHex()};e.prototype.getPublicBaseKeyB64=function(){return d(this.getPublicBaseKey())};e.wordwrap=function(t,e){e=e||64;if(!t)return t;var r="(.{1,"+e+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")};e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n";t+="-----END RSA PRIVATE KEY-----";return t};e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n";t+="-----END PUBLIC KEY-----";return t};e.hasPublicKeyProperty=function(t){t=t||{};return t.hasOwnProperty("n")&&t.hasOwnProperty("e")};e.hasPrivateKeyProperty=function(t){t=t||{};return t.hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")};e.prototype.parsePropertiesFrom=function(t){this.n=t.n;this.e=t.e;if(t.hasOwnProperty("d")){this.d=t.d;this.p=t.p;this.q=t.q;this.dmp1=t.dmp1;this.dmq1=t.dmq1;this.coeff=t.coeff;}};return e}(ut);const mt={i:"3.2.1"};var wt=function(){function t(t){if(void 0===t)t={};t=t||{};this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024;this.default_public_exponent=t.default_public_exponent||"010001";this.log=t.log||false;this.key=null;}t.prototype.setKey=function(t){if(this.log&&this.key)console.warn("A key was already set, overriding existing.");this.key=new yt(t);};t.prototype.setPrivateKey=function(t){this.setKey(t);};t.prototype.setPublicKey=function(t){this.setKey(t);};t.prototype.decrypt=function(t){try{return this.getKey().decrypt(t)}catch(t){return false}};t.prototype.encrypt=function(t){try{return this.getKey().encrypt(t)}catch(t){return false}};t.prototype.encryptLong=function(t){try{return d(this.getKey().encryptLong(t))}catch(t){return false}};t.prototype.decryptLong=function(t){try{return this.getKey().decryptLong(t)}catch(t){return false}};t.prototype.sign=function(t,e,r){try{return d(this.getKey().sign(t,e,r))}catch(t){return false}};t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,v(e),r)}catch(t){return false}};t.prototype.getKey=function(t){if(!this.key){this.key=new yt;if(t&&"[object Function]"==={}.toString.call(t)){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent);}return this.key};t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()};t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()};t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()};t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()};t.version=mt.i;return t}();const St=wt;},2480:()=>{}};var e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={id:i,loaded:false,exports:{}};t[i].call(s.exports,s,s.exports,r);s.loaded=true;return s.exports}(()=>{r.d=(t,e)=>{for(var i in e)if(r.o(e,i)&&!r.o(t,i))Object.defineProperty(t,i,{enumerable:true,get:e[i]});};})();(()=>{r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}();})();(()=>{r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);})();(()=>{r.r=t=>{if("undefined"!==typeof Symbol&&Symbol.toStringTag)Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});Object.defineProperty(t,"__esModule",{value:true});};})();(()=>{r.nmd=t=>{t.paths=[];if(!t.children)t.children=[];return t};})();var i=r(9021);return i})()));
|
99
|
+
}}}}e["default"]=r;},4486:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(3854));class s{constructor(){this.systemInfo=wx.getSystemInfoSync();}os(){return n.default.getStr(this.systemInfo,"platform")}osVersion(){return n.default.getStr(this.systemInfo,"system")}model(){return n.default.getStr(this.systemInfo,"model")}brand(){return n.default.getStr(this.systemInfo,"brand")}platform(){return "MP-WEIXIN"}platformVersion(){return n.default.getStr(this.systemInfo,"version")}language(){return n.default.getStr(this.systemInfo,"language")}platformId(){if(wx.canIUse("getAccountInfoSync"))return wx.getAccountInfoSync().miniProgram.appId;return ""}getNetworkType(t){wx.getNetworkType({success:e=>{var r;null===(r=t.success)||void 0===r||r.call(t.success,{networkType:e.networkType});},fail:t.fail});}onNetworkStatusChange(t){wx.onNetworkStatusChange(t);}}e["default"]=s;},5867:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{set(t){wx.setStorage(t);}setSync(t,e){wx.setStorageSync(t,e);}get(t){wx.getStorage(t);}getSync(t){return wx.getStorageSync(t)}}e["default"]=r;},7006:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{connect(t){let e=wx.connectSocket({url:t.url,header:t.header,protocols:t.protocols,success:t.success,fail:t.fail,complete:t.complete});return {onOpen:e.onOpen,send:e.send,onMessage:e.onMessage,onError:e.onError,onClose:e.onClose,close:e.close}}}e["default"]=r;},6893:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});var r;(function(t){t.SDK_VERSION="GTMP-2.0.4.dcloud";t.DEFAULT_SOCKET_URL="wss://wshzn.gepush.com:5223/nws";t.SOCKET_PROTOCOL_VERSION="1.0";t.SERVER_PUBLIC_KEY="MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAJp1rROuvBF7sBSnvLaesj2iFhMcY8aXyLvpnNLKs2wjL3JmEnyr++SlVa35liUlzi83tnAFkn3A9GB7pHBNzawyUkBh8WUhq5bnFIkk2RaDa6+5MpG84DEv52p7RR+aWwIDAQAB";t.SERVER_PUBLIC_KEY_ID="69d747c4b9f641baf4004be4297e9f3b";t.ID_U_2_G=true;})(r||(r={}));e["default"]=r;},7555:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7002));const s=i(r(529));const a=i(r(6379));class o{static init(t){var e;if(this.inited)return;try{this.checkAppid(t.appid);this.inited=true;s.default.info(`init: appid=${t.appid}`);a.default.init(t);n.default.connect();}catch(r){this.inited=false;null===(e=t.onError)||void 0===e||e.call(t.onError,{error:r});throw r}}static enableSocket(t){this.checkInit();n.default.enableSocket(t);}static checkInit(){if(!this.inited)throw new Error(`not init, please invoke init method firstly`)}static checkAppid(t){if(null==t||void 0==t||""==t.trim())throw new Error(`invalid appid ${t}`)}}o.inited=false;e["default"]=o;},6379:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));const s=i(r(8506));const a=i(r(6893));const o=i(r(7002));const u=i(r(529));const c=i(r(4685));const l=i(r(2323));class f{static init(t){var e;if(a.default.ID_U_2_G)this.appid=l.default.to_getui(t.appid);else this.appid=t.appid;this.onError=t.onError;this.onClientId=t.onClientId;this.onlineState=t.onlineState;this.onPushMsg=t.onPushMsg;if(this.appid!=s.default.getSync(s.default.KEY_APPID,this.appid)){u.default.info("appid changed, clear session and cid");s.default.setSync(s.default.KEY_CID,"");s.default.setSync(s.default.KEY_SESSION,"");}s.default.setSync(s.default.KEY_APPID,this.appid);this.cid=s.default.getSync(s.default.KEY_CID,this.cid);if(this.cid)null===(e=this.onClientId)||void 0===e||e.call(this.onClientId,{cid:f.cid});this.session=s.default.getSync(s.default.KEY_SESSION,this.session);this.deviceId=s.default.getSync(s.default.KEY_DEVICE_ID,this.deviceId);this.regId=s.default.getSync(s.default.KEY_REGID,this.regId);if(!this.regId){this.regId=this.createRegId();s.default.set({key:s.default.KEY_REGID,data:this.regId});}this.socketUrl=s.default.getSync(s.default.KEY_SOCKET_URL,this.socketUrl);let r=this;c.default.getNetworkType({success:t=>{r.networkType=t.networkType;r.networkConnected="none"!=r.networkType&&""!=r.networkType;}});c.default.onNetworkStatusChange((t=>{r.networkConnected=t.isConnected;r.networkType=t.networkType;if(r.networkConnected)o.default.reconnect(100);}));}static createRegId(){return `M-V${n.default.md5Hex(this.getUuid())}-${(new Date).getTime()}`}static getUuid(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){let e=16*Math.random()|0,r="x"===t?e:3&e|8;return r.toString(16)}))}}f.appid="";f.cid="";f.regId="";f.session="";f.deviceId="";f.packetId=1;f.online=false;f.socketUrl=a.default.DEFAULT_SOCKET_URL;f.publicKeyId=a.default.SERVER_PUBLIC_KEY_ID;f.publicKey=a.default.SERVER_PUBLIC_KEY;f.lastAliasTime=0;f.networkConnected=true;f.networkType="none";e["default"]=f;},9586:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n,s;Object.defineProperty(e,"__esModule",{value:true});const a=i(r(661));const o=r(4198);const u=i(r(6379));class c extends a.default{constructor(){super(...arguments);this.actionMsgData=new l;}static initActionMsg(t,...e){super.initMsg(t);t.command=a.default.Command.CLIENT_MSG;t.data=t.actionMsgData=l.create();return t}static parseActionMsg(t,e){super.parseMsg(t,e);t.actionMsgData=l.parse(t.data);return t}send(){setTimeout((()=>{var t;if(c.waitingLoginMsgMap.has(this.actionMsgData.msgId)||c.waitingResponseMsgMap.has(this.actionMsgData.msgId)){c.waitingLoginMsgMap.delete(this.actionMsgData.msgId);c.waitingResponseMsgMap.delete(this.actionMsgData.msgId);null===(t=this.callback)||void 0===t||t.call(this.callback,{resultCode:o.ErrorCode.TIME_OUT,message:"waiting time out"});}}),1e4);if(!u.default.online){c.waitingLoginMsgMap.set(this.actionMsgData.msgId,this);return}if(this.actionMsgData.msgAction!=c.ClientAction.RECEIVED)c.waitingResponseMsgMap.set(this.actionMsgData.msgId,this);super.send();}receive(){}static sendWaitingMessages(){let t=this.waitingLoginMsgMap.keys();let e;while(e=t.next(),!e.done){let t=this.waitingLoginMsgMap.get(e.value);this.waitingLoginMsgMap.delete(e.value);null===t||void 0===t||t.send();}}static getWaitingResponseMessage(t){return c.waitingResponseMsgMap.get(t)}static removeWaitingResponseMessage(t){let e=c.waitingResponseMsgMap.get(t);if(e)c.waitingResponseMsgMap.delete(t);return e}}c.ServerAction=(n=class{},n.PUSH_MESSAGE="pushmessage",n.REDIRECT_SERVER="redirect_server",n.ADD_PHONE_INFO_RESULT="addphoneinfo",n.SET_MODE_RESULT="set_mode_result",n.SET_TAG_RESULT="settag_result",n.BIND_ALIAS_RESULT="response_bind",n.UNBIND_ALIAS_RESULT="response_unbind",n.FEED_BACK_RESULT="pushmessage_feedback",n.RECEIVED="received",n);c.ClientAction=(s=class{},s.ADD_PHONE_INFO="addphoneinfo",s.SET_MODE="set_mode",s.FEED_BACK="pushmessage_feedback",s.SET_TAGS="set_tag",s.BIND_ALIAS="bind_alias",s.UNBIND_ALIAS="unbind_alias",s.RECEIVED="received",s);c.waitingLoginMsgMap=new Map;c.waitingResponseMsgMap=new Map;class l{constructor(){this.appId="";this.cid="";this.msgId="";this.msgAction="";this.msgData="";this.msgExtraData="";}static create(){let t=new l;t.appId=u.default.appid;t.cid=u.default.cid;t.msgId=(2147483647&(new Date).getTime()).toString();return t}static parse(t){let e=new l;let r=JSON.parse(t);e.appId=r.appId;e.cid=r.cid;e.msgId=r.msgId;e.msgAction=r.msgAction;e.msgData=r.msgData;e.msgExtraData=r.msgExtraData;return e}}e["default"]=c;},4516:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(4685));const s=i(r(8506));const a=i(r(6893));const o=r(4198);const u=i(r(9586));const c=i(r(6379));class l extends u.default{constructor(){super(...arguments);this.addPhoneInfoData=new f;}static create(){let t=new l;super.initActionMsg(t);t.callback=e=>{if(e.resultCode!=o.ErrorCode.SUCCESS&&e.resultCode!=o.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){t.send();}),30*1e3);else s.default.set({key:s.default.KEY_ADD_PHONE_INFO_TIME,data:(new Date).getTime()});};t.actionMsgData.msgAction=u.default.ClientAction.ADD_PHONE_INFO;t.addPhoneInfoData=f.create();t.actionMsgData.msgData=JSON.stringify(t.addPhoneInfoData);return t}send(){let t=(new Date).getTime();let e=s.default.getSync(s.default.KEY_ADD_PHONE_INFO_TIME,0);if(t-e<24*60*60*1e3)return;super.send();}}class f{constructor(){this.model="";this.brand="";this.system_version="";this.version="";this.deviceid="";this.type="";}static create(){let t=new f;t.model=n.default.model();t.brand=n.default.brand();t.system_version=n.default.osVersion();t.version=a.default.SDK_VERSION;t.device_token="";t.imei="";t.oaid="";t.mac="";t.idfa="";t.type="MINIPROGRAM";t.deviceid=`${t.type}-${c.default.deviceId}`;t.extra={os:n.default.os(),platform:n.default.platform(),platformVersion:n.default.platformVersion(),platformId:n.default.platformId(),language:n.default.language(),userAgent:n.default.userAgent()};return t}}e["default"]=l;},8723:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n,s;Object.defineProperty(e,"__esModule",{value:true});const a=i(r(6379));const o=r(4198);const u=i(r(9586));class c extends u.default{constructor(){super(...arguments);this.feedbackData=new l;}static create(t,e){let r=new c;super.initActionMsg(r);r.callback=t=>{if(t.resultCode!=o.ErrorCode.SUCCESS&&t.resultCode!=o.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){r.send();}),30*1e3);};r.feedbackData=l.create(t,e);r.actionMsgData.msgAction=u.default.ClientAction.FEED_BACK;r.actionMsgData.msgData=JSON.stringify(r.feedbackData);return r}send(){super.send();}}c.ActionId=(n=class{},n.RECEIVE="0",n.MP_RECEIVE="210000",n.WEB_RECEIVE="220000",n.BEGIN="1",n);c.RESULT=(s=class{},s.OK="ok",s);class l{constructor(){this.messageid="";this.appkey="";this.appid="";this.taskid="";this.actionid="";this.result="";this.timestamp="";}static create(t,e){let r=new l;r.messageid=t.pushMessageData.messageid;r.appkey=t.pushMessageData.appKey;r.appid=a.default.appid;r.taskid=t.pushMessageData.taskId;r.actionid=e;r.result=c.RESULT.OK;r.timestamp=(new Date).getTime().toString();return r}}e["default"]=c;},6362:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));class s extends n.default{static create(){let t=new s;super.initMsg(t);t.command=n.default.Command.HEART_BEAT;return t}}e["default"]=s;},1386:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));const s=i(r(6379));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.keyNegotiateData=new u;}static create(){let t=new o;super.initMsg(t);t.command=a.default.Command.KEY_NEGOTIATE;n.default.resetKey();t.data=t.keyNegotiateData=u.create();return t}send(){super.send();}}class u{constructor(){this.appId="";this.rsaPublicKeyId="";this.algorithm="";this.secretKey="";this.iv="";}static create(){let t=new u;t.appId=s.default.appid;t.rsaPublicKeyId=s.default.publicKeyId;t.algorithm="AES";t.secretKey=n.default.getEncryptedSecretKey();t.iv=n.default.getEncryptedIV();return t}}e["default"]=o;},1280:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));const s=i(r(6667));const a=i(r(8858));const o=i(r(529));const u=i(r(6379));class c extends n.default{constructor(){super(...arguments);this.keyNegotiateResultData=new l;}static parse(t){let e=new c;super.parseMsg(e,t);e.keyNegotiateResultData=l.parse(e.data);return e}receive(){var t,e;if(0!=this.keyNegotiateResultData.errorCode){o.default.error(`key negotiate fail: ${this.data}`);null===(t=u.default.onError)||void 0===t||t.call(u.default.onError,{error:`key negotiate fail: ${this.data}`});return}let r=this.keyNegotiateResultData.encryptType.split("/");if(!s.default.algorithmMap.has(r[0].trim().toLowerCase())||!s.default.modeMap.has(r[1].trim().toLowerCase())||!s.default.paddingMap.has(r[2].trim().toLowerCase())){o.default.error(`key negotiate fail: ${this.data}`);null===(e=u.default.onError)||void 0===e||e.call(u.default.onError,{error:`key negotiate fail: ${this.data}`});return}s.default.setEncryptParams(r[0].trim().toLowerCase(),r[1].trim().toLowerCase(),r[2].trim().toLowerCase());a.default.create().send();}}class l{constructor(){this.errorCode=-1;this.errorMsg="";this.encryptType="";}static parse(t){let e=new l;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.encryptType=r.encryptType;return e}}e["default"]=c;},8858:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6379));const s=i(r(6667));const a=i(r(661));const o=i(r(4534));class u extends a.default{constructor(){super(...arguments);this.loginData=new c;}static create(){let t=new u;super.initMsg(t);t.command=a.default.Command.LOGIN;t.data=t.loginData=c.create();return t}send(){if(!this.loginData.session||n.default.cid!=s.default.md5Hex(this.loginData.session)){o.default.create().send();return}super.send();}}class c{constructor(){this.appId="";this.session="";}static create(){let t=new c;t.appId=n.default.appid;t.session=n.default.session;return t}}e["default"]=u;},1606:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(661));const a=i(r(6379));const o=i(r(9586));const u=i(r(4516));const c=i(r(8858));class l extends s.default{constructor(){super(...arguments);this.loginResultData=new f;}static parse(t){let e=new l;super.parseMsg(e,t);e.loginResultData=f.parse(e.data);return e}receive(){var t;if(0!=this.loginResultData.errorCode){this.data;a.default.session=a.default.cid="";n.default.setSync(n.default.KEY_CID,"");n.default.setSync(n.default.KEY_SESSION,"");c.default.create().send();return}if(!a.default.online){a.default.online=true;null===(t=a.default.onlineState)||void 0===t||t.call(a.default.onlineState,{online:a.default.online});}o.default.sendWaitingMessages();u.default.create().send();}}class f{constructor(){this.errorCode=-1;this.errorMsg="";this.session="";}static parse(t){let e=new f;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.session=r.session;return e}}e["default"]=l;},661:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(9593));const a=i(r(7002));const o=i(r(6893));const u=i(r(6379));class c{constructor(){this.version="";this.command=0;this.packetId=0;this.timeStamp=0;this.data="";this.signature="";}static initMsg(t,...e){t.version=o.default.SOCKET_PROTOCOL_VERSION;t.command=0;t.timeStamp=(new Date).getTime();return t}static parseMsg(t,e){let r=JSON.parse(e);t.version=r.version;t.command=r.command;t.packetId=r.packetId;t.timeStamp=r.timeStamp;t.data=r.data;t.signature=r.signature;return t}stringify(){return JSON.stringify(this,["version","command","packetId","timeStamp","data","signature"])}send(){if(!a.default.isAvailable())return;this.packetId=u.default.packetId++;if(this.temp)this.data=this.temp;else this.temp=this.data;this.data=JSON.stringify(this.data);this.stringify();if(this.command!=c.Command.HEART_BEAT){s.default.sign(this);if(this.data&&this.command!=c.Command.KEY_NEGOTIATE)s.default.encrypt(this);}a.default.send(this.stringify());}}c.Command=(n=class{},n.HEART_BEAT=0,n.KEY_NEGOTIATE=1,n.KEY_NEGOTIATE_RESULT=16,n.REGISTER=2,n.REGISTER_RESULT=32,n.LOGIN=3,n.LOGIN_RESULT=48,n.LOGOUT=4,n.LOGOUT_RESULT=64,n.CLIENT_MSG=5,n.SERVER_MSG=80,n.SERVER_CLOSE=96,n.REDIRECT_SERVER=112,n);e["default"]=c;},9593:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));var s;(function(t){function e(t){t.data=n.default.encrypt(t.data);}t.encrypt=e;function r(t){t.data=n.default.decrypt(t.data);}t.decrypt=r;function i(t){t.signature=n.default.sha256(`${t.timeStamp}${t.packetId}${t.command}${t.data}`);}t.sign=i;function s(t){let e=n.default.sha256(`${t.timeStamp}${t.packetId}${t.command}${t.data}`);if(t.signature!=e)throw new Error(`msg signature vierfy failed`)}t.verify=s;})(s||(s={}));e["default"]=s;},4054:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(1280));const s=i(r(1606));const a=i(r(661));const o=i(r(1277));const u=i(r(910));const c=i(r(9538));const l=i(r(9479));const f=i(r(6755));const h=i(r(2918));const d=i(r(9586));const v=i(r(9510));const p=i(r(4626));const g=i(r(7562));const y=i(r(9593));const m=i(r(9586));const w=i(r(9519));const S=i(r(8947));class _{static receiveMessage(t){let e=a.default.parseMsg(new a.default,t);if(e.command==a.default.Command.HEART_BEAT)return;if(e.command!=a.default.Command.KEY_NEGOTIATE_RESULT&&e.command!=a.default.Command.SERVER_CLOSE&&e.command!=a.default.Command.REDIRECT_SERVER)y.default.decrypt(e);if(e.command!=a.default.Command.SERVER_CLOSE&&e.command!=a.default.Command.REDIRECT_SERVER)y.default.verify(e);switch(e.command){case a.default.Command.KEY_NEGOTIATE_RESULT:n.default.parse(e.stringify()).receive();break;case a.default.Command.REGISTER_RESULT:o.default.parse(e.stringify()).receive();break;case a.default.Command.LOGIN_RESULT:s.default.parse(e.stringify()).receive();break;case a.default.Command.SERVER_MSG:this.receiveActionMsg(e.stringify());break;case a.default.Command.SERVER_CLOSE:S.default.parse(e.stringify()).receive();break;case a.default.Command.REDIRECT_SERVER:h.default.parse(e.stringify()).receive();break;}}static receiveActionMsg(t){let e=m.default.parseActionMsg(new m.default,t);if(e.actionMsgData.msgAction!=d.default.ServerAction.RECEIVED&&e.actionMsgData.msgAction!=d.default.ServerAction.REDIRECT_SERVER){let t=JSON.parse(e.actionMsgData.msgData);w.default.create(t.id).send();}switch(e.actionMsgData.msgAction){case d.default.ServerAction.PUSH_MESSAGE:f.default.parse(t).receive();break;case d.default.ServerAction.ADD_PHONE_INFO_RESULT:u.default.parse(t).receive();break;case d.default.ServerAction.SET_MODE_RESULT:v.default.parse(t).receive();break;case d.default.ServerAction.SET_TAG_RESULT:p.default.parse(t).receive();break;case d.default.ServerAction.BIND_ALIAS_RESULT:c.default.parse(t).receive();break;case d.default.ServerAction.UNBIND_ALIAS_RESULT:g.default.parse(t).receive();break;case d.default.ServerAction.FEED_BACK_RESULT:l.default.parse(t).receive();break;case d.default.ServerAction.RECEIVED:w.default.parse(t).receive();break}}}e["default"]=_;},9519:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=r(4198);const s=i(r(6379));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.receivedData=new u;}static create(t){let e=new o;super.initActionMsg(e);e.callback=t=>{if(t.resultCode!=n.ErrorCode.SUCCESS&&t.resultCode!=n.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){e.send();}),3*1e3);};e.actionMsgData.msgAction=a.default.ClientAction.RECEIVED;e.receivedData=u.create(t);e.actionMsgData.msgData=JSON.stringify(e.receivedData);return e}static parse(t){let e=new o;super.parseActionMsg(e,t);e.receivedData=u.parse(e.data);return e}receive(){var t;let e=a.default.getWaitingResponseMessage(this.actionMsgData.msgId);if(e&&e.actionMsgData.msgAction==a.default.ClientAction.ADD_PHONE_INFO||e&&e.actionMsgData.msgAction==a.default.ClientAction.FEED_BACK){a.default.removeWaitingResponseMessage(e.actionMsgData.msgId);null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:n.ErrorCode.SUCCESS,message:"received"});}}send(){super.send();}}class u{constructor(){this.msgId="";this.cid="";}static create(t){let e=new u;e.cid=s.default.cid;e.msgId=t;return e}static parse(t){let e=new u;let r=JSON.parse(t);e.cid=r.cid;e.msgId=r.msgId;return e}}e["default"]=o;},2918:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.RedirectServerData=void 0;const n=i(r(7002));const s=i(r(8506));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.redirectServerData=new u;}static parse(t){let e=new o;super.parseMsg(e,t);e.redirectServerData=u.parse(e.data);return e}receive(){this.redirectServerData;s.default.setSync(s.default.KEY_REDIRECT_SERVER,JSON.stringify(this.redirectServerData));n.default.close("redirect server");n.default.reconnect(this.redirectServerData.delay);}}class u{constructor(){this.addressList=[];this.delay=0;this.loc="";this.conf="";this.time=0;}static parse(t){let e=new u;let r=JSON.parse(t);e.addressList=r.addressList;e.delay=r.delay;e.loc=r.loc;e.conf=r.conf;e.time=r.time?r.time:(new Date).getTime();return e}}e.RedirectServerData=u;e["default"]=o;},4534:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6379));const s=i(r(661));class a extends s.default{constructor(){super(...arguments);this.registerData=new o;}static create(){let t=new a;super.initMsg(t);t.command=s.default.Command.REGISTER;t.data=t.registerData=o.create();return t}send(){super.send();}}class o{constructor(){this.appId="";this.regId="";}static create(){let t=new o;t.appId=n.default.appid;t.regId=n.default.regId;return t}}e["default"]=a;},1277:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));const s=i(r(8506));const a=i(r(6379));const o=i(r(8858));const u=i(r(529));class c extends n.default{constructor(){super(...arguments);this.registerResultData=new l;}static parse(t){let e=new c;super.parseMsg(e,t);e.registerResultData=l.parse(e.data);return e}receive(){var t,e;if(0!=this.registerResultData.errorCode||!this.registerResultData.cid||!this.registerResultData.session){u.default.error(`register fail: ${this.data}`);null===(t=a.default.onError)||void 0===t||t.call(a.default.onError,{error:`register fail: ${this.data}`});return}if(a.default.cid!=this.registerResultData.cid)s.default.setSync(s.default.KEY_ADD_PHONE_INFO_TIME,0);a.default.cid=this.registerResultData.cid;null===(e=a.default.onClientId)||void 0===e||e.call(a.default.onClientId,{cid:a.default.cid});s.default.set({key:s.default.KEY_CID,data:a.default.cid});a.default.session=this.registerResultData.session;s.default.set({key:s.default.KEY_SESSION,data:a.default.session});a.default.deviceId=this.registerResultData.deviceId;s.default.set({key:s.default.KEY_DEVICE_ID,data:a.default.deviceId});o.default.create().send();}}class l{constructor(){this.errorCode=-1;this.errorMsg="";this.cid="";this.session="";this.deviceId="";this.regId="";}static parse(t){let e=new l;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.cid=r.cid;e.session=r.session;e.deviceId=r.deviceId;e.regId=r.regId;return e}}e["default"]=c;},8947:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7002));const s=i(r(529));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.serverCloseData=new u;}static parse(t){let e=new o;super.parseMsg(e,t);e.serverCloseData=u.parse(e.data);return e}receive(){JSON.stringify(this.serverCloseData);let t=`server close ${this.serverCloseData.code}`;if(20==this.serverCloseData.code||23==this.serverCloseData.code||24==this.serverCloseData.code){n.default.allowReconnect=false;n.default.close(t);}else if(21==this.serverCloseData.code)this.safeClose21(t);else {n.default.allowReconnect=true;n.default.close(t);n.default.reconnect(10);}}safeClose21(t){try{if("undefined"!=typeof document)if(document.hasFocus()&&"visible"==document.visibilityState){n.default.allowReconnect=true;n.default.close(t);n.default.reconnect(10);return}n.default.allowReconnect=false;n.default.close(t);}catch(e){s.default.error(`ServerClose t1`,e);n.default.allowReconnect=false;n.default.close(`${t} error`);}}}class u{constructor(){this.code=-1;this.msg="";}static parse(t){let e=new u;let r=JSON.parse(t);e.code=r.code;e.msg=r.msg;return e}}e["default"]=o;},910:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(9586));class a extends s.default{constructor(){super(...arguments);this.addPhoneInfoResultData=new o;}static parse(t){let e=new a;super.parseActionMsg(e,t);e.addPhoneInfoResultData=o.parse(e.actionMsgData.msgData);return e}receive(){var t;this.addPhoneInfoResultData;let e=s.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.addPhoneInfoResultData.errorCode,message:this.addPhoneInfoResultData.errorMsg});n.default.set({key:n.default.KEY_ADD_PHONE_INFO_TIME,data:(new Date).getTime()});}}class o{constructor(){this.errorCode=-1;this.errorMsg="";}static parse(t){let e=new o;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=a;},9538:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.bindAliasResultData=new u;}static parse(t){let e=new o;super.parseActionMsg(e,t);e.bindAliasResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`bind alias result`,this.bindAliasResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.bindAliasResultData.errorCode,message:this.bindAliasResultData.errorMsg});n.default.set({key:n.default.KEY_BIND_ALIAS_TIME,data:(new Date).getTime()});}}class u{constructor(){this.errorCode=-1;this.errorMsg="";}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o;},9479:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=r(4198);const s=i(r(9586));class a extends s.default{constructor(){super(...arguments);this.feedbackResultData=new o;}static parse(t){let e=new a;super.parseActionMsg(e,t);e.feedbackResultData=o.parse(e.actionMsgData.msgData);return e}receive(){var t;this.feedbackResultData;let e=s.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:n.ErrorCode.SUCCESS,message:"received"});}}class o{constructor(){this.actionId="";this.taskId="";this.result="";}static parse(t){let e=new o;let r=JSON.parse(t);e.actionId=r.actionId;e.taskId=r.taskId;e.result=r.result;return e}}e["default"]=a;},6755:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(6379));const a=i(r(9586));const o=i(r(8723));class u extends a.default{constructor(){super(...arguments);this.pushMessageData=new c;}static parse(t){let e=new u;super.parseActionMsg(e,t);e.pushMessageData=c.parse(e.actionMsgData.msgData);return e}receive(){var t;this.pushMessageData;if(this.pushMessageData.appId!=s.default.appid||!this.pushMessageData.messageid||!this.pushMessageData.taskId)this.stringify();o.default.create(this,o.default.ActionId.RECEIVE).send();o.default.create(this,o.default.ActionId.MP_RECEIVE).send();if(this.actionMsgData.msgExtraData&&s.default.onPushMsg)null===(t=s.default.onPushMsg)||void 0===t||t.call(s.default.onPushMsg,{message:this.actionMsgData.msgExtraData});}}class c{constructor(){this.id="";this.appKey="";this.appId="";this.messageid="";this.taskId="";this.actionChain=[];this.cdnType="";}static parse(t){let e=new c;let r=JSON.parse(t);e.id=r.id;e.appKey=r.appKey;e.appId=r.appId;e.messageid=r.messageid;e.taskId=r.taskId;e.actionChain=r.actionChain;e.cdnType=r.cdnType;return e}}(n=class{},n.GO_TO="goto",n.TRANSMIT="transmit",n);e["default"]=u;},9510:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(9586));class s extends n.default{constructor(){super(...arguments);this.setModeResultData=new a;}static parse(t){let e=new s;super.parseActionMsg(e,t);e.setModeResultData=a.parse(e.actionMsgData.msgData);return e}receive(){var t;this.setModeResultData;let e=n.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.setModeResultData.errorCode,message:this.setModeResultData.errorMsg});}}class a{constructor(){this.errorCode=-1;this.errorMsg="";}static parse(t){let e=new a;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=s;},4626:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.setTagResultData=new u;}static parse(t){let e=new o;super.parseActionMsg(e,t);e.setTagResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`set tag result`,this.setTagResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.setTagResultData.errorCode,message:this.setTagResultData.errorMsg});n.default.set({key:n.default.KEY_SET_TAG_TIME,data:(new Date).getTime()});}}class u{constructor(){this.errorCode=0;this.errorMsg="";}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o;},7562:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.unbindAliasResultData=new u;}static parse(t){let e=new o;super.parseActionMsg(e,t);e.unbindAliasResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`unbind alias result`,this.unbindAliasResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.unbindAliasResultData.errorCode,message:this.unbindAliasResultData.errorMsg});n.default.set({key:n.default.KEY_BIND_ALIAS_TIME,data:(new Date).getTime()});}}class u{constructor(){this.errorCode=-1;this.errorMsg="";}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o;},8227:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{constructor(t){this.delay=10;this.delay=t;}start(){this.cancel();let t=this;this.timer=setInterval((function(){t.run();}),this.delay);}cancel(){if(this.timer)clearInterval(this.timer);}}e["default"]=r;},7167:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(6362));const a=i(r(8227));class o extends a.default{static getInstance(){return o.InstanceHolder.instance}run(){s.default.create().send();}refresh(){this.delay=60*1e3;this.start();}}o.INTERVAL=60*1e3;o.InstanceHolder=(n=class{},n.instance=new o(o.INTERVAL),n);e["default"]=o;},2323:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(4736));const s=i(r(6667));var a;(function(t){let e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let r=(0, n.default)("9223372036854775808");function i(t){let e=a(t);let r=o(e);let i=r[1];let n=r[0];return u(i)+u(n)}t.to_getui=i;function a(t){let e=s.default.md5Hex(t);let r=c(e);r[6]&=15;r[6]|=48;r[8]&=63;r[8]|=128;return r}function o(t){let e=(0, n.default)(0);let r=(0, n.default)(0);for(let r=0;r<8;r++)e=e.multiply(256).plus((0, n.default)(255&t[r]));for(let e=8;e<16;e++)r=r.multiply(256).plus((0, n.default)(255&t[e]));return [e,r]}function u(t){if(t>=r)t=r.multiply(2).minus(t);let i="";for(;t>(0, n.default)(0);t=t.divide(62))i+=e.charAt(Number(t.divmod(62).remainder));return i}function c(t){let e=t.length;if(e%2!=0)return [];let r=new Array;for(let i=0;i<e;i+=2)r.push(parseInt(t.substring(i,i+2),16));return r}})(a||(a={}));e["default"]=a;},6667:function(t,e,r){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(2620));const s=i(r(1354));const a=i(r(6379));var o;(function(t){let e;let r;let i;let o;let u=new n.default;let c=s.default.mode.CBC;let l=s.default.pad.Pkcs7;let f=s.default.AES;t.algorithmMap=new Map([["aes",s.default.AES]]);t.modeMap=new Map([["cbc",s.default.mode.CBC],["cfb",s.default.mode.CFB],["cfb128",s.default.mode.CFB],["ecb",s.default.mode.ECB],["ofb",s.default.mode.OFB]]);t.paddingMap=new Map([["nopadding",s.default.pad.NoPadding],["pkcs7",s.default.pad.Pkcs7]]);function h(){e=s.default.MD5((new Date).getTime().toString());r=s.default.MD5(e);u.setPublicKey(a.default.publicKey);e.toString(s.default.enc.Hex);r.toString(s.default.enc.Hex);i=u.encrypt(e.toString(s.default.enc.Hex));o=u.encrypt(r.toString(s.default.enc.Hex));}t.resetKey=h;function d(e,r,i){f=t.algorithmMap.get(e);c=t.modeMap.get(r);l=t.paddingMap.get(i);}t.setEncryptParams=d;function v(t){return f.encrypt(t,e,{iv:r,mode:c,padding:l}).toString()}t.encrypt=v;function p(t){return f.decrypt(t,e,{iv:r,mode:c,padding:l}).toString(s.default.enc.Utf8)}t.decrypt=p;function g(t){return s.default.SHA256(t).toString(s.default.enc.Base64)}t.sha256=g;function y(t){return s.default.MD5(t).toString(s.default.enc.Hex)}t.md5Hex=y;function m(){return i?i:""}t.getEncryptedSecretKey=m;function w(){return o?o:""}t.getEncryptedIV=w;})(o||(o={}));e["default"]=o;},529:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{static info(...t){if(this.debugMode)console.info(`[GtPush]`,t);}static warn(...t){console.warn(`[GtPush]`,t);}static error(...t){console.error(`[GtPush]`,t);}}r.debugMode=false;e["default"]=r;},3854:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});class r{static getStr(t,e){try{if(!t||void 0===t[e])return "";return t[e]}catch(t){}return ""}}e["default"]=r;},2620:(t,e,r)=>{r.r(e);r.d(e,{JSEncrypt:()=>wt,default:()=>St});var i="0123456789abcdefghijklmnopqrstuvwxyz";function n(t){return i.charAt(t)}function s(t,e){return t&e}function a(t,e){return t|e}function o(t,e){return t^e}function u(t,e){return t&~e}function c(t){if(0==t)return -1;var e=0;if(0==(65535&t)){t>>=16;e+=16;}if(0==(255&t)){t>>=8;e+=8;}if(0==(15&t)){t>>=4;e+=4;}if(0==(3&t)){t>>=2;e+=2;}if(0==(1&t))++e;return e}function l(t){var e=0;while(0!=t){t&=t-1;++e;}return e}var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var h="=";function d(t){var e;var r;var i="";for(e=0;e+3<=t.length;e+=3){r=parseInt(t.substring(e,e+3),16);i+=f.charAt(r>>6)+f.charAt(63&r);}if(e+1==t.length){r=parseInt(t.substring(e,e+1),16);i+=f.charAt(r<<2);}else if(e+2==t.length){r=parseInt(t.substring(e,e+2),16);i+=f.charAt(r>>2)+f.charAt((3&r)<<4);}while((3&i.length)>0)i+=h;return i}function v(t){var e="";var r;var i=0;var s=0;for(r=0;r<t.length;++r){if(t.charAt(r)==h)break;var a=f.indexOf(t.charAt(r));if(a<0)continue;if(0==i){e+=n(a>>2);s=3&a;i=1;}else if(1==i){e+=n(s<<2|a>>4);s=15&a;i=2;}else if(2==i){e+=n(s);e+=n(a>>2);s=3&a;i=3;}else {e+=n(s<<2|a>>4);e+=n(15&a);i=0;}}if(1==i)e+=n(s<<2);return e}var g;var y={decode:function(t){var e;if(void 0===g){var r="0123456789ABCDEF";var i=" \f\n\r\t \u2028\u2029";g={};for(e=0;e<16;++e)g[r.charAt(e)]=e;r=r.toLowerCase();for(e=10;e<16;++e)g[r.charAt(e)]=e;for(e=0;e<i.length;++e)g[i.charAt(e)]=-1;}var n=[];var s=0;var a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;o=g[o];if(-1==o)continue;if(void 0===o)throw new Error("Illegal character at offset "+e);s|=o;if(++a>=2){n[n.length]=s;s=0;a=0;}else s<<=4;}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return n}};var m;var w={decode:function(t){var e;if(void 0===m){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var i="= \f\n\r\t \u2028\u2029";m=Object.create(null);for(e=0;e<64;++e)m[r.charAt(e)]=e;m["-"]=62;m["_"]=63;for(e=0;e<i.length;++e)m[i.charAt(e)]=-1;}var n=[];var s=0;var a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;o=m[o];if(-1==o)continue;if(void 0===o)throw new Error("Illegal character at offset "+e);s|=o;if(++a>=4){n[n.length]=s>>16;n[n.length]=s>>8&255;n[n.length]=255&s;s=0;a=0;}else s<<=6;}switch(a){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=s>>10;break;case 3:n[n.length]=s>>16;n[n.length]=s>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=w.re.exec(t);if(e)if(e[1])t=e[1];else if(e[2])t=e[2];else throw new Error("RegExp out of sync");return w.decode(t)}};var S=1e13;var _=function(){function t(t){this.buf=[+t||0];}t.prototype.mulAdd=function(t,e){var r=this.buf;var i=r.length;var n;var s;for(n=0;n<i;++n){s=r[n]*t+e;if(s<S)e=0;else {e=0|s/S;s-=e*S;}r[n]=s;}if(e>0)r[n]=e;};t.prototype.sub=function(t){var e=this.buf;var r=e.length;var i;var n;for(i=0;i<r;++i){n=e[i]-t;if(n<0){n+=S;t=1;}else t=0;e[i]=n;}while(0===e[e.length-1])e.pop();};t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");var e=this.buf;var r=e[e.length-1].toString();for(var i=e.length-2;i>=0;--i)r+=(S+e[i]).toString().substring(1);return r};t.prototype.valueOf=function(){var t=this.buf;var e=0;for(var r=t.length-1;r>=0;--r)e=e*S+t[r];return e};t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this};return t}();var b="…";var E=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;var D=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function M(t,e){if(t.length>e)t=t.substring(0,e)+b;return t}var T=function(){function t(e,r){this.hexDigits="0123456789ABCDEF";if(e instanceof t){this.enc=e.enc;this.pos=e.pos;}else {this.enc=e;this.pos=r;}}t.prototype.get=function(t){if(void 0===t)t=this.pos++;if(t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return "string"===typeof this.enc?this.enc.charCodeAt(t):this.enc[t]};t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)};t.prototype.hexDump=function(t,e,r){var i="";for(var n=t;n<e;++n){i+=this.hexByte(this.get(n));if(true!==r)switch(15&n){case 7:i+=" ";break;case 15:i+="\n";break;default:i+=" ";}}return i};t.prototype.isASCII=function(t,e){for(var r=t;r<e;++r){var i=this.get(r);if(i<32||i>176)return false}return true};t.prototype.parseStringISO=function(t,e){var r="";for(var i=t;i<e;++i)r+=String.fromCharCode(this.get(i));return r};t.prototype.parseStringUTF=function(t,e){var r="";for(var i=t;i<e;){var n=this.get(i++);if(n<128)r+=String.fromCharCode(n);else if(n>191&&n<224)r+=String.fromCharCode((31&n)<<6|63&this.get(i++));else r+=String.fromCharCode((15&n)<<12|(63&this.get(i++))<<6|63&this.get(i++));}return r};t.prototype.parseStringBMP=function(t,e){var r="";var i;var n;for(var s=t;s<e;){i=this.get(s++);n=this.get(s++);r+=String.fromCharCode(i<<8|n);}return r};t.prototype.parseTime=function(t,e,r){var i=this.parseStringISO(t,e);var n=(r?E:D).exec(i);if(!n)return "Unrecognized time: "+i;if(r){n[1]=+n[1];n[1]+=+n[1]<70?2e3:1900;}i=n[1]+"-"+n[2]+"-"+n[3]+" "+n[4];if(n[5]){i+=":"+n[5];if(n[6]){i+=":"+n[6];if(n[7])i+="."+n[7];}}if(n[8]){i+=" UTC";if("Z"!=n[8]){i+=n[8];if(n[9])i+=":"+n[9];}}return i};t.prototype.parseInteger=function(t,e){var r=this.get(t);var i=r>127;var n=i?255:0;var s;var a="";while(r==n&&++t<e)r=this.get(t);s=e-t;if(0===s)return i?-1:0;if(s>4){a=r;s<<=3;while(0==(128&(+a^n))){a=+a<<1;--s;}a="("+s+" bit)\n";}if(i)r-=256;var o=new _(r);for(var u=t+1;u<e;++u)o.mulAdd(256,this.get(u));return a+o.toString()};t.prototype.parseBitString=function(t,e,r){var i=this.get(t);var n=(e-t-1<<3)-i;var s="("+n+" bit)\n";var a="";for(var o=t+1;o<e;++o){var u=this.get(o);var c=o==e-1?i:0;for(var l=7;l>=c;--l)a+=u>>l&1?"1":"0";if(a.length>r)return s+M(a,r)}return s+a};t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return M(this.parseStringISO(t,e),r);var i=e-t;var n="("+i+" byte)\n";r/=2;if(i>r)e=t+r;for(var s=t;s<e;++s)n+=this.hexByte(this.get(s));if(i>r)n+=b;return n};t.prototype.parseOID=function(t,e,r){var i="";var n=new _;var s=0;for(var a=t;a<e;++a){var o=this.get(a);n.mulAdd(128,127&o);s+=7;if(!(128&o)){if(""===i){n=n.simplify();if(n instanceof _){n.sub(80);i="2."+n.toString();}else {var u=n<80?n<40?0:1:2;i=u+"."+(n-40*u);}}else i+="."+n.toString();if(i.length>r)return M(i,r);n=new _;s=0;}}if(s>0)i+=".incomplete";return i};return t}();var I=function(){function t(t,e,r,i,n){if(!(i instanceof A))throw new Error("Invalid tag value.");this.stream=t;this.header=e;this.length=r;this.tag=i;this.sub=n;}t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return "EOC";case 1:return "BOOLEAN";case 2:return "INTEGER";case 3:return "BIT_STRING";case 4:return "OCTET_STRING";case 5:return "NULL";case 6:return "OBJECT_IDENTIFIER";case 7:return "ObjectDescriptor";case 8:return "EXTERNAL";case 9:return "REAL";case 10:return "ENUMERATED";case 11:return "EMBEDDED_PDV";case 12:return "UTF8String";case 16:return "SEQUENCE";case 17:return "SET";case 18:return "NumericString";case 19:return "PrintableString";case 20:return "TeletexString";case 21:return "VideotexString";case 22:return "IA5String";case 23:return "UTCTime";case 24:return "GeneralizedTime";case 25:return "GraphicString";case 26:return "VisibleString";case 27:return "GeneralString";case 28:return "UniversalString";case 30:return "BMPString"}return "Universal_"+this.tag.tagNumber.toString();case 1:return "Application_"+this.tag.tagNumber.toString();case 2:return "["+this.tag.tagNumber.toString()+"]";case 3:return "Private_"+this.tag.tagNumber.toString()}};t.prototype.content=function(t){if(void 0===this.tag)return null;if(void 0===t)t=1/0;var e=this.posContent();var r=Math.abs(this.length);if(!this.tag.isUniversal()){if(null!==this.sub)return "("+this.sub.length+" elem)";return this.stream.parseOctetString(e,e+r,t)}switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:if(null!==this.sub)return "("+this.sub.length+" elem)";else return "(no elem)";case 12:return M(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return M(this.stream.parseStringISO(e,e+r),t);case 30:return M(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null};t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"};t.prototype.toPrettyString=function(t){if(void 0===t)t="";var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0)e+="+";e+=this.length;if(this.tag.tagConstructed)e+=" (constructed)";else if(this.tag.isUniversal()&&(3==this.tag.tagNumber||4==this.tag.tagNumber)&&null!==this.sub)e+=" (encapsulates)";e+="\n";if(null!==this.sub){t+=" ";for(var r=0,i=this.sub.length;r<i;++r)e+=this.sub[r].toPrettyString(t);}return e};t.prototype.posStart=function(){return this.stream.pos};t.prototype.posContent=function(){return this.stream.pos+this.header};t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)};t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),true)};t.decodeLength=function(t){var e=t.get();var r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var i=0;i<r;++i)e=256*e+t.get();return e};t.prototype.getHexStringValue=function(){var t=this.toHexString();var e=2*this.header;var r=2*this.length;return t.substr(e,r)};t.decode=function(e){var r;if(!(e instanceof T))r=new T(e,0);else r=e;var i=new T(r);var n=new A(r);var s=t.decodeLength(r);var a=r.pos;var o=a-i.pos;var u=null;var c=function(){var e=[];if(null!==s){var i=a+s;while(r.pos<i)e[e.length]=t.decode(r);if(r.pos!=i)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var n=t.decode(r);if(n.tag.isEOC())break;e[e.length]=n;}s=a-r.pos;}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(n.tagConstructed)u=c();else if(n.isUniversal()&&(3==n.tagNumber||4==n.tagNumber))try{if(3==n.tagNumber)if(0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=c();for(var l=0;l<u.length;++l)if(u[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){u=null;}if(null===u){if(null===s)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);r.pos=a+Math.abs(s);}return new t(i,o,s,n,u)};return t}();var A=function(){function t(t){var e=t.get();this.tagClass=e>>6;this.tagConstructed=0!==(32&e);this.tagNumber=31&e;if(31==this.tagNumber){var r=new _;do{e=t.get();r.mulAdd(128,127&e);}while(128&e);this.tagNumber=r.simplify();}}t.prototype.isUniversal=function(){return 0===this.tagClass};t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber};return t}();var x;var R=0xdeadbeefcafe;var B=15715070==(16777215&R);var O=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];var k=(1<<26)/O[O.length-1];var C=function(){function t(t,e,r){if(null!=t)if("number"==typeof t)this.fromNumber(t,e,r);else if(null==e&&"string"!=typeof t)this.fromString(t,256);else this.fromString(t,e);}t.prototype.toString=function(t){if(this.s<0)return "-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else if(4==t)e=2;else return this.toRadix(t);var r=(1<<e)-1;var i;var s=false;var a="";var o=this.t;var u=this.DB-o*this.DB%e;if(o-- >0){if(u<this.DB&&(i=this[o]>>u)>0){s=true;a=n(i);}while(o>=0){if(u<e){i=(this[o]&(1<<u)-1)<<e-u;i|=this[--o]>>(u+=this.DB-e);}else {i=this[o]>>(u-=e)&r;if(u<=0){u+=this.DB;--o;}}if(i>0)s=true;if(s)a+=n(i);}}return s?a:"0"};t.prototype.negate=function(){var e=H();t.ZERO.subTo(this,e);return e};t.prototype.abs=function(){return this.s<0?this.negate():this};t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;e=r-t.t;if(0!=e)return this.s<0?-e:e;while(--r>=0)if(0!=(e=this[r]-t[r]))return e;return 0};t.prototype.bitLength=function(){if(this.t<=0)return 0;return this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM)};t.prototype.mod=function(e){var r=H();this.abs().divRemTo(e,null,r);if(this.s<0&&r.compareTo(t.ZERO)>0)e.subTo(r,r);return r};t.prototype.modPowInt=function(t,e){var r;if(t<256||e.isEven())r=new P(e);else r=new V(e);return this.exp(t,r)};t.prototype.clone=function(){var t=H();this.copyTo(t);return t};t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;else if(0==this.t)return -1}else if(1==this.t)return this[0];else if(0==this.t)return 0;return (this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]};t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24};t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16};t.prototype.signum=function(){if(this.s<0)return -1;else if(this.t<=0||1==this.t&&this[0]<=0)return 0;else return 1};t.prototype.toByteArray=function(){var t=this.t;var e=[];e[0]=this.s;var r=this.DB-t*this.DB%8;var i;var n=0;if(t-- >0){if(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r)e[n++]=i|this.s<<this.DB-r;while(t>=0){if(r<8){i=(this[t]&(1<<r)-1)<<8-r;i|=this[--t]>>(r+=this.DB-8);}else {i=this[t]>>(r-=8)&255;if(r<=0){r+=this.DB;--t;}}if(0!=(128&i))i|=-256;if(0==n&&(128&this.s)!=(128&i))++n;if(n>0||i!=this.s)e[n++]=i;}}return e};t.prototype.equals=function(t){return 0==this.compareTo(t)};t.prototype.min=function(t){return this.compareTo(t)<0?this:t};t.prototype.max=function(t){return this.compareTo(t)>0?this:t};t.prototype.and=function(t){var e=H();this.bitwiseTo(t,s,e);return e};t.prototype.or=function(t){var e=H();this.bitwiseTo(t,a,e);return e};t.prototype.xor=function(t){var e=H();this.bitwiseTo(t,o,e);return e};t.prototype.andNot=function(t){var e=H();this.bitwiseTo(t,u,e);return e};t.prototype.not=function(){var t=H();for(var e=0;e<this.t;++e)t[e]=this.DM&~this[e];t.t=this.t;t.s=~this.s;return t};t.prototype.shiftLeft=function(t){var e=H();if(t<0)this.rShiftTo(-t,e);else this.lShiftTo(t,e);return e};t.prototype.shiftRight=function(t){var e=H();if(t<0)this.lShiftTo(-t,e);else this.rShiftTo(t,e);return e};t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+c(this[t]);if(this.s<0)return this.t*this.DB;return -1};t.prototype.bitCount=function(){var t=0;var e=this.s&this.DM;for(var r=0;r<this.t;++r)t+=l(this[r]^e);return t};t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);if(e>=this.t)return 0!=this.s;return 0!=(this[e]&1<<t%this.DB)};t.prototype.setBit=function(t){return this.changeBit(t,a)};t.prototype.clearBit=function(t){return this.changeBit(t,u)};t.prototype.flipBit=function(t){return this.changeBit(t,o)};t.prototype.add=function(t){var e=H();this.addTo(t,e);return e};t.prototype.subtract=function(t){var e=H();this.subTo(t,e);return e};t.prototype.multiply=function(t){var e=H();this.multiplyTo(t,e);return e};t.prototype.divide=function(t){var e=H();this.divRemTo(t,e,null);return e};t.prototype.remainder=function(t){var e=H();this.divRemTo(t,null,e);return e};t.prototype.divideAndRemainder=function(t){var e=H();var r=H();this.divRemTo(t,e,r);return [e,r]};t.prototype.modPow=function(t,e){var r=t.bitLength();var i;var n=Y(1);var s;if(r<=0)return n;else if(r<18)i=1;else if(r<48)i=3;else if(r<144)i=4;else if(r<768)i=5;else i=6;if(r<8)s=new P(e);else if(e.isEven())s=new L(e);else s=new V(e);var a=[];var o=3;var u=i-1;var c=(1<<i)-1;a[1]=s.convert(this);if(i>1){var l=H();s.sqrTo(a[1],l);while(o<=c){a[o]=H();s.mulTo(l,a[o-2],a[o]);o+=2;}}var f=t.t-1;var h;var d=true;var v=H();var p;r=W(t[f])-1;while(f>=0){if(r>=u)h=t[f]>>r-u&c;else {h=(t[f]&(1<<r+1)-1)<<u-r;if(f>0)h|=t[f-1]>>this.DB+r-u;}o=i;while(0==(1&h)){h>>=1;--o;}if((r-=o)<0){r+=this.DB;--f;}if(d){a[h].copyTo(n);d=false;}else {while(o>1){s.sqrTo(n,v);s.sqrTo(v,n);o-=2;}if(o>0)s.sqrTo(n,v);else {p=n;n=v;v=p;}s.mulTo(v,a[h],n);}while(f>=0&&0==(t[f]&1<<r)){s.sqrTo(n,v);p=n;n=v;v=p;if(--r<0){r=this.DB-1;--f;}}}return s.revert(n)};t.prototype.modInverse=function(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;var i=e.clone();var n=this.clone();var s=Y(1);var a=Y(0);var o=Y(0);var u=Y(1);while(0!=i.signum()){while(i.isEven()){i.rShiftTo(1,i);if(r){if(!s.isEven()||!a.isEven()){s.addTo(this,s);a.subTo(e,a);}s.rShiftTo(1,s);}else if(!a.isEven())a.subTo(e,a);a.rShiftTo(1,a);}while(n.isEven()){n.rShiftTo(1,n);if(r){if(!o.isEven()||!u.isEven()){o.addTo(this,o);u.subTo(e,u);}o.rShiftTo(1,o);}else if(!u.isEven())u.subTo(e,u);u.rShiftTo(1,u);}if(i.compareTo(n)>=0){i.subTo(n,i);if(r)s.subTo(o,s);a.subTo(u,a);}else {n.subTo(i,n);if(r)o.subTo(s,o);u.subTo(a,u);}}if(0!=n.compareTo(t.ONE))return t.ZERO;if(u.compareTo(e)>=0)return u.subtract(e);if(u.signum()<0)u.addTo(e,u);else return u;if(u.signum()<0)return u.add(e);else return u};t.prototype.pow=function(t){return this.exp(t,new N)};t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone();var r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r;r=i;}var n=e.getLowestSetBit();var s=r.getLowestSetBit();if(s<0)return e;if(n<s)s=n;if(s>0){e.rShiftTo(s,e);r.rShiftTo(s,r);}while(e.signum()>0){if((n=e.getLowestSetBit())>0)e.rShiftTo(n,e);if((n=r.getLowestSetBit())>0)r.rShiftTo(n,r);if(e.compareTo(r)>=0){e.subTo(r,e);e.rShiftTo(1,e);}else {r.subTo(e,r);r.rShiftTo(1,r);}}if(s>0)r.lShiftTo(s,r);return r};t.prototype.isProbablePrime=function(t){var e;var r=this.abs();if(1==r.t&&r[0]<=O[O.length-1]){for(e=0;e<O.length;++e)if(r[0]==O[e])return true;return false}if(r.isEven())return false;e=1;while(e<O.length){var i=O[e];var n=e+1;while(n<O.length&&i<k)i*=O[n++];i=r.modInt(i);while(e<n)if(i%O[e++]==0)return false}return r.millerRabin(t)};t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t;t.s=this.s;};t.prototype.fromInt=function(t){this.t=1;this.s=t<0?-1:0;if(t>0)this[0]=t;else if(t<-1)this[0]=t+this.DV;else this.t=0;};t.prototype.fromString=function(e,r){var i;if(16==r)i=4;else if(8==r)i=3;else if(256==r)i=8;else if(2==r)i=1;else if(32==r)i=5;else if(4==r)i=2;else {this.fromRadix(e,r);return}this.t=0;this.s=0;var n=e.length;var s=false;var a=0;while(--n>=0){var o=8==i?255&+e[n]:G(e,n);if(o<0){if("-"==e.charAt(n))s=true;continue}s=false;if(0==a)this[this.t++]=o;else if(a+i>this.DB){this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a;this[this.t++]=o>>this.DB-a;}else this[this.t-1]|=o<<a;a+=i;if(a>=this.DB)a-=this.DB;}if(8==i&&0!=(128&+e[0])){this.s=-1;if(a>0)this[this.t-1]|=(1<<this.DB-a)-1<<a;}this.clamp();if(s)t.ZERO.subTo(this,this);};t.prototype.clamp=function(){var t=this.s&this.DM;while(this.t>0&&this[this.t-1]==t)--this.t;};t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t;e.s=this.s;};t.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0);e.s=this.s;};t.prototype.lShiftTo=function(t,e){var r=t%this.DB;var i=this.DB-r;var n=(1<<i)-1;var s=Math.floor(t/this.DB);var a=this.s<<r&this.DM;for(var o=this.t-1;o>=0;--o){e[o+s+1]=this[o]>>i|a;a=(this[o]&n)<<r;}for(var o=s-1;o>=0;--o)e[o]=0;e[s]=a;e.t=this.t+s+1;e.s=this.s;e.clamp();};t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var i=t%this.DB;var n=this.DB-i;var s=(1<<i)-1;e[0]=this[r]>>i;for(var a=r+1;a<this.t;++a){e[a-r-1]|=(this[a]&s)<<n;e[a-r]=this[a]>>i;}if(i>0)e[this.t-r-1]|=(this.s&s)<<n;e.t=this.t-r;e.clamp();};t.prototype.subTo=function(t,e){var r=0;var i=0;var n=Math.min(t.t,this.t);while(r<n){i+=this[r]-t[r];e[r++]=i&this.DM;i>>=this.DB;}if(t.t<this.t){i-=t.s;while(r<this.t){i+=this[r];e[r++]=i&this.DM;i>>=this.DB;}i+=this.s;}else {i+=this.s;while(r<t.t){i-=t[r];e[r++]=i&this.DM;i>>=this.DB;}i-=t.s;}e.s=i<0?-1:0;if(i<-1)e[r++]=this.DV+i;else if(i>0)e[r++]=i;e.t=r;e.clamp();};t.prototype.multiplyTo=function(e,r){var i=this.abs();var n=e.abs();var s=i.t;r.t=s+n.t;while(--s>=0)r[s]=0;for(s=0;s<n.t;++s)r[s+i.t]=i.am(0,n[s],r,s,0,i.t);r.s=0;r.clamp();if(this.s!=e.s)t.ZERO.subTo(r,r);};t.prototype.squareTo=function(t){var e=this.abs();var r=t.t=2*e.t;while(--r>=0)t[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e[r],t,2*r,0,1);if((t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,i,e.t-r-1))>=e.DV){t[r+e.t]-=e.DV;t[r+e.t+1]=1;}}if(t.t>0)t[t.t-1]+=e.am(r,e[r],t,2*r,0,1);t.s=0;t.clamp();};t.prototype.divRemTo=function(e,r,i){var n=e.abs();if(n.t<=0)return;var s=this.abs();if(s.t<n.t){if(null!=r)r.fromInt(0);if(null!=i)this.copyTo(i);return}if(null==i)i=H();var a=H();var o=this.s;var u=e.s;var c=this.DB-W(n[n.t-1]);if(c>0){n.lShiftTo(c,a);s.lShiftTo(c,i);}else {n.copyTo(a);s.copyTo(i);}var l=a.t;var f=a[l-1];if(0==f)return;var h=f*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0);var d=this.FV/h;var v=(1<<this.F1)/h;var p=1<<this.F2;var g=i.t;var y=g-l;var m=null==r?H():r;a.dlShiftTo(y,m);if(i.compareTo(m)>=0){i[i.t++]=1;i.subTo(m,i);}t.ONE.dlShiftTo(l,m);m.subTo(a,a);while(a.t<l)a[a.t++]=0;while(--y>=0){var w=i[--g]==f?this.DM:Math.floor(i[g]*d+(i[g-1]+p)*v);if((i[g]+=a.am(0,w,i,y,0,l))<w){a.dlShiftTo(y,m);i.subTo(m,i);while(i[g]<--w)i.subTo(m,i);}}if(null!=r){i.drShiftTo(l,r);if(o!=u)t.ZERO.subTo(r,r);}i.t=l;i.clamp();if(c>0)i.rShiftTo(c,i);if(o<0)t.ZERO.subTo(i,i);};t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;e=e*(2-(15&t)*e)&15;e=e*(2-(255&t)*e)&255;e=e*(2-((65535&t)*e&65535))&65535;e=e*(2-t*e%this.DV)%this.DV;return e>0?this.DV-e:-e};t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)};t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var i=H();var n=H();var s=r.convert(this);var a=W(e)-1;s.copyTo(i);while(--a>=0){r.sqrTo(i,n);if((e&1<<a)>0)r.mulTo(n,s,i);else {var o=i;i=n;n=o;}}return r.revert(i)};t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))};t.prototype.toRadix=function(t){if(null==t)t=10;if(0==this.signum()||t<2||t>36)return "0";var e=this.chunkSize(t);var r=Math.pow(t,e);var i=Y(r);var n=H();var s=H();var a="";this.divRemTo(i,n,s);while(n.signum()>0){a=(r+s.intValue()).toString(t).substr(1)+a;n.divRemTo(i,n,s);}return s.intValue().toString(t)+a};t.prototype.fromRadix=function(e,r){this.fromInt(0);if(null==r)r=10;var i=this.chunkSize(r);var n=Math.pow(r,i);var s=false;var a=0;var o=0;for(var u=0;u<e.length;++u){var c=G(e,u);if(c<0){if("-"==e.charAt(u)&&0==this.signum())s=true;continue}o=r*o+c;if(++a>=i){this.dMultiply(n);this.dAddOffset(o,0);a=0;o=0;}}if(a>0){this.dMultiply(Math.pow(r,a));this.dAddOffset(o,0);}if(s)t.ZERO.subTo(this,this);};t.prototype.fromNumber=function(e,r,i){if("number"==typeof r)if(e<2)this.fromInt(1);else {this.fromNumber(e,i);if(!this.testBit(e-1))this.bitwiseTo(t.ONE.shiftLeft(e-1),a,this);if(this.isEven())this.dAddOffset(1,0);while(!this.isProbablePrime(r)){this.dAddOffset(2,0);if(this.bitLength()>e)this.subTo(t.ONE.shiftLeft(e-1),this);}}else {var n=[];var s=7&e;n.length=(e>>3)+1;r.nextBytes(n);if(s>0)n[0]&=(1<<s)-1;else n[0]=0;this.fromString(n,256);}};t.prototype.bitwiseTo=function(t,e,r){var i;var n;var s=Math.min(t.t,this.t);for(i=0;i<s;++i)r[i]=e(this[i],t[i]);if(t.t<this.t){n=t.s&this.DM;for(i=s;i<this.t;++i)r[i]=e(this[i],n);r.t=this.t;}else {n=this.s&this.DM;for(i=s;i<t.t;++i)r[i]=e(n,t[i]);r.t=t.t;}r.s=e(this.s,t.s);r.clamp();};t.prototype.changeBit=function(e,r){var i=t.ONE.shiftLeft(e);this.bitwiseTo(i,r,i);return i};t.prototype.addTo=function(t,e){var r=0;var i=0;var n=Math.min(t.t,this.t);while(r<n){i+=this[r]+t[r];e[r++]=i&this.DM;i>>=this.DB;}if(t.t<this.t){i+=t.s;while(r<this.t){i+=this[r];e[r++]=i&this.DM;i>>=this.DB;}i+=this.s;}else {i+=this.s;while(r<t.t){i+=t[r];e[r++]=i&this.DM;i>>=this.DB;}i+=t.s;}e.s=i<0?-1:0;if(i>0)e[r++]=i;else if(i<-1)e[r++]=this.DV+i;e.t=r;e.clamp();};t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t);++this.t;this.clamp();};t.prototype.dAddOffset=function(t,e){if(0==t)return;while(this.t<=e)this[this.t++]=0;this[e]+=t;while(this[e]>=this.DV){this[e]-=this.DV;if(++e>=this.t)this[this.t++]=0;++this[e];}};t.prototype.multiplyLowerTo=function(t,e,r){var i=Math.min(this.t+t.t,e);r.s=0;r.t=i;while(i>0)r[--i]=0;for(var n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(var n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp();};t.prototype.multiplyUpperTo=function(t,e,r){--e;var i=r.t=this.t+t.t-e;r.s=0;while(--i>=0)r[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)r[this.t+i-e]=this.am(e-i,t[i],r,0,0,this.t+i-e);r.clamp();r.drShiftTo(1,r);};t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t;var r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r};t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE);var i=r.getLowestSetBit();if(i<=0)return false;var n=r.shiftRight(i);e=e+1>>1;if(e>O.length)e=O.length;var s=H();for(var a=0;a<e;++a){s.fromInt(O[Math.floor(Math.random()*O.length)]);var o=s.modPow(n,this);if(0!=o.compareTo(t.ONE)&&0!=o.compareTo(r)){var u=1;while(u++<i&&0!=o.compareTo(r)){o=o.modPowInt(2,this);if(0==o.compareTo(t.ONE))return false}if(0!=o.compareTo(r))return false}}return true};t.prototype.square=function(){var t=H();this.squareTo(t);return t};t.prototype.gcda=function(t,e){var r=this.s<0?this.negate():this.clone();var i=t.s<0?t.negate():t.clone();if(r.compareTo(i)<0){var n=r;r=i;i=n;}var s=r.getLowestSetBit();var a=i.getLowestSetBit();if(a<0){e(r);return}if(s<a)a=s;if(a>0){r.rShiftTo(a,r);i.rShiftTo(a,i);}var o=function(){if((s=r.getLowestSetBit())>0)r.rShiftTo(s,r);if((s=i.getLowestSetBit())>0)i.rShiftTo(s,i);if(r.compareTo(i)>=0){r.subTo(i,r);r.rShiftTo(1,r);}else {i.subTo(r,i);i.rShiftTo(1,i);}if(!(r.signum()>0)){if(a>0)i.lShiftTo(a,i);setTimeout((function(){e(i);}),0);}else setTimeout(o,0);};setTimeout(o,10);};t.prototype.fromNumberAsync=function(e,r,i,n){if("number"==typeof r)if(e<2)this.fromInt(1);else {this.fromNumber(e,i);if(!this.testBit(e-1))this.bitwiseTo(t.ONE.shiftLeft(e-1),a,this);if(this.isEven())this.dAddOffset(1,0);var s=this;var o=function(){s.dAddOffset(2,0);if(s.bitLength()>e)s.subTo(t.ONE.shiftLeft(e-1),s);if(s.isProbablePrime(r))setTimeout((function(){n();}),0);else setTimeout(o,0);};setTimeout(o,0);}else {var u=[];var c=7&e;u.length=(e>>3)+1;r.nextBytes(u);if(c>0)u[0]&=(1<<c)-1;else u[0]=0;this.fromString(u,256);}};return t}();var N=function(){function t(){}t.prototype.convert=function(t){return t};t.prototype.revert=function(t){return t};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);};t.prototype.sqrTo=function(t,e){t.squareTo(e);};return t}();var P=function(){function t(t){this.m=t;}t.prototype.convert=function(t){if(t.s<0||t.compareTo(this.m)>=0)return t.mod(this.m);else return t};t.prototype.revert=function(t){return t};t.prototype.reduce=function(t){t.divRemTo(this.m,null,t);};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r);};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e);};return t}();var V=function(){function t(t){this.m=t;this.mp=t.invDigit();this.mpl=32767&this.mp;this.mph=this.mp>>15;this.um=(1<<t.DB-15)-1;this.mt2=2*t.t;}t.prototype.convert=function(t){var e=H();t.abs().dlShiftTo(this.m.t,e);e.divRemTo(this.m,null,e);if(t.s<0&&e.compareTo(C.ZERO)>0)this.m.subTo(e,e);return e};t.prototype.revert=function(t){var e=H();t.copyTo(e);this.reduce(e);return e};t.prototype.reduce=function(t){while(t.t<=this.mt2)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e];var i=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;r=e+this.m.t;t[r]+=this.m.am(0,i,t,e,0,this.m.t);while(t[r]>=t.DV){t[r]-=t.DV;t[++r]++;}}t.clamp();t.drShiftTo(this.m.t,t);if(t.compareTo(this.m)>=0)t.subTo(this.m,t);};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r);};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e);};return t}();var L=function(){function t(t){this.m=t;this.r2=H();this.q3=H();C.ONE.dlShiftTo(2*t.t,this.r2);this.mu=this.r2.divide(t);}t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);else if(t.compareTo(this.m)<0)return t;else {var e=H();t.copyTo(e);this.reduce(e);return e}};t.prototype.revert=function(t){return t};t.prototype.reduce=function(t){t.drShiftTo(this.m.t-1,this.r2);if(t.t>this.m.t+1){t.t=this.m.t+1;t.clamp();}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(t.compareTo(this.r2)<0)t.dAddOffset(1,this.m.t+1);t.subTo(this.r2,t);while(t.compareTo(this.m)>=0)t.subTo(this.m,t);};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r);};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e);};return t}();function H(){return new C(null)}function U(t,e){return new C(t,e)}var K="undefined"!==typeof navigator;if(K&&B&&"Microsoft Internet Explorer"==navigator.appName){C.prototype.am=function t(e,r,i,n,s,a){var o=32767&r;var u=r>>15;while(--a>=0){var c=32767&this[e];var l=this[e++]>>15;var f=u*c+l*o;c=o*c+((32767&f)<<15)+i[n]+(1073741823&s);s=(c>>>30)+(f>>>15)+u*l+(s>>>30);i[n++]=1073741823&c;}return s};x=30;}else if(K&&B&&"Netscape"!=navigator.appName){C.prototype.am=function t(e,r,i,n,s,a){while(--a>=0){var o=r*this[e++]+i[n]+s;s=Math.floor(o/67108864);i[n++]=67108863&o;}return s};x=26;}else {C.prototype.am=function t(e,r,i,n,s,a){var o=16383&r;var u=r>>14;while(--a>=0){var c=16383&this[e];var l=this[e++]>>14;var f=u*c+l*o;c=o*c+((16383&f)<<14)+i[n]+s;s=(c>>28)+(f>>14)+u*l;i[n++]=268435455&c;}return s};x=28;}C.prototype.DB=x;C.prototype.DM=(1<<x)-1;C.prototype.DV=1<<x;var j=52;C.prototype.FV=Math.pow(2,j);C.prototype.F1=j-x;C.prototype.F2=2*x-j;var q=[];var F;var z;F="0".charCodeAt(0);for(z=0;z<=9;++z)q[F++]=z;F="a".charCodeAt(0);for(z=10;z<36;++z)q[F++]=z;F="A".charCodeAt(0);for(z=10;z<36;++z)q[F++]=z;function G(t,e){var r=q[t.charCodeAt(e)];return null==r?-1:r}function Y(t){var e=H();e.fromInt(t);return e}function W(t){var e=1;var r;if(0!=(r=t>>>16)){t=r;e+=16;}if(0!=(r=t>>8)){t=r;e+=8;}if(0!=(r=t>>4)){t=r;e+=4;}if(0!=(r=t>>2)){t=r;e+=2;}if(0!=(r=t>>1)){t=r;e+=1;}return e}C.ZERO=Y(0);C.ONE=Y(1);var J=function(){function t(){this.i=0;this.j=0;this.S=[];}t.prototype.init=function(t){var e;var r;var i;for(e=0;e<256;++e)this.S[e]=e;r=0;for(e=0;e<256;++e){r=r+this.S[e]+t[e%t.length]&255;i=this.S[e];this.S[e]=this.S[r];this.S[r]=i;}this.i=0;this.j=0;};t.prototype.next=function(){var t;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;t=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=t;return this.S[t+this.S[this.i]&255]};return t}();function Z(){return new J}var $=256;var X;var Q=null;var tt;if(null==Q){Q=[];tt=0;}function nt(){if(null==X){X=Z();while(tt<$){var t=Math.floor(65536*Math.random());Q[tt++]=255&t;}X.init(Q);for(tt=0;tt<Q.length;++tt)Q[tt]=0;tt=0;}return X.next()}var st=function(){function t(){}t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=nt();};return t}();function at(t,e){if(e<t.length+22){console.error("Message too long for RSA");return null}var r=e-t.length-6;var i="";for(var n=0;n<r;n+=2)i+="ff";var s="0001"+i+"00"+t;return U(s,16)}function ot(t,e){if(e<t.length+11){console.error("Message too long for RSA");return null}var r=[];var i=t.length-1;while(i>=0&&e>0){var n=t.charCodeAt(i--);if(n<128)r[--e]=n;else if(n>127&&n<2048){r[--e]=63&n|128;r[--e]=n>>6|192;}else {r[--e]=63&n|128;r[--e]=n>>6&63|128;r[--e]=n>>12|224;}}r[--e]=0;var s=new st;var a=[];while(e>2){a[0]=0;while(0==a[0])s.nextBytes(a);r[--e]=a[0];}r[--e]=2;r[--e]=0;return new C(r)}var ut=function(){function t(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null;}t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)};t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);var e=t.mod(this.p).modPow(this.dmp1,this.p);var r=t.mod(this.q).modPow(this.dmq1,this.q);while(e.compareTo(r)<0)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)};t.prototype.setPublic=function(t,e){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);}else console.error("Invalid RSA public key");};t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3;var r=ot(t,e);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var n=i.toString(16);var s=n.length;for(var a=0;a<2*e-s;a++)n="0"+n;return n};t.prototype.setPrivate=function(t,e,r){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);this.d=U(r,16);}else console.error("Invalid RSA private key");};t.prototype.setPrivateEx=function(t,e,r,i,n,s,a,o){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);this.d=U(r,16);this.p=U(i,16);this.q=U(n,16);this.dmp1=U(s,16);this.dmq1=U(a,16);this.coeff=U(o,16);}else console.error("Invalid RSA private key");};t.prototype.generate=function(t,e){var r=new st;var i=t>>1;this.e=parseInt(e,16);var n=new C(e,16);for(;;){for(;;){this.p=new C(t-i,1,r);if(0==this.p.subtract(C.ONE).gcd(n).compareTo(C.ONE)&&this.p.isProbablePrime(10))break}for(;;){this.q=new C(i,1,r);if(0==this.q.subtract(C.ONE).gcd(n).compareTo(C.ONE)&&this.q.isProbablePrime(10))break}if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q;this.q=s;}var a=this.p.subtract(C.ONE);var o=this.q.subtract(C.ONE);var u=a.multiply(o);if(0==u.gcd(n).compareTo(C.ONE)){this.n=this.p.multiply(this.q);this.d=n.modInverse(u);this.dmp1=this.d.mod(a);this.dmq1=this.d.mod(o);this.coeff=this.q.modInverse(this.p);break}}};t.prototype.decrypt=function(t){var e=U(t,16);var r=this.doPrivate(e);if(null==r)return null;return ct(r,this.n.bitLength()+7>>3)};t.prototype.generateAsync=function(t,e,r){var i=new st;var n=t>>1;this.e=parseInt(e,16);var s=new C(e,16);var a=this;var o=function(){var e=function(){if(a.p.compareTo(a.q)<=0){var t=a.p;a.p=a.q;a.q=t;}var e=a.p.subtract(C.ONE);var i=a.q.subtract(C.ONE);var n=e.multiply(i);if(0==n.gcd(s).compareTo(C.ONE)){a.n=a.p.multiply(a.q);a.d=s.modInverse(n);a.dmp1=a.d.mod(e);a.dmq1=a.d.mod(i);a.coeff=a.q.modInverse(a.p);setTimeout((function(){r();}),0);}else setTimeout(o,0);};var u=function(){a.q=H();a.q.fromNumberAsync(n,1,i,(function(){a.q.subtract(C.ONE).gcda(s,(function(t){if(0==t.compareTo(C.ONE)&&a.q.isProbablePrime(10))setTimeout(e,0);else setTimeout(u,0);}));}));};var c=function(){a.p=H();a.p.fromNumberAsync(t-n,1,i,(function(){a.p.subtract(C.ONE).gcda(s,(function(t){if(0==t.compareTo(C.ONE)&&a.p.isProbablePrime(10))setTimeout(u,0);else setTimeout(c,0);}));}));};setTimeout(c,0);};setTimeout(o,0);};t.prototype.sign=function(t,e,r){var i=ht(r);var n=i+e(t).toString();var s=at(n,this.n.bitLength()/4);if(null==s)return null;var a=this.doPrivate(s);if(null==a)return null;var o=a.toString(16);if(0==(1&o.length))return o;else return "0"+o};t.prototype.verify=function(t,e,r){var i=U(e,16);var n=this.doPublic(i);if(null==n)return null;var s=n.toString(16).replace(/^1f+00/,"");var a=dt(s);return a==r(t).toString()};t.prototype.encryptLong=function(t){var e=this;var r="";var i=(this.n.bitLength()+7>>3)-11;var n=this.setSplitChn(t,i);n.forEach((function(t){r+=e.encrypt(t);}));return r};t.prototype.decryptLong=function(t){var e="";var r=this.n.bitLength()+7>>3;var i=2*r;if(t.length>i){var n=t.match(new RegExp(".{1,"+i+"}","g"))||[];var s=[];for(var a=0;a<n.length;a++){var o=U(n[a],16);var u=this.doPrivate(o);if(null==u)return null;s.push(u);}e=lt(s,r);}else e=this.decrypt(t);return e};t.prototype.setSplitChn=function(t,e,r){if(void 0===r)r=[];var i=t.split("");var n=0;for(var s=0;s<i.length;s++){var a=i[s].charCodeAt(0);if(a<=127)n+=1;else if(a<=2047)n+=2;else if(a<=65535)n+=3;else n+=4;if(n>e){var o=t.substring(0,s);r.push(o);return this.setSplitChn(t.substring(s),e,r)}}r.push(t);return r};return t}();function ct(t,e){var r=t.toByteArray();var i=0;while(i<r.length&&0==r[i])++i;if(r.length-i!=e-1||2!=r[i])return null;++i;while(0!=r[i])if(++i>=r.length)return null;var n="";while(++i<r.length){var s=255&r[i];if(s<128)n+=String.fromCharCode(s);else if(s>191&&s<224){n+=String.fromCharCode((31&s)<<6|63&r[i+1]);++i;}else {n+=String.fromCharCode((15&s)<<12|(63&r[i+1])<<6|63&r[i+2]);i+=2;}}return n}function lt(t,e){var r=[];for(var i=0;i<t.length;i++){var n=t[i];var s=n.toByteArray();var a=0;while(a<s.length&&0==s[a])++a;if(s.length-a!=e-1||2!=s[a])return null;++a;while(0!=s[a])if(++a>=s.length)return null;r=r.concat(s.slice(a+1));}var o=r;var u=-1;var c="";while(++u<o.length){var l=255&o[u];if(l<128)c+=String.fromCharCode(l);else if(l>191&&l<224){c+=String.fromCharCode((31&l)<<6|63&o[u+1]);++u;}else {c+=String.fromCharCode((15&l)<<12|(63&o[u+1])<<6|63&o[u+2]);u+=2;}}return c}var ft={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function ht(t){return ft[t]||""}function dt(t){for(var e in ft)if(ft.hasOwnProperty(e)){var r=ft[e];var i=r.length;if(t.substr(0,i)==r)return t.substr(i)}return t}var vt={};vt.lang={extend:function(t,e,r){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");var i=function(){};i.prototype=e.prototype;t.prototype=new i;t.prototype.constructor=t;t.superclass=e.prototype;if(e.prototype.constructor==Object.prototype.constructor)e.prototype.constructor=e;if(r){var n;for(n in r)t.prototype[n]=r[n];var s=function(){},a=["toString","valueOf"];try{if(/MSIE/.test(navigator.userAgent))s=function(t,e){for(n=0;n<a.length;n+=1){var r=a[n],i=e[r];if("function"===typeof i&&i!=Object.prototype[r])t[r]=i;}};}catch(t){}s(t.prototype,r);}}};var pt={};if("undefined"==typeof pt.asn1||!pt.asn1)pt.asn1={};pt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);if(e.length%2==1)e="0"+e;return e};this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1)){if(e.length%2==1)e="0"+e;else if(!e.match(/^[0-7]/))e="00"+e;}else {var r=e.substr(1);var i=r.length;if(i%2==1)i+=1;else if(!e.match(/^[0-7]/))i+=2;var n="";for(var s=0;s<i;s++)n+="f";var a=new C(n,16);var o=a.xor(t).add(C.ONE);e=o.toString(16).replace(/^-/,"");}return e};this.getPEMStringFromHex=function(t,e){return hextopem(t,e)};this.newObject=function(t){var e=pt,r=e.asn1,i=r.DERBoolean,n=r.DERInteger,s=r.DERBitString,a=r.DEROctetString,o=r.DERNull,u=r.DERObjectIdentifier,c=r.DEREnumerated,l=r.DERUTF8String,f=r.DERNumericString,h=r.DERPrintableString,d=r.DERTeletexString,v=r.DERIA5String,p=r.DERUTCTime,g=r.DERGeneralizedTime,y=r.DERSequence,m=r.DERSet,w=r.DERTaggedObject,S=r.ASN1Util.newObject;var _=Object.keys(t);if(1!=_.length)throw "key of param shall be only one.";var b=_[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+b+":"))throw "undefined key: "+b;if("bool"==b)return new i(t[b]);if("int"==b)return new n(t[b]);if("bitstr"==b)return new s(t[b]);if("octstr"==b)return new a(t[b]);if("null"==b)return new o(t[b]);if("oid"==b)return new u(t[b]);if("enum"==b)return new c(t[b]);if("utf8str"==b)return new l(t[b]);if("numstr"==b)return new f(t[b]);if("prnstr"==b)return new h(t[b]);if("telstr"==b)return new d(t[b]);if("ia5str"==b)return new v(t[b]);if("utctime"==b)return new p(t[b]);if("gentime"==b)return new g(t[b]);if("seq"==b){var E=t[b];var D=[];for(var M=0;M<E.length;M++){var T=S(E[M]);D.push(T);}return new y({array:D})}if("set"==b){var E=t[b];var D=[];for(var M=0;M<E.length;M++){var T=S(E[M]);D.push(T);}return new m({array:D})}if("tag"==b){var I=t[b];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var A=S(I[2]);return new w({tag:I[0],explicit:I[1],obj:A})}else {var x={};if(void 0!==I.explicit)x.explicit=I.explicit;if(void 0!==I.tag)x.tag=I.tag;if(void 0===I.obj)throw "obj shall be specified for 'tag'.";x.obj=S(I.obj);return new w(x)}}};this.jsonToASN1HEX=function(t){var e=this.newObject(t);return e.getEncodedHex()};};pt.asn1.ASN1Util.oidHexToInt=function(t){var e="";var r=parseInt(t.substr(0,2),16);var i=Math.floor(r/40);var n=r%40;var e=i+"."+n;var s="";for(var a=2;a<t.length;a+=2){var o=parseInt(t.substr(a,2),16);var u=("00000000"+o.toString(2)).slice(-8);s+=u.substr(1,7);if("0"==u.substr(0,1)){var c=new C(s,2);e=e+"."+c.toString(10);s="";}}return e};pt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);if(1==e.length)e="0"+e;return e};var r=function(t){var r="";var i=new C(t,10);var n=i.toString(2);var s=7-n.length%7;if(7==s)s=0;var a="";for(var o=0;o<s;o++)a+="0";n=a+n;for(var o=0;o<n.length-1;o+=7){var u=n.substr(o,7);if(o!=n.length-7)u="1"+u;r+=e(parseInt(u,2));}return r};if(!t.match(/^[0-9.]+$/))throw "malformed oid string: "+t;var i="";var n=t.split(".");var s=40*parseInt(n[0])+parseInt(n[1]);i+=e(s);n.splice(0,2);for(var a=0;a<n.length;a++)i+=r(n[a]);return i};pt.asn1.ASN1Object=function(){var n="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw "this.hV is null or undefined.";if(this.hV.length%2==1)throw "value hex must be even length: n="+n.length+",v="+this.hV;var t=this.hV.length/2;var e=t.toString(16);if(e.length%2==1)e="0"+e;if(t<128)return e;else {var r=e.length/2;if(r>15)throw "ASN.1 length too long to represent by 8x: n = "+t.toString(16);var i=128+r;return i.toString(16)+e}};this.getEncodedHex=function(){if(null==this.hTLV||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false;}return this.hTLV};this.getValueHex=function(){this.getEncodedHex();return this.hV};this.getFreshValueHex=function(){return ""};};pt.asn1.DERAbstractString=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s};this.setString=function(t){this.hTLV=null;this.isModified=true;this.s=t;this.hV=stohex(this.s);};this.setStringHex=function(t){this.hTLV=null;this.isModified=true;this.s=null;this.hV=t;};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("string"==typeof t)this.setString(t);else if("undefined"!=typeof t["str"])this.setString(t["str"]);else if("undefined"!=typeof t["hex"])this.setStringHex(t["hex"]);};vt.lang.extend(pt.asn1.DERAbstractString,pt.asn1.ASN1Object);pt.asn1.DERAbstractTime=function(t){pt.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e};this.formatDate=function(t,e,r){var i=this.zeroPadding;var n=this.localDateToUTC(t);var s=String(n.getFullYear());if("utc"==e)s=s.substr(2,2);var a=i(String(n.getMonth()+1),2);var o=i(String(n.getDate()),2);var u=i(String(n.getHours()),2);var c=i(String(n.getMinutes()),2);var l=i(String(n.getSeconds()),2);var f=s+a+o+u+c+l;if(true===r){var h=n.getMilliseconds();if(0!=h){var d=i(String(h),3);d=d.replace(/[0]+$/,"");f=f+"."+d;}}return f+"Z"};this.zeroPadding=function(t,e){if(t.length>=e)return t;return new Array(e-t.length+1).join("0")+t};this.getString=function(){return this.s};this.setString=function(t){this.hTLV=null;this.isModified=true;this.s=t;this.hV=stohex(t);};this.setByDateValue=function(t,e,r,i,n,s){var a=new Date(Date.UTC(t,e-1,r,i,n,s,0));this.setByDate(a);};this.getFreshValueHex=function(){return this.hV};};vt.lang.extend(pt.asn1.DERAbstractTime,pt.asn1.ASN1Object);pt.asn1.DERAbstractStructured=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null;this.isModified=true;this.asn1Array=t;};this.appendASN1Object=function(t){this.hTLV=null;this.isModified=true;this.asn1Array.push(t);};this.asn1Array=new Array;if("undefined"!=typeof t)if("undefined"!=typeof t["array"])this.asn1Array=t["array"];};vt.lang.extend(pt.asn1.DERAbstractStructured,pt.asn1.ASN1Object);pt.asn1.DERBoolean=function(){pt.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff";};vt.lang.extend(pt.asn1.DERBoolean,pt.asn1.ASN1Object);pt.asn1.DERInteger=function(t){pt.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(t){this.hTLV=null;this.isModified=true;this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);};this.setByInteger=function(t){var e=new C(String(t),10);this.setByBigInteger(e);};this.setValueHex=function(t){this.hV=t;};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t["bigint"])this.setByBigInteger(t["bigint"]);else if("undefined"!=typeof t["int"])this.setByInteger(t["int"]);else if("number"==typeof t)this.setByInteger(t);else if("undefined"!=typeof t["hex"])this.setValueHex(t["hex"]);};vt.lang.extend(pt.asn1.DERInteger,pt.asn1.ASN1Object);pt.asn1.DERBitString=function(t){if(void 0!==t&&"undefined"!==typeof t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex();}pt.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null;this.isModified=true;this.hV=t;};this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw "unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null;this.isModified=true;this.hV=r+e;};this.setByBinaryString=function(t){t=t.replace(/0+$/,"");var e=8-t.length%8;if(8==e)e=0;for(var r=0;r<=e;r++)t+="0";var i="";for(var r=0;r<t.length-1;r+=8){var n=t.substr(r,8);var s=parseInt(n,2).toString(16);if(1==s.length)s="0"+s;i+=s;}this.hTLV=null;this.isModified=true;this.hV="0"+e+i;};this.setByBooleanArray=function(t){var e="";for(var r=0;r<t.length;r++)if(true==t[r])e+="1";else e+="0";this.setByBinaryString(e);};this.newFalseArray=function(t){var e=new Array(t);for(var r=0;r<t;r++)e[r]=false;return e};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/))this.setHexValueIncludingUnusedBits(t);else if("undefined"!=typeof t["hex"])this.setHexValueIncludingUnusedBits(t["hex"]);else if("undefined"!=typeof t["bin"])this.setByBinaryString(t["bin"]);else if("undefined"!=typeof t["array"])this.setByBooleanArray(t["array"]);};vt.lang.extend(pt.asn1.DERBitString,pt.asn1.ASN1Object);pt.asn1.DEROctetString=function(t){if(void 0!==t&&"undefined"!==typeof t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex();}pt.asn1.DEROctetString.superclass.constructor.call(this,t);this.hT="04";};vt.lang.extend(pt.asn1.DEROctetString,pt.asn1.DERAbstractString);pt.asn1.DERNull=function(){pt.asn1.DERNull.superclass.constructor.call(this);this.hT="05";this.hTLV="0500";};vt.lang.extend(pt.asn1.DERNull,pt.asn1.ASN1Object);pt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);if(1==e.length)e="0"+e;return e};var r=function(t){var r="";var i=new C(t,10);var n=i.toString(2);var s=7-n.length%7;if(7==s)s=0;var a="";for(var o=0;o<s;o++)a+="0";n=a+n;for(var o=0;o<n.length-1;o+=7){var u=n.substr(o,7);if(o!=n.length-7)u="1"+u;r+=e(parseInt(u,2));}return r};pt.asn1.DERObjectIdentifier.superclass.constructor.call(this);this.hT="06";this.setValueHex=function(t){this.hTLV=null;this.isModified=true;this.s=null;this.hV=t;};this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw "malformed oid string: "+t;var i="";var n=t.split(".");var s=40*parseInt(n[0])+parseInt(n[1]);i+=e(s);n.splice(0,2);for(var a=0;a<n.length;a++)i+=r(n[a]);this.hTLV=null;this.isModified=true;this.s=null;this.hV=i;};this.setValueName=function(t){var e=pt.asn1.x509.OID.name2oid(t);if(""!==e)this.setValueOidString(e);else throw "DERObjectIdentifier oidName undefined: "+t};this.getFreshValueHex=function(){return this.hV};if(void 0!==t)if("string"===typeof t)if(t.match(/^[0-2].[0-9.]+$/))this.setValueOidString(t);else this.setValueName(t);else if(void 0!==t.oid)this.setValueOidString(t.oid);else if(void 0!==t.hex)this.setValueHex(t.hex);else if(void 0!==t.name)this.setValueName(t.name);};vt.lang.extend(pt.asn1.DERObjectIdentifier,pt.asn1.ASN1Object);pt.asn1.DEREnumerated=function(t){pt.asn1.DEREnumerated.superclass.constructor.call(this);this.hT="0a";this.setByBigInteger=function(t){this.hTLV=null;this.isModified=true;this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t);};this.setByInteger=function(t){var e=new C(String(t),10);this.setByBigInteger(e);};this.setValueHex=function(t){this.hV=t;};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t["int"])this.setByInteger(t["int"]);else if("number"==typeof t)this.setByInteger(t);else if("undefined"!=typeof t["hex"])this.setValueHex(t["hex"]);};vt.lang.extend(pt.asn1.DEREnumerated,pt.asn1.ASN1Object);pt.asn1.DERUTF8String=function(t){pt.asn1.DERUTF8String.superclass.constructor.call(this,t);this.hT="0c";};vt.lang.extend(pt.asn1.DERUTF8String,pt.asn1.DERAbstractString);pt.asn1.DERNumericString=function(t){pt.asn1.DERNumericString.superclass.constructor.call(this,t);this.hT="12";};vt.lang.extend(pt.asn1.DERNumericString,pt.asn1.DERAbstractString);pt.asn1.DERPrintableString=function(t){pt.asn1.DERPrintableString.superclass.constructor.call(this,t);this.hT="13";};vt.lang.extend(pt.asn1.DERPrintableString,pt.asn1.DERAbstractString);pt.asn1.DERTeletexString=function(t){pt.asn1.DERTeletexString.superclass.constructor.call(this,t);this.hT="14";};vt.lang.extend(pt.asn1.DERTeletexString,pt.asn1.DERAbstractString);pt.asn1.DERIA5String=function(t){pt.asn1.DERIA5String.superclass.constructor.call(this,t);this.hT="16";};vt.lang.extend(pt.asn1.DERIA5String,pt.asn1.DERAbstractString);pt.asn1.DERUTCTime=function(t){pt.asn1.DERUTCTime.superclass.constructor.call(this,t);this.hT="17";this.setByDate=function(t){this.hTLV=null;this.isModified=true;this.date=t;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s);};this.getFreshValueHex=function(){if("undefined"==typeof this.date&&"undefined"==typeof this.s){this.date=new Date;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s);}return this.hV};if(void 0!==t)if(void 0!==t.str)this.setString(t.str);else if("string"==typeof t&&t.match(/^[0-9]{12}Z$/))this.setString(t);else if(void 0!==t.hex)this.setStringHex(t.hex);else if(void 0!==t.date)this.setByDate(t.date);};vt.lang.extend(pt.asn1.DERUTCTime,pt.asn1.DERAbstractTime);pt.asn1.DERGeneralizedTime=function(t){pt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t);this.hT="18";this.withMillis=false;this.setByDate=function(t){this.hTLV=null;this.isModified=true;this.date=t;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=stohex(this.s);};this.getFreshValueHex=function(){if(void 0===this.date&&void 0===this.s){this.date=new Date;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=stohex(this.s);}return this.hV};if(void 0!==t){if(void 0!==t.str)this.setString(t.str);else if("string"==typeof t&&t.match(/^[0-9]{14}Z$/))this.setString(t);else if(void 0!==t.hex)this.setStringHex(t.hex);else if(void 0!==t.date)this.setByDate(t.date);if(true===t.millis)this.withMillis=true;}};vt.lang.extend(pt.asn1.DERGeneralizedTime,pt.asn1.DERAbstractTime);pt.asn1.DERSequence=function(t){pt.asn1.DERSequence.superclass.constructor.call(this,t);this.hT="30";this.getFreshValueHex=function(){var t="";for(var e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t+=r.getEncodedHex();}this.hV=t;return this.hV};};vt.lang.extend(pt.asn1.DERSequence,pt.asn1.DERAbstractStructured);pt.asn1.DERSet=function(t){pt.asn1.DERSet.superclass.constructor.call(this,t);this.hT="31";this.sortFlag=true;this.getFreshValueHex=function(){var t=new Array;for(var e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex());}if(true==this.sortFlag)t.sort();this.hV=t.join("");return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t.sortflag&&false==t.sortflag)this.sortFlag=false;};vt.lang.extend(pt.asn1.DERSet,pt.asn1.DERAbstractStructured);pt.asn1.DERTaggedObject=function(t){pt.asn1.DERTaggedObject.superclass.constructor.call(this);this.hT="a0";this.hV="";this.isExplicit=true;this.asn1Object=null;this.setASN1Object=function(t,e,r){this.hT=e;this.isExplicit=t;this.asn1Object=r;if(this.isExplicit){this.hV=this.asn1Object.getEncodedHex();this.hTLV=null;this.isModified=true;}else {this.hV=null;this.hTLV=r.getEncodedHex();this.hTLV=this.hTLV.replace(/^../,e);this.isModified=false;}};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t){if("undefined"!=typeof t["tag"])this.hT=t["tag"];if("undefined"!=typeof t["explicit"])this.isExplicit=t["explicit"];if("undefined"!=typeof t["obj"]){this.asn1Object=t["obj"];this.setASN1Object(this.isExplicit,this.hT,this.asn1Object);}}};vt.lang.extend(pt.asn1.DERTaggedObject,pt.asn1.ASN1Object);var gt=function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r];};return t(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e;}e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i);}}();var yt=function(t){gt(e,t);function e(r){var i=t.call(this)||this;if(r)if("string"===typeof r)i.parseKey(r);else if(e.hasPrivateKeyProperty(r)||e.hasPublicKeyProperty(r))i.parsePropertiesFrom(r);return i}e.prototype.parseKey=function(t){try{var e=0;var r=0;var i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/;var n=i.test(t)?y.decode(t):w.unarmor(t);var s=I.decode(n);if(3===s.sub.length)s=s.sub[2].sub[0];if(9===s.sub.length){e=s.sub[1].getHexStringValue();this.n=U(e,16);r=s.sub[2].getHexStringValue();this.e=parseInt(r,16);var a=s.sub[3].getHexStringValue();this.d=U(a,16);var o=s.sub[4].getHexStringValue();this.p=U(o,16);var u=s.sub[5].getHexStringValue();this.q=U(u,16);var c=s.sub[6].getHexStringValue();this.dmp1=U(c,16);var l=s.sub[7].getHexStringValue();this.dmq1=U(l,16);var f=s.sub[8].getHexStringValue();this.coeff=U(f,16);}else if(2===s.sub.length){var h=s.sub[1];var d=h.sub[0];e=d.sub[0].getHexStringValue();this.n=U(e,16);r=d.sub[1].getHexStringValue();this.e=parseInt(r,16);}else return false;return true}catch(t){return false}};e.prototype.getPrivateBaseKey=function(){var t={array:[new pt.asn1.DERInteger({int:0}),new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e}),new pt.asn1.DERInteger({bigint:this.d}),new pt.asn1.DERInteger({bigint:this.p}),new pt.asn1.DERInteger({bigint:this.q}),new pt.asn1.DERInteger({bigint:this.dmp1}),new pt.asn1.DERInteger({bigint:this.dmq1}),new pt.asn1.DERInteger({bigint:this.coeff})]};var e=new pt.asn1.DERSequence(t);return e.getEncodedHex()};e.prototype.getPrivateBaseKeyB64=function(){return d(this.getPrivateBaseKey())};e.prototype.getPublicBaseKey=function(){var t=new pt.asn1.DERSequence({array:[new pt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new pt.asn1.DERNull]});var e=new pt.asn1.DERSequence({array:[new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e})]});var r=new pt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});var i=new pt.asn1.DERSequence({array:[t,r]});return i.getEncodedHex()};e.prototype.getPublicBaseKeyB64=function(){return d(this.getPublicBaseKey())};e.wordwrap=function(t,e){e=e||64;if(!t)return t;var r="(.{1,"+e+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")};e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n";t+="-----END RSA PRIVATE KEY-----";return t};e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n";t+="-----END PUBLIC KEY-----";return t};e.hasPublicKeyProperty=function(t){t=t||{};return t.hasOwnProperty("n")&&t.hasOwnProperty("e")};e.hasPrivateKeyProperty=function(t){t=t||{};return t.hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")};e.prototype.parsePropertiesFrom=function(t){this.n=t.n;this.e=t.e;if(t.hasOwnProperty("d")){this.d=t.d;this.p=t.p;this.q=t.q;this.dmp1=t.dmp1;this.dmq1=t.dmq1;this.coeff=t.coeff;}};return e}(ut);const mt={i:"3.2.1"};var wt=function(){function t(t){if(void 0===t)t={};t=t||{};this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024;this.default_public_exponent=t.default_public_exponent||"010001";this.log=t.log||false;this.key=null;}t.prototype.setKey=function(t){if(this.log&&this.key)console.warn("A key was already set, overriding existing.");this.key=new yt(t);};t.prototype.setPrivateKey=function(t){this.setKey(t);};t.prototype.setPublicKey=function(t){this.setKey(t);};t.prototype.decrypt=function(t){try{return this.getKey().decrypt(t)}catch(t){return false}};t.prototype.encrypt=function(t){try{return this.getKey().encrypt(t)}catch(t){return false}};t.prototype.encryptLong=function(t){try{return d(this.getKey().encryptLong(t))}catch(t){return false}};t.prototype.decryptLong=function(t){try{return this.getKey().decryptLong(t)}catch(t){return false}};t.prototype.sign=function(t,e,r){try{return d(this.getKey().sign(t,e,r))}catch(t){return false}};t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,v(e),r)}catch(t){return false}};t.prototype.getKey=function(t){if(!this.key){this.key=new yt;if(t&&"[object Function]"==={}.toString.call(t)){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent);}return this.key};t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()};t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()};t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()};t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()};t.version=mt.i;return t}();const St=wt;},2480:()=>{}};var e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={id:i,loaded:false,exports:{}};t[i].call(s.exports,s,s.exports,r);s.loaded=true;return s.exports}(()=>{r.d=(t,e)=>{for(var i in e)if(r.o(e,i)&&!r.o(t,i))Object.defineProperty(t,i,{enumerable:true,get:e[i]});};})();(()=>{r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}();})();(()=>{r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);})();(()=>{r.r=t=>{if("undefined"!==typeof Symbol&&Symbol.toStringTag)Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});Object.defineProperty(t,"__esModule",{value:true});};})();(()=>{r.nmd=t=>{t.paths=[];if(!t.children)t.children=[];return t};})();var i=r(9021);return i})()));
|
100
100
|
|
101
101
|
} (gtpushMin));
|
102
102
|
|
package/lib/gtpush-min.js
CHANGED
@@ -84,5 +84,5 @@ uni.onSocketClose(t);
|
|
84
84
|
// #ifndef MP-ALIPAY
|
85
85
|
null===e||void 0===e||e.onClose(t);
|
86
86
|
// #endif
|
87
|
-
}}}}e["default"]=r},4486:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(3854));class s{constructor(){this.systemInfo=wx.getSystemInfoSync()}os(){return n.default.getStr(this.systemInfo,"platform")}osVersion(){return n.default.getStr(this.systemInfo,"system")}model(){return n.default.getStr(this.systemInfo,"model")}brand(){return n.default.getStr(this.systemInfo,"brand")}platform(){return"MP-WEIXIN"}platformVersion(){return n.default.getStr(this.systemInfo,"version")}language(){return n.default.getStr(this.systemInfo,"language")}platformId(){if(wx.canIUse("getAccountInfoSync"))return wx.getAccountInfoSync().miniProgram.appId;return""}getNetworkType(t){wx.getNetworkType({success:e=>{var r;null===(r=t.success)||void 0===r||r.call(t.success,{networkType:e.networkType})},fail:t.fail})}onNetworkStatusChange(t){wx.onNetworkStatusChange(t)}}e["default"]=s},5867:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{set(t){wx.setStorage(t)}setSync(t,e){wx.setStorageSync(t,e)}get(t){wx.getStorage(t)}getSync(t){return wx.getStorageSync(t)}}e["default"]=r},7006:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{connect(t){let e=wx.connectSocket({url:t.url,header:t.header,protocols:t.protocols,success:t.success,fail:t.fail,complete:t.complete});return{onOpen:e.onOpen,send:e.send,onMessage:e.onMessage,onError:e.onError,onClose:e.onClose,close:e.close}}}e["default"]=r},6893:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});var r;(function(t){t.SDK_VERSION="GTMP-2.0.4.dcloud";t.DEFAULT_SOCKET_URL="wss://wshzn.getui.net:5223/nws";t.SOCKET_PROTOCOL_VERSION="1.0";t.SERVER_PUBLIC_KEY="MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAJp1rROuvBF7sBSnvLaesj2iFhMcY8aXyLvpnNLKs2wjL3JmEnyr++SlVa35liUlzi83tnAFkn3A9GB7pHBNzawyUkBh8WUhq5bnFIkk2RaDa6+5MpG84DEv52p7RR+aWwIDAQAB";t.SERVER_PUBLIC_KEY_ID="69d747c4b9f641baf4004be4297e9f3b";t.ID_U_2_G=true})(r||(r={}));e["default"]=r},7555:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7002));const s=i(r(529));const a=i(r(6379));class o{static init(t){var e;if(this.inited)return;try{this.checkAppid(t.appid);this.inited=true;s.default.info(`init: appid=${t.appid}`);a.default.init(t);n.default.connect()}catch(r){this.inited=false;null===(e=t.onError)||void 0===e||e.call(t.onError,{error:r});throw r}}static enableSocket(t){this.checkInit();n.default.enableSocket(t)}static checkInit(){if(!this.inited)throw new Error(`not init, please invoke init method firstly`)}static checkAppid(t){if(null==t||void 0==t||""==t.trim())throw new Error(`invalid appid ${t}`)}}o.inited=false;e["default"]=o},6379:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));const s=i(r(8506));const a=i(r(6893));const o=i(r(7002));const u=i(r(529));const c=i(r(4685));const l=i(r(2323));class f{static init(t){var e;if(a.default.ID_U_2_G)this.appid=l.default.to_getui(t.appid);else this.appid=t.appid;this.onError=t.onError;this.onClientId=t.onClientId;this.onlineState=t.onlineState;this.onPushMsg=t.onPushMsg;if(this.appid!=s.default.getSync(s.default.KEY_APPID,this.appid)){u.default.info("appid changed, clear session and cid");s.default.setSync(s.default.KEY_CID,"");s.default.setSync(s.default.KEY_SESSION,"")}s.default.setSync(s.default.KEY_APPID,this.appid);this.cid=s.default.getSync(s.default.KEY_CID,this.cid);if(this.cid)null===(e=this.onClientId)||void 0===e||e.call(this.onClientId,{cid:f.cid});this.session=s.default.getSync(s.default.KEY_SESSION,this.session);this.deviceId=s.default.getSync(s.default.KEY_DEVICE_ID,this.deviceId);this.regId=s.default.getSync(s.default.KEY_REGID,this.regId);if(!this.regId){this.regId=this.createRegId();s.default.set({key:s.default.KEY_REGID,data:this.regId})}this.socketUrl=s.default.getSync(s.default.KEY_SOCKET_URL,this.socketUrl);let r=this;c.default.getNetworkType({success:t=>{r.networkType=t.networkType;r.networkConnected="none"!=r.networkType&&""!=r.networkType}});c.default.onNetworkStatusChange((t=>{r.networkConnected=t.isConnected;r.networkType=t.networkType;if(r.networkConnected)o.default.reconnect(100)}))}static createRegId(){return`M-V${n.default.md5Hex(this.getUuid())}-${(new Date).getTime()}`}static getUuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){let e=16*Math.random()|0,r="x"===t?e:3&e|8;return r.toString(16)}))}}f.appid="";f.cid="";f.regId="";f.session="";f.deviceId="";f.packetId=1;f.online=false;f.socketUrl=a.default.DEFAULT_SOCKET_URL;f.publicKeyId=a.default.SERVER_PUBLIC_KEY_ID;f.publicKey=a.default.SERVER_PUBLIC_KEY;f.lastAliasTime=0;f.networkConnected=true;f.networkType="none";e["default"]=f},9586:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n,s;Object.defineProperty(e,"__esModule",{value:true});const a=i(r(661));const o=r(4198);const u=i(r(6379));class c extends a.default{constructor(){super(...arguments);this.actionMsgData=new l}static initActionMsg(t,...e){super.initMsg(t);t.command=a.default.Command.CLIENT_MSG;t.data=t.actionMsgData=l.create();return t}static parseActionMsg(t,e){super.parseMsg(t,e);t.actionMsgData=l.parse(t.data);return t}send(){let t=setTimeout((()=>{var t;if(c.waitingLoginMsgMap.has(this.actionMsgData.msgId)||c.waitingResponseMsgMap.has(this.actionMsgData.msgId)){c.waitingLoginMsgMap.delete(this.actionMsgData.msgId);c.waitingResponseMsgMap.delete(this.actionMsgData.msgId);null===(t=this.callback)||void 0===t||t.call(this.callback,{resultCode:o.ErrorCode.TIME_OUT,message:"waiting time out"})}}),1e4);if(!u.default.online){c.waitingLoginMsgMap.set(this.actionMsgData.msgId,this);return}if(this.actionMsgData.msgAction!=c.ClientAction.RECEIVED)c.waitingResponseMsgMap.set(this.actionMsgData.msgId,this);super.send()}receive(){}static sendWaitingMessages(){let t=this.waitingLoginMsgMap.keys();let e;while(e=t.next(),!e.done){let t=this.waitingLoginMsgMap.get(e.value);this.waitingLoginMsgMap.delete(e.value);null===t||void 0===t||t.send()}}static getWaitingResponseMessage(t){return c.waitingResponseMsgMap.get(t)}static removeWaitingResponseMessage(t){let e=c.waitingResponseMsgMap.get(t);if(e)c.waitingResponseMsgMap.delete(t);return e}}c.ServerAction=(n=class{},n.PUSH_MESSAGE="pushmessage",n.REDIRECT_SERVER="redirect_server",n.ADD_PHONE_INFO_RESULT="addphoneinfo",n.SET_MODE_RESULT="set_mode_result",n.SET_TAG_RESULT="settag_result",n.BIND_ALIAS_RESULT="response_bind",n.UNBIND_ALIAS_RESULT="response_unbind",n.FEED_BACK_RESULT="pushmessage_feedback",n.RECEIVED="received",n);c.ClientAction=(s=class{},s.ADD_PHONE_INFO="addphoneinfo",s.SET_MODE="set_mode",s.FEED_BACK="pushmessage_feedback",s.SET_TAGS="set_tag",s.BIND_ALIAS="bind_alias",s.UNBIND_ALIAS="unbind_alias",s.RECEIVED="received",s);c.waitingLoginMsgMap=new Map;c.waitingResponseMsgMap=new Map;class l{constructor(){this.appId="";this.cid="";this.msgId="";this.msgAction="";this.msgData="";this.msgExtraData=""}static create(){let t=new l;t.appId=u.default.appid;t.cid=u.default.cid;t.msgId=(2147483647&(new Date).getTime()).toString();return t}static parse(t){let e=new l;let r=JSON.parse(t);e.appId=r.appId;e.cid=r.cid;e.msgId=r.msgId;e.msgAction=r.msgAction;e.msgData=r.msgData;e.msgExtraData=r.msgExtraData;return e}}e["default"]=c},4516:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(4685));const s=i(r(8506));const a=i(r(6893));const o=r(4198);const u=i(r(9586));const c=i(r(6379));class l extends u.default{constructor(){super(...arguments);this.addPhoneInfoData=new f}static create(){let t=new l;super.initActionMsg(t);t.callback=e=>{if(e.resultCode!=o.ErrorCode.SUCCESS&&e.resultCode!=o.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){t.send()}),30*1e3);else s.default.set({key:s.default.KEY_ADD_PHONE_INFO_TIME,data:(new Date).getTime()})};t.actionMsgData.msgAction=u.default.ClientAction.ADD_PHONE_INFO;t.addPhoneInfoData=f.create();t.actionMsgData.msgData=JSON.stringify(t.addPhoneInfoData);return t}send(){let t=(new Date).getTime();let e=s.default.getSync(s.default.KEY_ADD_PHONE_INFO_TIME,0);if(t-e<24*60*60*1e3)return;super.send()}}class f{constructor(){this.model="";this.brand="";this.system_version="";this.version="";this.deviceid="";this.type=""}static create(){let t=new f;t.model=n.default.model();t.brand=n.default.brand();t.system_version=n.default.osVersion();t.version=a.default.SDK_VERSION;t.device_token="";t.imei="";t.oaid="";t.mac="";t.idfa="";t.type="MINIPROGRAM";t.deviceid=`${t.type}-${c.default.deviceId}`;t.extra={os:n.default.os(),platform:n.default.platform(),platformVersion:n.default.platformVersion(),platformId:n.default.platformId(),language:n.default.language(),userAgent:n.default.userAgent()};return t}}e["default"]=l},8723:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n,s;Object.defineProperty(e,"__esModule",{value:true});const a=i(r(6379));const o=r(4198);const u=i(r(9586));class c extends u.default{constructor(){super(...arguments);this.feedbackData=new l}static create(t,e){let r=new c;super.initActionMsg(r);r.callback=t=>{if(t.resultCode!=o.ErrorCode.SUCCESS&&t.resultCode!=o.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){r.send()}),30*1e3)};r.feedbackData=l.create(t,e);r.actionMsgData.msgAction=u.default.ClientAction.FEED_BACK;r.actionMsgData.msgData=JSON.stringify(r.feedbackData);return r}send(){super.send()}}c.ActionId=(n=class{},n.RECEIVE="0",n.MP_RECEIVE="210000",n.WEB_RECEIVE="220000",n.BEGIN="1",n);c.RESULT=(s=class{},s.OK="ok",s);class l{constructor(){this.messageid="";this.appkey="";this.appid="";this.taskid="";this.actionid="";this.result="";this.timestamp=""}static create(t,e){let r=new l;r.messageid=t.pushMessageData.messageid;r.appkey=t.pushMessageData.appKey;r.appid=a.default.appid;r.taskid=t.pushMessageData.taskId;r.actionid=e;r.result=c.RESULT.OK;r.timestamp=(new Date).getTime().toString();return r}}e["default"]=c},6362:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));class s extends n.default{static create(){let t=new s;super.initMsg(t);t.command=n.default.Command.HEART_BEAT;return t}}e["default"]=s},1386:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));const s=i(r(6379));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.keyNegotiateData=new u}static create(){let t=new o;super.initMsg(t);t.command=a.default.Command.KEY_NEGOTIATE;n.default.resetKey();t.data=t.keyNegotiateData=u.create();return t}send(){super.send()}}class u{constructor(){this.appId="";this.rsaPublicKeyId="";this.algorithm="";this.secretKey="";this.iv=""}static create(){let t=new u;t.appId=s.default.appid;t.rsaPublicKeyId=s.default.publicKeyId;t.algorithm="AES";t.secretKey=n.default.getEncryptedSecretKey();t.iv=n.default.getEncryptedIV();return t}}e["default"]=o},1280:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));const s=i(r(6667));const a=i(r(8858));const o=i(r(529));const u=i(r(6379));class c extends n.default{constructor(){super(...arguments);this.keyNegotiateResultData=new l}static parse(t){let e=new c;super.parseMsg(e,t);e.keyNegotiateResultData=l.parse(e.data);return e}receive(){var t,e;if(0!=this.keyNegotiateResultData.errorCode){o.default.error(`key negotiate fail: ${this.data}`);null===(t=u.default.onError)||void 0===t||t.call(u.default.onError,{error:`key negotiate fail: ${this.data}`});return}let r=this.keyNegotiateResultData.encryptType.split("/");if(!s.default.algorithmMap.has(r[0].trim().toLowerCase())||!s.default.modeMap.has(r[1].trim().toLowerCase())||!s.default.paddingMap.has(r[2].trim().toLowerCase())){o.default.error(`key negotiate fail: ${this.data}`);null===(e=u.default.onError)||void 0===e||e.call(u.default.onError,{error:`key negotiate fail: ${this.data}`});return}s.default.setEncryptParams(r[0].trim().toLowerCase(),r[1].trim().toLowerCase(),r[2].trim().toLowerCase());a.default.create().send()}}class l{constructor(){this.errorCode=-1;this.errorMsg="";this.encryptType=""}static parse(t){let e=new l;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.encryptType=r.encryptType;return e}}e["default"]=c},8858:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6379));const s=i(r(6667));const a=i(r(661));const o=i(r(4534));class u extends a.default{constructor(){super(...arguments);this.loginData=new c}static create(){let t=new u;super.initMsg(t);t.command=a.default.Command.LOGIN;t.data=t.loginData=c.create();return t}send(){if(!this.loginData.session||n.default.cid!=s.default.md5Hex(this.loginData.session)){o.default.create().send();return}super.send()}}class c{constructor(){this.appId="";this.session=""}static create(){let t=new c;t.appId=n.default.appid;t.session=n.default.session;return t}}e["default"]=u},1606:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(661));const a=i(r(6379));const o=i(r(9586));const u=i(r(4516));const c=i(r(8858));class l extends s.default{constructor(){super(...arguments);this.loginResultData=new f}static parse(t){let e=new l;super.parseMsg(e,t);e.loginResultData=f.parse(e.data);return e}receive(){var t;if(0!=this.loginResultData.errorCode){this.data;a.default.session=a.default.cid="";n.default.setSync(n.default.KEY_CID,"");n.default.setSync(n.default.KEY_SESSION,"");c.default.create().send();return}if(!a.default.online){a.default.online=true;null===(t=a.default.onlineState)||void 0===t||t.call(a.default.onlineState,{online:a.default.online})}o.default.sendWaitingMessages();u.default.create().send()}}class f{constructor(){this.errorCode=-1;this.errorMsg="";this.session=""}static parse(t){let e=new f;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.session=r.session;return e}}e["default"]=l},661:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(9593));const a=i(r(7002));const o=i(r(6893));const u=i(r(6379));class c{constructor(){this.version="";this.command=0;this.packetId=0;this.timeStamp=0;this.data="";this.signature=""}static initMsg(t,...e){t.version=o.default.SOCKET_PROTOCOL_VERSION;t.command=0;t.timeStamp=(new Date).getTime();return t}static parseMsg(t,e){let r=JSON.parse(e);t.version=r.version;t.command=r.command;t.packetId=r.packetId;t.timeStamp=r.timeStamp;t.data=r.data;t.signature=r.signature;return t}stringify(){return JSON.stringify(this,["version","command","packetId","timeStamp","data","signature"])}send(){if(!a.default.isAvailable())return;this.packetId=u.default.packetId++;if(this.temp)this.data=this.temp;else this.temp=this.data;this.data=JSON.stringify(this.data);this.stringify();if(this.command!=c.Command.HEART_BEAT){s.default.sign(this);if(this.data&&this.command!=c.Command.KEY_NEGOTIATE)s.default.encrypt(this)}a.default.send(this.stringify())}}c.Command=(n=class{},n.HEART_BEAT=0,n.KEY_NEGOTIATE=1,n.KEY_NEGOTIATE_RESULT=16,n.REGISTER=2,n.REGISTER_RESULT=32,n.LOGIN=3,n.LOGIN_RESULT=48,n.LOGOUT=4,n.LOGOUT_RESULT=64,n.CLIENT_MSG=5,n.SERVER_MSG=80,n.SERVER_CLOSE=96,n.REDIRECT_SERVER=112,n);e["default"]=c},9593:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));var s;(function(t){function e(t){t.data=n.default.encrypt(t.data)}t.encrypt=e;function r(t){t.data=n.default.decrypt(t.data)}t.decrypt=r;function i(t){t.signature=n.default.sha256(`${t.timeStamp}${t.packetId}${t.command}${t.data}`)}t.sign=i;function s(t){let e=n.default.sha256(`${t.timeStamp}${t.packetId}${t.command}${t.data}`);if(t.signature!=e)throw new Error(`msg signature vierfy failed`)}t.verify=s})(s||(s={}));e["default"]=s},4054:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(1280));const s=i(r(1606));const a=i(r(661));const o=i(r(1277));const u=i(r(910));const c=i(r(9538));const l=i(r(9479));const f=i(r(6755));const h=i(r(2918));const d=i(r(9586));const v=i(r(9510));const p=i(r(4626));const g=i(r(7562));const y=i(r(9593));const m=i(r(9586));const w=i(r(9519));const S=i(r(8947));class _{static receiveMessage(t){let e=a.default.parseMsg(new a.default,t);if(e.command==a.default.Command.HEART_BEAT)return;if(e.command!=a.default.Command.KEY_NEGOTIATE_RESULT&&e.command!=a.default.Command.SERVER_CLOSE&&e.command!=a.default.Command.REDIRECT_SERVER)y.default.decrypt(e);if(e.command!=a.default.Command.SERVER_CLOSE&&e.command!=a.default.Command.REDIRECT_SERVER)y.default.verify(e);switch(e.command){case a.default.Command.KEY_NEGOTIATE_RESULT:n.default.parse(e.stringify()).receive();break;case a.default.Command.REGISTER_RESULT:o.default.parse(e.stringify()).receive();break;case a.default.Command.LOGIN_RESULT:s.default.parse(e.stringify()).receive();break;case a.default.Command.SERVER_MSG:this.receiveActionMsg(e.stringify());break;case a.default.Command.SERVER_CLOSE:S.default.parse(e.stringify()).receive();break;case a.default.Command.REDIRECT_SERVER:h.default.parse(e.stringify()).receive();break;default:break}}static receiveActionMsg(t){let e=m.default.parseActionMsg(new m.default,t);if(e.actionMsgData.msgAction!=d.default.ServerAction.RECEIVED&&e.actionMsgData.msgAction!=d.default.ServerAction.REDIRECT_SERVER){let t=JSON.parse(e.actionMsgData.msgData);w.default.create(t.id).send()}switch(e.actionMsgData.msgAction){case d.default.ServerAction.PUSH_MESSAGE:f.default.parse(t).receive();break;case d.default.ServerAction.ADD_PHONE_INFO_RESULT:u.default.parse(t).receive();break;case d.default.ServerAction.SET_MODE_RESULT:v.default.parse(t).receive();break;case d.default.ServerAction.SET_TAG_RESULT:p.default.parse(t).receive();break;case d.default.ServerAction.BIND_ALIAS_RESULT:c.default.parse(t).receive();break;case d.default.ServerAction.UNBIND_ALIAS_RESULT:g.default.parse(t).receive();break;case d.default.ServerAction.FEED_BACK_RESULT:l.default.parse(t).receive();break;case d.default.ServerAction.RECEIVED:w.default.parse(t).receive();break}}}e["default"]=_},9519:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=r(4198);const s=i(r(6379));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.receivedData=new u}static create(t){let e=new o;super.initActionMsg(e);e.callback=t=>{if(t.resultCode!=n.ErrorCode.SUCCESS&&t.resultCode!=n.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){e.send()}),3*1e3)};e.actionMsgData.msgAction=a.default.ClientAction.RECEIVED;e.receivedData=u.create(t);e.actionMsgData.msgData=JSON.stringify(e.receivedData);return e}static parse(t){let e=new o;super.parseActionMsg(e,t);e.receivedData=u.parse(e.data);return e}receive(){var t;let e=a.default.getWaitingResponseMessage(this.actionMsgData.msgId);if(e&&e.actionMsgData.msgAction==a.default.ClientAction.ADD_PHONE_INFO||e&&e.actionMsgData.msgAction==a.default.ClientAction.FEED_BACK){a.default.removeWaitingResponseMessage(e.actionMsgData.msgId);null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:n.ErrorCode.SUCCESS,message:"received"})}}send(){super.send()}}class u{constructor(){this.msgId="";this.cid=""}static create(t){let e=new u;e.cid=s.default.cid;e.msgId=t;return e}static parse(t){let e=new u;let r=JSON.parse(t);e.cid=r.cid;e.msgId=r.msgId;return e}}e["default"]=o},2918:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.RedirectServerData=void 0;const n=i(r(7002));const s=i(r(8506));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.redirectServerData=new u}static parse(t){let e=new o;super.parseMsg(e,t);e.redirectServerData=u.parse(e.data);return e}receive(){this.redirectServerData;s.default.setSync(s.default.KEY_REDIRECT_SERVER,JSON.stringify(this.redirectServerData));n.default.close("redirect server");n.default.reconnect(this.redirectServerData.delay)}}class u{constructor(){this.addressList=[];this.delay=0;this.loc="";this.conf="";this.time=0}static parse(t){let e=new u;let r=JSON.parse(t);e.addressList=r.addressList;e.delay=r.delay;e.loc=r.loc;e.conf=r.conf;e.time=r.time?r.time:(new Date).getTime();return e}}e.RedirectServerData=u;e["default"]=o},4534:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6379));const s=i(r(661));class a extends s.default{constructor(){super(...arguments);this.registerData=new o}static create(){let t=new a;super.initMsg(t);t.command=s.default.Command.REGISTER;t.data=t.registerData=o.create();return t}send(){super.send()}}class o{constructor(){this.appId="";this.regId=""}static create(){let t=new o;t.appId=n.default.appid;t.regId=n.default.regId;return t}}e["default"]=a},1277:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));const s=i(r(8506));const a=i(r(6379));const o=i(r(8858));const u=i(r(529));class c extends n.default{constructor(){super(...arguments);this.registerResultData=new l}static parse(t){let e=new c;super.parseMsg(e,t);e.registerResultData=l.parse(e.data);return e}receive(){var t,e;if(0!=this.registerResultData.errorCode||!this.registerResultData.cid||!this.registerResultData.session){u.default.error(`register fail: ${this.data}`);null===(t=a.default.onError)||void 0===t||t.call(a.default.onError,{error:`register fail: ${this.data}`});return}if(a.default.cid!=this.registerResultData.cid)s.default.setSync(s.default.KEY_ADD_PHONE_INFO_TIME,0);a.default.cid=this.registerResultData.cid;null===(e=a.default.onClientId)||void 0===e||e.call(a.default.onClientId,{cid:a.default.cid});s.default.set({key:s.default.KEY_CID,data:a.default.cid});a.default.session=this.registerResultData.session;s.default.set({key:s.default.KEY_SESSION,data:a.default.session});a.default.deviceId=this.registerResultData.deviceId;s.default.set({key:s.default.KEY_DEVICE_ID,data:a.default.deviceId});o.default.create().send()}}class l{constructor(){this.errorCode=-1;this.errorMsg="";this.cid="";this.session="";this.deviceId="";this.regId=""}static parse(t){let e=new l;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.cid=r.cid;e.session=r.session;e.deviceId=r.deviceId;e.regId=r.regId;return e}}e["default"]=c},8947:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7002));const s=i(r(529));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.serverCloseData=new u}static parse(t){let e=new o;super.parseMsg(e,t);e.serverCloseData=u.parse(e.data);return e}receive(){JSON.stringify(this.serverCloseData);let t=`server close ${this.serverCloseData.code}`;if(20==this.serverCloseData.code||23==this.serverCloseData.code||24==this.serverCloseData.code){n.default.allowReconnect=false;n.default.close(t)}else if(21==this.serverCloseData.code)this.safeClose21(t);else{n.default.allowReconnect=true;n.default.close(t);n.default.reconnect(10)}}safeClose21(t){try{if("undefined"!=typeof document)if(document.hasFocus()&&"visible"==document.visibilityState){n.default.allowReconnect=true;n.default.close(t);n.default.reconnect(10);return}n.default.allowReconnect=false;n.default.close(t)}catch(e){s.default.error(`ServerClose t1`,e);n.default.allowReconnect=false;n.default.close(`${t} error`)}}}class u{constructor(){this.code=-1;this.msg=""}static parse(t){let e=new u;let r=JSON.parse(t);e.code=r.code;e.msg=r.msg;return e}}e["default"]=o},910:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(9586));class a extends s.default{constructor(){super(...arguments);this.addPhoneInfoResultData=new o}static parse(t){let e=new a;super.parseActionMsg(e,t);e.addPhoneInfoResultData=o.parse(e.actionMsgData.msgData);return e}receive(){var t;this.addPhoneInfoResultData;let e=s.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.addPhoneInfoResultData.errorCode,message:this.addPhoneInfoResultData.errorMsg});n.default.set({key:n.default.KEY_ADD_PHONE_INFO_TIME,data:(new Date).getTime()})}}class o{constructor(){this.errorCode=-1;this.errorMsg=""}static parse(t){let e=new o;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=a},9538:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.bindAliasResultData=new u}static parse(t){let e=new o;super.parseActionMsg(e,t);e.bindAliasResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`bind alias result`,this.bindAliasResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.bindAliasResultData.errorCode,message:this.bindAliasResultData.errorMsg});n.default.set({key:n.default.KEY_BIND_ALIAS_TIME,data:(new Date).getTime()})}}class u{constructor(){this.errorCode=-1;this.errorMsg=""}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o},9479:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=r(4198);const s=i(r(9586));class a extends s.default{constructor(){super(...arguments);this.feedbackResultData=new o}static parse(t){let e=new a;super.parseActionMsg(e,t);e.feedbackResultData=o.parse(e.actionMsgData.msgData);return e}receive(){var t;this.feedbackResultData;let e=s.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:n.ErrorCode.SUCCESS,message:"received"})}}class o{constructor(){this.actionId="";this.taskId="";this.result=""}static parse(t){let e=new o;let r=JSON.parse(t);e.actionId=r.actionId;e.taskId=r.taskId;e.result=r.result;return e}}e["default"]=a},6755:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(6379));const a=i(r(9586));const o=i(r(8723));class u extends a.default{constructor(){super(...arguments);this.pushMessageData=new c}static parse(t){let e=new u;super.parseActionMsg(e,t);e.pushMessageData=c.parse(e.actionMsgData.msgData);return e}receive(){var t;this.pushMessageData;if(this.pushMessageData.appId!=s.default.appid||!this.pushMessageData.messageid||!this.pushMessageData.taskId)this.stringify();o.default.create(this,o.default.ActionId.RECEIVE).send();o.default.create(this,o.default.ActionId.MP_RECEIVE).send();if(this.actionMsgData.msgExtraData&&s.default.onPushMsg)null===(t=s.default.onPushMsg)||void 0===t||t.call(s.default.onPushMsg,{message:this.actionMsgData.msgExtraData})}}class c{constructor(){this.id="";this.appKey="";this.appId="";this.messageid="";this.taskId="";this.actionChain=[];this.cdnType=""}static parse(t){let e=new c;let r=JSON.parse(t);e.id=r.id;e.appKey=r.appKey;e.appId=r.appId;e.messageid=r.messageid;e.taskId=r.taskId;e.actionChain=r.actionChain;e.cdnType=r.cdnType;return e}}class l{constructor(){this.type="";this.actionid="";this.do=""}}l.Type=(n=class{},n.GO_TO="goto",n.TRANSMIT="transmit",n);e["default"]=u},9510:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(9586));class s extends n.default{constructor(){super(...arguments);this.setModeResultData=new a}static parse(t){let e=new s;super.parseActionMsg(e,t);e.setModeResultData=a.parse(e.actionMsgData.msgData);return e}receive(){var t;this.setModeResultData;let e=n.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.setModeResultData.errorCode,message:this.setModeResultData.errorMsg})}}class a{constructor(){this.errorCode=-1;this.errorMsg=""}static parse(t){let e=new a;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=s},4626:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.setTagResultData=new u}static parse(t){let e=new o;super.parseActionMsg(e,t);e.setTagResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`set tag result`,this.setTagResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.setTagResultData.errorCode,message:this.setTagResultData.errorMsg});n.default.set({key:n.default.KEY_SET_TAG_TIME,data:(new Date).getTime()})}}class u{constructor(){this.errorCode=0;this.errorMsg=""}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o},7562:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.unbindAliasResultData=new u}static parse(t){let e=new o;super.parseActionMsg(e,t);e.unbindAliasResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`unbind alias result`,this.unbindAliasResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.unbindAliasResultData.errorCode,message:this.unbindAliasResultData.errorMsg});n.default.set({key:n.default.KEY_BIND_ALIAS_TIME,data:(new Date).getTime()})}}class u{constructor(){this.errorCode=-1;this.errorMsg=""}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o},8227:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{constructor(t){this.delay=10;this.delay=t}start(){this.cancel();let t=this;this.timer=setInterval((function(){t.run()}),this.delay)}cancel(){if(this.timer)clearInterval(this.timer)}}e["default"]=r},7167:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(6362));const a=i(r(8227));class o extends a.default{static getInstance(){return o.InstanceHolder.instance}run(){s.default.create().send()}refresh(){this.delay=60*1e3;this.start()}}o.INTERVAL=60*1e3;o.InstanceHolder=(n=class{},n.instance=new o(o.INTERVAL),n);e["default"]=o},2323:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(4736));const s=i(r(6667));var a;(function(t){let e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let r=(0,n.default)("9223372036854775808");function i(t){let e=a(t);let r=o(e);let i=r[1];let n=r[0];return u(i)+u(n)}t.to_getui=i;function a(t){let e=s.default.md5Hex(t);let r=c(e);r[6]&=15;r[6]|=48;r[8]&=63;r[8]|=128;return r}function o(t){let e=(0,n.default)(0);let r=(0,n.default)(0);for(let r=0;r<8;r++)e=e.multiply(256).plus((0,n.default)(255&t[r]));for(let e=8;e<16;e++)r=r.multiply(256).plus((0,n.default)(255&t[e]));return[e,r]}function u(t){if(t>=r)t=r.multiply(2).minus(t);let i="";for(;t>(0,n.default)(0);t=t.divide(62))i+=e.charAt(Number(t.divmod(62).remainder));return i}function c(t){let e=t.length;if(e%2!=0)return[];let r=new Array;for(let i=0;i<e;i+=2)r.push(parseInt(t.substring(i,i+2),16));return r}})(a||(a={}));e["default"]=a},6667:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(2620));const s=i(r(1354));const a=i(r(6379));var o;(function(t){let e;let r;let i;let o;let u=new n.default;let c=s.default.mode.CBC;let l=s.default.pad.Pkcs7;let f=s.default.AES;t.algorithmMap=new Map([["aes",s.default.AES]]);t.modeMap=new Map([["cbc",s.default.mode.CBC],["cfb",s.default.mode.CFB],["cfb128",s.default.mode.CFB],["ecb",s.default.mode.ECB],["ofb",s.default.mode.OFB]]);t.paddingMap=new Map([["nopadding",s.default.pad.NoPadding],["pkcs7",s.default.pad.Pkcs7]]);function h(){e=s.default.MD5((new Date).getTime().toString());r=s.default.MD5(e);u.setPublicKey(a.default.publicKey);e.toString(s.default.enc.Hex);r.toString(s.default.enc.Hex);i=u.encrypt(e.toString(s.default.enc.Hex));o=u.encrypt(r.toString(s.default.enc.Hex))}t.resetKey=h;function d(e,r,i){f=t.algorithmMap.get(e);c=t.modeMap.get(r);l=t.paddingMap.get(i)}t.setEncryptParams=d;function v(t){return f.encrypt(t,e,{iv:r,mode:c,padding:l}).toString()}t.encrypt=v;function p(t){return f.decrypt(t,e,{iv:r,mode:c,padding:l}).toString(s.default.enc.Utf8)}t.decrypt=p;function g(t){return s.default.SHA256(t).toString(s.default.enc.Base64)}t.sha256=g;function y(t){return s.default.MD5(t).toString(s.default.enc.Hex)}t.md5Hex=y;function m(){return i?i:""}t.getEncryptedSecretKey=m;function w(){return o?o:""}t.getEncryptedIV=w})(o||(o={}));e["default"]=o},529:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{static info(...t){if(this.debugMode)console.info(`[GtPush]`,t)}static warn(...t){console.warn(`[GtPush]`,t)}static error(...t){console.error(`[GtPush]`,t)}}r.debugMode=false;e["default"]=r},3854:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{static getStr(t,e){try{if(!t||void 0===t[e])return"";return t[e]}catch(t){}return""}}e["default"]=r},2620:(t,e,r)=>{"use strict";r.r(e);r.d(e,{JSEncrypt:()=>wt,default:()=>St});var i="0123456789abcdefghijklmnopqrstuvwxyz";function n(t){return i.charAt(t)}function s(t,e){return t&e}function a(t,e){return t|e}function o(t,e){return t^e}function u(t,e){return t&~e}function c(t){if(0==t)return-1;var e=0;if(0==(65535&t)){t>>=16;e+=16}if(0==(255&t)){t>>=8;e+=8}if(0==(15&t)){t>>=4;e+=4}if(0==(3&t)){t>>=2;e+=2}if(0==(1&t))++e;return e}function l(t){var e=0;while(0!=t){t&=t-1;++e}return e}var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var h="=";function d(t){var e;var r;var i="";for(e=0;e+3<=t.length;e+=3){r=parseInt(t.substring(e,e+3),16);i+=f.charAt(r>>6)+f.charAt(63&r)}if(e+1==t.length){r=parseInt(t.substring(e,e+1),16);i+=f.charAt(r<<2)}else if(e+2==t.length){r=parseInt(t.substring(e,e+2),16);i+=f.charAt(r>>2)+f.charAt((3&r)<<4)}while((3&i.length)>0)i+=h;return i}function v(t){var e="";var r;var i=0;var s=0;for(r=0;r<t.length;++r){if(t.charAt(r)==h)break;var a=f.indexOf(t.charAt(r));if(a<0)continue;if(0==i){e+=n(a>>2);s=3&a;i=1}else if(1==i){e+=n(s<<2|a>>4);s=15&a;i=2}else if(2==i){e+=n(s);e+=n(a>>2);s=3&a;i=3}else{e+=n(s<<2|a>>4);e+=n(15&a);i=0}}if(1==i)e+=n(s<<2);return e}function p(t){var e=v(t);var r;var i=[];for(r=0;2*r<e.length;++r)i[r]=parseInt(e.substring(2*r,2*r+2),16);return i}var g;var y={decode:function(t){var e;if(void 0===g){var r="0123456789ABCDEF";var i=" \f\n\r\t \u2028\u2029";g={};for(e=0;e<16;++e)g[r.charAt(e)]=e;r=r.toLowerCase();for(e=10;e<16;++e)g[r.charAt(e)]=e;for(e=0;e<i.length;++e)g[i.charAt(e)]=-1}var n=[];var s=0;var a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;o=g[o];if(-1==o)continue;if(void 0===o)throw new Error("Illegal character at offset "+e);s|=o;if(++a>=2){n[n.length]=s;s=0;a=0}else s<<=4}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return n}};var m;var w={decode:function(t){var e;if(void 0===m){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var i="= \f\n\r\t \u2028\u2029";m=Object.create(null);for(e=0;e<64;++e)m[r.charAt(e)]=e;m["-"]=62;m["_"]=63;for(e=0;e<i.length;++e)m[i.charAt(e)]=-1}var n=[];var s=0;var a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;o=m[o];if(-1==o)continue;if(void 0===o)throw new Error("Illegal character at offset "+e);s|=o;if(++a>=4){n[n.length]=s>>16;n[n.length]=s>>8&255;n[n.length]=255&s;s=0;a=0}else s<<=6}switch(a){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=s>>10;break;case 3:n[n.length]=s>>16;n[n.length]=s>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=w.re.exec(t);if(e)if(e[1])t=e[1];else if(e[2])t=e[2];else throw new Error("RegExp out of sync");return w.decode(t)}};var S=1e13;var _=function(){function t(t){this.buf=[+t||0]}t.prototype.mulAdd=function(t,e){var r=this.buf;var i=r.length;var n;var s;for(n=0;n<i;++n){s=r[n]*t+e;if(s<S)e=0;else{e=0|s/S;s-=e*S}r[n]=s}if(e>0)r[n]=e};t.prototype.sub=function(t){var e=this.buf;var r=e.length;var i;var n;for(i=0;i<r;++i){n=e[i]-t;if(n<0){n+=S;t=1}else t=0;e[i]=n}while(0===e[e.length-1])e.pop()};t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");var e=this.buf;var r=e[e.length-1].toString();for(var i=e.length-2;i>=0;--i)r+=(S+e[i]).toString().substring(1);return r};t.prototype.valueOf=function(){var t=this.buf;var e=0;for(var r=t.length-1;r>=0;--r)e=e*S+t[r];return e};t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this};return t}();var b="…";var E=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;var D=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function M(t,e){if(t.length>e)t=t.substring(0,e)+b;return t}var T=function(){function t(e,r){this.hexDigits="0123456789ABCDEF";if(e instanceof t){this.enc=e.enc;this.pos=e.pos}else{this.enc=e;this.pos=r}}t.prototype.get=function(t){if(void 0===t)t=this.pos++;if(t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"===typeof this.enc?this.enc.charCodeAt(t):this.enc[t]};t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)};t.prototype.hexDump=function(t,e,r){var i="";for(var n=t;n<e;++n){i+=this.hexByte(this.get(n));if(true!==r)switch(15&n){case 7:i+=" ";break;case 15:i+="\n";break;default:i+=" "}}return i};t.prototype.isASCII=function(t,e){for(var r=t;r<e;++r){var i=this.get(r);if(i<32||i>176)return false}return true};t.prototype.parseStringISO=function(t,e){var r="";for(var i=t;i<e;++i)r+=String.fromCharCode(this.get(i));return r};t.prototype.parseStringUTF=function(t,e){var r="";for(var i=t;i<e;){var n=this.get(i++);if(n<128)r+=String.fromCharCode(n);else if(n>191&&n<224)r+=String.fromCharCode((31&n)<<6|63&this.get(i++));else r+=String.fromCharCode((15&n)<<12|(63&this.get(i++))<<6|63&this.get(i++))}return r};t.prototype.parseStringBMP=function(t,e){var r="";var i;var n;for(var s=t;s<e;){i=this.get(s++);n=this.get(s++);r+=String.fromCharCode(i<<8|n)}return r};t.prototype.parseTime=function(t,e,r){var i=this.parseStringISO(t,e);var n=(r?E:D).exec(i);if(!n)return"Unrecognized time: "+i;if(r){n[1]=+n[1];n[1]+=+n[1]<70?2e3:1900}i=n[1]+"-"+n[2]+"-"+n[3]+" "+n[4];if(n[5]){i+=":"+n[5];if(n[6]){i+=":"+n[6];if(n[7])i+="."+n[7]}}if(n[8]){i+=" UTC";if("Z"!=n[8]){i+=n[8];if(n[9])i+=":"+n[9]}}return i};t.prototype.parseInteger=function(t,e){var r=this.get(t);var i=r>127;var n=i?255:0;var s;var a="";while(r==n&&++t<e)r=this.get(t);s=e-t;if(0===s)return i?-1:0;if(s>4){a=r;s<<=3;while(0==(128&(+a^n))){a=+a<<1;--s}a="("+s+" bit)\n"}if(i)r-=256;var o=new _(r);for(var u=t+1;u<e;++u)o.mulAdd(256,this.get(u));return a+o.toString()};t.prototype.parseBitString=function(t,e,r){var i=this.get(t);var n=(e-t-1<<3)-i;var s="("+n+" bit)\n";var a="";for(var o=t+1;o<e;++o){var u=this.get(o);var c=o==e-1?i:0;for(var l=7;l>=c;--l)a+=u>>l&1?"1":"0";if(a.length>r)return s+M(a,r)}return s+a};t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return M(this.parseStringISO(t,e),r);var i=e-t;var n="("+i+" byte)\n";r/=2;if(i>r)e=t+r;for(var s=t;s<e;++s)n+=this.hexByte(this.get(s));if(i>r)n+=b;return n};t.prototype.parseOID=function(t,e,r){var i="";var n=new _;var s=0;for(var a=t;a<e;++a){var o=this.get(a);n.mulAdd(128,127&o);s+=7;if(!(128&o)){if(""===i){n=n.simplify();if(n instanceof _){n.sub(80);i="2."+n.toString()}else{var u=n<80?n<40?0:1:2;i=u+"."+(n-40*u)}}else i+="."+n.toString();if(i.length>r)return M(i,r);n=new _;s=0}}if(s>0)i+=".incomplete";return i};return t}();var I=function(){function t(t,e,r,i,n){if(!(i instanceof A))throw new Error("Invalid tag value.");this.stream=t;this.header=e;this.length=r;this.tag=i;this.sub=n}t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}};t.prototype.content=function(t){if(void 0===this.tag)return null;if(void 0===t)t=1/0;var e=this.posContent();var r=Math.abs(this.length);if(!this.tag.isUniversal()){if(null!==this.sub)return"("+this.sub.length+" elem)";return this.stream.parseOctetString(e,e+r,t)}switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:if(null!==this.sub)return"("+this.sub.length+" elem)";else return"(no elem)";case 12:return M(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return M(this.stream.parseStringISO(e,e+r),t);case 30:return M(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null};t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"};t.prototype.toPrettyString=function(t){if(void 0===t)t="";var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0)e+="+";e+=this.length;if(this.tag.tagConstructed)e+=" (constructed)";else if(this.tag.isUniversal()&&(3==this.tag.tagNumber||4==this.tag.tagNumber)&&null!==this.sub)e+=" (encapsulates)";e+="\n";if(null!==this.sub){t+=" ";for(var r=0,i=this.sub.length;r<i;++r)e+=this.sub[r].toPrettyString(t)}return e};t.prototype.posStart=function(){return this.stream.pos};t.prototype.posContent=function(){return this.stream.pos+this.header};t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)};t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),true)};t.decodeLength=function(t){var e=t.get();var r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var i=0;i<r;++i)e=256*e+t.get();return e};t.prototype.getHexStringValue=function(){var t=this.toHexString();var e=2*this.header;var r=2*this.length;return t.substr(e,r)};t.decode=function(e){var r;if(!(e instanceof T))r=new T(e,0);else r=e;var i=new T(r);var n=new A(r);var s=t.decodeLength(r);var a=r.pos;var o=a-i.pos;var u=null;var c=function(){var e=[];if(null!==s){var i=a+s;while(r.pos<i)e[e.length]=t.decode(r);if(r.pos!=i)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var n=t.decode(r);if(n.tag.isEOC())break;e[e.length]=n}s=a-r.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(n.tagConstructed)u=c();else if(n.isUniversal()&&(3==n.tagNumber||4==n.tagNumber))try{if(3==n.tagNumber)if(0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=c();for(var l=0;l<u.length;++l)if(u[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){u=null}if(null===u){if(null===s)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);r.pos=a+Math.abs(s)}return new t(i,o,s,n,u)};return t}();var A=function(){function t(t){var e=t.get();this.tagClass=e>>6;this.tagConstructed=0!==(32&e);this.tagNumber=31&e;if(31==this.tagNumber){var r=new _;do{e=t.get();r.mulAdd(128,127&e)}while(128&e);this.tagNumber=r.simplify()}}t.prototype.isUniversal=function(){return 0===this.tagClass};t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber};return t}();var x;var R=0xdeadbeefcafe;var B=15715070==(16777215&R);var O=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];var k=(1<<26)/O[O.length-1];var C=function(){function t(t,e,r){if(null!=t)if("number"==typeof t)this.fromNumber(t,e,r);else if(null==e&&"string"!=typeof t)this.fromString(t,256);else this.fromString(t,e)}t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else if(4==t)e=2;else return this.toRadix(t);var r=(1<<e)-1;var i;var s=false;var a="";var o=this.t;var u=this.DB-o*this.DB%e;if(o-- >0){if(u<this.DB&&(i=this[o]>>u)>0){s=true;a=n(i)}while(o>=0){if(u<e){i=(this[o]&(1<<u)-1)<<e-u;i|=this[--o]>>(u+=this.DB-e)}else{i=this[o]>>(u-=e)&r;if(u<=0){u+=this.DB;--o}}if(i>0)s=true;if(s)a+=n(i)}}return s?a:"0"};t.prototype.negate=function(){var e=H();t.ZERO.subTo(this,e);return e};t.prototype.abs=function(){return this.s<0?this.negate():this};t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;e=r-t.t;if(0!=e)return this.s<0?-e:e;while(--r>=0)if(0!=(e=this[r]-t[r]))return e;return 0};t.prototype.bitLength=function(){if(this.t<=0)return 0;return this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM)};t.prototype.mod=function(e){var r=H();this.abs().divRemTo(e,null,r);if(this.s<0&&r.compareTo(t.ZERO)>0)e.subTo(r,r);return r};t.prototype.modPowInt=function(t,e){var r;if(t<256||e.isEven())r=new P(e);else r=new V(e);return this.exp(t,r)};t.prototype.clone=function(){var t=H();this.copyTo(t);return t};t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;else if(0==this.t)return-1}else if(1==this.t)return this[0];else if(0==this.t)return 0;return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]};t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24};t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16};t.prototype.signum=function(){if(this.s<0)return-1;else if(this.t<=0||1==this.t&&this[0]<=0)return 0;else return 1};t.prototype.toByteArray=function(){var t=this.t;var e=[];e[0]=this.s;var r=this.DB-t*this.DB%8;var i;var n=0;if(t-- >0){if(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r)e[n++]=i|this.s<<this.DB-r;while(t>=0){if(r<8){i=(this[t]&(1<<r)-1)<<8-r;i|=this[--t]>>(r+=this.DB-8)}else{i=this[t]>>(r-=8)&255;if(r<=0){r+=this.DB;--t}}if(0!=(128&i))i|=-256;if(0==n&&(128&this.s)!=(128&i))++n;if(n>0||i!=this.s)e[n++]=i}}return e};t.prototype.equals=function(t){return 0==this.compareTo(t)};t.prototype.min=function(t){return this.compareTo(t)<0?this:t};t.prototype.max=function(t){return this.compareTo(t)>0?this:t};t.prototype.and=function(t){var e=H();this.bitwiseTo(t,s,e);return e};t.prototype.or=function(t){var e=H();this.bitwiseTo(t,a,e);return e};t.prototype.xor=function(t){var e=H();this.bitwiseTo(t,o,e);return e};t.prototype.andNot=function(t){var e=H();this.bitwiseTo(t,u,e);return e};t.prototype.not=function(){var t=H();for(var e=0;e<this.t;++e)t[e]=this.DM&~this[e];t.t=this.t;t.s=~this.s;return t};t.prototype.shiftLeft=function(t){var e=H();if(t<0)this.rShiftTo(-t,e);else this.lShiftTo(t,e);return e};t.prototype.shiftRight=function(t){var e=H();if(t<0)this.lShiftTo(-t,e);else this.rShiftTo(t,e);return e};t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+c(this[t]);if(this.s<0)return this.t*this.DB;return-1};t.prototype.bitCount=function(){var t=0;var e=this.s&this.DM;for(var r=0;r<this.t;++r)t+=l(this[r]^e);return t};t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);if(e>=this.t)return 0!=this.s;return 0!=(this[e]&1<<t%this.DB)};t.prototype.setBit=function(t){return this.changeBit(t,a)};t.prototype.clearBit=function(t){return this.changeBit(t,u)};t.prototype.flipBit=function(t){return this.changeBit(t,o)};t.prototype.add=function(t){var e=H();this.addTo(t,e);return e};t.prototype.subtract=function(t){var e=H();this.subTo(t,e);return e};t.prototype.multiply=function(t){var e=H();this.multiplyTo(t,e);return e};t.prototype.divide=function(t){var e=H();this.divRemTo(t,e,null);return e};t.prototype.remainder=function(t){var e=H();this.divRemTo(t,null,e);return e};t.prototype.divideAndRemainder=function(t){var e=H();var r=H();this.divRemTo(t,e,r);return[e,r]};t.prototype.modPow=function(t,e){var r=t.bitLength();var i;var n=Y(1);var s;if(r<=0)return n;else if(r<18)i=1;else if(r<48)i=3;else if(r<144)i=4;else if(r<768)i=5;else i=6;if(r<8)s=new P(e);else if(e.isEven())s=new L(e);else s=new V(e);var a=[];var o=3;var u=i-1;var c=(1<<i)-1;a[1]=s.convert(this);if(i>1){var l=H();s.sqrTo(a[1],l);while(o<=c){a[o]=H();s.mulTo(l,a[o-2],a[o]);o+=2}}var f=t.t-1;var h;var d=true;var v=H();var p;r=W(t[f])-1;while(f>=0){if(r>=u)h=t[f]>>r-u&c;else{h=(t[f]&(1<<r+1)-1)<<u-r;if(f>0)h|=t[f-1]>>this.DB+r-u}o=i;while(0==(1&h)){h>>=1;--o}if((r-=o)<0){r+=this.DB;--f}if(d){a[h].copyTo(n);d=false}else{while(o>1){s.sqrTo(n,v);s.sqrTo(v,n);o-=2}if(o>0)s.sqrTo(n,v);else{p=n;n=v;v=p}s.mulTo(v,a[h],n)}while(f>=0&&0==(t[f]&1<<r)){s.sqrTo(n,v);p=n;n=v;v=p;if(--r<0){r=this.DB-1;--f}}}return s.revert(n)};t.prototype.modInverse=function(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;var i=e.clone();var n=this.clone();var s=Y(1);var a=Y(0);var o=Y(0);var u=Y(1);while(0!=i.signum()){while(i.isEven()){i.rShiftTo(1,i);if(r){if(!s.isEven()||!a.isEven()){s.addTo(this,s);a.subTo(e,a)}s.rShiftTo(1,s)}else if(!a.isEven())a.subTo(e,a);a.rShiftTo(1,a)}while(n.isEven()){n.rShiftTo(1,n);if(r){if(!o.isEven()||!u.isEven()){o.addTo(this,o);u.subTo(e,u)}o.rShiftTo(1,o)}else if(!u.isEven())u.subTo(e,u);u.rShiftTo(1,u)}if(i.compareTo(n)>=0){i.subTo(n,i);if(r)s.subTo(o,s);a.subTo(u,a)}else{n.subTo(i,n);if(r)o.subTo(s,o);u.subTo(a,u)}}if(0!=n.compareTo(t.ONE))return t.ZERO;if(u.compareTo(e)>=0)return u.subtract(e);if(u.signum()<0)u.addTo(e,u);else return u;if(u.signum()<0)return u.add(e);else return u};t.prototype.pow=function(t){return this.exp(t,new N)};t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone();var r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r;r=i}var n=e.getLowestSetBit();var s=r.getLowestSetBit();if(s<0)return e;if(n<s)s=n;if(s>0){e.rShiftTo(s,e);r.rShiftTo(s,r)}while(e.signum()>0){if((n=e.getLowestSetBit())>0)e.rShiftTo(n,e);if((n=r.getLowestSetBit())>0)r.rShiftTo(n,r);if(e.compareTo(r)>=0){e.subTo(r,e);e.rShiftTo(1,e)}else{r.subTo(e,r);r.rShiftTo(1,r)}}if(s>0)r.lShiftTo(s,r);return r};t.prototype.isProbablePrime=function(t){var e;var r=this.abs();if(1==r.t&&r[0]<=O[O.length-1]){for(e=0;e<O.length;++e)if(r[0]==O[e])return true;return false}if(r.isEven())return false;e=1;while(e<O.length){var i=O[e];var n=e+1;while(n<O.length&&i<k)i*=O[n++];i=r.modInt(i);while(e<n)if(i%O[e++]==0)return false}return r.millerRabin(t)};t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t;t.s=this.s};t.prototype.fromInt=function(t){this.t=1;this.s=t<0?-1:0;if(t>0)this[0]=t;else if(t<-1)this[0]=t+this.DV;else this.t=0};t.prototype.fromString=function(e,r){var i;if(16==r)i=4;else if(8==r)i=3;else if(256==r)i=8;else if(2==r)i=1;else if(32==r)i=5;else if(4==r)i=2;else{this.fromRadix(e,r);return}this.t=0;this.s=0;var n=e.length;var s=false;var a=0;while(--n>=0){var o=8==i?255&+e[n]:G(e,n);if(o<0){if("-"==e.charAt(n))s=true;continue}s=false;if(0==a)this[this.t++]=o;else if(a+i>this.DB){this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a;this[this.t++]=o>>this.DB-a}else this[this.t-1]|=o<<a;a+=i;if(a>=this.DB)a-=this.DB}if(8==i&&0!=(128&+e[0])){this.s=-1;if(a>0)this[this.t-1]|=(1<<this.DB-a)-1<<a}this.clamp();if(s)t.ZERO.subTo(this,this)};t.prototype.clamp=function(){var t=this.s&this.DM;while(this.t>0&&this[this.t-1]==t)--this.t};t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t;e.s=this.s};t.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0);e.s=this.s};t.prototype.lShiftTo=function(t,e){var r=t%this.DB;var i=this.DB-r;var n=(1<<i)-1;var s=Math.floor(t/this.DB);var a=this.s<<r&this.DM;for(var o=this.t-1;o>=0;--o){e[o+s+1]=this[o]>>i|a;a=(this[o]&n)<<r}for(var o=s-1;o>=0;--o)e[o]=0;e[s]=a;e.t=this.t+s+1;e.s=this.s;e.clamp()};t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var i=t%this.DB;var n=this.DB-i;var s=(1<<i)-1;e[0]=this[r]>>i;for(var a=r+1;a<this.t;++a){e[a-r-1]|=(this[a]&s)<<n;e[a-r]=this[a]>>i}if(i>0)e[this.t-r-1]|=(this.s&s)<<n;e.t=this.t-r;e.clamp()};t.prototype.subTo=function(t,e){var r=0;var i=0;var n=Math.min(t.t,this.t);while(r<n){i+=this[r]-t[r];e[r++]=i&this.DM;i>>=this.DB}if(t.t<this.t){i-=t.s;while(r<this.t){i+=this[r];e[r++]=i&this.DM;i>>=this.DB}i+=this.s}else{i+=this.s;while(r<t.t){i-=t[r];e[r++]=i&this.DM;i>>=this.DB}i-=t.s}e.s=i<0?-1:0;if(i<-1)e[r++]=this.DV+i;else if(i>0)e[r++]=i;e.t=r;e.clamp()};t.prototype.multiplyTo=function(e,r){var i=this.abs();var n=e.abs();var s=i.t;r.t=s+n.t;while(--s>=0)r[s]=0;for(s=0;s<n.t;++s)r[s+i.t]=i.am(0,n[s],r,s,0,i.t);r.s=0;r.clamp();if(this.s!=e.s)t.ZERO.subTo(r,r)};t.prototype.squareTo=function(t){var e=this.abs();var r=t.t=2*e.t;while(--r>=0)t[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e[r],t,2*r,0,1);if((t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,i,e.t-r-1))>=e.DV){t[r+e.t]-=e.DV;t[r+e.t+1]=1}}if(t.t>0)t[t.t-1]+=e.am(r,e[r],t,2*r,0,1);t.s=0;t.clamp()};t.prototype.divRemTo=function(e,r,i){var n=e.abs();if(n.t<=0)return;var s=this.abs();if(s.t<n.t){if(null!=r)r.fromInt(0);if(null!=i)this.copyTo(i);return}if(null==i)i=H();var a=H();var o=this.s;var u=e.s;var c=this.DB-W(n[n.t-1]);if(c>0){n.lShiftTo(c,a);s.lShiftTo(c,i)}else{n.copyTo(a);s.copyTo(i)}var l=a.t;var f=a[l-1];if(0==f)return;var h=f*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0);var d=this.FV/h;var v=(1<<this.F1)/h;var p=1<<this.F2;var g=i.t;var y=g-l;var m=null==r?H():r;a.dlShiftTo(y,m);if(i.compareTo(m)>=0){i[i.t++]=1;i.subTo(m,i)}t.ONE.dlShiftTo(l,m);m.subTo(a,a);while(a.t<l)a[a.t++]=0;while(--y>=0){var w=i[--g]==f?this.DM:Math.floor(i[g]*d+(i[g-1]+p)*v);if((i[g]+=a.am(0,w,i,y,0,l))<w){a.dlShiftTo(y,m);i.subTo(m,i);while(i[g]<--w)i.subTo(m,i)}}if(null!=r){i.drShiftTo(l,r);if(o!=u)t.ZERO.subTo(r,r)}i.t=l;i.clamp();if(c>0)i.rShiftTo(c,i);if(o<0)t.ZERO.subTo(i,i)};t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;e=e*(2-(15&t)*e)&15;e=e*(2-(255&t)*e)&255;e=e*(2-((65535&t)*e&65535))&65535;e=e*(2-t*e%this.DV)%this.DV;return e>0?this.DV-e:-e};t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)};t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var i=H();var n=H();var s=r.convert(this);var a=W(e)-1;s.copyTo(i);while(--a>=0){r.sqrTo(i,n);if((e&1<<a)>0)r.mulTo(n,s,i);else{var o=i;i=n;n=o}}return r.revert(i)};t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))};t.prototype.toRadix=function(t){if(null==t)t=10;if(0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t);var r=Math.pow(t,e);var i=Y(r);var n=H();var s=H();var a="";this.divRemTo(i,n,s);while(n.signum()>0){a=(r+s.intValue()).toString(t).substr(1)+a;n.divRemTo(i,n,s)}return s.intValue().toString(t)+a};t.prototype.fromRadix=function(e,r){this.fromInt(0);if(null==r)r=10;var i=this.chunkSize(r);var n=Math.pow(r,i);var s=false;var a=0;var o=0;for(var u=0;u<e.length;++u){var c=G(e,u);if(c<0){if("-"==e.charAt(u)&&0==this.signum())s=true;continue}o=r*o+c;if(++a>=i){this.dMultiply(n);this.dAddOffset(o,0);a=0;o=0}}if(a>0){this.dMultiply(Math.pow(r,a));this.dAddOffset(o,0)}if(s)t.ZERO.subTo(this,this)};t.prototype.fromNumber=function(e,r,i){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,i);if(!this.testBit(e-1))this.bitwiseTo(t.ONE.shiftLeft(e-1),a,this);if(this.isEven())this.dAddOffset(1,0);while(!this.isProbablePrime(r)){this.dAddOffset(2,0);if(this.bitLength()>e)this.subTo(t.ONE.shiftLeft(e-1),this)}}else{var n=[];var s=7&e;n.length=(e>>3)+1;r.nextBytes(n);if(s>0)n[0]&=(1<<s)-1;else n[0]=0;this.fromString(n,256)}};t.prototype.bitwiseTo=function(t,e,r){var i;var n;var s=Math.min(t.t,this.t);for(i=0;i<s;++i)r[i]=e(this[i],t[i]);if(t.t<this.t){n=t.s&this.DM;for(i=s;i<this.t;++i)r[i]=e(this[i],n);r.t=this.t}else{n=this.s&this.DM;for(i=s;i<t.t;++i)r[i]=e(n,t[i]);r.t=t.t}r.s=e(this.s,t.s);r.clamp()};t.prototype.changeBit=function(e,r){var i=t.ONE.shiftLeft(e);this.bitwiseTo(i,r,i);return i};t.prototype.addTo=function(t,e){var r=0;var i=0;var n=Math.min(t.t,this.t);while(r<n){i+=this[r]+t[r];e[r++]=i&this.DM;i>>=this.DB}if(t.t<this.t){i+=t.s;while(r<this.t){i+=this[r];e[r++]=i&this.DM;i>>=this.DB}i+=this.s}else{i+=this.s;while(r<t.t){i+=t[r];e[r++]=i&this.DM;i>>=this.DB}i+=t.s}e.s=i<0?-1:0;if(i>0)e[r++]=i;else if(i<-1)e[r++]=this.DV+i;e.t=r;e.clamp()};t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t);++this.t;this.clamp()};t.prototype.dAddOffset=function(t,e){if(0==t)return;while(this.t<=e)this[this.t++]=0;this[e]+=t;while(this[e]>=this.DV){this[e]-=this.DV;if(++e>=this.t)this[this.t++]=0;++this[e]}};t.prototype.multiplyLowerTo=function(t,e,r){var i=Math.min(this.t+t.t,e);r.s=0;r.t=i;while(i>0)r[--i]=0;for(var n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(var n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()};t.prototype.multiplyUpperTo=function(t,e,r){--e;var i=r.t=this.t+t.t-e;r.s=0;while(--i>=0)r[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)r[this.t+i-e]=this.am(e-i,t[i],r,0,0,this.t+i-e);r.clamp();r.drShiftTo(1,r)};t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t;var r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r};t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE);var i=r.getLowestSetBit();if(i<=0)return false;var n=r.shiftRight(i);e=e+1>>1;if(e>O.length)e=O.length;var s=H();for(var a=0;a<e;++a){s.fromInt(O[Math.floor(Math.random()*O.length)]);var o=s.modPow(n,this);if(0!=o.compareTo(t.ONE)&&0!=o.compareTo(r)){var u=1;while(u++<i&&0!=o.compareTo(r)){o=o.modPowInt(2,this);if(0==o.compareTo(t.ONE))return false}if(0!=o.compareTo(r))return false}}return true};t.prototype.square=function(){var t=H();this.squareTo(t);return t};t.prototype.gcda=function(t,e){var r=this.s<0?this.negate():this.clone();var i=t.s<0?t.negate():t.clone();if(r.compareTo(i)<0){var n=r;r=i;i=n}var s=r.getLowestSetBit();var a=i.getLowestSetBit();if(a<0){e(r);return}if(s<a)a=s;if(a>0){r.rShiftTo(a,r);i.rShiftTo(a,i)}var o=function(){if((s=r.getLowestSetBit())>0)r.rShiftTo(s,r);if((s=i.getLowestSetBit())>0)i.rShiftTo(s,i);if(r.compareTo(i)>=0){r.subTo(i,r);r.rShiftTo(1,r)}else{i.subTo(r,i);i.rShiftTo(1,i)}if(!(r.signum()>0)){if(a>0)i.lShiftTo(a,i);setTimeout((function(){e(i)}),0)}else setTimeout(o,0)};setTimeout(o,10)};t.prototype.fromNumberAsync=function(e,r,i,n){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,i);if(!this.testBit(e-1))this.bitwiseTo(t.ONE.shiftLeft(e-1),a,this);if(this.isEven())this.dAddOffset(1,0);var s=this;var o=function(){s.dAddOffset(2,0);if(s.bitLength()>e)s.subTo(t.ONE.shiftLeft(e-1),s);if(s.isProbablePrime(r))setTimeout((function(){n()}),0);else setTimeout(o,0)};setTimeout(o,0)}else{var u=[];var c=7&e;u.length=(e>>3)+1;r.nextBytes(u);if(c>0)u[0]&=(1<<c)-1;else u[0]=0;this.fromString(u,256)}};return t}();var N=function(){function t(){}t.prototype.convert=function(t){return t};t.prototype.revert=function(t){return t};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)};t.prototype.sqrTo=function(t,e){t.squareTo(e)};return t}();var P=function(){function t(t){this.m=t}t.prototype.convert=function(t){if(t.s<0||t.compareTo(this.m)>=0)return t.mod(this.m);else return t};t.prototype.revert=function(t){return t};t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r)};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e)};return t}();var V=function(){function t(t){this.m=t;this.mp=t.invDigit();this.mpl=32767&this.mp;this.mph=this.mp>>15;this.um=(1<<t.DB-15)-1;this.mt2=2*t.t}t.prototype.convert=function(t){var e=H();t.abs().dlShiftTo(this.m.t,e);e.divRemTo(this.m,null,e);if(t.s<0&&e.compareTo(C.ZERO)>0)this.m.subTo(e,e);return e};t.prototype.revert=function(t){var e=H();t.copyTo(e);this.reduce(e);return e};t.prototype.reduce=function(t){while(t.t<=this.mt2)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e];var i=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;r=e+this.m.t;t[r]+=this.m.am(0,i,t,e,0,this.m.t);while(t[r]>=t.DV){t[r]-=t.DV;t[++r]++}}t.clamp();t.drShiftTo(this.m.t,t);if(t.compareTo(this.m)>=0)t.subTo(this.m,t)};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r)};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e)};return t}();var L=function(){function t(t){this.m=t;this.r2=H();this.q3=H();C.ONE.dlShiftTo(2*t.t,this.r2);this.mu=this.r2.divide(t)}t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);else if(t.compareTo(this.m)<0)return t;else{var e=H();t.copyTo(e);this.reduce(e);return e}};t.prototype.revert=function(t){return t};t.prototype.reduce=function(t){t.drShiftTo(this.m.t-1,this.r2);if(t.t>this.m.t+1){t.t=this.m.t+1;t.clamp()}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(t.compareTo(this.r2)<0)t.dAddOffset(1,this.m.t+1);t.subTo(this.r2,t);while(t.compareTo(this.m)>=0)t.subTo(this.m,t)};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r)};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e)};return t}();function H(){return new C(null)}function U(t,e){return new C(t,e)}var K="undefined"!==typeof navigator;if(K&&B&&"Microsoft Internet Explorer"==navigator.appName){C.prototype.am=function t(e,r,i,n,s,a){var o=32767&r;var u=r>>15;while(--a>=0){var c=32767&this[e];var l=this[e++]>>15;var f=u*c+l*o;c=o*c+((32767&f)<<15)+i[n]+(1073741823&s);s=(c>>>30)+(f>>>15)+u*l+(s>>>30);i[n++]=1073741823&c}return s};x=30}else if(K&&B&&"Netscape"!=navigator.appName){C.prototype.am=function t(e,r,i,n,s,a){while(--a>=0){var o=r*this[e++]+i[n]+s;s=Math.floor(o/67108864);i[n++]=67108863&o}return s};x=26}else{C.prototype.am=function t(e,r,i,n,s,a){var o=16383&r;var u=r>>14;while(--a>=0){var c=16383&this[e];var l=this[e++]>>14;var f=u*c+l*o;c=o*c+((16383&f)<<14)+i[n]+s;s=(c>>28)+(f>>14)+u*l;i[n++]=268435455&c}return s};x=28}C.prototype.DB=x;C.prototype.DM=(1<<x)-1;C.prototype.DV=1<<x;var j=52;C.prototype.FV=Math.pow(2,j);C.prototype.F1=j-x;C.prototype.F2=2*x-j;var q=[];var F;var z;F="0".charCodeAt(0);for(z=0;z<=9;++z)q[F++]=z;F="a".charCodeAt(0);for(z=10;z<36;++z)q[F++]=z;F="A".charCodeAt(0);for(z=10;z<36;++z)q[F++]=z;function G(t,e){var r=q[t.charCodeAt(e)];return null==r?-1:r}function Y(t){var e=H();e.fromInt(t);return e}function W(t){var e=1;var r;if(0!=(r=t>>>16)){t=r;e+=16}if(0!=(r=t>>8)){t=r;e+=8}if(0!=(r=t>>4)){t=r;e+=4}if(0!=(r=t>>2)){t=r;e+=2}if(0!=(r=t>>1)){t=r;e+=1}return e}C.ZERO=Y(0);C.ONE=Y(1);var J=function(){function t(){this.i=0;this.j=0;this.S=[]}t.prototype.init=function(t){var e;var r;var i;for(e=0;e<256;++e)this.S[e]=e;r=0;for(e=0;e<256;++e){r=r+this.S[e]+t[e%t.length]&255;i=this.S[e];this.S[e]=this.S[r];this.S[r]=i}this.i=0;this.j=0};t.prototype.next=function(){var t;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;t=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=t;return this.S[t+this.S[this.i]&255]};return t}();function Z(){return new J}var $=256;var X;var Q=null;var tt;if(null==Q){Q=[];tt=0;var et=void 0;var rt=0;var it=function(t){rt=rt||0;if(rt>=256||tt>=rng_psize)return;try{var e=t.x+t.y;Q[tt++]=255&e;rt+=1}catch(t){}}}function nt(){if(null==X){X=Z();while(tt<$){var t=Math.floor(65536*Math.random());Q[tt++]=255&t}X.init(Q);for(tt=0;tt<Q.length;++tt)Q[tt]=0;tt=0}return X.next()}var st=function(){function t(){}t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=nt()};return t}();function at(t,e){if(e<t.length+22){console.error("Message too long for RSA");return null}var r=e-t.length-6;var i="";for(var n=0;n<r;n+=2)i+="ff";var s="0001"+i+"00"+t;return U(s,16)}function ot(t,e){if(e<t.length+11){console.error("Message too long for RSA");return null}var r=[];var i=t.length-1;while(i>=0&&e>0){var n=t.charCodeAt(i--);if(n<128)r[--e]=n;else if(n>127&&n<2048){r[--e]=63&n|128;r[--e]=n>>6|192}else{r[--e]=63&n|128;r[--e]=n>>6&63|128;r[--e]=n>>12|224}}r[--e]=0;var s=new st;var a=[];while(e>2){a[0]=0;while(0==a[0])s.nextBytes(a);r[--e]=a[0]}r[--e]=2;r[--e]=0;return new C(r)}var ut=function(){function t(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null}t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)};t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);var e=t.mod(this.p).modPow(this.dmp1,this.p);var r=t.mod(this.q).modPow(this.dmq1,this.q);while(e.compareTo(r)<0)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)};t.prototype.setPublic=function(t,e){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16)}else console.error("Invalid RSA public key")};t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3;var r=ot(t,e);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var n=i.toString(16);var s=n.length;for(var a=0;a<2*e-s;a++)n="0"+n;return n};t.prototype.setPrivate=function(t,e,r){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);this.d=U(r,16)}else console.error("Invalid RSA private key")};t.prototype.setPrivateEx=function(t,e,r,i,n,s,a,o){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);this.d=U(r,16);this.p=U(i,16);this.q=U(n,16);this.dmp1=U(s,16);this.dmq1=U(a,16);this.coeff=U(o,16)}else console.error("Invalid RSA private key")};t.prototype.generate=function(t,e){var r=new st;var i=t>>1;this.e=parseInt(e,16);var n=new C(e,16);for(;;){for(;;){this.p=new C(t-i,1,r);if(0==this.p.subtract(C.ONE).gcd(n).compareTo(C.ONE)&&this.p.isProbablePrime(10))break}for(;;){this.q=new C(i,1,r);if(0==this.q.subtract(C.ONE).gcd(n).compareTo(C.ONE)&&this.q.isProbablePrime(10))break}if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q;this.q=s}var a=this.p.subtract(C.ONE);var o=this.q.subtract(C.ONE);var u=a.multiply(o);if(0==u.gcd(n).compareTo(C.ONE)){this.n=this.p.multiply(this.q);this.d=n.modInverse(u);this.dmp1=this.d.mod(a);this.dmq1=this.d.mod(o);this.coeff=this.q.modInverse(this.p);break}}};t.prototype.decrypt=function(t){var e=U(t,16);var r=this.doPrivate(e);if(null==r)return null;return ct(r,this.n.bitLength()+7>>3)};t.prototype.generateAsync=function(t,e,r){var i=new st;var n=t>>1;this.e=parseInt(e,16);var s=new C(e,16);var a=this;var o=function(){var e=function(){if(a.p.compareTo(a.q)<=0){var t=a.p;a.p=a.q;a.q=t}var e=a.p.subtract(C.ONE);var i=a.q.subtract(C.ONE);var n=e.multiply(i);if(0==n.gcd(s).compareTo(C.ONE)){a.n=a.p.multiply(a.q);a.d=s.modInverse(n);a.dmp1=a.d.mod(e);a.dmq1=a.d.mod(i);a.coeff=a.q.modInverse(a.p);setTimeout((function(){r()}),0)}else setTimeout(o,0)};var u=function(){a.q=H();a.q.fromNumberAsync(n,1,i,(function(){a.q.subtract(C.ONE).gcda(s,(function(t){if(0==t.compareTo(C.ONE)&&a.q.isProbablePrime(10))setTimeout(e,0);else setTimeout(u,0)}))}))};var c=function(){a.p=H();a.p.fromNumberAsync(t-n,1,i,(function(){a.p.subtract(C.ONE).gcda(s,(function(t){if(0==t.compareTo(C.ONE)&&a.p.isProbablePrime(10))setTimeout(u,0);else setTimeout(c,0)}))}))};setTimeout(c,0)};setTimeout(o,0)};t.prototype.sign=function(t,e,r){var i=ht(r);var n=i+e(t).toString();var s=at(n,this.n.bitLength()/4);if(null==s)return null;var a=this.doPrivate(s);if(null==a)return null;var o=a.toString(16);if(0==(1&o.length))return o;else return"0"+o};t.prototype.verify=function(t,e,r){var i=U(e,16);var n=this.doPublic(i);if(null==n)return null;var s=n.toString(16).replace(/^1f+00/,"");var a=dt(s);return a==r(t).toString()};t.prototype.encryptLong=function(t){var e=this;var r="";var i=(this.n.bitLength()+7>>3)-11;var n=this.setSplitChn(t,i);n.forEach((function(t){r+=e.encrypt(t)}));return r};t.prototype.decryptLong=function(t){var e="";var r=this.n.bitLength()+7>>3;var i=2*r;if(t.length>i){var n=t.match(new RegExp(".{1,"+i+"}","g"))||[];var s=[];for(var a=0;a<n.length;a++){var o=U(n[a],16);var u=this.doPrivate(o);if(null==u)return null;s.push(u)}e=lt(s,r)}else e=this.decrypt(t);return e};t.prototype.setSplitChn=function(t,e,r){if(void 0===r)r=[];var i=t.split("");var n=0;for(var s=0;s<i.length;s++){var a=i[s].charCodeAt(0);if(a<=127)n+=1;else if(a<=2047)n+=2;else if(a<=65535)n+=3;else n+=4;if(n>e){var o=t.substring(0,s);r.push(o);return this.setSplitChn(t.substring(s),e,r)}}r.push(t);return r};return t}();function ct(t,e){var r=t.toByteArray();var i=0;while(i<r.length&&0==r[i])++i;if(r.length-i!=e-1||2!=r[i])return null;++i;while(0!=r[i])if(++i>=r.length)return null;var n="";while(++i<r.length){var s=255&r[i];if(s<128)n+=String.fromCharCode(s);else if(s>191&&s<224){n+=String.fromCharCode((31&s)<<6|63&r[i+1]);++i}else{n+=String.fromCharCode((15&s)<<12|(63&r[i+1])<<6|63&r[i+2]);i+=2}}return n}function lt(t,e){var r=[];for(var i=0;i<t.length;i++){var n=t[i];var s=n.toByteArray();var a=0;while(a<s.length&&0==s[a])++a;if(s.length-a!=e-1||2!=s[a])return null;++a;while(0!=s[a])if(++a>=s.length)return null;r=r.concat(s.slice(a+1))}var o=r;var u=-1;var c="";while(++u<o.length){var l=255&o[u];if(l<128)c+=String.fromCharCode(l);else if(l>191&&l<224){c+=String.fromCharCode((31&l)<<6|63&o[u+1]);++u}else{c+=String.fromCharCode((15&l)<<12|(63&o[u+1])<<6|63&o[u+2]);u+=2}}return c}var ft={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function ht(t){return ft[t]||""}function dt(t){for(var e in ft)if(ft.hasOwnProperty(e)){var r=ft[e];var i=r.length;if(t.substr(0,i)==r)return t.substr(i)}return t}var vt={};vt.lang={extend:function(t,e,r){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");var i=function(){};i.prototype=e.prototype;t.prototype=new i;t.prototype.constructor=t;t.superclass=e.prototype;if(e.prototype.constructor==Object.prototype.constructor)e.prototype.constructor=e;if(r){var n;for(n in r)t.prototype[n]=r[n];var s=function(){},a=["toString","valueOf"];try{if(/MSIE/.test(navigator.userAgent))s=function(t,e){for(n=0;n<a.length;n+=1){var r=a[n],i=e[r];if("function"===typeof i&&i!=Object.prototype[r])t[r]=i}}}catch(t){}s(t.prototype,r)}}};var pt={};if("undefined"==typeof pt.asn1||!pt.asn1)pt.asn1={};pt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);if(e.length%2==1)e="0"+e;return e};this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1)){if(e.length%2==1)e="0"+e;else if(!e.match(/^[0-7]/))e="00"+e}else{var r=e.substr(1);var i=r.length;if(i%2==1)i+=1;else if(!e.match(/^[0-7]/))i+=2;var n="";for(var s=0;s<i;s++)n+="f";var a=new C(n,16);var o=a.xor(t).add(C.ONE);e=o.toString(16).replace(/^-/,"")}return e};this.getPEMStringFromHex=function(t,e){return hextopem(t,e)};this.newObject=function(t){var e=pt,r=e.asn1,i=r.DERBoolean,n=r.DERInteger,s=r.DERBitString,a=r.DEROctetString,o=r.DERNull,u=r.DERObjectIdentifier,c=r.DEREnumerated,l=r.DERUTF8String,f=r.DERNumericString,h=r.DERPrintableString,d=r.DERTeletexString,v=r.DERIA5String,p=r.DERUTCTime,g=r.DERGeneralizedTime,y=r.DERSequence,m=r.DERSet,w=r.DERTaggedObject,S=r.ASN1Util.newObject;var _=Object.keys(t);if(1!=_.length)throw"key of param shall be only one.";var b=_[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+b+":"))throw"undefined key: "+b;if("bool"==b)return new i(t[b]);if("int"==b)return new n(t[b]);if("bitstr"==b)return new s(t[b]);if("octstr"==b)return new a(t[b]);if("null"==b)return new o(t[b]);if("oid"==b)return new u(t[b]);if("enum"==b)return new c(t[b]);if("utf8str"==b)return new l(t[b]);if("numstr"==b)return new f(t[b]);if("prnstr"==b)return new h(t[b]);if("telstr"==b)return new d(t[b]);if("ia5str"==b)return new v(t[b]);if("utctime"==b)return new p(t[b]);if("gentime"==b)return new g(t[b]);if("seq"==b){var E=t[b];var D=[];for(var M=0;M<E.length;M++){var T=S(E[M]);D.push(T)}return new y({array:D})}if("set"==b){var E=t[b];var D=[];for(var M=0;M<E.length;M++){var T=S(E[M]);D.push(T)}return new m({array:D})}if("tag"==b){var I=t[b];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var A=S(I[2]);return new w({tag:I[0],explicit:I[1],obj:A})}else{var x={};if(void 0!==I.explicit)x.explicit=I.explicit;if(void 0!==I.tag)x.tag=I.tag;if(void 0===I.obj)throw"obj shall be specified for 'tag'.";x.obj=S(I.obj);return new w(x)}}};this.jsonToASN1HEX=function(t){var e=this.newObject(t);return e.getEncodedHex()}};pt.asn1.ASN1Util.oidHexToInt=function(t){var e="";var r=parseInt(t.substr(0,2),16);var i=Math.floor(r/40);var n=r%40;var e=i+"."+n;var s="";for(var a=2;a<t.length;a+=2){var o=parseInt(t.substr(a,2),16);var u=("00000000"+o.toString(2)).slice(-8);s+=u.substr(1,7);if("0"==u.substr(0,1)){var c=new C(s,2);e=e+"."+c.toString(10);s=""}}return e};pt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);if(1==e.length)e="0"+e;return e};var r=function(t){var r="";var i=new C(t,10);var n=i.toString(2);var s=7-n.length%7;if(7==s)s=0;var a="";for(var o=0;o<s;o++)a+="0";n=a+n;for(var o=0;o<n.length-1;o+=7){var u=n.substr(o,7);if(o!=n.length-7)u="1"+u;r+=e(parseInt(u,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="";var n=t.split(".");var s=40*parseInt(n[0])+parseInt(n[1]);i+=e(s);n.splice(0,2);for(var a=0;a<n.length;a++)i+=r(n[a]);return i};pt.asn1.ASN1Object=function(){var t=true;var e=null;var r="00";var i="00";var n="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+n.length+",v="+this.hV;var t=this.hV.length/2;var e=t.toString(16);if(e.length%2==1)e="0"+e;if(t<128)return e;else{var r=e.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var i=128+r;return i.toString(16)+e}};this.getEncodedHex=function(){if(null==this.hTLV||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false}return this.hTLV};this.getValueHex=function(){this.getEncodedHex();return this.hV};this.getFreshValueHex=function(){return""}};pt.asn1.DERAbstractString=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this);var e=null;var r=null;this.getString=function(){return this.s};this.setString=function(t){this.hTLV=null;this.isModified=true;this.s=t;this.hV=stohex(this.s)};this.setStringHex=function(t){this.hTLV=null;this.isModified=true;this.s=null;this.hV=t};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("string"==typeof t)this.setString(t);else if("undefined"!=typeof t["str"])this.setString(t["str"]);else if("undefined"!=typeof t["hex"])this.setStringHex(t["hex"])};vt.lang.extend(pt.asn1.DERAbstractString,pt.asn1.ASN1Object);pt.asn1.DERAbstractTime=function(t){pt.asn1.DERAbstractTime.superclass.constructor.call(this);var e=null;var r=null;this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e};this.formatDate=function(t,e,r){var i=this.zeroPadding;var n=this.localDateToUTC(t);var s=String(n.getFullYear());if("utc"==e)s=s.substr(2,2);var a=i(String(n.getMonth()+1),2);var o=i(String(n.getDate()),2);var u=i(String(n.getHours()),2);var c=i(String(n.getMinutes()),2);var l=i(String(n.getSeconds()),2);var f=s+a+o+u+c+l;if(true===r){var h=n.getMilliseconds();if(0!=h){var d=i(String(h),3);d=d.replace(/[0]+$/,"");f=f+"."+d}}return f+"Z"};this.zeroPadding=function(t,e){if(t.length>=e)return t;return new Array(e-t.length+1).join("0")+t};this.getString=function(){return this.s};this.setString=function(t){this.hTLV=null;this.isModified=true;this.s=t;this.hV=stohex(t)};this.setByDateValue=function(t,e,r,i,n,s){var a=new Date(Date.UTC(t,e-1,r,i,n,s,0));this.setByDate(a)};this.getFreshValueHex=function(){return this.hV}};vt.lang.extend(pt.asn1.DERAbstractTime,pt.asn1.ASN1Object);pt.asn1.DERAbstractStructured=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this);var e=null;this.setByASN1ObjectArray=function(t){this.hTLV=null;this.isModified=true;this.asn1Array=t};this.appendASN1Object=function(t){this.hTLV=null;this.isModified=true;this.asn1Array.push(t)};this.asn1Array=new Array;if("undefined"!=typeof t)if("undefined"!=typeof t["array"])this.asn1Array=t["array"]};vt.lang.extend(pt.asn1.DERAbstractStructured,pt.asn1.ASN1Object);pt.asn1.DERBoolean=function(){pt.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};vt.lang.extend(pt.asn1.DERBoolean,pt.asn1.ASN1Object);pt.asn1.DERInteger=function(t){pt.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(t){this.hTLV=null;this.isModified=true;this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)};this.setByInteger=function(t){var e=new C(String(t),10);this.setByBigInteger(e)};this.setValueHex=function(t){this.hV=t};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t["bigint"])this.setByBigInteger(t["bigint"]);else if("undefined"!=typeof t["int"])this.setByInteger(t["int"]);else if("number"==typeof t)this.setByInteger(t);else if("undefined"!=typeof t["hex"])this.setValueHex(t["hex"])};vt.lang.extend(pt.asn1.DERInteger,pt.asn1.ASN1Object);pt.asn1.DERBitString=function(t){if(void 0!==t&&"undefined"!==typeof t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}pt.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null;this.isModified=true;this.hV=t};this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null;this.isModified=true;this.hV=r+e};this.setByBinaryString=function(t){t=t.replace(/0+$/,"");var e=8-t.length%8;if(8==e)e=0;for(var r=0;r<=e;r++)t+="0";var i="";for(var r=0;r<t.length-1;r+=8){var n=t.substr(r,8);var s=parseInt(n,2).toString(16);if(1==s.length)s="0"+s;i+=s}this.hTLV=null;this.isModified=true;this.hV="0"+e+i};this.setByBooleanArray=function(t){var e="";for(var r=0;r<t.length;r++)if(true==t[r])e+="1";else e+="0";this.setByBinaryString(e)};this.newFalseArray=function(t){var e=new Array(t);for(var r=0;r<t;r++)e[r]=false;return e};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/))this.setHexValueIncludingUnusedBits(t);else if("undefined"!=typeof t["hex"])this.setHexValueIncludingUnusedBits(t["hex"]);else if("undefined"!=typeof t["bin"])this.setByBinaryString(t["bin"]);else if("undefined"!=typeof t["array"])this.setByBooleanArray(t["array"])};vt.lang.extend(pt.asn1.DERBitString,pt.asn1.ASN1Object);pt.asn1.DEROctetString=function(t){if(void 0!==t&&"undefined"!==typeof t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}pt.asn1.DEROctetString.superclass.constructor.call(this,t);this.hT="04"};vt.lang.extend(pt.asn1.DEROctetString,pt.asn1.DERAbstractString);pt.asn1.DERNull=function(){pt.asn1.DERNull.superclass.constructor.call(this);this.hT="05";this.hTLV="0500"};vt.lang.extend(pt.asn1.DERNull,pt.asn1.ASN1Object);pt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);if(1==e.length)e="0"+e;return e};var r=function(t){var r="";var i=new C(t,10);var n=i.toString(2);var s=7-n.length%7;if(7==s)s=0;var a="";for(var o=0;o<s;o++)a+="0";n=a+n;for(var o=0;o<n.length-1;o+=7){var u=n.substr(o,7);if(o!=n.length-7)u="1"+u;r+=e(parseInt(u,2))}return r};pt.asn1.DERObjectIdentifier.superclass.constructor.call(this);this.hT="06";this.setValueHex=function(t){this.hTLV=null;this.isModified=true;this.s=null;this.hV=t};this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="";var n=t.split(".");var s=40*parseInt(n[0])+parseInt(n[1]);i+=e(s);n.splice(0,2);for(var a=0;a<n.length;a++)i+=r(n[a]);this.hTLV=null;this.isModified=true;this.s=null;this.hV=i};this.setValueName=function(t){var e=pt.asn1.x509.OID.name2oid(t);if(""!==e)this.setValueOidString(e);else throw"DERObjectIdentifier oidName undefined: "+t};this.getFreshValueHex=function(){return this.hV};if(void 0!==t)if("string"===typeof t)if(t.match(/^[0-2].[0-9.]+$/))this.setValueOidString(t);else this.setValueName(t);else if(void 0!==t.oid)this.setValueOidString(t.oid);else if(void 0!==t.hex)this.setValueHex(t.hex);else if(void 0!==t.name)this.setValueName(t.name)};vt.lang.extend(pt.asn1.DERObjectIdentifier,pt.asn1.ASN1Object);pt.asn1.DEREnumerated=function(t){pt.asn1.DEREnumerated.superclass.constructor.call(this);this.hT="0a";this.setByBigInteger=function(t){this.hTLV=null;this.isModified=true;this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)};this.setByInteger=function(t){var e=new C(String(t),10);this.setByBigInteger(e)};this.setValueHex=function(t){this.hV=t};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t["int"])this.setByInteger(t["int"]);else if("number"==typeof t)this.setByInteger(t);else if("undefined"!=typeof t["hex"])this.setValueHex(t["hex"])};vt.lang.extend(pt.asn1.DEREnumerated,pt.asn1.ASN1Object);pt.asn1.DERUTF8String=function(t){pt.asn1.DERUTF8String.superclass.constructor.call(this,t);this.hT="0c"};vt.lang.extend(pt.asn1.DERUTF8String,pt.asn1.DERAbstractString);pt.asn1.DERNumericString=function(t){pt.asn1.DERNumericString.superclass.constructor.call(this,t);this.hT="12"};vt.lang.extend(pt.asn1.DERNumericString,pt.asn1.DERAbstractString);pt.asn1.DERPrintableString=function(t){pt.asn1.DERPrintableString.superclass.constructor.call(this,t);this.hT="13"};vt.lang.extend(pt.asn1.DERPrintableString,pt.asn1.DERAbstractString);pt.asn1.DERTeletexString=function(t){pt.asn1.DERTeletexString.superclass.constructor.call(this,t);this.hT="14"};vt.lang.extend(pt.asn1.DERTeletexString,pt.asn1.DERAbstractString);pt.asn1.DERIA5String=function(t){pt.asn1.DERIA5String.superclass.constructor.call(this,t);this.hT="16"};vt.lang.extend(pt.asn1.DERIA5String,pt.asn1.DERAbstractString);pt.asn1.DERUTCTime=function(t){pt.asn1.DERUTCTime.superclass.constructor.call(this,t);this.hT="17";this.setByDate=function(t){this.hTLV=null;this.isModified=true;this.date=t;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s)};this.getFreshValueHex=function(){if("undefined"==typeof this.date&&"undefined"==typeof this.s){this.date=new Date;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s)}return this.hV};if(void 0!==t)if(void 0!==t.str)this.setString(t.str);else if("string"==typeof t&&t.match(/^[0-9]{12}Z$/))this.setString(t);else if(void 0!==t.hex)this.setStringHex(t.hex);else if(void 0!==t.date)this.setByDate(t.date)};vt.lang.extend(pt.asn1.DERUTCTime,pt.asn1.DERAbstractTime);pt.asn1.DERGeneralizedTime=function(t){pt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t);this.hT="18";this.withMillis=false;this.setByDate=function(t){this.hTLV=null;this.isModified=true;this.date=t;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=stohex(this.s)};this.getFreshValueHex=function(){if(void 0===this.date&&void 0===this.s){this.date=new Date;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=stohex(this.s)}return this.hV};if(void 0!==t){if(void 0!==t.str)this.setString(t.str);else if("string"==typeof t&&t.match(/^[0-9]{14}Z$/))this.setString(t);else if(void 0!==t.hex)this.setStringHex(t.hex);else if(void 0!==t.date)this.setByDate(t.date);if(true===t.millis)this.withMillis=true}};vt.lang.extend(pt.asn1.DERGeneralizedTime,pt.asn1.DERAbstractTime);pt.asn1.DERSequence=function(t){pt.asn1.DERSequence.superclass.constructor.call(this,t);this.hT="30";this.getFreshValueHex=function(){var t="";for(var e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t+=r.getEncodedHex()}this.hV=t;return this.hV}};vt.lang.extend(pt.asn1.DERSequence,pt.asn1.DERAbstractStructured);pt.asn1.DERSet=function(t){pt.asn1.DERSet.superclass.constructor.call(this,t);this.hT="31";this.sortFlag=true;this.getFreshValueHex=function(){var t=new Array;for(var e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex())}if(true==this.sortFlag)t.sort();this.hV=t.join("");return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t.sortflag&&false==t.sortflag)this.sortFlag=false};vt.lang.extend(pt.asn1.DERSet,pt.asn1.DERAbstractStructured);pt.asn1.DERTaggedObject=function(t){pt.asn1.DERTaggedObject.superclass.constructor.call(this);this.hT="a0";this.hV="";this.isExplicit=true;this.asn1Object=null;this.setASN1Object=function(t,e,r){this.hT=e;this.isExplicit=t;this.asn1Object=r;if(this.isExplicit){this.hV=this.asn1Object.getEncodedHex();this.hTLV=null;this.isModified=true}else{this.hV=null;this.hTLV=r.getEncodedHex();this.hTLV=this.hTLV.replace(/^../,e);this.isModified=false}};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t){if("undefined"!=typeof t["tag"])this.hT=t["tag"];if("undefined"!=typeof t["explicit"])this.isExplicit=t["explicit"];if("undefined"!=typeof t["obj"]){this.asn1Object=t["obj"];this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)}}};vt.lang.extend(pt.asn1.DERTaggedObject,pt.asn1.ASN1Object);var gt=void 0&&(void 0).__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var yt=function(t){gt(e,t);function e(r){var i=t.call(this)||this;if(r)if("string"===typeof r)i.parseKey(r);else if(e.hasPrivateKeyProperty(r)||e.hasPublicKeyProperty(r))i.parsePropertiesFrom(r);return i}e.prototype.parseKey=function(t){try{var e=0;var r=0;var i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/;var n=i.test(t)?y.decode(t):w.unarmor(t);var s=I.decode(n);if(3===s.sub.length)s=s.sub[2].sub[0];if(9===s.sub.length){e=s.sub[1].getHexStringValue();this.n=U(e,16);r=s.sub[2].getHexStringValue();this.e=parseInt(r,16);var a=s.sub[3].getHexStringValue();this.d=U(a,16);var o=s.sub[4].getHexStringValue();this.p=U(o,16);var u=s.sub[5].getHexStringValue();this.q=U(u,16);var c=s.sub[6].getHexStringValue();this.dmp1=U(c,16);var l=s.sub[7].getHexStringValue();this.dmq1=U(l,16);var f=s.sub[8].getHexStringValue();this.coeff=U(f,16)}else if(2===s.sub.length){var h=s.sub[1];var d=h.sub[0];e=d.sub[0].getHexStringValue();this.n=U(e,16);r=d.sub[1].getHexStringValue();this.e=parseInt(r,16)}else return false;return true}catch(t){return false}};e.prototype.getPrivateBaseKey=function(){var t={array:[new pt.asn1.DERInteger({int:0}),new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e}),new pt.asn1.DERInteger({bigint:this.d}),new pt.asn1.DERInteger({bigint:this.p}),new pt.asn1.DERInteger({bigint:this.q}),new pt.asn1.DERInteger({bigint:this.dmp1}),new pt.asn1.DERInteger({bigint:this.dmq1}),new pt.asn1.DERInteger({bigint:this.coeff})]};var e=new pt.asn1.DERSequence(t);return e.getEncodedHex()};e.prototype.getPrivateBaseKeyB64=function(){return d(this.getPrivateBaseKey())};e.prototype.getPublicBaseKey=function(){var t=new pt.asn1.DERSequence({array:[new pt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new pt.asn1.DERNull]});var e=new pt.asn1.DERSequence({array:[new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e})]});var r=new pt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});var i=new pt.asn1.DERSequence({array:[t,r]});return i.getEncodedHex()};e.prototype.getPublicBaseKeyB64=function(){return d(this.getPublicBaseKey())};e.wordwrap=function(t,e){e=e||64;if(!t)return t;var r="(.{1,"+e+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")};e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n";t+="-----END RSA PRIVATE KEY-----";return t};e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n";t+="-----END PUBLIC KEY-----";return t};e.hasPublicKeyProperty=function(t){t=t||{};return t.hasOwnProperty("n")&&t.hasOwnProperty("e")};e.hasPrivateKeyProperty=function(t){t=t||{};return t.hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")};e.prototype.parsePropertiesFrom=function(t){this.n=t.n;this.e=t.e;if(t.hasOwnProperty("d")){this.d=t.d;this.p=t.p;this.q=t.q;this.dmp1=t.dmp1;this.dmq1=t.dmq1;this.coeff=t.coeff}};return e}(ut);const mt={i:"3.2.1"};var wt=function(){function t(t){if(void 0===t)t={};t=t||{};this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024;this.default_public_exponent=t.default_public_exponent||"010001";this.log=t.log||false;this.key=null}t.prototype.setKey=function(t){if(this.log&&this.key)console.warn("A key was already set, overriding existing.");this.key=new yt(t)};t.prototype.setPrivateKey=function(t){this.setKey(t)};t.prototype.setPublicKey=function(t){this.setKey(t)};t.prototype.decrypt=function(t){try{return this.getKey().decrypt(t)}catch(t){return false}};t.prototype.encrypt=function(t){try{return this.getKey().encrypt(t)}catch(t){return false}};t.prototype.encryptLong=function(t){try{return d(this.getKey().encryptLong(t))}catch(t){return false}};t.prototype.decryptLong=function(t){try{return this.getKey().decryptLong(t)}catch(t){return false}};t.prototype.sign=function(t,e,r){try{return d(this.getKey().sign(t,e,r))}catch(t){return false}};t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,v(e),r)}catch(t){return false}};t.prototype.getKey=function(t){if(!this.key){this.key=new yt;if(t&&"[object Function]"==={}.toString.call(t)){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key};t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()};t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()};t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()};t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()};t.version=mt.i;return t}();const St=wt},2480:()=>{}};var e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={id:i,loaded:false,exports:{}};t[i].call(s.exports,s,s.exports,r);s.loaded=true;return s.exports}(()=>{r.d=(t,e)=>{for(var i in e)if(r.o(e,i)&&!r.o(t,i))Object.defineProperty(t,i,{enumerable:true,get:e[i]})}})();(()=>{r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()})();(()=>{r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{r.r=t=>{if("undefined"!==typeof Symbol&&Symbol.toStringTag)Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});Object.defineProperty(t,"__esModule",{value:true})}})();(()=>{r.nmd=t=>{t.paths=[];if(!t.children)t.children=[];return t}})();var i=r(9021);return i})()));
|
87
|
+
}}}}e["default"]=r},4486:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(3854));class s{constructor(){this.systemInfo=wx.getSystemInfoSync()}os(){return n.default.getStr(this.systemInfo,"platform")}osVersion(){return n.default.getStr(this.systemInfo,"system")}model(){return n.default.getStr(this.systemInfo,"model")}brand(){return n.default.getStr(this.systemInfo,"brand")}platform(){return"MP-WEIXIN"}platformVersion(){return n.default.getStr(this.systemInfo,"version")}language(){return n.default.getStr(this.systemInfo,"language")}platformId(){if(wx.canIUse("getAccountInfoSync"))return wx.getAccountInfoSync().miniProgram.appId;return""}getNetworkType(t){wx.getNetworkType({success:e=>{var r;null===(r=t.success)||void 0===r||r.call(t.success,{networkType:e.networkType})},fail:t.fail})}onNetworkStatusChange(t){wx.onNetworkStatusChange(t)}}e["default"]=s},5867:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{set(t){wx.setStorage(t)}setSync(t,e){wx.setStorageSync(t,e)}get(t){wx.getStorage(t)}getSync(t){return wx.getStorageSync(t)}}e["default"]=r},7006:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{connect(t){let e=wx.connectSocket({url:t.url,header:t.header,protocols:t.protocols,success:t.success,fail:t.fail,complete:t.complete});return{onOpen:e.onOpen,send:e.send,onMessage:e.onMessage,onError:e.onError,onClose:e.onClose,close:e.close}}}e["default"]=r},6893:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});var r;(function(t){t.SDK_VERSION="GTMP-2.0.4.dcloud";t.DEFAULT_SOCKET_URL="wss://wshzn.gepush.com:5223/nws";t.SOCKET_PROTOCOL_VERSION="1.0";t.SERVER_PUBLIC_KEY="MHwwDQYJKoZIhvcNAQEBBQADawAwaAJhAJp1rROuvBF7sBSnvLaesj2iFhMcY8aXyLvpnNLKs2wjL3JmEnyr++SlVa35liUlzi83tnAFkn3A9GB7pHBNzawyUkBh8WUhq5bnFIkk2RaDa6+5MpG84DEv52p7RR+aWwIDAQAB";t.SERVER_PUBLIC_KEY_ID="69d747c4b9f641baf4004be4297e9f3b";t.ID_U_2_G=true})(r||(r={}));e["default"]=r},7555:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7002));const s=i(r(529));const a=i(r(6379));class o{static init(t){var e;if(this.inited)return;try{this.checkAppid(t.appid);this.inited=true;s.default.info(`init: appid=${t.appid}`);a.default.init(t);n.default.connect()}catch(r){this.inited=false;null===(e=t.onError)||void 0===e||e.call(t.onError,{error:r});throw r}}static enableSocket(t){this.checkInit();n.default.enableSocket(t)}static checkInit(){if(!this.inited)throw new Error(`not init, please invoke init method firstly`)}static checkAppid(t){if(null==t||void 0==t||""==t.trim())throw new Error(`invalid appid ${t}`)}}o.inited=false;e["default"]=o},6379:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));const s=i(r(8506));const a=i(r(6893));const o=i(r(7002));const u=i(r(529));const c=i(r(4685));const l=i(r(2323));class f{static init(t){var e;if(a.default.ID_U_2_G)this.appid=l.default.to_getui(t.appid);else this.appid=t.appid;this.onError=t.onError;this.onClientId=t.onClientId;this.onlineState=t.onlineState;this.onPushMsg=t.onPushMsg;if(this.appid!=s.default.getSync(s.default.KEY_APPID,this.appid)){u.default.info("appid changed, clear session and cid");s.default.setSync(s.default.KEY_CID,"");s.default.setSync(s.default.KEY_SESSION,"")}s.default.setSync(s.default.KEY_APPID,this.appid);this.cid=s.default.getSync(s.default.KEY_CID,this.cid);if(this.cid)null===(e=this.onClientId)||void 0===e||e.call(this.onClientId,{cid:f.cid});this.session=s.default.getSync(s.default.KEY_SESSION,this.session);this.deviceId=s.default.getSync(s.default.KEY_DEVICE_ID,this.deviceId);this.regId=s.default.getSync(s.default.KEY_REGID,this.regId);if(!this.regId){this.regId=this.createRegId();s.default.set({key:s.default.KEY_REGID,data:this.regId})}this.socketUrl=s.default.getSync(s.default.KEY_SOCKET_URL,this.socketUrl);let r=this;c.default.getNetworkType({success:t=>{r.networkType=t.networkType;r.networkConnected="none"!=r.networkType&&""!=r.networkType}});c.default.onNetworkStatusChange((t=>{r.networkConnected=t.isConnected;r.networkType=t.networkType;if(r.networkConnected)o.default.reconnect(100)}))}static createRegId(){return`M-V${n.default.md5Hex(this.getUuid())}-${(new Date).getTime()}`}static getUuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){let e=16*Math.random()|0,r="x"===t?e:3&e|8;return r.toString(16)}))}}f.appid="";f.cid="";f.regId="";f.session="";f.deviceId="";f.packetId=1;f.online=false;f.socketUrl=a.default.DEFAULT_SOCKET_URL;f.publicKeyId=a.default.SERVER_PUBLIC_KEY_ID;f.publicKey=a.default.SERVER_PUBLIC_KEY;f.lastAliasTime=0;f.networkConnected=true;f.networkType="none";e["default"]=f},9586:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n,s;Object.defineProperty(e,"__esModule",{value:true});const a=i(r(661));const o=r(4198);const u=i(r(6379));class c extends a.default{constructor(){super(...arguments);this.actionMsgData=new l}static initActionMsg(t,...e){super.initMsg(t);t.command=a.default.Command.CLIENT_MSG;t.data=t.actionMsgData=l.create();return t}static parseActionMsg(t,e){super.parseMsg(t,e);t.actionMsgData=l.parse(t.data);return t}send(){let t=setTimeout((()=>{var t;if(c.waitingLoginMsgMap.has(this.actionMsgData.msgId)||c.waitingResponseMsgMap.has(this.actionMsgData.msgId)){c.waitingLoginMsgMap.delete(this.actionMsgData.msgId);c.waitingResponseMsgMap.delete(this.actionMsgData.msgId);null===(t=this.callback)||void 0===t||t.call(this.callback,{resultCode:o.ErrorCode.TIME_OUT,message:"waiting time out"})}}),1e4);if(!u.default.online){c.waitingLoginMsgMap.set(this.actionMsgData.msgId,this);return}if(this.actionMsgData.msgAction!=c.ClientAction.RECEIVED)c.waitingResponseMsgMap.set(this.actionMsgData.msgId,this);super.send()}receive(){}static sendWaitingMessages(){let t=this.waitingLoginMsgMap.keys();let e;while(e=t.next(),!e.done){let t=this.waitingLoginMsgMap.get(e.value);this.waitingLoginMsgMap.delete(e.value);null===t||void 0===t||t.send()}}static getWaitingResponseMessage(t){return c.waitingResponseMsgMap.get(t)}static removeWaitingResponseMessage(t){let e=c.waitingResponseMsgMap.get(t);if(e)c.waitingResponseMsgMap.delete(t);return e}}c.ServerAction=(n=class{},n.PUSH_MESSAGE="pushmessage",n.REDIRECT_SERVER="redirect_server",n.ADD_PHONE_INFO_RESULT="addphoneinfo",n.SET_MODE_RESULT="set_mode_result",n.SET_TAG_RESULT="settag_result",n.BIND_ALIAS_RESULT="response_bind",n.UNBIND_ALIAS_RESULT="response_unbind",n.FEED_BACK_RESULT="pushmessage_feedback",n.RECEIVED="received",n);c.ClientAction=(s=class{},s.ADD_PHONE_INFO="addphoneinfo",s.SET_MODE="set_mode",s.FEED_BACK="pushmessage_feedback",s.SET_TAGS="set_tag",s.BIND_ALIAS="bind_alias",s.UNBIND_ALIAS="unbind_alias",s.RECEIVED="received",s);c.waitingLoginMsgMap=new Map;c.waitingResponseMsgMap=new Map;class l{constructor(){this.appId="";this.cid="";this.msgId="";this.msgAction="";this.msgData="";this.msgExtraData=""}static create(){let t=new l;t.appId=u.default.appid;t.cid=u.default.cid;t.msgId=(2147483647&(new Date).getTime()).toString();return t}static parse(t){let e=new l;let r=JSON.parse(t);e.appId=r.appId;e.cid=r.cid;e.msgId=r.msgId;e.msgAction=r.msgAction;e.msgData=r.msgData;e.msgExtraData=r.msgExtraData;return e}}e["default"]=c},4516:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(4685));const s=i(r(8506));const a=i(r(6893));const o=r(4198);const u=i(r(9586));const c=i(r(6379));class l extends u.default{constructor(){super(...arguments);this.addPhoneInfoData=new f}static create(){let t=new l;super.initActionMsg(t);t.callback=e=>{if(e.resultCode!=o.ErrorCode.SUCCESS&&e.resultCode!=o.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){t.send()}),30*1e3);else s.default.set({key:s.default.KEY_ADD_PHONE_INFO_TIME,data:(new Date).getTime()})};t.actionMsgData.msgAction=u.default.ClientAction.ADD_PHONE_INFO;t.addPhoneInfoData=f.create();t.actionMsgData.msgData=JSON.stringify(t.addPhoneInfoData);return t}send(){let t=(new Date).getTime();let e=s.default.getSync(s.default.KEY_ADD_PHONE_INFO_TIME,0);if(t-e<24*60*60*1e3)return;super.send()}}class f{constructor(){this.model="";this.brand="";this.system_version="";this.version="";this.deviceid="";this.type=""}static create(){let t=new f;t.model=n.default.model();t.brand=n.default.brand();t.system_version=n.default.osVersion();t.version=a.default.SDK_VERSION;t.device_token="";t.imei="";t.oaid="";t.mac="";t.idfa="";t.type="MINIPROGRAM";t.deviceid=`${t.type}-${c.default.deviceId}`;t.extra={os:n.default.os(),platform:n.default.platform(),platformVersion:n.default.platformVersion(),platformId:n.default.platformId(),language:n.default.language(),userAgent:n.default.userAgent()};return t}}e["default"]=l},8723:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n,s;Object.defineProperty(e,"__esModule",{value:true});const a=i(r(6379));const o=r(4198);const u=i(r(9586));class c extends u.default{constructor(){super(...arguments);this.feedbackData=new l}static create(t,e){let r=new c;super.initActionMsg(r);r.callback=t=>{if(t.resultCode!=o.ErrorCode.SUCCESS&&t.resultCode!=o.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){r.send()}),30*1e3)};r.feedbackData=l.create(t,e);r.actionMsgData.msgAction=u.default.ClientAction.FEED_BACK;r.actionMsgData.msgData=JSON.stringify(r.feedbackData);return r}send(){super.send()}}c.ActionId=(n=class{},n.RECEIVE="0",n.MP_RECEIVE="210000",n.WEB_RECEIVE="220000",n.BEGIN="1",n);c.RESULT=(s=class{},s.OK="ok",s);class l{constructor(){this.messageid="";this.appkey="";this.appid="";this.taskid="";this.actionid="";this.result="";this.timestamp=""}static create(t,e){let r=new l;r.messageid=t.pushMessageData.messageid;r.appkey=t.pushMessageData.appKey;r.appid=a.default.appid;r.taskid=t.pushMessageData.taskId;r.actionid=e;r.result=c.RESULT.OK;r.timestamp=(new Date).getTime().toString();return r}}e["default"]=c},6362:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));class s extends n.default{static create(){let t=new s;super.initMsg(t);t.command=n.default.Command.HEART_BEAT;return t}}e["default"]=s},1386:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));const s=i(r(6379));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.keyNegotiateData=new u}static create(){let t=new o;super.initMsg(t);t.command=a.default.Command.KEY_NEGOTIATE;n.default.resetKey();t.data=t.keyNegotiateData=u.create();return t}send(){super.send()}}class u{constructor(){this.appId="";this.rsaPublicKeyId="";this.algorithm="";this.secretKey="";this.iv=""}static create(){let t=new u;t.appId=s.default.appid;t.rsaPublicKeyId=s.default.publicKeyId;t.algorithm="AES";t.secretKey=n.default.getEncryptedSecretKey();t.iv=n.default.getEncryptedIV();return t}}e["default"]=o},1280:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));const s=i(r(6667));const a=i(r(8858));const o=i(r(529));const u=i(r(6379));class c extends n.default{constructor(){super(...arguments);this.keyNegotiateResultData=new l}static parse(t){let e=new c;super.parseMsg(e,t);e.keyNegotiateResultData=l.parse(e.data);return e}receive(){var t,e;if(0!=this.keyNegotiateResultData.errorCode){o.default.error(`key negotiate fail: ${this.data}`);null===(t=u.default.onError)||void 0===t||t.call(u.default.onError,{error:`key negotiate fail: ${this.data}`});return}let r=this.keyNegotiateResultData.encryptType.split("/");if(!s.default.algorithmMap.has(r[0].trim().toLowerCase())||!s.default.modeMap.has(r[1].trim().toLowerCase())||!s.default.paddingMap.has(r[2].trim().toLowerCase())){o.default.error(`key negotiate fail: ${this.data}`);null===(e=u.default.onError)||void 0===e||e.call(u.default.onError,{error:`key negotiate fail: ${this.data}`});return}s.default.setEncryptParams(r[0].trim().toLowerCase(),r[1].trim().toLowerCase(),r[2].trim().toLowerCase());a.default.create().send()}}class l{constructor(){this.errorCode=-1;this.errorMsg="";this.encryptType=""}static parse(t){let e=new l;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.encryptType=r.encryptType;return e}}e["default"]=c},8858:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6379));const s=i(r(6667));const a=i(r(661));const o=i(r(4534));class u extends a.default{constructor(){super(...arguments);this.loginData=new c}static create(){let t=new u;super.initMsg(t);t.command=a.default.Command.LOGIN;t.data=t.loginData=c.create();return t}send(){if(!this.loginData.session||n.default.cid!=s.default.md5Hex(this.loginData.session)){o.default.create().send();return}super.send()}}class c{constructor(){this.appId="";this.session=""}static create(){let t=new c;t.appId=n.default.appid;t.session=n.default.session;return t}}e["default"]=u},1606:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(661));const a=i(r(6379));const o=i(r(9586));const u=i(r(4516));const c=i(r(8858));class l extends s.default{constructor(){super(...arguments);this.loginResultData=new f}static parse(t){let e=new l;super.parseMsg(e,t);e.loginResultData=f.parse(e.data);return e}receive(){var t;if(0!=this.loginResultData.errorCode){this.data;a.default.session=a.default.cid="";n.default.setSync(n.default.KEY_CID,"");n.default.setSync(n.default.KEY_SESSION,"");c.default.create().send();return}if(!a.default.online){a.default.online=true;null===(t=a.default.onlineState)||void 0===t||t.call(a.default.onlineState,{online:a.default.online})}o.default.sendWaitingMessages();u.default.create().send()}}class f{constructor(){this.errorCode=-1;this.errorMsg="";this.session=""}static parse(t){let e=new f;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.session=r.session;return e}}e["default"]=l},661:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(9593));const a=i(r(7002));const o=i(r(6893));const u=i(r(6379));class c{constructor(){this.version="";this.command=0;this.packetId=0;this.timeStamp=0;this.data="";this.signature=""}static initMsg(t,...e){t.version=o.default.SOCKET_PROTOCOL_VERSION;t.command=0;t.timeStamp=(new Date).getTime();return t}static parseMsg(t,e){let r=JSON.parse(e);t.version=r.version;t.command=r.command;t.packetId=r.packetId;t.timeStamp=r.timeStamp;t.data=r.data;t.signature=r.signature;return t}stringify(){return JSON.stringify(this,["version","command","packetId","timeStamp","data","signature"])}send(){if(!a.default.isAvailable())return;this.packetId=u.default.packetId++;if(this.temp)this.data=this.temp;else this.temp=this.data;this.data=JSON.stringify(this.data);this.stringify();if(this.command!=c.Command.HEART_BEAT){s.default.sign(this);if(this.data&&this.command!=c.Command.KEY_NEGOTIATE)s.default.encrypt(this)}a.default.send(this.stringify())}}c.Command=(n=class{},n.HEART_BEAT=0,n.KEY_NEGOTIATE=1,n.KEY_NEGOTIATE_RESULT=16,n.REGISTER=2,n.REGISTER_RESULT=32,n.LOGIN=3,n.LOGIN_RESULT=48,n.LOGOUT=4,n.LOGOUT_RESULT=64,n.CLIENT_MSG=5,n.SERVER_MSG=80,n.SERVER_CLOSE=96,n.REDIRECT_SERVER=112,n);e["default"]=c},9593:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6667));var s;(function(t){function e(t){t.data=n.default.encrypt(t.data)}t.encrypt=e;function r(t){t.data=n.default.decrypt(t.data)}t.decrypt=r;function i(t){t.signature=n.default.sha256(`${t.timeStamp}${t.packetId}${t.command}${t.data}`)}t.sign=i;function s(t){let e=n.default.sha256(`${t.timeStamp}${t.packetId}${t.command}${t.data}`);if(t.signature!=e)throw new Error(`msg signature vierfy failed`)}t.verify=s})(s||(s={}));e["default"]=s},4054:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(1280));const s=i(r(1606));const a=i(r(661));const o=i(r(1277));const u=i(r(910));const c=i(r(9538));const l=i(r(9479));const f=i(r(6755));const h=i(r(2918));const d=i(r(9586));const v=i(r(9510));const p=i(r(4626));const g=i(r(7562));const y=i(r(9593));const m=i(r(9586));const w=i(r(9519));const S=i(r(8947));class _{static receiveMessage(t){let e=a.default.parseMsg(new a.default,t);if(e.command==a.default.Command.HEART_BEAT)return;if(e.command!=a.default.Command.KEY_NEGOTIATE_RESULT&&e.command!=a.default.Command.SERVER_CLOSE&&e.command!=a.default.Command.REDIRECT_SERVER)y.default.decrypt(e);if(e.command!=a.default.Command.SERVER_CLOSE&&e.command!=a.default.Command.REDIRECT_SERVER)y.default.verify(e);switch(e.command){case a.default.Command.KEY_NEGOTIATE_RESULT:n.default.parse(e.stringify()).receive();break;case a.default.Command.REGISTER_RESULT:o.default.parse(e.stringify()).receive();break;case a.default.Command.LOGIN_RESULT:s.default.parse(e.stringify()).receive();break;case a.default.Command.SERVER_MSG:this.receiveActionMsg(e.stringify());break;case a.default.Command.SERVER_CLOSE:S.default.parse(e.stringify()).receive();break;case a.default.Command.REDIRECT_SERVER:h.default.parse(e.stringify()).receive();break;default:break}}static receiveActionMsg(t){let e=m.default.parseActionMsg(new m.default,t);if(e.actionMsgData.msgAction!=d.default.ServerAction.RECEIVED&&e.actionMsgData.msgAction!=d.default.ServerAction.REDIRECT_SERVER){let t=JSON.parse(e.actionMsgData.msgData);w.default.create(t.id).send()}switch(e.actionMsgData.msgAction){case d.default.ServerAction.PUSH_MESSAGE:f.default.parse(t).receive();break;case d.default.ServerAction.ADD_PHONE_INFO_RESULT:u.default.parse(t).receive();break;case d.default.ServerAction.SET_MODE_RESULT:v.default.parse(t).receive();break;case d.default.ServerAction.SET_TAG_RESULT:p.default.parse(t).receive();break;case d.default.ServerAction.BIND_ALIAS_RESULT:c.default.parse(t).receive();break;case d.default.ServerAction.UNBIND_ALIAS_RESULT:g.default.parse(t).receive();break;case d.default.ServerAction.FEED_BACK_RESULT:l.default.parse(t).receive();break;case d.default.ServerAction.RECEIVED:w.default.parse(t).receive();break}}}e["default"]=_},9519:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=r(4198);const s=i(r(6379));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.receivedData=new u}static create(t){let e=new o;super.initActionMsg(e);e.callback=t=>{if(t.resultCode!=n.ErrorCode.SUCCESS&&t.resultCode!=n.ErrorCode.REPEAT_MESSAGE)setTimeout((function(){e.send()}),3*1e3)};e.actionMsgData.msgAction=a.default.ClientAction.RECEIVED;e.receivedData=u.create(t);e.actionMsgData.msgData=JSON.stringify(e.receivedData);return e}static parse(t){let e=new o;super.parseActionMsg(e,t);e.receivedData=u.parse(e.data);return e}receive(){var t;let e=a.default.getWaitingResponseMessage(this.actionMsgData.msgId);if(e&&e.actionMsgData.msgAction==a.default.ClientAction.ADD_PHONE_INFO||e&&e.actionMsgData.msgAction==a.default.ClientAction.FEED_BACK){a.default.removeWaitingResponseMessage(e.actionMsgData.msgId);null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:n.ErrorCode.SUCCESS,message:"received"})}}send(){super.send()}}class u{constructor(){this.msgId="";this.cid=""}static create(t){let e=new u;e.cid=s.default.cid;e.msgId=t;return e}static parse(t){let e=new u;let r=JSON.parse(t);e.cid=r.cid;e.msgId=r.msgId;return e}}e["default"]=o},2918:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.RedirectServerData=void 0;const n=i(r(7002));const s=i(r(8506));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.redirectServerData=new u}static parse(t){let e=new o;super.parseMsg(e,t);e.redirectServerData=u.parse(e.data);return e}receive(){this.redirectServerData;s.default.setSync(s.default.KEY_REDIRECT_SERVER,JSON.stringify(this.redirectServerData));n.default.close("redirect server");n.default.reconnect(this.redirectServerData.delay)}}class u{constructor(){this.addressList=[];this.delay=0;this.loc="";this.conf="";this.time=0}static parse(t){let e=new u;let r=JSON.parse(t);e.addressList=r.addressList;e.delay=r.delay;e.loc=r.loc;e.conf=r.conf;e.time=r.time?r.time:(new Date).getTime();return e}}e.RedirectServerData=u;e["default"]=o},4534:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(6379));const s=i(r(661));class a extends s.default{constructor(){super(...arguments);this.registerData=new o}static create(){let t=new a;super.initMsg(t);t.command=s.default.Command.REGISTER;t.data=t.registerData=o.create();return t}send(){super.send()}}class o{constructor(){this.appId="";this.regId=""}static create(){let t=new o;t.appId=n.default.appid;t.regId=n.default.regId;return t}}e["default"]=a},1277:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(661));const s=i(r(8506));const a=i(r(6379));const o=i(r(8858));const u=i(r(529));class c extends n.default{constructor(){super(...arguments);this.registerResultData=new l}static parse(t){let e=new c;super.parseMsg(e,t);e.registerResultData=l.parse(e.data);return e}receive(){var t,e;if(0!=this.registerResultData.errorCode||!this.registerResultData.cid||!this.registerResultData.session){u.default.error(`register fail: ${this.data}`);null===(t=a.default.onError)||void 0===t||t.call(a.default.onError,{error:`register fail: ${this.data}`});return}if(a.default.cid!=this.registerResultData.cid)s.default.setSync(s.default.KEY_ADD_PHONE_INFO_TIME,0);a.default.cid=this.registerResultData.cid;null===(e=a.default.onClientId)||void 0===e||e.call(a.default.onClientId,{cid:a.default.cid});s.default.set({key:s.default.KEY_CID,data:a.default.cid});a.default.session=this.registerResultData.session;s.default.set({key:s.default.KEY_SESSION,data:a.default.session});a.default.deviceId=this.registerResultData.deviceId;s.default.set({key:s.default.KEY_DEVICE_ID,data:a.default.deviceId});o.default.create().send()}}class l{constructor(){this.errorCode=-1;this.errorMsg="";this.cid="";this.session="";this.deviceId="";this.regId=""}static parse(t){let e=new l;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;e.cid=r.cid;e.session=r.session;e.deviceId=r.deviceId;e.regId=r.regId;return e}}e["default"]=c},8947:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(7002));const s=i(r(529));const a=i(r(661));class o extends a.default{constructor(){super(...arguments);this.serverCloseData=new u}static parse(t){let e=new o;super.parseMsg(e,t);e.serverCloseData=u.parse(e.data);return e}receive(){JSON.stringify(this.serverCloseData);let t=`server close ${this.serverCloseData.code}`;if(20==this.serverCloseData.code||23==this.serverCloseData.code||24==this.serverCloseData.code){n.default.allowReconnect=false;n.default.close(t)}else if(21==this.serverCloseData.code)this.safeClose21(t);else{n.default.allowReconnect=true;n.default.close(t);n.default.reconnect(10)}}safeClose21(t){try{if("undefined"!=typeof document)if(document.hasFocus()&&"visible"==document.visibilityState){n.default.allowReconnect=true;n.default.close(t);n.default.reconnect(10);return}n.default.allowReconnect=false;n.default.close(t)}catch(e){s.default.error(`ServerClose t1`,e);n.default.allowReconnect=false;n.default.close(`${t} error`)}}}class u{constructor(){this.code=-1;this.msg=""}static parse(t){let e=new u;let r=JSON.parse(t);e.code=r.code;e.msg=r.msg;return e}}e["default"]=o},910:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(9586));class a extends s.default{constructor(){super(...arguments);this.addPhoneInfoResultData=new o}static parse(t){let e=new a;super.parseActionMsg(e,t);e.addPhoneInfoResultData=o.parse(e.actionMsgData.msgData);return e}receive(){var t;this.addPhoneInfoResultData;let e=s.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.addPhoneInfoResultData.errorCode,message:this.addPhoneInfoResultData.errorMsg});n.default.set({key:n.default.KEY_ADD_PHONE_INFO_TIME,data:(new Date).getTime()})}}class o{constructor(){this.errorCode=-1;this.errorMsg=""}static parse(t){let e=new o;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=a},9538:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.bindAliasResultData=new u}static parse(t){let e=new o;super.parseActionMsg(e,t);e.bindAliasResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`bind alias result`,this.bindAliasResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.bindAliasResultData.errorCode,message:this.bindAliasResultData.errorMsg});n.default.set({key:n.default.KEY_BIND_ALIAS_TIME,data:(new Date).getTime()})}}class u{constructor(){this.errorCode=-1;this.errorMsg=""}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o},9479:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=r(4198);const s=i(r(9586));class a extends s.default{constructor(){super(...arguments);this.feedbackResultData=new o}static parse(t){let e=new a;super.parseActionMsg(e,t);e.feedbackResultData=o.parse(e.actionMsgData.msgData);return e}receive(){var t;this.feedbackResultData;let e=s.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:n.ErrorCode.SUCCESS,message:"received"})}}class o{constructor(){this.actionId="";this.taskId="";this.result=""}static parse(t){let e=new o;let r=JSON.parse(t);e.actionId=r.actionId;e.taskId=r.taskId;e.result=r.result;return e}}e["default"]=a},6755:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(6379));const a=i(r(9586));const o=i(r(8723));class u extends a.default{constructor(){super(...arguments);this.pushMessageData=new c}static parse(t){let e=new u;super.parseActionMsg(e,t);e.pushMessageData=c.parse(e.actionMsgData.msgData);return e}receive(){var t;this.pushMessageData;if(this.pushMessageData.appId!=s.default.appid||!this.pushMessageData.messageid||!this.pushMessageData.taskId)this.stringify();o.default.create(this,o.default.ActionId.RECEIVE).send();o.default.create(this,o.default.ActionId.MP_RECEIVE).send();if(this.actionMsgData.msgExtraData&&s.default.onPushMsg)null===(t=s.default.onPushMsg)||void 0===t||t.call(s.default.onPushMsg,{message:this.actionMsgData.msgExtraData})}}class c{constructor(){this.id="";this.appKey="";this.appId="";this.messageid="";this.taskId="";this.actionChain=[];this.cdnType=""}static parse(t){let e=new c;let r=JSON.parse(t);e.id=r.id;e.appKey=r.appKey;e.appId=r.appId;e.messageid=r.messageid;e.taskId=r.taskId;e.actionChain=r.actionChain;e.cdnType=r.cdnType;return e}}class l{constructor(){this.type="";this.actionid="";this.do=""}}l.Type=(n=class{},n.GO_TO="goto",n.TRANSMIT="transmit",n);e["default"]=u},9510:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(9586));class s extends n.default{constructor(){super(...arguments);this.setModeResultData=new a}static parse(t){let e=new s;super.parseActionMsg(e,t);e.setModeResultData=a.parse(e.actionMsgData.msgData);return e}receive(){var t;this.setModeResultData;let e=n.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.setModeResultData.errorCode,message:this.setModeResultData.errorMsg})}}class a{constructor(){this.errorCode=-1;this.errorMsg=""}static parse(t){let e=new a;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=s},4626:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.setTagResultData=new u}static parse(t){let e=new o;super.parseActionMsg(e,t);e.setTagResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`set tag result`,this.setTagResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.setTagResultData.errorCode,message:this.setTagResultData.errorMsg});n.default.set({key:n.default.KEY_SET_TAG_TIME,data:(new Date).getTime()})}}class u{constructor(){this.errorCode=0;this.errorMsg=""}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o},7562:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(8506));const s=i(r(529));const a=i(r(9586));class o extends a.default{constructor(){super(...arguments);this.unbindAliasResultData=new u}static parse(t){let e=new o;super.parseActionMsg(e,t);e.unbindAliasResultData=u.parse(e.actionMsgData.msgData);return e}receive(){var t;s.default.info(`unbind alias result`,this.unbindAliasResultData);let e=a.default.removeWaitingResponseMessage(this.actionMsgData.msgId);if(e)null===(t=e.callback)||void 0===t||t.call(e.callback,{resultCode:this.unbindAliasResultData.errorCode,message:this.unbindAliasResultData.errorMsg});n.default.set({key:n.default.KEY_BIND_ALIAS_TIME,data:(new Date).getTime()})}}class u{constructor(){this.errorCode=-1;this.errorMsg=""}static parse(t){let e=new u;let r=JSON.parse(t);e.errorCode=r.errorCode;e.errorMsg=r.errorMsg;return e}}e["default"]=o},8227:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{constructor(t){this.delay=10;this.delay=t}start(){this.cancel();let t=this;this.timer=setInterval((function(){t.run()}),this.delay)}cancel(){if(this.timer)clearInterval(this.timer)}}e["default"]=r},7167:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};var n;Object.defineProperty(e,"__esModule",{value:true});const s=i(r(6362));const a=i(r(8227));class o extends a.default{static getInstance(){return o.InstanceHolder.instance}run(){s.default.create().send()}refresh(){this.delay=60*1e3;this.start()}}o.INTERVAL=60*1e3;o.InstanceHolder=(n=class{},n.instance=new o(o.INTERVAL),n);e["default"]=o},2323:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(4736));const s=i(r(6667));var a;(function(t){let e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let r=(0,n.default)("9223372036854775808");function i(t){let e=a(t);let r=o(e);let i=r[1];let n=r[0];return u(i)+u(n)}t.to_getui=i;function a(t){let e=s.default.md5Hex(t);let r=c(e);r[6]&=15;r[6]|=48;r[8]&=63;r[8]|=128;return r}function o(t){let e=(0,n.default)(0);let r=(0,n.default)(0);for(let r=0;r<8;r++)e=e.multiply(256).plus((0,n.default)(255&t[r]));for(let e=8;e<16;e++)r=r.multiply(256).plus((0,n.default)(255&t[e]));return[e,r]}function u(t){if(t>=r)t=r.multiply(2).minus(t);let i="";for(;t>(0,n.default)(0);t=t.divide(62))i+=e.charAt(Number(t.divmod(62).remainder));return i}function c(t){let e=t.length;if(e%2!=0)return[];let r=new Array;for(let i=0;i<e;i+=2)r.push(parseInt(t.substring(i,i+2),16));return r}})(a||(a={}));e["default"]=a},6667:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});const n=i(r(2620));const s=i(r(1354));const a=i(r(6379));var o;(function(t){let e;let r;let i;let o;let u=new n.default;let c=s.default.mode.CBC;let l=s.default.pad.Pkcs7;let f=s.default.AES;t.algorithmMap=new Map([["aes",s.default.AES]]);t.modeMap=new Map([["cbc",s.default.mode.CBC],["cfb",s.default.mode.CFB],["cfb128",s.default.mode.CFB],["ecb",s.default.mode.ECB],["ofb",s.default.mode.OFB]]);t.paddingMap=new Map([["nopadding",s.default.pad.NoPadding],["pkcs7",s.default.pad.Pkcs7]]);function h(){e=s.default.MD5((new Date).getTime().toString());r=s.default.MD5(e);u.setPublicKey(a.default.publicKey);e.toString(s.default.enc.Hex);r.toString(s.default.enc.Hex);i=u.encrypt(e.toString(s.default.enc.Hex));o=u.encrypt(r.toString(s.default.enc.Hex))}t.resetKey=h;function d(e,r,i){f=t.algorithmMap.get(e);c=t.modeMap.get(r);l=t.paddingMap.get(i)}t.setEncryptParams=d;function v(t){return f.encrypt(t,e,{iv:r,mode:c,padding:l}).toString()}t.encrypt=v;function p(t){return f.decrypt(t,e,{iv:r,mode:c,padding:l}).toString(s.default.enc.Utf8)}t.decrypt=p;function g(t){return s.default.SHA256(t).toString(s.default.enc.Base64)}t.sha256=g;function y(t){return s.default.MD5(t).toString(s.default.enc.Hex)}t.md5Hex=y;function m(){return i?i:""}t.getEncryptedSecretKey=m;function w(){return o?o:""}t.getEncryptedIV=w})(o||(o={}));e["default"]=o},529:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{static info(...t){if(this.debugMode)console.info(`[GtPush]`,t)}static warn(...t){console.warn(`[GtPush]`,t)}static error(...t){console.error(`[GtPush]`,t)}}r.debugMode=false;e["default"]=r},3854:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:true});class r{static getStr(t,e){try{if(!t||void 0===t[e])return"";return t[e]}catch(t){}return""}}e["default"]=r},2620:(t,e,r)=>{"use strict";r.r(e);r.d(e,{JSEncrypt:()=>wt,default:()=>St});var i="0123456789abcdefghijklmnopqrstuvwxyz";function n(t){return i.charAt(t)}function s(t,e){return t&e}function a(t,e){return t|e}function o(t,e){return t^e}function u(t,e){return t&~e}function c(t){if(0==t)return-1;var e=0;if(0==(65535&t)){t>>=16;e+=16}if(0==(255&t)){t>>=8;e+=8}if(0==(15&t)){t>>=4;e+=4}if(0==(3&t)){t>>=2;e+=2}if(0==(1&t))++e;return e}function l(t){var e=0;while(0!=t){t&=t-1;++e}return e}var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var h="=";function d(t){var e;var r;var i="";for(e=0;e+3<=t.length;e+=3){r=parseInt(t.substring(e,e+3),16);i+=f.charAt(r>>6)+f.charAt(63&r)}if(e+1==t.length){r=parseInt(t.substring(e,e+1),16);i+=f.charAt(r<<2)}else if(e+2==t.length){r=parseInt(t.substring(e,e+2),16);i+=f.charAt(r>>2)+f.charAt((3&r)<<4)}while((3&i.length)>0)i+=h;return i}function v(t){var e="";var r;var i=0;var s=0;for(r=0;r<t.length;++r){if(t.charAt(r)==h)break;var a=f.indexOf(t.charAt(r));if(a<0)continue;if(0==i){e+=n(a>>2);s=3&a;i=1}else if(1==i){e+=n(s<<2|a>>4);s=15&a;i=2}else if(2==i){e+=n(s);e+=n(a>>2);s=3&a;i=3}else{e+=n(s<<2|a>>4);e+=n(15&a);i=0}}if(1==i)e+=n(s<<2);return e}function p(t){var e=v(t);var r;var i=[];for(r=0;2*r<e.length;++r)i[r]=parseInt(e.substring(2*r,2*r+2),16);return i}var g;var y={decode:function(t){var e;if(void 0===g){var r="0123456789ABCDEF";var i=" \f\n\r\t \u2028\u2029";g={};for(e=0;e<16;++e)g[r.charAt(e)]=e;r=r.toLowerCase();for(e=10;e<16;++e)g[r.charAt(e)]=e;for(e=0;e<i.length;++e)g[i.charAt(e)]=-1}var n=[];var s=0;var a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;o=g[o];if(-1==o)continue;if(void 0===o)throw new Error("Illegal character at offset "+e);s|=o;if(++a>=2){n[n.length]=s;s=0;a=0}else s<<=4}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return n}};var m;var w={decode:function(t){var e;if(void 0===m){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var i="= \f\n\r\t \u2028\u2029";m=Object.create(null);for(e=0;e<64;++e)m[r.charAt(e)]=e;m["-"]=62;m["_"]=63;for(e=0;e<i.length;++e)m[i.charAt(e)]=-1}var n=[];var s=0;var a=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;o=m[o];if(-1==o)continue;if(void 0===o)throw new Error("Illegal character at offset "+e);s|=o;if(++a>=4){n[n.length]=s>>16;n[n.length]=s>>8&255;n[n.length]=255&s;s=0;a=0}else s<<=6}switch(a){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=s>>10;break;case 3:n[n.length]=s>>16;n[n.length]=s>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=w.re.exec(t);if(e)if(e[1])t=e[1];else if(e[2])t=e[2];else throw new Error("RegExp out of sync");return w.decode(t)}};var S=1e13;var _=function(){function t(t){this.buf=[+t||0]}t.prototype.mulAdd=function(t,e){var r=this.buf;var i=r.length;var n;var s;for(n=0;n<i;++n){s=r[n]*t+e;if(s<S)e=0;else{e=0|s/S;s-=e*S}r[n]=s}if(e>0)r[n]=e};t.prototype.sub=function(t){var e=this.buf;var r=e.length;var i;var n;for(i=0;i<r;++i){n=e[i]-t;if(n<0){n+=S;t=1}else t=0;e[i]=n}while(0===e[e.length-1])e.pop()};t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");var e=this.buf;var r=e[e.length-1].toString();for(var i=e.length-2;i>=0;--i)r+=(S+e[i]).toString().substring(1);return r};t.prototype.valueOf=function(){var t=this.buf;var e=0;for(var r=t.length-1;r>=0;--r)e=e*S+t[r];return e};t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this};return t}();var b="…";var E=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;var D=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function M(t,e){if(t.length>e)t=t.substring(0,e)+b;return t}var T=function(){function t(e,r){this.hexDigits="0123456789ABCDEF";if(e instanceof t){this.enc=e.enc;this.pos=e.pos}else{this.enc=e;this.pos=r}}t.prototype.get=function(t){if(void 0===t)t=this.pos++;if(t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"===typeof this.enc?this.enc.charCodeAt(t):this.enc[t]};t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)};t.prototype.hexDump=function(t,e,r){var i="";for(var n=t;n<e;++n){i+=this.hexByte(this.get(n));if(true!==r)switch(15&n){case 7:i+=" ";break;case 15:i+="\n";break;default:i+=" "}}return i};t.prototype.isASCII=function(t,e){for(var r=t;r<e;++r){var i=this.get(r);if(i<32||i>176)return false}return true};t.prototype.parseStringISO=function(t,e){var r="";for(var i=t;i<e;++i)r+=String.fromCharCode(this.get(i));return r};t.prototype.parseStringUTF=function(t,e){var r="";for(var i=t;i<e;){var n=this.get(i++);if(n<128)r+=String.fromCharCode(n);else if(n>191&&n<224)r+=String.fromCharCode((31&n)<<6|63&this.get(i++));else r+=String.fromCharCode((15&n)<<12|(63&this.get(i++))<<6|63&this.get(i++))}return r};t.prototype.parseStringBMP=function(t,e){var r="";var i;var n;for(var s=t;s<e;){i=this.get(s++);n=this.get(s++);r+=String.fromCharCode(i<<8|n)}return r};t.prototype.parseTime=function(t,e,r){var i=this.parseStringISO(t,e);var n=(r?E:D).exec(i);if(!n)return"Unrecognized time: "+i;if(r){n[1]=+n[1];n[1]+=+n[1]<70?2e3:1900}i=n[1]+"-"+n[2]+"-"+n[3]+" "+n[4];if(n[5]){i+=":"+n[5];if(n[6]){i+=":"+n[6];if(n[7])i+="."+n[7]}}if(n[8]){i+=" UTC";if("Z"!=n[8]){i+=n[8];if(n[9])i+=":"+n[9]}}return i};t.prototype.parseInteger=function(t,e){var r=this.get(t);var i=r>127;var n=i?255:0;var s;var a="";while(r==n&&++t<e)r=this.get(t);s=e-t;if(0===s)return i?-1:0;if(s>4){a=r;s<<=3;while(0==(128&(+a^n))){a=+a<<1;--s}a="("+s+" bit)\n"}if(i)r-=256;var o=new _(r);for(var u=t+1;u<e;++u)o.mulAdd(256,this.get(u));return a+o.toString()};t.prototype.parseBitString=function(t,e,r){var i=this.get(t);var n=(e-t-1<<3)-i;var s="("+n+" bit)\n";var a="";for(var o=t+1;o<e;++o){var u=this.get(o);var c=o==e-1?i:0;for(var l=7;l>=c;--l)a+=u>>l&1?"1":"0";if(a.length>r)return s+M(a,r)}return s+a};t.prototype.parseOctetString=function(t,e,r){if(this.isASCII(t,e))return M(this.parseStringISO(t,e),r);var i=e-t;var n="("+i+" byte)\n";r/=2;if(i>r)e=t+r;for(var s=t;s<e;++s)n+=this.hexByte(this.get(s));if(i>r)n+=b;return n};t.prototype.parseOID=function(t,e,r){var i="";var n=new _;var s=0;for(var a=t;a<e;++a){var o=this.get(a);n.mulAdd(128,127&o);s+=7;if(!(128&o)){if(""===i){n=n.simplify();if(n instanceof _){n.sub(80);i="2."+n.toString()}else{var u=n<80?n<40?0:1:2;i=u+"."+(n-40*u)}}else i+="."+n.toString();if(i.length>r)return M(i,r);n=new _;s=0}}if(s>0)i+=".incomplete";return i};return t}();var I=function(){function t(t,e,r,i,n){if(!(i instanceof A))throw new Error("Invalid tag value.");this.stream=t;this.header=e;this.length=r;this.tag=i;this.sub=n}t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}};t.prototype.content=function(t){if(void 0===this.tag)return null;if(void 0===t)t=1/0;var e=this.posContent();var r=Math.abs(this.length);if(!this.tag.isUniversal()){if(null!==this.sub)return"("+this.sub.length+" elem)";return this.stream.parseOctetString(e,e+r,t)}switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+r,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+r,t);case 6:return this.stream.parseOID(e,e+r,t);case 16:case 17:if(null!==this.sub)return"("+this.sub.length+" elem)";else return"(no elem)";case 12:return M(this.stream.parseStringUTF(e,e+r),t);case 18:case 19:case 20:case 21:case 22:case 26:return M(this.stream.parseStringISO(e,e+r),t);case 30:return M(this.stream.parseStringBMP(e,e+r),t);case 23:case 24:return this.stream.parseTime(e,e+r,23==this.tag.tagNumber)}return null};t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"};t.prototype.toPrettyString=function(t){if(void 0===t)t="";var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0)e+="+";e+=this.length;if(this.tag.tagConstructed)e+=" (constructed)";else if(this.tag.isUniversal()&&(3==this.tag.tagNumber||4==this.tag.tagNumber)&&null!==this.sub)e+=" (encapsulates)";e+="\n";if(null!==this.sub){t+=" ";for(var r=0,i=this.sub.length;r<i;++r)e+=this.sub[r].toPrettyString(t)}return e};t.prototype.posStart=function(){return this.stream.pos};t.prototype.posContent=function(){return this.stream.pos+this.header};t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)};t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),true)};t.decodeLength=function(t){var e=t.get();var r=127&e;if(r==e)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===r)return null;e=0;for(var i=0;i<r;++i)e=256*e+t.get();return e};t.prototype.getHexStringValue=function(){var t=this.toHexString();var e=2*this.header;var r=2*this.length;return t.substr(e,r)};t.decode=function(e){var r;if(!(e instanceof T))r=new T(e,0);else r=e;var i=new T(r);var n=new A(r);var s=t.decodeLength(r);var a=r.pos;var o=a-i.pos;var u=null;var c=function(){var e=[];if(null!==s){var i=a+s;while(r.pos<i)e[e.length]=t.decode(r);if(r.pos!=i)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var n=t.decode(r);if(n.tag.isEOC())break;e[e.length]=n}s=a-r.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(n.tagConstructed)u=c();else if(n.isUniversal()&&(3==n.tagNumber||4==n.tagNumber))try{if(3==n.tagNumber)if(0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=c();for(var l=0;l<u.length;++l)if(u[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){u=null}if(null===u){if(null===s)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);r.pos=a+Math.abs(s)}return new t(i,o,s,n,u)};return t}();var A=function(){function t(t){var e=t.get();this.tagClass=e>>6;this.tagConstructed=0!==(32&e);this.tagNumber=31&e;if(31==this.tagNumber){var r=new _;do{e=t.get();r.mulAdd(128,127&e)}while(128&e);this.tagNumber=r.simplify()}}t.prototype.isUniversal=function(){return 0===this.tagClass};t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber};return t}();var x;var R=0xdeadbeefcafe;var B=15715070==(16777215&R);var O=[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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];var k=(1<<26)/O[O.length-1];var C=function(){function t(t,e,r){if(null!=t)if("number"==typeof t)this.fromNumber(t,e,r);else if(null==e&&"string"!=typeof t)this.fromString(t,256);else this.fromString(t,e)}t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else if(4==t)e=2;else return this.toRadix(t);var r=(1<<e)-1;var i;var s=false;var a="";var o=this.t;var u=this.DB-o*this.DB%e;if(o-- >0){if(u<this.DB&&(i=this[o]>>u)>0){s=true;a=n(i)}while(o>=0){if(u<e){i=(this[o]&(1<<u)-1)<<e-u;i|=this[--o]>>(u+=this.DB-e)}else{i=this[o]>>(u-=e)&r;if(u<=0){u+=this.DB;--o}}if(i>0)s=true;if(s)a+=n(i)}}return s?a:"0"};t.prototype.negate=function(){var e=H();t.ZERO.subTo(this,e);return e};t.prototype.abs=function(){return this.s<0?this.negate():this};t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;e=r-t.t;if(0!=e)return this.s<0?-e:e;while(--r>=0)if(0!=(e=this[r]-t[r]))return e;return 0};t.prototype.bitLength=function(){if(this.t<=0)return 0;return this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM)};t.prototype.mod=function(e){var r=H();this.abs().divRemTo(e,null,r);if(this.s<0&&r.compareTo(t.ZERO)>0)e.subTo(r,r);return r};t.prototype.modPowInt=function(t,e){var r;if(t<256||e.isEven())r=new P(e);else r=new V(e);return this.exp(t,r)};t.prototype.clone=function(){var t=H();this.copyTo(t);return t};t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;else if(0==this.t)return-1}else if(1==this.t)return this[0];else if(0==this.t)return 0;return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]};t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24};t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16};t.prototype.signum=function(){if(this.s<0)return-1;else if(this.t<=0||1==this.t&&this[0]<=0)return 0;else return 1};t.prototype.toByteArray=function(){var t=this.t;var e=[];e[0]=this.s;var r=this.DB-t*this.DB%8;var i;var n=0;if(t-- >0){if(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r)e[n++]=i|this.s<<this.DB-r;while(t>=0){if(r<8){i=(this[t]&(1<<r)-1)<<8-r;i|=this[--t]>>(r+=this.DB-8)}else{i=this[t]>>(r-=8)&255;if(r<=0){r+=this.DB;--t}}if(0!=(128&i))i|=-256;if(0==n&&(128&this.s)!=(128&i))++n;if(n>0||i!=this.s)e[n++]=i}}return e};t.prototype.equals=function(t){return 0==this.compareTo(t)};t.prototype.min=function(t){return this.compareTo(t)<0?this:t};t.prototype.max=function(t){return this.compareTo(t)>0?this:t};t.prototype.and=function(t){var e=H();this.bitwiseTo(t,s,e);return e};t.prototype.or=function(t){var e=H();this.bitwiseTo(t,a,e);return e};t.prototype.xor=function(t){var e=H();this.bitwiseTo(t,o,e);return e};t.prototype.andNot=function(t){var e=H();this.bitwiseTo(t,u,e);return e};t.prototype.not=function(){var t=H();for(var e=0;e<this.t;++e)t[e]=this.DM&~this[e];t.t=this.t;t.s=~this.s;return t};t.prototype.shiftLeft=function(t){var e=H();if(t<0)this.rShiftTo(-t,e);else this.lShiftTo(t,e);return e};t.prototype.shiftRight=function(t){var e=H();if(t<0)this.lShiftTo(-t,e);else this.rShiftTo(t,e);return e};t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+c(this[t]);if(this.s<0)return this.t*this.DB;return-1};t.prototype.bitCount=function(){var t=0;var e=this.s&this.DM;for(var r=0;r<this.t;++r)t+=l(this[r]^e);return t};t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);if(e>=this.t)return 0!=this.s;return 0!=(this[e]&1<<t%this.DB)};t.prototype.setBit=function(t){return this.changeBit(t,a)};t.prototype.clearBit=function(t){return this.changeBit(t,u)};t.prototype.flipBit=function(t){return this.changeBit(t,o)};t.prototype.add=function(t){var e=H();this.addTo(t,e);return e};t.prototype.subtract=function(t){var e=H();this.subTo(t,e);return e};t.prototype.multiply=function(t){var e=H();this.multiplyTo(t,e);return e};t.prototype.divide=function(t){var e=H();this.divRemTo(t,e,null);return e};t.prototype.remainder=function(t){var e=H();this.divRemTo(t,null,e);return e};t.prototype.divideAndRemainder=function(t){var e=H();var r=H();this.divRemTo(t,e,r);return[e,r]};t.prototype.modPow=function(t,e){var r=t.bitLength();var i;var n=Y(1);var s;if(r<=0)return n;else if(r<18)i=1;else if(r<48)i=3;else if(r<144)i=4;else if(r<768)i=5;else i=6;if(r<8)s=new P(e);else if(e.isEven())s=new L(e);else s=new V(e);var a=[];var o=3;var u=i-1;var c=(1<<i)-1;a[1]=s.convert(this);if(i>1){var l=H();s.sqrTo(a[1],l);while(o<=c){a[o]=H();s.mulTo(l,a[o-2],a[o]);o+=2}}var f=t.t-1;var h;var d=true;var v=H();var p;r=W(t[f])-1;while(f>=0){if(r>=u)h=t[f]>>r-u&c;else{h=(t[f]&(1<<r+1)-1)<<u-r;if(f>0)h|=t[f-1]>>this.DB+r-u}o=i;while(0==(1&h)){h>>=1;--o}if((r-=o)<0){r+=this.DB;--f}if(d){a[h].copyTo(n);d=false}else{while(o>1){s.sqrTo(n,v);s.sqrTo(v,n);o-=2}if(o>0)s.sqrTo(n,v);else{p=n;n=v;v=p}s.mulTo(v,a[h],n)}while(f>=0&&0==(t[f]&1<<r)){s.sqrTo(n,v);p=n;n=v;v=p;if(--r<0){r=this.DB-1;--f}}}return s.revert(n)};t.prototype.modInverse=function(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;var i=e.clone();var n=this.clone();var s=Y(1);var a=Y(0);var o=Y(0);var u=Y(1);while(0!=i.signum()){while(i.isEven()){i.rShiftTo(1,i);if(r){if(!s.isEven()||!a.isEven()){s.addTo(this,s);a.subTo(e,a)}s.rShiftTo(1,s)}else if(!a.isEven())a.subTo(e,a);a.rShiftTo(1,a)}while(n.isEven()){n.rShiftTo(1,n);if(r){if(!o.isEven()||!u.isEven()){o.addTo(this,o);u.subTo(e,u)}o.rShiftTo(1,o)}else if(!u.isEven())u.subTo(e,u);u.rShiftTo(1,u)}if(i.compareTo(n)>=0){i.subTo(n,i);if(r)s.subTo(o,s);a.subTo(u,a)}else{n.subTo(i,n);if(r)o.subTo(s,o);u.subTo(a,u)}}if(0!=n.compareTo(t.ONE))return t.ZERO;if(u.compareTo(e)>=0)return u.subtract(e);if(u.signum()<0)u.addTo(e,u);else return u;if(u.signum()<0)return u.add(e);else return u};t.prototype.pow=function(t){return this.exp(t,new N)};t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone();var r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r;r=i}var n=e.getLowestSetBit();var s=r.getLowestSetBit();if(s<0)return e;if(n<s)s=n;if(s>0){e.rShiftTo(s,e);r.rShiftTo(s,r)}while(e.signum()>0){if((n=e.getLowestSetBit())>0)e.rShiftTo(n,e);if((n=r.getLowestSetBit())>0)r.rShiftTo(n,r);if(e.compareTo(r)>=0){e.subTo(r,e);e.rShiftTo(1,e)}else{r.subTo(e,r);r.rShiftTo(1,r)}}if(s>0)r.lShiftTo(s,r);return r};t.prototype.isProbablePrime=function(t){var e;var r=this.abs();if(1==r.t&&r[0]<=O[O.length-1]){for(e=0;e<O.length;++e)if(r[0]==O[e])return true;return false}if(r.isEven())return false;e=1;while(e<O.length){var i=O[e];var n=e+1;while(n<O.length&&i<k)i*=O[n++];i=r.modInt(i);while(e<n)if(i%O[e++]==0)return false}return r.millerRabin(t)};t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t;t.s=this.s};t.prototype.fromInt=function(t){this.t=1;this.s=t<0?-1:0;if(t>0)this[0]=t;else if(t<-1)this[0]=t+this.DV;else this.t=0};t.prototype.fromString=function(e,r){var i;if(16==r)i=4;else if(8==r)i=3;else if(256==r)i=8;else if(2==r)i=1;else if(32==r)i=5;else if(4==r)i=2;else{this.fromRadix(e,r);return}this.t=0;this.s=0;var n=e.length;var s=false;var a=0;while(--n>=0){var o=8==i?255&+e[n]:G(e,n);if(o<0){if("-"==e.charAt(n))s=true;continue}s=false;if(0==a)this[this.t++]=o;else if(a+i>this.DB){this[this.t-1]|=(o&(1<<this.DB-a)-1)<<a;this[this.t++]=o>>this.DB-a}else this[this.t-1]|=o<<a;a+=i;if(a>=this.DB)a-=this.DB}if(8==i&&0!=(128&+e[0])){this.s=-1;if(a>0)this[this.t-1]|=(1<<this.DB-a)-1<<a}this.clamp();if(s)t.ZERO.subTo(this,this)};t.prototype.clamp=function(){var t=this.s&this.DM;while(this.t>0&&this[this.t-1]==t)--this.t};t.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t;e.s=this.s};t.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0);e.s=this.s};t.prototype.lShiftTo=function(t,e){var r=t%this.DB;var i=this.DB-r;var n=(1<<i)-1;var s=Math.floor(t/this.DB);var a=this.s<<r&this.DM;for(var o=this.t-1;o>=0;--o){e[o+s+1]=this[o]>>i|a;a=(this[o]&n)<<r}for(var o=s-1;o>=0;--o)e[o]=0;e[s]=a;e.t=this.t+s+1;e.s=this.s;e.clamp()};t.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t){e.t=0;return}var i=t%this.DB;var n=this.DB-i;var s=(1<<i)-1;e[0]=this[r]>>i;for(var a=r+1;a<this.t;++a){e[a-r-1]|=(this[a]&s)<<n;e[a-r]=this[a]>>i}if(i>0)e[this.t-r-1]|=(this.s&s)<<n;e.t=this.t-r;e.clamp()};t.prototype.subTo=function(t,e){var r=0;var i=0;var n=Math.min(t.t,this.t);while(r<n){i+=this[r]-t[r];e[r++]=i&this.DM;i>>=this.DB}if(t.t<this.t){i-=t.s;while(r<this.t){i+=this[r];e[r++]=i&this.DM;i>>=this.DB}i+=this.s}else{i+=this.s;while(r<t.t){i-=t[r];e[r++]=i&this.DM;i>>=this.DB}i-=t.s}e.s=i<0?-1:0;if(i<-1)e[r++]=this.DV+i;else if(i>0)e[r++]=i;e.t=r;e.clamp()};t.prototype.multiplyTo=function(e,r){var i=this.abs();var n=e.abs();var s=i.t;r.t=s+n.t;while(--s>=0)r[s]=0;for(s=0;s<n.t;++s)r[s+i.t]=i.am(0,n[s],r,s,0,i.t);r.s=0;r.clamp();if(this.s!=e.s)t.ZERO.subTo(r,r)};t.prototype.squareTo=function(t){var e=this.abs();var r=t.t=2*e.t;while(--r>=0)t[r]=0;for(r=0;r<e.t-1;++r){var i=e.am(r,e[r],t,2*r,0,1);if((t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,i,e.t-r-1))>=e.DV){t[r+e.t]-=e.DV;t[r+e.t+1]=1}}if(t.t>0)t[t.t-1]+=e.am(r,e[r],t,2*r,0,1);t.s=0;t.clamp()};t.prototype.divRemTo=function(e,r,i){var n=e.abs();if(n.t<=0)return;var s=this.abs();if(s.t<n.t){if(null!=r)r.fromInt(0);if(null!=i)this.copyTo(i);return}if(null==i)i=H();var a=H();var o=this.s;var u=e.s;var c=this.DB-W(n[n.t-1]);if(c>0){n.lShiftTo(c,a);s.lShiftTo(c,i)}else{n.copyTo(a);s.copyTo(i)}var l=a.t;var f=a[l-1];if(0==f)return;var h=f*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0);var d=this.FV/h;var v=(1<<this.F1)/h;var p=1<<this.F2;var g=i.t;var y=g-l;var m=null==r?H():r;a.dlShiftTo(y,m);if(i.compareTo(m)>=0){i[i.t++]=1;i.subTo(m,i)}t.ONE.dlShiftTo(l,m);m.subTo(a,a);while(a.t<l)a[a.t++]=0;while(--y>=0){var w=i[--g]==f?this.DM:Math.floor(i[g]*d+(i[g-1]+p)*v);if((i[g]+=a.am(0,w,i,y,0,l))<w){a.dlShiftTo(y,m);i.subTo(m,i);while(i[g]<--w)i.subTo(m,i)}}if(null!=r){i.drShiftTo(l,r);if(o!=u)t.ZERO.subTo(r,r)}i.t=l;i.clamp();if(c>0)i.rShiftTo(c,i);if(o<0)t.ZERO.subTo(i,i)};t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;e=e*(2-(15&t)*e)&15;e=e*(2-(255&t)*e)&255;e=e*(2-((65535&t)*e&65535))&65535;e=e*(2-t*e%this.DV)%this.DV;return e>0?this.DV-e:-e};t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)};t.prototype.exp=function(e,r){if(e>4294967295||e<1)return t.ONE;var i=H();var n=H();var s=r.convert(this);var a=W(e)-1;s.copyTo(i);while(--a>=0){r.sqrTo(i,n);if((e&1<<a)>0)r.mulTo(n,s,i);else{var o=i;i=n;n=o}}return r.revert(i)};t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))};t.prototype.toRadix=function(t){if(null==t)t=10;if(0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t);var r=Math.pow(t,e);var i=Y(r);var n=H();var s=H();var a="";this.divRemTo(i,n,s);while(n.signum()>0){a=(r+s.intValue()).toString(t).substr(1)+a;n.divRemTo(i,n,s)}return s.intValue().toString(t)+a};t.prototype.fromRadix=function(e,r){this.fromInt(0);if(null==r)r=10;var i=this.chunkSize(r);var n=Math.pow(r,i);var s=false;var a=0;var o=0;for(var u=0;u<e.length;++u){var c=G(e,u);if(c<0){if("-"==e.charAt(u)&&0==this.signum())s=true;continue}o=r*o+c;if(++a>=i){this.dMultiply(n);this.dAddOffset(o,0);a=0;o=0}}if(a>0){this.dMultiply(Math.pow(r,a));this.dAddOffset(o,0)}if(s)t.ZERO.subTo(this,this)};t.prototype.fromNumber=function(e,r,i){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,i);if(!this.testBit(e-1))this.bitwiseTo(t.ONE.shiftLeft(e-1),a,this);if(this.isEven())this.dAddOffset(1,0);while(!this.isProbablePrime(r)){this.dAddOffset(2,0);if(this.bitLength()>e)this.subTo(t.ONE.shiftLeft(e-1),this)}}else{var n=[];var s=7&e;n.length=(e>>3)+1;r.nextBytes(n);if(s>0)n[0]&=(1<<s)-1;else n[0]=0;this.fromString(n,256)}};t.prototype.bitwiseTo=function(t,e,r){var i;var n;var s=Math.min(t.t,this.t);for(i=0;i<s;++i)r[i]=e(this[i],t[i]);if(t.t<this.t){n=t.s&this.DM;for(i=s;i<this.t;++i)r[i]=e(this[i],n);r.t=this.t}else{n=this.s&this.DM;for(i=s;i<t.t;++i)r[i]=e(n,t[i]);r.t=t.t}r.s=e(this.s,t.s);r.clamp()};t.prototype.changeBit=function(e,r){var i=t.ONE.shiftLeft(e);this.bitwiseTo(i,r,i);return i};t.prototype.addTo=function(t,e){var r=0;var i=0;var n=Math.min(t.t,this.t);while(r<n){i+=this[r]+t[r];e[r++]=i&this.DM;i>>=this.DB}if(t.t<this.t){i+=t.s;while(r<this.t){i+=this[r];e[r++]=i&this.DM;i>>=this.DB}i+=this.s}else{i+=this.s;while(r<t.t){i+=t[r];e[r++]=i&this.DM;i>>=this.DB}i+=t.s}e.s=i<0?-1:0;if(i>0)e[r++]=i;else if(i<-1)e[r++]=this.DV+i;e.t=r;e.clamp()};t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t);++this.t;this.clamp()};t.prototype.dAddOffset=function(t,e){if(0==t)return;while(this.t<=e)this[this.t++]=0;this[e]+=t;while(this[e]>=this.DV){this[e]-=this.DV;if(++e>=this.t)this[this.t++]=0;++this[e]}};t.prototype.multiplyLowerTo=function(t,e,r){var i=Math.min(this.t+t.t,e);r.s=0;r.t=i;while(i>0)r[--i]=0;for(var n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(var n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()};t.prototype.multiplyUpperTo=function(t,e,r){--e;var i=r.t=this.t+t.t-e;r.s=0;while(--i>=0)r[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)r[this.t+i-e]=this.am(e-i,t[i],r,0,0,this.t+i-e);r.clamp();r.drShiftTo(1,r)};t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t;var r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r};t.prototype.millerRabin=function(e){var r=this.subtract(t.ONE);var i=r.getLowestSetBit();if(i<=0)return false;var n=r.shiftRight(i);e=e+1>>1;if(e>O.length)e=O.length;var s=H();for(var a=0;a<e;++a){s.fromInt(O[Math.floor(Math.random()*O.length)]);var o=s.modPow(n,this);if(0!=o.compareTo(t.ONE)&&0!=o.compareTo(r)){var u=1;while(u++<i&&0!=o.compareTo(r)){o=o.modPowInt(2,this);if(0==o.compareTo(t.ONE))return false}if(0!=o.compareTo(r))return false}}return true};t.prototype.square=function(){var t=H();this.squareTo(t);return t};t.prototype.gcda=function(t,e){var r=this.s<0?this.negate():this.clone();var i=t.s<0?t.negate():t.clone();if(r.compareTo(i)<0){var n=r;r=i;i=n}var s=r.getLowestSetBit();var a=i.getLowestSetBit();if(a<0){e(r);return}if(s<a)a=s;if(a>0){r.rShiftTo(a,r);i.rShiftTo(a,i)}var o=function(){if((s=r.getLowestSetBit())>0)r.rShiftTo(s,r);if((s=i.getLowestSetBit())>0)i.rShiftTo(s,i);if(r.compareTo(i)>=0){r.subTo(i,r);r.rShiftTo(1,r)}else{i.subTo(r,i);i.rShiftTo(1,i)}if(!(r.signum()>0)){if(a>0)i.lShiftTo(a,i);setTimeout((function(){e(i)}),0)}else setTimeout(o,0)};setTimeout(o,10)};t.prototype.fromNumberAsync=function(e,r,i,n){if("number"==typeof r)if(e<2)this.fromInt(1);else{this.fromNumber(e,i);if(!this.testBit(e-1))this.bitwiseTo(t.ONE.shiftLeft(e-1),a,this);if(this.isEven())this.dAddOffset(1,0);var s=this;var o=function(){s.dAddOffset(2,0);if(s.bitLength()>e)s.subTo(t.ONE.shiftLeft(e-1),s);if(s.isProbablePrime(r))setTimeout((function(){n()}),0);else setTimeout(o,0)};setTimeout(o,0)}else{var u=[];var c=7&e;u.length=(e>>3)+1;r.nextBytes(u);if(c>0)u[0]&=(1<<c)-1;else u[0]=0;this.fromString(u,256)}};return t}();var N=function(){function t(){}t.prototype.convert=function(t){return t};t.prototype.revert=function(t){return t};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)};t.prototype.sqrTo=function(t,e){t.squareTo(e)};return t}();var P=function(){function t(t){this.m=t}t.prototype.convert=function(t){if(t.s<0||t.compareTo(this.m)>=0)return t.mod(this.m);else return t};t.prototype.revert=function(t){return t};t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r)};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e)};return t}();var V=function(){function t(t){this.m=t;this.mp=t.invDigit();this.mpl=32767&this.mp;this.mph=this.mp>>15;this.um=(1<<t.DB-15)-1;this.mt2=2*t.t}t.prototype.convert=function(t){var e=H();t.abs().dlShiftTo(this.m.t,e);e.divRemTo(this.m,null,e);if(t.s<0&&e.compareTo(C.ZERO)>0)this.m.subTo(e,e);return e};t.prototype.revert=function(t){var e=H();t.copyTo(e);this.reduce(e);return e};t.prototype.reduce=function(t){while(t.t<=this.mt2)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e];var i=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;r=e+this.m.t;t[r]+=this.m.am(0,i,t,e,0,this.m.t);while(t[r]>=t.DV){t[r]-=t.DV;t[++r]++}}t.clamp();t.drShiftTo(this.m.t,t);if(t.compareTo(this.m)>=0)t.subTo(this.m,t)};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r)};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e)};return t}();var L=function(){function t(t){this.m=t;this.r2=H();this.q3=H();C.ONE.dlShiftTo(2*t.t,this.r2);this.mu=this.r2.divide(t)}t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);else if(t.compareTo(this.m)<0)return t;else{var e=H();t.copyTo(e);this.reduce(e);return e}};t.prototype.revert=function(t){return t};t.prototype.reduce=function(t){t.drShiftTo(this.m.t-1,this.r2);if(t.t>this.m.t+1){t.t=this.m.t+1;t.clamp()}this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(t.compareTo(this.r2)<0)t.dAddOffset(1,this.m.t+1);t.subTo(this.r2,t);while(t.compareTo(this.m)>=0)t.subTo(this.m,t)};t.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r);this.reduce(r)};t.prototype.sqrTo=function(t,e){t.squareTo(e);this.reduce(e)};return t}();function H(){return new C(null)}function U(t,e){return new C(t,e)}var K="undefined"!==typeof navigator;if(K&&B&&"Microsoft Internet Explorer"==navigator.appName){C.prototype.am=function t(e,r,i,n,s,a){var o=32767&r;var u=r>>15;while(--a>=0){var c=32767&this[e];var l=this[e++]>>15;var f=u*c+l*o;c=o*c+((32767&f)<<15)+i[n]+(1073741823&s);s=(c>>>30)+(f>>>15)+u*l+(s>>>30);i[n++]=1073741823&c}return s};x=30}else if(K&&B&&"Netscape"!=navigator.appName){C.prototype.am=function t(e,r,i,n,s,a){while(--a>=0){var o=r*this[e++]+i[n]+s;s=Math.floor(o/67108864);i[n++]=67108863&o}return s};x=26}else{C.prototype.am=function t(e,r,i,n,s,a){var o=16383&r;var u=r>>14;while(--a>=0){var c=16383&this[e];var l=this[e++]>>14;var f=u*c+l*o;c=o*c+((16383&f)<<14)+i[n]+s;s=(c>>28)+(f>>14)+u*l;i[n++]=268435455&c}return s};x=28}C.prototype.DB=x;C.prototype.DM=(1<<x)-1;C.prototype.DV=1<<x;var j=52;C.prototype.FV=Math.pow(2,j);C.prototype.F1=j-x;C.prototype.F2=2*x-j;var q=[];var F;var z;F="0".charCodeAt(0);for(z=0;z<=9;++z)q[F++]=z;F="a".charCodeAt(0);for(z=10;z<36;++z)q[F++]=z;F="A".charCodeAt(0);for(z=10;z<36;++z)q[F++]=z;function G(t,e){var r=q[t.charCodeAt(e)];return null==r?-1:r}function Y(t){var e=H();e.fromInt(t);return e}function W(t){var e=1;var r;if(0!=(r=t>>>16)){t=r;e+=16}if(0!=(r=t>>8)){t=r;e+=8}if(0!=(r=t>>4)){t=r;e+=4}if(0!=(r=t>>2)){t=r;e+=2}if(0!=(r=t>>1)){t=r;e+=1}return e}C.ZERO=Y(0);C.ONE=Y(1);var J=function(){function t(){this.i=0;this.j=0;this.S=[]}t.prototype.init=function(t){var e;var r;var i;for(e=0;e<256;++e)this.S[e]=e;r=0;for(e=0;e<256;++e){r=r+this.S[e]+t[e%t.length]&255;i=this.S[e];this.S[e]=this.S[r];this.S[r]=i}this.i=0;this.j=0};t.prototype.next=function(){var t;this.i=this.i+1&255;this.j=this.j+this.S[this.i]&255;t=this.S[this.i];this.S[this.i]=this.S[this.j];this.S[this.j]=t;return this.S[t+this.S[this.i]&255]};return t}();function Z(){return new J}var $=256;var X;var Q=null;var tt;if(null==Q){Q=[];tt=0;var et=void 0;var rt=0;var it=function(t){rt=rt||0;if(rt>=256||tt>=rng_psize)return;try{var e=t.x+t.y;Q[tt++]=255&e;rt+=1}catch(t){}}}function nt(){if(null==X){X=Z();while(tt<$){var t=Math.floor(65536*Math.random());Q[tt++]=255&t}X.init(Q);for(tt=0;tt<Q.length;++tt)Q[tt]=0;tt=0}return X.next()}var st=function(){function t(){}t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=nt()};return t}();function at(t,e){if(e<t.length+22){console.error("Message too long for RSA");return null}var r=e-t.length-6;var i="";for(var n=0;n<r;n+=2)i+="ff";var s="0001"+i+"00"+t;return U(s,16)}function ot(t,e){if(e<t.length+11){console.error("Message too long for RSA");return null}var r=[];var i=t.length-1;while(i>=0&&e>0){var n=t.charCodeAt(i--);if(n<128)r[--e]=n;else if(n>127&&n<2048){r[--e]=63&n|128;r[--e]=n>>6|192}else{r[--e]=63&n|128;r[--e]=n>>6&63|128;r[--e]=n>>12|224}}r[--e]=0;var s=new st;var a=[];while(e>2){a[0]=0;while(0==a[0])s.nextBytes(a);r[--e]=a[0]}r[--e]=2;r[--e]=0;return new C(r)}var ut=function(){function t(){this.n=null;this.e=0;this.d=null;this.p=null;this.q=null;this.dmp1=null;this.dmq1=null;this.coeff=null}t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)};t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);var e=t.mod(this.p).modPow(this.dmp1,this.p);var r=t.mod(this.q).modPow(this.dmq1,this.q);while(e.compareTo(r)<0)e=e.add(this.p);return e.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)};t.prototype.setPublic=function(t,e){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16)}else console.error("Invalid RSA public key")};t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3;var r=ot(t,e);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var n=i.toString(16);var s=n.length;for(var a=0;a<2*e-s;a++)n="0"+n;return n};t.prototype.setPrivate=function(t,e,r){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);this.d=U(r,16)}else console.error("Invalid RSA private key")};t.prototype.setPrivateEx=function(t,e,r,i,n,s,a,o){if(null!=t&&null!=e&&t.length>0&&e.length>0){this.n=U(t,16);this.e=parseInt(e,16);this.d=U(r,16);this.p=U(i,16);this.q=U(n,16);this.dmp1=U(s,16);this.dmq1=U(a,16);this.coeff=U(o,16)}else console.error("Invalid RSA private key")};t.prototype.generate=function(t,e){var r=new st;var i=t>>1;this.e=parseInt(e,16);var n=new C(e,16);for(;;){for(;;){this.p=new C(t-i,1,r);if(0==this.p.subtract(C.ONE).gcd(n).compareTo(C.ONE)&&this.p.isProbablePrime(10))break}for(;;){this.q=new C(i,1,r);if(0==this.q.subtract(C.ONE).gcd(n).compareTo(C.ONE)&&this.q.isProbablePrime(10))break}if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q;this.q=s}var a=this.p.subtract(C.ONE);var o=this.q.subtract(C.ONE);var u=a.multiply(o);if(0==u.gcd(n).compareTo(C.ONE)){this.n=this.p.multiply(this.q);this.d=n.modInverse(u);this.dmp1=this.d.mod(a);this.dmq1=this.d.mod(o);this.coeff=this.q.modInverse(this.p);break}}};t.prototype.decrypt=function(t){var e=U(t,16);var r=this.doPrivate(e);if(null==r)return null;return ct(r,this.n.bitLength()+7>>3)};t.prototype.generateAsync=function(t,e,r){var i=new st;var n=t>>1;this.e=parseInt(e,16);var s=new C(e,16);var a=this;var o=function(){var e=function(){if(a.p.compareTo(a.q)<=0){var t=a.p;a.p=a.q;a.q=t}var e=a.p.subtract(C.ONE);var i=a.q.subtract(C.ONE);var n=e.multiply(i);if(0==n.gcd(s).compareTo(C.ONE)){a.n=a.p.multiply(a.q);a.d=s.modInverse(n);a.dmp1=a.d.mod(e);a.dmq1=a.d.mod(i);a.coeff=a.q.modInverse(a.p);setTimeout((function(){r()}),0)}else setTimeout(o,0)};var u=function(){a.q=H();a.q.fromNumberAsync(n,1,i,(function(){a.q.subtract(C.ONE).gcda(s,(function(t){if(0==t.compareTo(C.ONE)&&a.q.isProbablePrime(10))setTimeout(e,0);else setTimeout(u,0)}))}))};var c=function(){a.p=H();a.p.fromNumberAsync(t-n,1,i,(function(){a.p.subtract(C.ONE).gcda(s,(function(t){if(0==t.compareTo(C.ONE)&&a.p.isProbablePrime(10))setTimeout(u,0);else setTimeout(c,0)}))}))};setTimeout(c,0)};setTimeout(o,0)};t.prototype.sign=function(t,e,r){var i=ht(r);var n=i+e(t).toString();var s=at(n,this.n.bitLength()/4);if(null==s)return null;var a=this.doPrivate(s);if(null==a)return null;var o=a.toString(16);if(0==(1&o.length))return o;else return"0"+o};t.prototype.verify=function(t,e,r){var i=U(e,16);var n=this.doPublic(i);if(null==n)return null;var s=n.toString(16).replace(/^1f+00/,"");var a=dt(s);return a==r(t).toString()};t.prototype.encryptLong=function(t){var e=this;var r="";var i=(this.n.bitLength()+7>>3)-11;var n=this.setSplitChn(t,i);n.forEach((function(t){r+=e.encrypt(t)}));return r};t.prototype.decryptLong=function(t){var e="";var r=this.n.bitLength()+7>>3;var i=2*r;if(t.length>i){var n=t.match(new RegExp(".{1,"+i+"}","g"))||[];var s=[];for(var a=0;a<n.length;a++){var o=U(n[a],16);var u=this.doPrivate(o);if(null==u)return null;s.push(u)}e=lt(s,r)}else e=this.decrypt(t);return e};t.prototype.setSplitChn=function(t,e,r){if(void 0===r)r=[];var i=t.split("");var n=0;for(var s=0;s<i.length;s++){var a=i[s].charCodeAt(0);if(a<=127)n+=1;else if(a<=2047)n+=2;else if(a<=65535)n+=3;else n+=4;if(n>e){var o=t.substring(0,s);r.push(o);return this.setSplitChn(t.substring(s),e,r)}}r.push(t);return r};return t}();function ct(t,e){var r=t.toByteArray();var i=0;while(i<r.length&&0==r[i])++i;if(r.length-i!=e-1||2!=r[i])return null;++i;while(0!=r[i])if(++i>=r.length)return null;var n="";while(++i<r.length){var s=255&r[i];if(s<128)n+=String.fromCharCode(s);else if(s>191&&s<224){n+=String.fromCharCode((31&s)<<6|63&r[i+1]);++i}else{n+=String.fromCharCode((15&s)<<12|(63&r[i+1])<<6|63&r[i+2]);i+=2}}return n}function lt(t,e){var r=[];for(var i=0;i<t.length;i++){var n=t[i];var s=n.toByteArray();var a=0;while(a<s.length&&0==s[a])++a;if(s.length-a!=e-1||2!=s[a])return null;++a;while(0!=s[a])if(++a>=s.length)return null;r=r.concat(s.slice(a+1))}var o=r;var u=-1;var c="";while(++u<o.length){var l=255&o[u];if(l<128)c+=String.fromCharCode(l);else if(l>191&&l<224){c+=String.fromCharCode((31&l)<<6|63&o[u+1]);++u}else{c+=String.fromCharCode((15&l)<<12|(63&o[u+1])<<6|63&o[u+2]);u+=2}}return c}var ft={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function ht(t){return ft[t]||""}function dt(t){for(var e in ft)if(ft.hasOwnProperty(e)){var r=ft[e];var i=r.length;if(t.substr(0,i)==r)return t.substr(i)}return t}var vt={};vt.lang={extend:function(t,e,r){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");var i=function(){};i.prototype=e.prototype;t.prototype=new i;t.prototype.constructor=t;t.superclass=e.prototype;if(e.prototype.constructor==Object.prototype.constructor)e.prototype.constructor=e;if(r){var n;for(n in r)t.prototype[n]=r[n];var s=function(){},a=["toString","valueOf"];try{if(/MSIE/.test(navigator.userAgent))s=function(t,e){for(n=0;n<a.length;n+=1){var r=a[n],i=e[r];if("function"===typeof i&&i!=Object.prototype[r])t[r]=i}}}catch(t){}s(t.prototype,r)}}};var pt={};if("undefined"==typeof pt.asn1||!pt.asn1)pt.asn1={};pt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);if(e.length%2==1)e="0"+e;return e};this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1)){if(e.length%2==1)e="0"+e;else if(!e.match(/^[0-7]/))e="00"+e}else{var r=e.substr(1);var i=r.length;if(i%2==1)i+=1;else if(!e.match(/^[0-7]/))i+=2;var n="";for(var s=0;s<i;s++)n+="f";var a=new C(n,16);var o=a.xor(t).add(C.ONE);e=o.toString(16).replace(/^-/,"")}return e};this.getPEMStringFromHex=function(t,e){return hextopem(t,e)};this.newObject=function(t){var e=pt,r=e.asn1,i=r.DERBoolean,n=r.DERInteger,s=r.DERBitString,a=r.DEROctetString,o=r.DERNull,u=r.DERObjectIdentifier,c=r.DEREnumerated,l=r.DERUTF8String,f=r.DERNumericString,h=r.DERPrintableString,d=r.DERTeletexString,v=r.DERIA5String,p=r.DERUTCTime,g=r.DERGeneralizedTime,y=r.DERSequence,m=r.DERSet,w=r.DERTaggedObject,S=r.ASN1Util.newObject;var _=Object.keys(t);if(1!=_.length)throw"key of param shall be only one.";var b=_[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+b+":"))throw"undefined key: "+b;if("bool"==b)return new i(t[b]);if("int"==b)return new n(t[b]);if("bitstr"==b)return new s(t[b]);if("octstr"==b)return new a(t[b]);if("null"==b)return new o(t[b]);if("oid"==b)return new u(t[b]);if("enum"==b)return new c(t[b]);if("utf8str"==b)return new l(t[b]);if("numstr"==b)return new f(t[b]);if("prnstr"==b)return new h(t[b]);if("telstr"==b)return new d(t[b]);if("ia5str"==b)return new v(t[b]);if("utctime"==b)return new p(t[b]);if("gentime"==b)return new g(t[b]);if("seq"==b){var E=t[b];var D=[];for(var M=0;M<E.length;M++){var T=S(E[M]);D.push(T)}return new y({array:D})}if("set"==b){var E=t[b];var D=[];for(var M=0;M<E.length;M++){var T=S(E[M]);D.push(T)}return new m({array:D})}if("tag"==b){var I=t[b];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var A=S(I[2]);return new w({tag:I[0],explicit:I[1],obj:A})}else{var x={};if(void 0!==I.explicit)x.explicit=I.explicit;if(void 0!==I.tag)x.tag=I.tag;if(void 0===I.obj)throw"obj shall be specified for 'tag'.";x.obj=S(I.obj);return new w(x)}}};this.jsonToASN1HEX=function(t){var e=this.newObject(t);return e.getEncodedHex()}};pt.asn1.ASN1Util.oidHexToInt=function(t){var e="";var r=parseInt(t.substr(0,2),16);var i=Math.floor(r/40);var n=r%40;var e=i+"."+n;var s="";for(var a=2;a<t.length;a+=2){var o=parseInt(t.substr(a,2),16);var u=("00000000"+o.toString(2)).slice(-8);s+=u.substr(1,7);if("0"==u.substr(0,1)){var c=new C(s,2);e=e+"."+c.toString(10);s=""}}return e};pt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);if(1==e.length)e="0"+e;return e};var r=function(t){var r="";var i=new C(t,10);var n=i.toString(2);var s=7-n.length%7;if(7==s)s=0;var a="";for(var o=0;o<s;o++)a+="0";n=a+n;for(var o=0;o<n.length-1;o+=7){var u=n.substr(o,7);if(o!=n.length-7)u="1"+u;r+=e(parseInt(u,2))}return r};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="";var n=t.split(".");var s=40*parseInt(n[0])+parseInt(n[1]);i+=e(s);n.splice(0,2);for(var a=0;a<n.length;a++)i+=r(n[a]);return i};pt.asn1.ASN1Object=function(){var t=true;var e=null;var r="00";var i="00";var n="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+n.length+",v="+this.hV;var t=this.hV.length/2;var e=t.toString(16);if(e.length%2==1)e="0"+e;if(t<128)return e;else{var r=e.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var i=128+r;return i.toString(16)+e}};this.getEncodedHex=function(){if(null==this.hTLV||this.isModified){this.hV=this.getFreshValueHex();this.hL=this.getLengthHexFromValue();this.hTLV=this.hT+this.hL+this.hV;this.isModified=false}return this.hTLV};this.getValueHex=function(){this.getEncodedHex();return this.hV};this.getFreshValueHex=function(){return""}};pt.asn1.DERAbstractString=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this);var e=null;var r=null;this.getString=function(){return this.s};this.setString=function(t){this.hTLV=null;this.isModified=true;this.s=t;this.hV=stohex(this.s)};this.setStringHex=function(t){this.hTLV=null;this.isModified=true;this.s=null;this.hV=t};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("string"==typeof t)this.setString(t);else if("undefined"!=typeof t["str"])this.setString(t["str"]);else if("undefined"!=typeof t["hex"])this.setStringHex(t["hex"])};vt.lang.extend(pt.asn1.DERAbstractString,pt.asn1.ASN1Object);pt.asn1.DERAbstractTime=function(t){pt.asn1.DERAbstractTime.superclass.constructor.call(this);var e=null;var r=null;this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e};this.formatDate=function(t,e,r){var i=this.zeroPadding;var n=this.localDateToUTC(t);var s=String(n.getFullYear());if("utc"==e)s=s.substr(2,2);var a=i(String(n.getMonth()+1),2);var o=i(String(n.getDate()),2);var u=i(String(n.getHours()),2);var c=i(String(n.getMinutes()),2);var l=i(String(n.getSeconds()),2);var f=s+a+o+u+c+l;if(true===r){var h=n.getMilliseconds();if(0!=h){var d=i(String(h),3);d=d.replace(/[0]+$/,"");f=f+"."+d}}return f+"Z"};this.zeroPadding=function(t,e){if(t.length>=e)return t;return new Array(e-t.length+1).join("0")+t};this.getString=function(){return this.s};this.setString=function(t){this.hTLV=null;this.isModified=true;this.s=t;this.hV=stohex(t)};this.setByDateValue=function(t,e,r,i,n,s){var a=new Date(Date.UTC(t,e-1,r,i,n,s,0));this.setByDate(a)};this.getFreshValueHex=function(){return this.hV}};vt.lang.extend(pt.asn1.DERAbstractTime,pt.asn1.ASN1Object);pt.asn1.DERAbstractStructured=function(t){pt.asn1.DERAbstractString.superclass.constructor.call(this);var e=null;this.setByASN1ObjectArray=function(t){this.hTLV=null;this.isModified=true;this.asn1Array=t};this.appendASN1Object=function(t){this.hTLV=null;this.isModified=true;this.asn1Array.push(t)};this.asn1Array=new Array;if("undefined"!=typeof t)if("undefined"!=typeof t["array"])this.asn1Array=t["array"]};vt.lang.extend(pt.asn1.DERAbstractStructured,pt.asn1.ASN1Object);pt.asn1.DERBoolean=function(){pt.asn1.DERBoolean.superclass.constructor.call(this);this.hT="01";this.hTLV="0101ff"};vt.lang.extend(pt.asn1.DERBoolean,pt.asn1.ASN1Object);pt.asn1.DERInteger=function(t){pt.asn1.DERInteger.superclass.constructor.call(this);this.hT="02";this.setByBigInteger=function(t){this.hTLV=null;this.isModified=true;this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)};this.setByInteger=function(t){var e=new C(String(t),10);this.setByBigInteger(e)};this.setValueHex=function(t){this.hV=t};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t["bigint"])this.setByBigInteger(t["bigint"]);else if("undefined"!=typeof t["int"])this.setByInteger(t["int"]);else if("number"==typeof t)this.setByInteger(t);else if("undefined"!=typeof t["hex"])this.setValueHex(t["hex"])};vt.lang.extend(pt.asn1.DERInteger,pt.asn1.ASN1Object);pt.asn1.DERBitString=function(t){if(void 0!==t&&"undefined"!==typeof t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}pt.asn1.DERBitString.superclass.constructor.call(this);this.hT="03";this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null;this.isModified=true;this.hV=t};this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var r="0"+t;this.hTLV=null;this.isModified=true;this.hV=r+e};this.setByBinaryString=function(t){t=t.replace(/0+$/,"");var e=8-t.length%8;if(8==e)e=0;for(var r=0;r<=e;r++)t+="0";var i="";for(var r=0;r<t.length-1;r+=8){var n=t.substr(r,8);var s=parseInt(n,2).toString(16);if(1==s.length)s="0"+s;i+=s}this.hTLV=null;this.isModified=true;this.hV="0"+e+i};this.setByBooleanArray=function(t){var e="";for(var r=0;r<t.length;r++)if(true==t[r])e+="1";else e+="0";this.setByBinaryString(e)};this.newFalseArray=function(t){var e=new Array(t);for(var r=0;r<t;r++)e[r]=false;return e};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/))this.setHexValueIncludingUnusedBits(t);else if("undefined"!=typeof t["hex"])this.setHexValueIncludingUnusedBits(t["hex"]);else if("undefined"!=typeof t["bin"])this.setByBinaryString(t["bin"]);else if("undefined"!=typeof t["array"])this.setByBooleanArray(t["array"])};vt.lang.extend(pt.asn1.DERBitString,pt.asn1.ASN1Object);pt.asn1.DEROctetString=function(t){if(void 0!==t&&"undefined"!==typeof t.obj){var e=pt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}pt.asn1.DEROctetString.superclass.constructor.call(this,t);this.hT="04"};vt.lang.extend(pt.asn1.DEROctetString,pt.asn1.DERAbstractString);pt.asn1.DERNull=function(){pt.asn1.DERNull.superclass.constructor.call(this);this.hT="05";this.hTLV="0500"};vt.lang.extend(pt.asn1.DERNull,pt.asn1.ASN1Object);pt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);if(1==e.length)e="0"+e;return e};var r=function(t){var r="";var i=new C(t,10);var n=i.toString(2);var s=7-n.length%7;if(7==s)s=0;var a="";for(var o=0;o<s;o++)a+="0";n=a+n;for(var o=0;o<n.length-1;o+=7){var u=n.substr(o,7);if(o!=n.length-7)u="1"+u;r+=e(parseInt(u,2))}return r};pt.asn1.DERObjectIdentifier.superclass.constructor.call(this);this.hT="06";this.setValueHex=function(t){this.hTLV=null;this.isModified=true;this.s=null;this.hV=t};this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="";var n=t.split(".");var s=40*parseInt(n[0])+parseInt(n[1]);i+=e(s);n.splice(0,2);for(var a=0;a<n.length;a++)i+=r(n[a]);this.hTLV=null;this.isModified=true;this.s=null;this.hV=i};this.setValueName=function(t){var e=pt.asn1.x509.OID.name2oid(t);if(""!==e)this.setValueOidString(e);else throw"DERObjectIdentifier oidName undefined: "+t};this.getFreshValueHex=function(){return this.hV};if(void 0!==t)if("string"===typeof t)if(t.match(/^[0-2].[0-9.]+$/))this.setValueOidString(t);else this.setValueName(t);else if(void 0!==t.oid)this.setValueOidString(t.oid);else if(void 0!==t.hex)this.setValueHex(t.hex);else if(void 0!==t.name)this.setValueName(t.name)};vt.lang.extend(pt.asn1.DERObjectIdentifier,pt.asn1.ASN1Object);pt.asn1.DEREnumerated=function(t){pt.asn1.DEREnumerated.superclass.constructor.call(this);this.hT="0a";this.setByBigInteger=function(t){this.hTLV=null;this.isModified=true;this.hV=pt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)};this.setByInteger=function(t){var e=new C(String(t),10);this.setByBigInteger(e)};this.setValueHex=function(t){this.hV=t};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t["int"])this.setByInteger(t["int"]);else if("number"==typeof t)this.setByInteger(t);else if("undefined"!=typeof t["hex"])this.setValueHex(t["hex"])};vt.lang.extend(pt.asn1.DEREnumerated,pt.asn1.ASN1Object);pt.asn1.DERUTF8String=function(t){pt.asn1.DERUTF8String.superclass.constructor.call(this,t);this.hT="0c"};vt.lang.extend(pt.asn1.DERUTF8String,pt.asn1.DERAbstractString);pt.asn1.DERNumericString=function(t){pt.asn1.DERNumericString.superclass.constructor.call(this,t);this.hT="12"};vt.lang.extend(pt.asn1.DERNumericString,pt.asn1.DERAbstractString);pt.asn1.DERPrintableString=function(t){pt.asn1.DERPrintableString.superclass.constructor.call(this,t);this.hT="13"};vt.lang.extend(pt.asn1.DERPrintableString,pt.asn1.DERAbstractString);pt.asn1.DERTeletexString=function(t){pt.asn1.DERTeletexString.superclass.constructor.call(this,t);this.hT="14"};vt.lang.extend(pt.asn1.DERTeletexString,pt.asn1.DERAbstractString);pt.asn1.DERIA5String=function(t){pt.asn1.DERIA5String.superclass.constructor.call(this,t);this.hT="16"};vt.lang.extend(pt.asn1.DERIA5String,pt.asn1.DERAbstractString);pt.asn1.DERUTCTime=function(t){pt.asn1.DERUTCTime.superclass.constructor.call(this,t);this.hT="17";this.setByDate=function(t){this.hTLV=null;this.isModified=true;this.date=t;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s)};this.getFreshValueHex=function(){if("undefined"==typeof this.date&&"undefined"==typeof this.s){this.date=new Date;this.s=this.formatDate(this.date,"utc");this.hV=stohex(this.s)}return this.hV};if(void 0!==t)if(void 0!==t.str)this.setString(t.str);else if("string"==typeof t&&t.match(/^[0-9]{12}Z$/))this.setString(t);else if(void 0!==t.hex)this.setStringHex(t.hex);else if(void 0!==t.date)this.setByDate(t.date)};vt.lang.extend(pt.asn1.DERUTCTime,pt.asn1.DERAbstractTime);pt.asn1.DERGeneralizedTime=function(t){pt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t);this.hT="18";this.withMillis=false;this.setByDate=function(t){this.hTLV=null;this.isModified=true;this.date=t;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=stohex(this.s)};this.getFreshValueHex=function(){if(void 0===this.date&&void 0===this.s){this.date=new Date;this.s=this.formatDate(this.date,"gen",this.withMillis);this.hV=stohex(this.s)}return this.hV};if(void 0!==t){if(void 0!==t.str)this.setString(t.str);else if("string"==typeof t&&t.match(/^[0-9]{14}Z$/))this.setString(t);else if(void 0!==t.hex)this.setStringHex(t.hex);else if(void 0!==t.date)this.setByDate(t.date);if(true===t.millis)this.withMillis=true}};vt.lang.extend(pt.asn1.DERGeneralizedTime,pt.asn1.DERAbstractTime);pt.asn1.DERSequence=function(t){pt.asn1.DERSequence.superclass.constructor.call(this,t);this.hT="30";this.getFreshValueHex=function(){var t="";for(var e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t+=r.getEncodedHex()}this.hV=t;return this.hV}};vt.lang.extend(pt.asn1.DERSequence,pt.asn1.DERAbstractStructured);pt.asn1.DERSet=function(t){pt.asn1.DERSet.superclass.constructor.call(this,t);this.hT="31";this.sortFlag=true;this.getFreshValueHex=function(){var t=new Array;for(var e=0;e<this.asn1Array.length;e++){var r=this.asn1Array[e];t.push(r.getEncodedHex())}if(true==this.sortFlag)t.sort();this.hV=t.join("");return this.hV};if("undefined"!=typeof t)if("undefined"!=typeof t.sortflag&&false==t.sortflag)this.sortFlag=false};vt.lang.extend(pt.asn1.DERSet,pt.asn1.DERAbstractStructured);pt.asn1.DERTaggedObject=function(t){pt.asn1.DERTaggedObject.superclass.constructor.call(this);this.hT="a0";this.hV="";this.isExplicit=true;this.asn1Object=null;this.setASN1Object=function(t,e,r){this.hT=e;this.isExplicit=t;this.asn1Object=r;if(this.isExplicit){this.hV=this.asn1Object.getEncodedHex();this.hTLV=null;this.isModified=true}else{this.hV=null;this.hTLV=r.getEncodedHex();this.hTLV=this.hTLV.replace(/^../,e);this.isModified=false}};this.getFreshValueHex=function(){return this.hV};if("undefined"!=typeof t){if("undefined"!=typeof t["tag"])this.hT=t["tag"];if("undefined"!=typeof t["explicit"])this.isExplicit=t["explicit"];if("undefined"!=typeof t["obj"]){this.asn1Object=t["obj"];this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)}}};vt.lang.extend(pt.asn1.DERTaggedObject,pt.asn1.ASN1Object);var gt=void 0&&(void 0).__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();var yt=function(t){gt(e,t);function e(r){var i=t.call(this)||this;if(r)if("string"===typeof r)i.parseKey(r);else if(e.hasPrivateKeyProperty(r)||e.hasPublicKeyProperty(r))i.parsePropertiesFrom(r);return i}e.prototype.parseKey=function(t){try{var e=0;var r=0;var i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/;var n=i.test(t)?y.decode(t):w.unarmor(t);var s=I.decode(n);if(3===s.sub.length)s=s.sub[2].sub[0];if(9===s.sub.length){e=s.sub[1].getHexStringValue();this.n=U(e,16);r=s.sub[2].getHexStringValue();this.e=parseInt(r,16);var a=s.sub[3].getHexStringValue();this.d=U(a,16);var o=s.sub[4].getHexStringValue();this.p=U(o,16);var u=s.sub[5].getHexStringValue();this.q=U(u,16);var c=s.sub[6].getHexStringValue();this.dmp1=U(c,16);var l=s.sub[7].getHexStringValue();this.dmq1=U(l,16);var f=s.sub[8].getHexStringValue();this.coeff=U(f,16)}else if(2===s.sub.length){var h=s.sub[1];var d=h.sub[0];e=d.sub[0].getHexStringValue();this.n=U(e,16);r=d.sub[1].getHexStringValue();this.e=parseInt(r,16)}else return false;return true}catch(t){return false}};e.prototype.getPrivateBaseKey=function(){var t={array:[new pt.asn1.DERInteger({int:0}),new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e}),new pt.asn1.DERInteger({bigint:this.d}),new pt.asn1.DERInteger({bigint:this.p}),new pt.asn1.DERInteger({bigint:this.q}),new pt.asn1.DERInteger({bigint:this.dmp1}),new pt.asn1.DERInteger({bigint:this.dmq1}),new pt.asn1.DERInteger({bigint:this.coeff})]};var e=new pt.asn1.DERSequence(t);return e.getEncodedHex()};e.prototype.getPrivateBaseKeyB64=function(){return d(this.getPrivateBaseKey())};e.prototype.getPublicBaseKey=function(){var t=new pt.asn1.DERSequence({array:[new pt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new pt.asn1.DERNull]});var e=new pt.asn1.DERSequence({array:[new pt.asn1.DERInteger({bigint:this.n}),new pt.asn1.DERInteger({int:this.e})]});var r=new pt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});var i=new pt.asn1.DERSequence({array:[t,r]});return i.getEncodedHex()};e.prototype.getPublicBaseKeyB64=function(){return d(this.getPublicBaseKey())};e.wordwrap=function(t,e){e=e||64;if(!t)return t;var r="(.{1,"+e+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(r,"g")).join("\n")};e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n";t+="-----END RSA PRIVATE KEY-----";return t};e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n";t+="-----END PUBLIC KEY-----";return t};e.hasPublicKeyProperty=function(t){t=t||{};return t.hasOwnProperty("n")&&t.hasOwnProperty("e")};e.hasPrivateKeyProperty=function(t){t=t||{};return t.hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")};e.prototype.parsePropertiesFrom=function(t){this.n=t.n;this.e=t.e;if(t.hasOwnProperty("d")){this.d=t.d;this.p=t.p;this.q=t.q;this.dmp1=t.dmp1;this.dmq1=t.dmq1;this.coeff=t.coeff}};return e}(ut);const mt={i:"3.2.1"};var wt=function(){function t(t){if(void 0===t)t={};t=t||{};this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024;this.default_public_exponent=t.default_public_exponent||"010001";this.log=t.log||false;this.key=null}t.prototype.setKey=function(t){if(this.log&&this.key)console.warn("A key was already set, overriding existing.");this.key=new yt(t)};t.prototype.setPrivateKey=function(t){this.setKey(t)};t.prototype.setPublicKey=function(t){this.setKey(t)};t.prototype.decrypt=function(t){try{return this.getKey().decrypt(t)}catch(t){return false}};t.prototype.encrypt=function(t){try{return this.getKey().encrypt(t)}catch(t){return false}};t.prototype.encryptLong=function(t){try{return d(this.getKey().encryptLong(t))}catch(t){return false}};t.prototype.decryptLong=function(t){try{return this.getKey().decryptLong(t)}catch(t){return false}};t.prototype.sign=function(t,e,r){try{return d(this.getKey().sign(t,e,r))}catch(t){return false}};t.prototype.verify=function(t,e,r){try{return this.getKey().verify(t,v(e),r)}catch(t){return false}};t.prototype.getKey=function(t){if(!this.key){this.key=new yt;if(t&&"[object Function]"==={}.toString.call(t)){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key};t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()};t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()};t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()};t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()};t.version=mt.i;return t}();const St=wt},2480:()=>{}};var e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var s=e[i]={id:i,loaded:false,exports:{}};t[i].call(s.exports,s,s.exports,r);s.loaded=true;return s.exports}(()=>{r.d=(t,e)=>{for(var i in e)if(r.o(e,i)&&!r.o(t,i))Object.defineProperty(t,i,{enumerable:true,get:e[i]})}})();(()=>{r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()})();(()=>{r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{r.r=t=>{if("undefined"!==typeof Symbol&&Symbol.toStringTag)Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});Object.defineProperty(t,"__esModule",{value:true})}})();(()=>{r.nmd=t=>{t.paths=[];if(!t.children)t.children=[];return t}})();var i=r(9021);return i})()));
|
88
88
|
//# sourceMappingURL=gtpush.map
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcloudio/uni-push",
|
3
|
-
"version": "3.0.0-alpha-
|
3
|
+
"version": "3.0.0-alpha-3080720230627001",
|
4
4
|
"description": "@dcloudio/uni-push",
|
5
5
|
"main": "lib/uni-push.js",
|
6
6
|
"module": "lib/uni-push.js",
|
@@ -20,6 +20,6 @@
|
|
20
20
|
},
|
21
21
|
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
22
22
|
"dependencies": {
|
23
|
-
"@dcloudio/uni-cli-shared": "3.0.0-alpha-
|
23
|
+
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3080720230627001"
|
24
24
|
}
|
25
25
|
}
|