Skip to content

Instantly share code, notes, and snippets.

@selfboot
Last active January 29, 2019 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selfboot/3ba2a75ba1077fa7c6c61a0bc84eeaed to your computer and use it in GitHub Desktop.
Save selfboot/3ba2a75ba1077fa7c6c61a0bc84eeaed to your computer and use it in GitHub Desktop.
!function(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var i=r();for(var e in i)("object"==typeof exports?exports:t)[e]=i[e]}}(window,function(){return function(t){var r={};function i(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=r,i.d=function(t,r,e){i.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:e})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,r){if(1&r&&(t=i(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(i.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var n in t)i.d(e,n,function(r){return t[r]}.bind(null,n));return e},i.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(r,"a",r),r},i.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},i.p="",i(i.s=2)}([function(t,r,i){"use strict";
/*! CryptoJS v3.1.2 core-fix.js
* code.google.com/p/crypto-js
* (c) 2009-2013 by Jeff Mott. All rights reserved.
* code.google.com/p/crypto-js/wiki/License
* THIS IS FIX of 'core.js' to fix Hmac issue.
* https://code.google.com/p/crypto-js/issues/detail?id=84
* https://crypto-js.googlecode.com/svn-history/r667/branches/3.x/src/core.js
*/var e=function(t,r){var i={},e=i.lib={},n=e.Base=function(){function t(){}return{extend:function(r){t.prototype=this;var i=new t;return r&&i.mixIn(r),i.hasOwnProperty("init")||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var r in t)t.hasOwnProperty(r)&&(this[r]=t[r]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),s=e.WordArray=n.extend({init:function(t,r){t=this.words=t||[],this.sigBytes=void 0!=r?r:4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var r=this.words,i=t.words,e=this.sigBytes,n=t.sigBytes;if(this.clamp(),e%4)for(var s=0;s<n;s++){var o=i[s>>>2]>>>24-s%4*8&255;r[e+s>>>2]|=o<<24-(e+s)%4*8}else for(s=0;s<n;s+=4)r[e+s>>>2]=i[s>>>2];return this.sigBytes+=n,this},clamp:function(){var r=this.words,i=this.sigBytes;r[i>>>2]&=4294967295<<32-i%4*8,r.length=t.ceil(i/4)},clone:function(){var t=n.clone.call(this);return t.words=this.words.slice(0),t},random:function(r){for(var i=[],e=0;e<r;e+=4)i.push(4294967296*t.random()|0);return new s.init(i,r)}}),o=i.enc={},h=o.Hex={stringify:function(t){for(var r=t.words,i=t.sigBytes,e=[],n=0;n<i;n++){var s=r[n>>>2]>>>24-n%4*8&255;e.push((s>>>4).toString(16)),e.push((15&s).toString(16))}return e.join("")},parse:function(t){for(var r=t.length,i=[],e=0;e<r;e+=2)i[e>>>3]|=parseInt(t.substr(e,2),16)<<24-e%8*4;return new s.init(i,r/2)}},a=o.Latin1={stringify:function(t){for(var r=t.words,i=t.sigBytes,e=[],n=0;n<i;n++){var s=r[n>>>2]>>>24-n%4*8&255;e.push(String.fromCharCode(s))}return e.join("")},parse:function(t){for(var r=t.length,i=[],e=0;e<r;e++)i[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8;return new s.init(i,r)}},u=o.Utf8={stringify:function(t){try{return decodeURIComponent(escape(a.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return a.parse(unescape(encodeURIComponent(t)))}},f=e.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=u.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(r){var i=this._data,e=i.words,n=i.sigBytes,o=this.blockSize,h=n/(4*o),a=(h=r?t.ceil(h):t.max((0|h)-this._minBufferSize,0))*o,u=t.min(4*a,n);if(a){for(var f=0;f<a;f+=o)this._doProcessBlock(e,f);var c=e.splice(0,a);i.sigBytes-=u}return new s.init(c,u)},clone:function(){var t=n.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),c=(e.Hasher=f.extend({cfg:n.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(r,i){return new t.init(i).finalize(r)}},_createHmacHelper:function(t){return function(r,i){return new c.HMAC.init(t,i).finalize(r)}}}),i.algo={});return i}(Math);r.a=e},function(t,r,i){"use strict";(function(t){var e=i(0),n={};
/*!
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.9.0
*/function s(t,r,i){if(r&&t){var e,n=function(){};if(n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=r.prototype,i)for(e in i)t.prototype[e]=i[e]}}
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/var o,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a="=";function u(t){var r,i,e="";for(r=0;r+3<=t.length;r+=3)i=parseInt(t.substring(r,r+3),16),e+=h.charAt(i>>6)+h.charAt(63&i);if(r+1==t.length?(i=parseInt(t.substring(r,r+1),16),e+=h.charAt(i<<2)):r+2==t.length&&(i=parseInt(t.substring(r,r+2),16),e+=h.charAt(i>>2)+h.charAt((3&i)<<4)),a)for(;(3&e.length)>0;)e+=a;return e}function f(t){var r,i,e,n="",s=0;for(r=0;r<t.length&&t.charAt(r)!=a;++r)(e=h.indexOf(t.charAt(r)))<0||(0==s?(n+=v(e>>2),i=3&e,s=1):1==s?(n+=v(i<<2|e>>4),i=15&e,s=2):2==s?(n+=v(i),n+=v(e>>2),i=3&e,s=3):(n+=v(i<<2|e>>4),n+=v(15&e),s=0));return 1==s&&(n+=v(i<<2)),n}
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/function c(t,r,i){null!=t&&("number"==typeof t?this.fromNumber(t,r,i):null==r&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,r))}var l,g,d="0123456789abcdefghijklmnopqrstuvwxyz",p=new Array;for(l="0".charCodeAt(0),g=0;g<=9;++g)p[l++]=g;for(l="a".charCodeAt(0),g=10;g<36;++g)p[l++]=g;for(l="A".charCodeAt(0),g=10;g<36;++g)p[l++]=g;function v(t){return d.charAt(t)}function m(t,r){var i=p[t.charCodeAt(r)];return null==i?-1:i}function y(t){var r=O();return r.fromInt(t),r}function S(t){var r,i=1;return 0!=(r=t>>>16)&&(t=r,i+=16),0!=(r=t>>8)&&(t=r,i+=8),0!=(r=t>>4)&&(t=r,i+=4),0!=(r=t>>2)&&(t=r,i+=2),0!=(r=t>>1)&&(t=r,i+=1),i}function A(t){this.m=t}function w(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}
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function b(t,r){return t&r}function E(t,r){return t|r}function T(t,r){return t^r}function D(t,r){return t&~r}function x(t){if(0==t)return-1;var r=0;return 0==(65535&t)&&(t>>=16,r+=16),0==(255&t)&&(t>>=8,r+=8),0==(15&t)&&(t>>=4,r+=4),0==(3&t)&&(t>>=2,r+=2),0==(1&t)&&++r,r}function R(t){for(var r=0;0!=t;)t&=t-1,++r;return r}function H(){}function P(t){this.r2=O(),this.q3=O(),c.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}A.prototype={convert:function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},revert:function(t){return t},reduce:function(t){t.divRemTo(this.m,null,t)},mulTo:function(t,r,i){t.multiplyTo(r,i),this.reduce(i)},sqrTo:function(t,r){t.squareTo(r),this.reduce(r)}},w.prototype={convert:function(t){var r=O();return t.abs().dlShiftTo(this.m.t,r),r.divRemTo(this.m,null,r),t.s<0&&r.compareTo(c.ZERO)>0&&this.m.subTo(r,r),r},revert:function(t){var r=O();return t.copyTo(r),this.reduce(r),r},reduce:function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var r=0;r<this.m.t;++r){var i=32767&t[r],e=i*this.mpl+((i*this.mph+(t[r]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=r+this.m.t]+=this.m.am(0,e,t,r,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},mulTo:function(t,r,i){t.multiplyTo(r,i),this.reduce(i)},sqrTo:function(t,r){t.squareTo(r),this.reduce(r)}},H.prototype={convert:function(t){return t},revert:function(t){return t},mulTo:function(t,r,i){t.multiplyTo(r,i)},sqrTo:function(t,r){t.squareTo(r)}},P.prototype={convert:function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var r=O();return t.copyTo(r),this.reduce(r),r},revert:function(t){return t},reduce:function(t){for(t.drShiftTo(this.m.t-1,this.r2),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);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},mulTo:function(t,r){t.squareTo(r),this.reduce(r)},sqrTo:function(t,r,i){t.multiplyTo(r,i),this.reduce(i)}};var B,N=[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],I=(1<<26)/N[N.length-1];function O(){return new c(null)}"Microsoft Internet Explorer"==n.appName?(B=function(t,r,i,e,n,s){for(var o=32767&r,h=r>>15;--s>=0;){var a=32767&this[t],u=this[t++]>>15,f=h*a+u*o;n=((a=o*a+((32767&f)<<15)+i[e]+(1073741823&n))>>>30)+(f>>>15)+h*u+(n>>>30),i[e++]=1073741823&a}return n},o=30):"Netscape"!=n.appName?(B=function(t,r,i,e,n,s){for(;--s>=0;){var o=r*this[t++]+i[e]+n;n=Math.floor(o/67108864),i[e++]=67108863&o}return n},o=26):(B=function(t,r,i,e,n,s){for(var o=16383&r,h=r>>14;--s>=0;){var a=16383&this[t],u=this[t++]>>14,f=h*a+u*o;n=((a=o*a+((16383&f)<<14)+i[e]+n)>>28)+(f>>14)+h*u,i[e++]=268435455&a}return n},o=28);
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function M(){this.i=0,this.j=0,this.S=new Array}c.prototype={FV:Math.pow(2,52),F1:52-o,F2:2*o-52,DB:o,DM:(1<<o)-1,DV:1<<o,am:B,copyTo:function(t){for(var r=this.t-1;r>=0;--r)t[r]=this[r];t.t=this.t,t.s=this.s},fromInt:function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},fromString:function(t,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)return void this.fromRadix(t,r);i=2}this.t=0,this.s=0;for(var e=t.length,n=!1,s=0;--e>=0;){var o=8==i?255&t[e]:m(t,e);o<0?"-"==t.charAt(e)&&(n=!0):(n=!1,0==s?this[this.t++]=o:s+i>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,(s+=i)>=this.DB&&(s-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),n&&c.ZERO.subTo(this,this)},clamp:function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},dlShiftTo:function(t,r){var i;for(i=this.t-1;i>=0;--i)r[i+t]=this[i];for(i=t-1;i>=0;--i)r[i]=0;r.t=this.t+t,r.s=this.s},drShiftTo:function(t,r){for(var i=t;i<this.t;++i)r[i-t]=this[i];r.t=Math.max(this.t-t,0),r.s=this.s},lShiftTo:function(t,r){var i,e=t%this.DB,n=this.DB-e,s=(1<<n)-1,o=Math.floor(t/this.DB),h=this.s<<e&this.DM;for(i=this.t-1;i>=0;--i)r[i+o+1]=this[i]>>n|h,h=(this[i]&s)<<e;for(i=o-1;i>=0;--i)r[i]=0;r[o]=h,r.t=this.t+o+1,r.s=this.s,r.clamp()},rShiftTo:function(t,r){r.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)r.t=0;else{var e=t%this.DB,n=this.DB-e,s=(1<<e)-1;r[0]=this[i]>>e;for(var o=i+1;o<this.t;++o)r[o-i-1]|=(this[o]&s)<<n,r[o-i]=this[o]>>e;e>0&&(r[this.t-i-1]|=(this.s&s)<<n),r.t=this.t-i,r.clamp()}},subTo:function(t,r){for(var i=0,e=0,n=Math.min(t.t,this.t);i<n;)e+=this[i]-t[i],r[i++]=e&this.DM,e>>=this.DB;if(t.t<this.t){for(e-=t.s;i<this.t;)e+=this[i],r[i++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;i<t.t;)e-=t[i],r[i++]=e&this.DM,e>>=this.DB;e-=t.s}r.s=e<0?-1:0,e<-1?r[i++]=this.DV+e:e>0&&(r[i++]=e),r.t=i,r.clamp()},multiplyTo:function(t,r){var i=this.abs(),e=t.abs(),n=i.t;for(r.t=n+e.t;--n>=0;)r[n]=0;for(n=0;n<e.t;++n)r[n+i.t]=i.am(0,e[n],r,n,0,i.t);r.s=0,r.clamp(),this.s!=t.s&&c.ZERO.subTo(r,r)},squareTo:function(t){for(var r=this.abs(),i=t.t=2*r.t;--i>=0;)t[i]=0;for(i=0;i<r.t-1;++i){var e=r.am(i,r[i],t,2*i,0,1);(t[i+r.t]+=r.am(i+1,2*r[i],t,2*i+1,e,r.t-i-1))>=r.DV&&(t[i+r.t]-=r.DV,t[i+r.t+1]=1)}t.t>0&&(t[t.t-1]+=r.am(i,r[i],t,2*i,0,1)),t.s=0,t.clamp()},divRemTo:function(t,r,i){var e=t.abs();if(!(e.t<=0)){var n=this.abs();if(n.t<e.t)return null!=r&&r.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=O());var s=O(),o=this.s,h=t.s,a=this.DB-S(e[e.t-1]);a>0?(e.lShiftTo(a,s),n.lShiftTo(a,i)):(e.copyTo(s),n.copyTo(i));var u=s.t,f=s[u-1];if(0!=f){var l=f*(1<<this.F1)+(u>1?s[u-2]>>this.F2:0),g=this.FV/l,d=(1<<this.F1)/l,p=1<<this.F2,v=i.t,m=v-u,y=null==r?O():r;for(s.dlShiftTo(m,y),i.compareTo(y)>=0&&(i[i.t++]=1,i.subTo(y,i)),c.ONE.dlShiftTo(u,y),y.subTo(s,s);s.t<u;)s[s.t++]=0;for(;--m>=0;){var A=i[--v]==f?this.DM:Math.floor(i[v]*g+(i[v-1]+p)*d);if((i[v]+=s.am(0,A,i,m,0,u))<A)for(s.dlShiftTo(m,y),i.subTo(y,i);i[v]<--A;)i.subTo(y,i)}null!=r&&(i.drShiftTo(u,r),o!=h&&c.ZERO.subTo(r,r)),i.t=u,i.clamp(),a>0&&i.rShiftTo(a,i),o<0&&c.ZERO.subTo(i,i)}}},invDigit:function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var r=3&t;return(r=(r=(r=(r=r*(2-(15&t)*r)&15)*(2-(255&t)*r)&255)*(2-((65535&t)*r&65535))&65535)*(2-t*r%this.DV)%this.DV)>0?this.DV-r:-r},isEven:function(){return 0==(this.t>0?1&this[0]:this.s)},exp:function(t,r){if(t>4294967295||t<1)return c.ONE;var i=O(),e=O(),n=r.convert(this),s=S(t)-1;for(n.copyTo(i);--s>=0;)if(r.sqrTo(i,e),(t&1<<s)>0)r.mulTo(e,n,i);else{var o=i;i=e,e=o}return r.revert(i)},toString:function(t){if(this.s<0)return"-"+this.negate().toString(t);var r;if(16==t)r=4;else if(8==t)r=3;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return this.toRadix(t);r=2}var i,e=(1<<r)-1,n=!1,s="",o=this.t,h=this.DB-o*this.DB%r;if(o-- >0)for(h<this.DB&&(i=this[o]>>h)>0&&(n=!0,s=v(i));o>=0;)h<r?(i=(this[o]&(1<<h)-1)<<r-h,i|=this[--o]>>(h+=this.DB-r)):(i=this[o]>>(h-=r)&e,h<=0&&(h+=this.DB,--o)),i>0&&(n=!0),n&&(s+=v(i));return n?s:"0"},negate:function(){var t=O();return c.ZERO.subTo(this,t),t},abs:function(){return this.s<0?this.negate():this},compareTo:function(t){var r=this.s-t.s;if(0!=r)return r;var i=this.t;if(0!=(r=i-t.t))return this.s<0?-r:r;for(;--i>=0;)if(0!=(r=this[i]-t[i]))return r;return 0},bitLength:function(){return this.t<=0?0:this.DB*(this.t-1)+S(this[this.t-1]^this.s&this.DM)},mod:function(t){var r=O();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(c.ZERO)>0&&t.subTo(r,r),r},modPowInt:function(t,r){var i;return i=t<256||r.isEven()?new A(r):new w(r),this.exp(t,i)},chunkSize:function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},toRadix:function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var r=this.chunkSize(t),i=Math.pow(t,r),e=y(i),n=O(),s=O(),o="";for(this.divRemTo(e,n,s);n.signum()>0;)o=(i+s.intValue()).toString(t).substr(1)+o,n.divRemTo(e,n,s);return s.intValue().toString(t)+o},fromRadix:function(t,r){this.fromInt(0),null==r&&(r=10);for(var i=this.chunkSize(r),e=Math.pow(r,i),n=!1,s=0,o=0,h=0;h<t.length;++h){var a=m(t,h);a<0?"-"==t.charAt(h)&&0==this.signum()&&(n=!0):(o=r*o+a,++s>=i&&(this.dMultiply(e),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(r,s)),this.dAddOffset(o,0)),n&&c.ZERO.subTo(this,this)},fromNumber:function(t,r,i){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(c.ONE.shiftLeft(t-1),E,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(c.ONE.shiftLeft(t-1),this);else{var e=new Array,n=7&t;e.length=1+(t>>3),r.nextBytes(e),n>0?e[0]&=(1<<n)-1:e[0]=0,this.fromString(e,256)}},bitwiseTo:function(t,r,i){var e,n,s=Math.min(t.t,this.t);for(e=0;e<s;++e)i[e]=r(this[e],t[e]);if(t.t<this.t){for(n=t.s&this.DM,e=s;e<this.t;++e)i[e]=r(this[e],n);i.t=this.t}else{for(n=this.s&this.DM,e=s;e<t.t;++e)i[e]=r(n,t[e]);i.t=t.t}i.s=r(this.s,t.s),i.clamp()},changeBit:function(t,r){var i=c.ONE.shiftLeft(t);return this.bitwiseTo(i,r,i),i},addTo:function(t,r){for(var i=0,e=0,n=Math.min(t.t,this.t);i<n;)e+=this[i]+t[i],r[i++]=e&this.DM,e>>=this.DB;if(t.t<this.t){for(e+=t.s;i<this.t;)e+=this[i],r[i++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;i<t.t;)e+=t[i],r[i++]=e&this.DM,e>>=this.DB;e+=t.s}r.s=e<0?-1:0,e>0?r[i++]=e:e<-1&&(r[i++]=this.DV+e),r.t=i,r.clamp()},dMultiply:function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},dAddOffset:function(t,r){if(0!=t){for(;this.t<=r;)this[this.t++]=0;for(this[r]+=t;this[r]>=this.DV;)this[r]-=this.DV,++r>=this.t&&(this[this.t++]=0),++this[r]}},multiplyLowerTo:function(t,r,i){var e,n=Math.min(this.t+t.t,r);for(i.s=0,i.t=n;n>0;)i[--n]=0;for(e=i.t-this.t;n<e;++n)i[n+this.t]=this.am(0,t[n],i,n,0,this.t);for(e=Math.min(t.t,r);n<e;++n)this.am(0,t[n],i,n,0,r-n);i.clamp()},multiplyUpperTo:function(t,r,i){--r;var e=i.t=this.t+t.t-r;for(i.s=0;--e>=0;)i[e]=0;for(e=Math.max(r-this.t,0);e<t.t;++e)i[this.t+e-r]=this.am(r-e,t[e],i,0,0,this.t+e-r);i.clamp(),i.drShiftTo(1,i)},modInt:function(t){if(t<=0)return 0;var r=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==r)i=this[0]%t;else for(var e=this.t-1;e>=0;--e)i=(r*i+this[e])%t;return i},clone:function(){var t=O();return this.copyTo(t),t},intValue:function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},millerRabin:function(t){var r=this.subtract(c.ONE),i=r.getLowestSetBit();if(i<=0)return!1;var e=r.shiftRight(i);(t=t+1>>1)>N.length&&(t=N.length);for(var n=O(),s=0;s<t;++s){n.fromInt(N[Math.floor(Math.random()*N.length)]);var o=n.modPow(e,this);if(0!=o.compareTo(c.ONE)&&0!=o.compareTo(r)){for(var h=1;h++<i&&0!=o.compareTo(r);)if(0==(o=o.modPowInt(2,this)).compareTo(c.ONE))return!1;if(0!=o.compareTo(r))return!1}}return!0},byteValue:function(){return 0==this.t?this.s:this[0]<<24>>24},shortValue:function(){return 0==this.t?this.s:this[0]<<16>>16},signum:function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},toByteArray:function(){var t=this.t,r=new Array;r[0]=this.s;var i,e=this.DB-t*this.DB%8,n=0;if(t-- >0)for(e<this.DB&&(i=this[t]>>e)!=(this.s&this.DM)>>e&&(r[n++]=i|this.s<<this.DB-e);t>=0;)e<8?(i=(this[t]&(1<<e)-1)<<8-e,i|=this[--t]>>(e+=this.DB-8)):(i=this[t]>>(e-=8)&255,e<=0&&(e+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==n&&(128&this.s)!=(128&i)&&++n,(n>0||i!=this.s)&&(r[n++]=i);return r},equals:function(t){return 0==this.compareTo(t)},min:function(t){return this.compareTo(t)<0?this:t},max:function(t){return this.compareTo(t)>0?this:t},and:function(t){var r=O();return this.bitwiseTo(t,b,r),r},or:function(t){var r=O();return this.bitwiseTo(t,E,r),r},xor:function(t){var r=O();return this.bitwiseTo(t,T,r),r},andNot:function(t){var r=O();return this.bitwiseTo(t,D,r),r},not:function(){for(var t=O(),r=0;r<this.t;++r)t[r]=this.DM&~this[r];return t.t=this.t,t.s=~this.s,t},shiftLeft:function(t){var r=O();return t<0?this.rShiftTo(-t,r):this.lShiftTo(t,r),r},shiftRight:function(t){var r=O();return t<0?this.lShiftTo(-t,r):this.rShiftTo(t,r),r},getLowestSetBit:function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+x(this[t]);return this.s<0?this.t*this.DB:-1},bitCount:function(){for(var t=0,r=this.s&this.DM,i=0;i<this.t;++i)t+=R(this[i]^r);return t},testBit:function(t){var r=Math.floor(t/this.DB);return r>=this.t?0!=this.s:0!=(this[r]&1<<t%this.DB)},setBit:function(t){return this.changeBit(t,E)},clearBit:function(t){return this.changeBit(t,D)},flipBit:function(t){return this.changeBit(t,T)},add:function(t){var r=O();return this.addTo(t,r),r},subtract:function(t){var r=O();return this.subTo(t,r),r},multiply:function(t){var r=O();return this.multiplyTo(t,r),r},divide:function(t){var r=O();return this.divRemTo(t,r,null),r},remainder:function(t){var r=O();return this.divRemTo(t,null,r),r},divideAndRemainder:function(t){var r=O(),i=O();return this.divRemTo(t,r,i),new Array(r,i)},modPow:function(t,r){var i,e,n=t.bitLength(),s=y(1);if(n<=0)return s;i=n<18?1:n<48?3:n<144?4:n<768?5:6,e=n<8?new A(r):r.isEven()?new P(r):new w(r);var o=new Array,h=3,a=i-1,u=(1<<i)-1;if(o[1]=e.convert(this),i>1){var f=O();for(e.sqrTo(o[1],f);h<=u;)o[h]=O(),e.mulTo(f,o[h-2],o[h]),h+=2}var c,l,g=t.t-1,d=!0,p=O();for(n=S(t[g])-1;g>=0;){for(n>=a?c=t[g]>>n-a&u:(c=(t[g]&(1<<n+1)-1)<<a-n,g>0&&(c|=t[g-1]>>this.DB+n-a)),h=i;0==(1&c);)c>>=1,--h;if((n-=h)<0&&(n+=this.DB,--g),d)o[c].copyTo(s),d=!1;else{for(;h>1;)e.sqrTo(s,p),e.sqrTo(p,s),h-=2;h>0?e.sqrTo(s,p):(l=s,s=p,p=l),e.mulTo(p,o[c],s)}for(;g>=0&&0==(t[g]&1<<n);)e.sqrTo(s,p),l=s,s=p,p=l,--n<0&&(n=this.DB-1,--g)}return e.revert(s)},modInverse:function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return c.ZERO;for(var i=t.clone(),e=this.clone(),n=y(1),s=y(0),o=y(0),h=y(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),r?(n.isEven()&&s.isEven()||(n.addTo(this,n),s.subTo(t,s)),n.rShiftTo(1,n)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;e.isEven();)e.rShiftTo(1,e),r?(o.isEven()&&h.isEven()||(o.addTo(this,o),h.subTo(t,h)),o.rShiftTo(1,o)):h.isEven()||h.subTo(t,h),h.rShiftTo(1,h);i.compareTo(e)>=0?(i.subTo(e,i),r&&n.subTo(o,n),s.subTo(h,s)):(e.subTo(i,e),r&&o.subTo(n,o),h.subTo(s,h))}return 0!=e.compareTo(c.ONE)?c.ZERO:h.compareTo(t)>=0?h.subtract(t):h.signum()<0?(h.addTo(t,h),h.signum()<0?h.add(t):h):h},pow:function(t){return this.exp(t,new H)},gcd:function(t){var r=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(r.compareTo(i)<0){var e=r;r=i,i=e}var n=r.getLowestSetBit(),s=i.getLowestSetBit();if(s<0)return r;for(n<s&&(s=n),s>0&&(r.rShiftTo(s,r),i.rShiftTo(s,i));r.signum()>0;)(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),(n=i.getLowestSetBit())>0&&i.rShiftTo(n,i),r.compareTo(i)>=0?(r.subTo(i,r),r.rShiftTo(1,r)):(i.subTo(r,i),i.rShiftTo(1,i));return s>0&&i.lShiftTo(s,i),i},isProbablePrime:function(t){var r,i=this.abs();if(1==i.t&&i[0]<=N[N.length-1]){for(r=0;r<N.length;++r)if(i[0]==N[r])return!0;return!1}if(i.isEven())return!1;for(r=1;r<N.length;){for(var e=N[r],n=r+1;n<N.length&&e<I;)e*=N[n++];for(e=i.modInt(e);r<n;)if(e%N[r++]==0)return!1}return i.millerRabin(t)},square:function(){var t=O();return this.squareTo(t),t}},c.ZERO=y(0),c.ONE=y(1),M.prototype={init:function(t){var r,i,e;for(r=0;r<256;++r)this.S[r]=r;for(i=0,r=0;r<256;++r)i=i+this.S[r]+t[r%t.length]&255,e=this.S[r],this.S[r]=this.S[i],this.S[i]=e;this.i=0,this.j=0},next:function(){var t;return 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,this.S[t+this.S[this.i]&255]}};var C,j,L,V=256;
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/function U(){!function(t){j[L++]^=255&t,j[L++]^=t>>8&255,j[L++]^=t>>16&255,j[L++]^=t>>24&255,L>=V&&(L-=V)}((new Date).getTime())}if(null==j){var _;if(j=new Array,L=0,void 0!==window&&(void 0!==window.crypto||void 0!==window.msCrypto))if((X=window.crypto||window.msCrypto).getRandomValues){var F=new Uint8Array(32);for(X.getRandomValues(F),_=0;_<32;++_)j[L++]=F[_]}else if("Netscape"==n.appName&&n.appVersion<"5"){var k=window.crypto.random(32);for(_=0;_<k.length;++_)j[L++]=255&k.charCodeAt(_)}for(;L<V;)_=Math.floor(65536*Math.random()),j[L++]=_>>>8,j[L++]=255&_;L=0,U()}function q(){if(null==C){for(U(),(C=new M).init(j),L=0;L<j.length;++L)j[L]=0;L=0}return C.next()}function K(){}
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/
function Y(t,r){return new c(t,r)}function G(t,r,i){for(var e="",n=0;e.length<r;)e+=i(String.fromCharCode.apply(String,t.concat([(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n]))),n+=1;return e}function z(t,r,i){for(var e="",n=0;e.length<r;)e+=i(t+String.fromCharCode.apply(String,[(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n])),n+=1;return e}K.prototype.nextBytes=function(t){var r;for(r=0;r<t.length;++r)t[r]=q()},void 0!==W&&W||(W={}),void 0!==W.asn1&&W.asn1||(W.asn1={});var Z=W.asn1;Z.ASN1Util=new function(){this.integerToByteHex=function(t){var r=t.toString(16);return r.length%2==1&&(r="0"+r),r},this.bigIntToMinTwosComplementsHex=function(t){var r=t.toString(16);if("-"!=r.substr(0,1))r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{var i=r.substr(1).length;i%2==1?i+=1:r.match(/^[0-7]/)||(i+=2);for(var e="",n=0;n<i;n++)e+="f";r=new c(e,16).xor(t).add(c.ONE).toString(16).replace(/^-/,"")}return r},this.getPEMStringFromHex=at,this.newObject=function(t){var r=W.asn1,i=r.DERBoolean,e=r.DERInteger,n=r.DERBitString,s=r.DEROctetString,o=r.DERNull,h=r.DERObjectIdentifier,a=r.DEREnumerated,u=r.DERUTF8String,f=r.DERNumericString,c=r.DERPrintableString,l=r.DERTeletexString,g=r.DERIA5String,d=r.DERUTCTime,p=r.DERGeneralizedTime,v=r.DERSequence,m=r.DERSet,y=r.DERTaggedObject,S=r.ASN1Util.newObject,A=Object.keys(t);if(1!=A.length)throw"key of param shall be only one.";var w=A[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:setStoreData:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new i(t[w]);if("int"==w)return new e(t[w]);if("bitstr"==w)return new n(t[w]);if("octstr"==w)return new s(t[w]);if("null"==w)return new o(t[w]);if("oid"==w)return new h(t[w]);if("enum"==w)return new a(t[w]);if("utf8str"==w)return new u(t[w]);if("numstr"==w)return new f(t[w]);if("prnstr"==w)return new c(t[w]);if("telstr"==w)return new l(t[w]);if("ia5str"==w)return new g(t[w]);if("utctime"==w)return new d(t[w]);if("gentime"==w)return new p(t[w]);if("seq"==w){for(var b=t[w],E=[],T=0;T<b.length;T++){var D=S(b[T]);E.push(D)}return new v({array:E})}if("setStoreData"==w){for(b=t[w],E=[],T=0;T<b.length;T++){D=S(b[T]);E.push(D)}return new m({array:E})}if("tag"==w){var x=t[w];if("[object Array]"===Object.prototype.toString.call(x)&&3==x.length){var R=S(x[2]);return new y({tag:x[0],explicit:x[1],obj:R})}var H={};if(void 0!==x.explicit&&(H.explicit=x.explicit),void 0!==x.tag&&(H.tag=x.tag),void 0===x.obj)throw"obj shall be specified for 'tag'.";return H.obj=S(x.obj),new y(H)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},Z.ASN1Util.oidHexToInt=function(t){for(var r="",i=parseInt(t.substr(0,2),16),e=(r=Math.floor(i/40)+"."+i%40,""),n=2;n<t.length;n+=2){var s=("00000000"+parseInt(t.substr(n,2),16).toString(2)).slice(-8);if(e+=s.substr(1,7),"0"==s.substr(0,1))r=r+"."+new c(e,2).toString(10),e=""}return r},Z.ASN1Util.oidIntToHex=function(t){var r=function(t){var r=t.toString(16);return 1==r.length&&(r="0"+r),r},i=function(t){var i="",e=new c(t,10).toString(2),n=7-e.length%7;7==n&&(n=0);for(var s="",o=0;o<n;o++)s+="0";e=s+e;for(o=0;o<e.length-1;o+=7){var h=e.substr(o,7);o!=e.length-7&&(h="1"+h),i+=r(parseInt(h,2))}return i};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var e="",n=t.split("."),s=40*parseInt(n[0])+parseInt(n[1]);e+=r(s),n.splice(0,2);for(var o=0;o<n.length;o++)e+=i(n[o]);return e},Z.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===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="+"".length+",v="+this.hV;var t=this.hV.length/2,r=t.toString(16);if(r.length%2==1&&(r="0"+r),t<128)return r;var i=r.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+r},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},Z.DERAbstractString=function(t){Z.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=et(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},s(Z.DERAbstractString,Z.ASN1Object),Z.DERAbstractTime=function(t){Z.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,r,i){var e=this.zeroPadding,n=this.localDateToUTC(t),s=String(n.getFullYear());"utc"==r&&(s=s.substr(2,2));var o=s+e(String(n.getMonth()+1),2)+e(String(n.getDate()),2)+e(String(n.getHours()),2)+e(String(n.getMinutes()),2)+e(String(n.getSeconds()),2);if(!0===i){var h=n.getMilliseconds();if(0!=h){var a=e(String(h),3);o=o+"."+(a=a.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=$(t)},this.setByDateValue=function(t,r,i,e,n,s){var o=new Date(Date.UTC(t,r-1,i,e,n,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},s(Z.DERAbstractTime,Z.ASN1Object),Z.DERAbstractStructured=function(t){Z.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},s(Z.DERAbstractStructured,Z.ASN1Object),Z.DERBoolean=function(){Z.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},s(Z.DERBoolean,Z.ASN1Object),Z.DERInteger=function(t){Z.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Z.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var r=new c(String(t),10);this.setByBigInteger(r)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},s(Z.DERInteger,Z.ASN1Object),Z.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var r=Z.ASN1Util.newObject(t.obj);t.hex="00"+r.getEncodedHex()}Z.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,r){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var i="0"+t;this.hTLV=null,this.isModified=!0,this.hV=i+r},this.setByBinaryString=function(t){var r=8-(t=t.replace(/0+$/,"")).length%8;8==r&&(r=0);for(var i=0;i<=r;i++)t+="0";var e="";for(i=0;i<t.length-1;i+=8){var n=t.substr(i,8),s=parseInt(n,2).toString(16);1==s.length&&(s="0"+s),e+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+r+e},this.setByBooleanArray=function(t){for(var r="",i=0;i<t.length;i++)1==t[i]?r+="1":r+="0";this.setByBinaryString(r)},this.newFalseArray=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=!1;return r},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},s(Z.DERBitString,Z.ASN1Object),Z.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var r=Z.ASN1Util.newObject(t.obj);t.hex=r.getEncodedHex()}Z.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},s(Z.DEROctetString,Z.DERAbstractString),Z.DERNull=function(){Z.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},s(Z.DERNull,Z.ASN1Object),Z.DERObjectIdentifier=function(t){var r=function(t){var r=t.toString(16);return 1==r.length&&(r="0"+r),r},i=function(t){var i="",e=new c(t,10).toString(2),n=7-e.length%7;7==n&&(n=0);for(var s="",o=0;o<n;o++)s+="0";e=s+e;for(o=0;o<e.length-1;o+=7){var h=e.substr(o,7);o!=e.length-7&&(h="1"+h),i+=r(parseInt(h,2))}return i};Z.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var e="",n=t.split("."),s=40*parseInt(n[0])+parseInt(n[1]);e+=r(s),n.splice(0,2);for(var o=0;o<n.length;o++)e+=i(n[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var r=Z.x509.OID.name2oid(t);if(""===r)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(r)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},s(Z.DERObjectIdentifier,Z.ASN1Object),Z.DEREnumerated=function(t){Z.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=Z.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var r=new c(String(t),10);this.setByBigInteger(r)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},s(Z.DEREnumerated,Z.ASN1Object),Z.DERUTF8String=function(t){Z.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},s(Z.DERUTF8String,Z.DERAbstractString),Z.DERNumericString=function(t){Z.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},s(Z.DERNumericString,Z.DERAbstractString),Z.DERPrintableString=function(t){Z.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},s(Z.DERPrintableString,Z.DERAbstractString),Z.DERTeletexString=function(t){Z.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},s(Z.DERTeletexString,Z.DERAbstractString),Z.DERIA5String=function(t){Z.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},s(Z.DERIA5String,Z.DERAbstractString),Z.DERUTCTime=function(t){Z.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=$(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=$(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},s(Z.DERUTCTime,Z.DERAbstractTime),Z.DERGeneralizedTime=function(t){Z.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=$(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=$(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},s(Z.DERGeneralizedTime,Z.DERAbstractTime),Z.DERSequence=function(t){Z.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",r=0;r<this.asn1Array.length;r++){t+=this.asn1Array[r].getEncodedHex()}return this.hV=t,this.hV}},s(Z.DERSequence,Z.DERAbstractStructured),Z.DERSet=function(t){Z.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,r=0;r<this.asn1Array.length;r++){var i=this.asn1Array[r];t.push(i.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},s(Z.DERSet,Z.DERAbstractStructured),Z.DERTaggedObject=function(t){Z.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,r,i){this.hT=r,this.isExplicit=t,this.asn1Object=i,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,r),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},s(Z.DERTaggedObject,Z.ASN1Object);var W,X,J={getLblen:function(t,r){if("8"!=t.substr(r+2,1))return 1;var i=parseInt(t.substr(r+3,1));return 0==i?-1:0<i&&i<10?i+1:-2},getL:function(t,r){var i=J.getLblen(t,r);return i<1?"":t.substr(r+2,2*i)},getVblen:function(t,r){var i;return""==(i=J.getL(t,r))?-1:("8"===i.substr(0,1)?new c(i.substr(2),16):new c(i,16)).intValue()},getVidx:function(t,r){var i=J.getLblen(t,r);return i<0?i:r+2*(i+1)},getV:function(t,r){var i=J.getVidx(t,r),e=J.getVblen(t,r);return t.substr(i,2*e)},getTLV:function(t,r){return t.substr(r,2)+J.getL(t,r)+J.getV(t,r)},getNextSiblingIdx:function(t,r){return J.getVidx(t,r)+2*J.getVblen(t,r)},getChildIdx:function(t,r){var i=J,e=new Array,n=i.getVidx(t,r);"03"==t.substr(r,2)?e.push(n+2):e.push(n);for(var s=i.getVblen(t,r),o=n,h=0;;){var a=i.getNextSiblingIdx(t,o);if(null==a||a-n>=2*s)break;if(h>=200)break;e.push(a),o=a,h++}return e},getNthChildIdx:function(t,r,i){return J.getChildIdx(t,r)[i]},getIdxbyList:function(t,r,i,e){var n,s,o=J;if(0==i.length){if(void 0!==e&&t.substr(r,2)!==e)throw"checking tag doesn't match: "+t.substr(r,2)+"!="+e;return r}return n=i.shift(),s=o.getChildIdx(t,r),o.getIdxbyList(t,s[n],i,e)},getTLVbyList:function(t,r,i,e){var n=J,s=n.getIdxbyList(t,r,i);if(void 0===s)throw"can't find nthList object";if(void 0!==e&&t.substr(s,2)!=e)throw"checking tag doesn't match: "+t.substr(s,2)+"!="+e;return n.getTLV(t,s)},getVbyList:function(t,r,i,e,n){var s,o,h=J;if(void 0===(s=h.getIdxbyList(t,r,i,e)))throw"can't find nthList object";return o=h.getV(t,s),!0===n&&(o=o.substr(2)),o},hextooidstr:function(t){var r=function(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t},i=[],e=t.substr(0,2),n=parseInt(e,16);i[0]=new String(Math.floor(n/40)),i[1]=new String(n%40);for(var s=t.substr(2),o=[],h=0;h<s.length/2;h++)o.push(parseInt(s.substr(2*h,2),16));var a=[],u="";for(h=0;h<o.length;h++)128&o[h]?u+=r((127&o[h]).toString(2),7):(u+=r((127&o[h]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var f=i.join(".");return a.length>0&&(f=f+"."+a.join(".")),f},dump:function(t,r,i,e){var n=J,s=n.getV,o=n.dump,h=n.getChildIdx,a=t;t instanceof Z.ASN1Object&&(a=t.getEncodedHex());var u=function(t,r){return t.length<=2*r?t:t.substr(0,r)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-r,r)};void 0===r&&(r={ommit_long_octet:32}),void 0===i&&(i=0),void 0===e&&(e="");var f=r.ommit_long_octet;if("01"==a.substr(i,2))return"00"==(c=s(a,i))?e+"BOOLEAN FALSE\n":e+"BOOLEAN TRUE\n";if("02"==a.substr(i,2))return e+"INTEGER "+u(c=s(a,i),f)+"\n";if("03"==a.substr(i,2))return e+"BITSTRING "+u(c=s(a,i),f)+"\n";if("04"==a.substr(i,2)){var c=s(a,i);if(n.isASN1HEX(c)){var l=e+"OCTETSTRING, encapsulates\n";return l+=o(c,r,0,e+" ")}return e+"OCTETSTRING "+u(c,f)+"\n"}if("05"==a.substr(i,2))return e+"NULL\n";if("06"==a.substr(i,2)){var g=s(a,i),d=Z.ASN1Util.oidHexToInt(g),p=Z.x509.OID.oid2name(d),v=d.replace(/\./g," ");return""!=p?e+"ObjectIdentifier "+p+" ("+v+")\n":e+"ObjectIdentifier ("+v+")\n"}if("0c"==a.substr(i,2))return e+"UTF8String '"+nt(s(a,i))+"'\n";if("13"==a.substr(i,2))return e+"PrintableString '"+nt(s(a,i))+"'\n";if("14"==a.substr(i,2))return e+"TeletexString '"+nt(s(a,i))+"'\n";if("16"==a.substr(i,2))return e+"IA5String '"+nt(s(a,i))+"'\n";if("17"==a.substr(i,2))return e+"UTCTime "+nt(s(a,i))+"\n";if("18"==a.substr(i,2))return e+"GeneralizedTime "+nt(s(a,i))+"\n";if("30"==a.substr(i,2)){if("3000"==a.substr(i,4))return e+"SEQUENCE {}\n";l=e+"SEQUENCE\n";var m=r;if((2==(A=h(a,i)).length||3==A.length)&&"06"==a.substr(A[0],2)&&"04"==a.substr(A[A.length-1],2)){p=n.oidname(s(a,A[0]));var y=JSON.parse(JSON.stringify(r));y.x509ExtName=p,m=y}for(var S=0;S<A.length;S++)l+=o(a,m,A[S],e+" ");return l}if("31"==a.substr(i,2)){l=e+"SET\n";var A=h(a,i);for(S=0;S<A.length;S++)l+=o(a,r,A[S],e+" ");return l}var w=parseInt(a.substr(i,2),16);if(0!=(128&w)){var b=31&w;if(0!=(32&w)){var l=e+"["+b+"]\n";for(A=h(a,i),S=0;S<A.length;S++)l+=o(a,r,A[S],e+" ");return l}return"68747470"==(c=s(a,i)).substr(0,8)&&(c=nt(c)),"subjectAltName"===r.x509ExtName&&2==b&&(c=nt(c)),l=e+"["+b+"] "+c+"\n"}return e+"UNKNOWN("+a.substr(i,2)+") "+s(a,i)+"\n"},isASN1HEX:function(t){var r=J;if(t.length%2==1)return!1;var i=r.getVblen(t,0),e=t.substr(0,2),n=r.getL(t,0);return t.length-e.length-n.length==2*i},oidname:function(t){var r=W.asn1;W.lang.String.isHex(t)&&(t=r.ASN1Util.oidHexToInt(t));var i=r.x509.OID.oid2name(t);return""===i&&(i=t),i}};function Q(t){for(var r="",i=0;i<t.length;i++){var e=t[i].toString(16);1==e.length&&(e="0"+e),r+=e}return r}function $(t){return Q(function(t){for(var r=new Array,i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}(t))}function tt(t){return t=(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function rt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function it(t){return f(rt(t))}function et(t){return ft(lt(t))}function nt(t){return decodeURIComponent(ct(t))}function st(t){for(var r="",i=0;i<t.length-1;i+=2)r+=String.fromCharCode(parseInt(t.substr(i,2),16));return r}function ot(t){for(var r="",i=0;i<t.length;i++)r+=("0"+t.charCodeAt(i).toString(16)).slice(-2);return r}function ht(t){var r=function(t){return u(t)}(t).replace(/(.{64})/g,"$1\r\n");return r=r.replace(/\r\n$/,"")}function at(t,r){return"-----BEGIN "+r+"-----\r\n"+ht(t)+"\r\n-----END "+r+"-----\r\n"}function ut(t,r){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+r;return function(t){return f(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}(t=void 0!==r?(t=t.replace("-----BEGIN "+r+"-----","")).replace("-----END "+r+"-----",""):(t=t.replace(/-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----/,""))}function ft(t){return t.replace(/%/g,"")}function ct(t){return t.replace(/(..)/g,"%$1")}function lt(t){for(var r=encodeURIComponent(t),i="",e=0;e<r.length;e++)"%"==r[e]?(i+=r.substr(e,3),e+=2):i=i+"%"+$(r[e]);return i}void 0!==W&&W||(W={}),void 0!==W.lang&&W.lang||(W.lang={}),W.lang.String=function(){},"function"==typeof t?function(r){return tt(new t(r,"utf8").toString("base64"))}:function(t){return function(t){return t.length%2==1&&(t="0"+t),tt(u(t))}(ft(lt(t)))},W.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},W.lang.String.isHex=function(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))},W.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},W.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=rt(t),W.lang.String.isBase64(t))},W.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},void 0!==W&&W||(W={}),void 0!==W.crypto&&W.crypto||(W.crypto={}),(X=W.crypto).Util={DIGESTINFOHEAD:{sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},DEFAULTPROVIDER:{md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},CRYPTOJSMESSAGEDIGESTNAME:{md5:e.a.algo.MD5,sha1:e.a.algo.SHA1,sha224:e.a.algo.SHA224,sha256:e.a.algo.SHA256,sha384:e.a.algo.SHA384,sha512:e.a.algo.SHA512,ripemd160:e.a.algo.RIPEMD160},getDigestInfoHex:function(t,r){if(void 0===this.DIGESTINFOHEAD[r])throw"alg not supported in Util.DIGESTINFOHEAD: "+r;return this.DIGESTINFOHEAD[r]+t},getPaddedDigestInfoHex:function(t,r,i){var e=this.getDigestInfoHex(t,r),n=i/4;if(e.length+22>n)throw"key is too short for SigAlg: keylen="+i+","+r;for(var s="0001",o="00"+e,h="",a=n-s.length-o.length,u=0;u<a;u+=2)h+="ff";return s+h+o},hashString:function(t,r){return new X.MessageDigest({alg:r}).digestString(t)},hashHex:function(t,r){return new X.MessageDigest({alg:r}).digestHex(t)},sha1:function(t){return new X.MessageDigest({alg:"sha1",prov:"cryptojs"}).digestString(t)},sha256:function(t){return new X.MessageDigest({alg:"sha256",prov:"cryptojs"}).digestString(t)},sha256Hex:function(t){return new X.MessageDigest({alg:"sha256",prov:"cryptojs"}).digestHex(t)},sha512:function(t){return new X.MessageDigest({alg:"sha512",prov:"cryptojs"}).digestString(t)},sha512Hex:function(t){return new X.MessageDigest({alg:"sha512",prov:"cryptojs"}).digestHex(t)},md5:function(t){return new X.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},ripemd160:function(t){return new X.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},SECURERANDOMGEN:new K,getRandomHexOfNbytes:function(t){var r=new Array(t);return X.Util.SECURERANDOMGEN.nextBytes(r),Q(r)},getRandomBigIntegerOfNbytes:function(t){return new c(X.Util.getRandomHexOfNbytes(t),16)},getRandomHexOfNbits:function(t){var r=t%8,i=new Array((t-r)/8+1);return X.Util.SECURERANDOMGEN.nextBytes(i),i[0]=(255<<r&255^255)&i[0],Q(i)},getRandomBigIntegerOfNbits:function(t){return new c(X.Util.getRandomHexOfNbits(t),16)},getRandomBigIntegerZeroToMax:function(t){for(var r=t.bitLength();;){var i=X.Util.getRandomBigIntegerOfNbits(r);if(-1!=t.compareTo(i))return i}},getRandomBigIntegerMinToMax:function(t,r){var i=t.compareTo(r);if(1==i)throw"biMin is greater than biMax";if(0==i)return t;var e=r.subtract(t);return X.Util.getRandomBigIntegerZeroToMax(e).add(t)}},X.MessageDigest=function(t){this.setAlgAndProvider=function(t,r){if(null!==(t=X.MessageDigest.getCanonicalAlgName(t))&&void 0===r&&(r=X.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==r){try{this.md=X.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(r){throw"setAlgAndProvider hash alg setStoreData fail alg="+t+"/"+r}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var r=e.a.enc.Hex.parse(t);this.md.update(r)},this.digest=function(){return this.md.finalize().toString(e.a.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==r){try{this.md=new sjcl.hash.sha256}catch(r){throw"setAlgAndProvider hash alg setStoreData fail alg="+t+"/"+r}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var r=sjcl.codec.hex.toBits(t);this.md.update(r)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=X.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},X.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},X.MessageDigest.getHashLength=function(t){var r=X.MessageDigest,i=r.getCanonicalAlgName(t);if(void 0===r.HASHLENGTH[i])throw"not supported algorithm: "+t;return r.HASHLENGTH[i]},X.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},X.Mac=function(t){this.setAlgAndProvider=function(t,r){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===r&&(r=X.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+r;var i=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(i)&&"cryptojs"==r){try{var n=X.Util.CRYPTOJSMESSAGEDIGESTNAME[i];this.mac=e.a.algo.HMAC.create(n,this.pass)}catch(t){throw"setAlgAndProvider hash alg setStoreData fail hashAlg="+i+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var r=e.a.enc.Hex.parse(t);this.mac.update(r)},this.doFinal=function(){return this.mac.finalize().toString(e.a.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var r=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(r=ot(t)),void(this.pass=e.a.enc.Hex.parse(r))}if("object"!=typeof t)throw"crypto.Mac unsupported password type: "+t;r=null;if(void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;r=t.hex}if(void 0!==t.utf8&&(r=et(t.utf8)),void 0!==t.rstr&&(r=ot(t.rstr)),void 0!==t.b64&&(r=f(t.b64)),void 0!==t.b64u&&(r=it(t.b64u)),null==r)throw"crypto.Mac unsupported password type: "+t;this.pass=e.a.enc.Hex.parse(r)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=X.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},X.Signature=function(t){var r=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase())},this._zeroPaddingOfSignature=function(t,r){for(var i="",e=r/4-t.length,n=0;n<e;n++)i+="0";return i+t},this.setAlgAndProvider=function(t,r){if(this._setAlgNames(),"cryptojs/jsrsa"!=r)throw"provider not supported: "+r;if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new X.MessageDigest({alg:this.mdAlgName})}catch(t){throw"setAlgAndProvider hash alg setStoreData fail alg="+this.mdAlgName+"/"+t}this.init=function(t,r){var i=null;try{i=void 0===r?KEYUTIL.getKey(t):KEYUTIL.getKey(t,r)}catch(t){throw"init failed:"+t}if(!0===i.isPrivate)this.prvKey=i,this.state="SIGN";else{if(!0!==i.isPublic)throw"init failed.:"+i;this.pubKey=i,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0!==this.ecprvhex&&void 0!==this.eccurvename){var t=new X.ECDSA({curve:this.eccurvename});this.hSign=t.signHex(this.sHashHex,this.ecprvhex)}else if(this.prvKey instanceof mt&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof mt&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof X.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof X.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0!==this.ecpubhex&&void 0!==this.eccurvename)return new X.ECDSA({curve:this.eccurvename}).verifyHex(this.sHashHex,t,this.ecpubhex);if(this.pubKey instanceof mt&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof mt&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==X.ECDSA&&this.pubKey instanceof X.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==X.DSA&&this.pubKey instanceof X.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,r){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=X.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{r=KEYUTIL.getKey(t.prvkeypem);this.init(r)}catch(t){throw"fatal error to load pem private key: "+t}}},X.Cipher=function(t){},X.Cipher.encrypt=function(t,r,i){if(r instanceof mt&&r.isPublic){var e=X.Cipher.getAlgByKeyAndName(r,i);if("RSA"===e)return r.encrypt(t);if("RSAOAEP"===e)return r.encryptOAEP(t,"sha1");var n=e.match(/^RSAOAEP(\d+)$/);if(null!==n)return r.encryptOAEP(t,"sha"+n[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.encrypt: unsupported key or algorithm"},X.Cipher.decrypt=function(t,r,i){if(r instanceof mt&&r.isPrivate){var e=X.Cipher.getAlgByKeyAndName(r,i);if("RSA"===e)return r.decrypt(t);if("RSAOAEP"===e)return r.decryptOAEP(t,"sha1");var n=e.match(/^RSAOAEP(\d+)$/);if(null!==n)return r.decryptOAEP(t,"sha"+n[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+i}throw"Cipher.decrypt: unsupported key or algorithm"},X.Cipher.getAlgByKeyAndName=function(t,r){if(t instanceof mt){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(r))return r;if(null===r||void 0===r)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+r}throw"getAlgByKeyAndName: not supported algorithm name: "+r},X.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040023":"secp521r1","2b81040022":"secp384r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},mt.getPosArrayOfChildrenFromHex=function(t){return J.getChildIdx(t,0)};var gt=new RegExp("");function dt(t,r){for(var i="",e=r/4-t.length,n=0;n<e;n++)i+="0";return i+t}function pt(t,r,i){for(var e="",n=0;e.length<r;)e+=st(i(ot(t+String.fromCharCode.apply(String,[(4278190080&n)>>24,(16711680&n)>>16,(65280&n)>>8,255&n])))),n+=1;return e}function vt(t){for(var r in X.Util.DIGESTINFOHEAD){var i=X.Util.DIGESTINFOHEAD[r],e=i.length;if(t.substring(0,e)==i)return[r,t.substring(e)]}return[]}function mt(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}gt.compile("[^0-9a-f]","gi"),mt.SALT_LEN_HLEN=-1,mt.SALT_LEN_MAX=-2,mt.SALT_LEN_RECOVER=-2,mt.getHexValueArrayOfChildrenFromHex=function(t){var r,i=J.getV,e=i(t,(r=mt.getPosArrayOfChildrenFromHex(t))[0]),n=i(t,r[1]),s=i(t,r[2]),o=i(t,r[3]),h=i(t,r[4]),a=i(t,r[5]),u=i(t,r[6]),f=i(t,r[7]),c=i(t,r[8]);return(r=new Array).push(e,n,s,o,h,a,u,f,c),r},mt.prototype={doPublic:function(t){return t.modPowInt(this.e,this.n)},setPublic:function(t,r){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=r;else{if(!(null!=t&&null!=r&&t.length>0&&r.length>0))throw"Invalid RSA public key";this.n=Y(t,16),this.e=parseInt(r,16)}},encrypt:function(t){var r=function(t,r){if(r<t.length+11)throw"Message too long for RSA";for(var i=new Array,e=t.length-1;e>=0&&r>0;){var n=t.charCodeAt(e--);n<128?i[--r]=n:n>127&&n<2048?(i[--r]=63&n|128,i[--r]=n>>6|192):(i[--r]=63&n|128,i[--r]=n>>6&63|128,i[--r]=n>>12|224)}i[--r]=0;for(var s=new K,o=new Array;r>2;){for(o[0]=0;0==o[0];)s.nextBytes(o);i[--r]=o[0]}return i[--r]=2,i[--r]=0,new c(i)}(t,this.n.bitLength()+7>>3);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var e=i.toString(16);return 0==(1&e.length)?e:"0"+e},encryptOAEP:function(t,r,i){var e=function(t,r,i,e){var n=X.MessageDigest,s=X.Util,o=null;if(i||(i="sha1"),"string"==typeof i&&(o=n.getCanonicalAlgName(i),e=n.getHashLength(o),i=function(t){return st(s.hashHex(ot(t),o))}),t.length+2*e+2>r)throw"Message too long for RSA";var h,a="";for(h=0;h<r-t.length-2*e-2;h+=1)a+="\0";var u=i("")+a+""+t,f=new Array(e);(new K).nextBytes(f);var l=G(f,u.length,i),g=[];for(h=0;h<u.length;h+=1)g[h]=u.charCodeAt(h)^l.charCodeAt(h);var d=G(g,f.length,i),p=[0];for(h=0;h<f.length;h+=1)p[h+1]=f[h]^d.charCodeAt(h);return new c(p.concat(g))}
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
*/(t,this.n.bitLength()+7>>3,r,i);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var s=n.toString(16);return 0==(1&s.length)?s:"0"+s},type:"RSA",doPrivate:function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var r=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);r.compareTo(i)<0;)r=r.add(this.p);return r.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},setPrivate:function(t,r,i){if(this.isPrivate=!0,"string"!=typeof t)this.n=t,this.e=r,this.d=i;else{if(!(null!=t&&null!=r&&t.length>0&&r.length>0))throw"Invalid RSA private key";this.n=Y(t,16),this.e=parseInt(r,16),this.d=Y(i,16)}},setPrivateEx:function(t,r,i,e,n,s,o,h){if(this.isPrivate=!0,this.isPublic=!1,null==t)throw"RSASetPrivateEx N == null";if(null==r)throw"RSASetPrivateEx E == null";if(0==t.length)throw"RSASetPrivateEx N.length == 0";if(0==r.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=t&&null!=r&&t.length>0&&r.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=Y(t,16),this.e=parseInt(r,16),this.d=Y(i,16),this.p=Y(e,16),this.q=Y(n,16),this.dmp1=Y(s,16),this.dmq1=Y(o,16),this.coeff=Y(h,16)},generate:function(t,r){var i=new K,e=t>>1;this.e=parseInt(r,16);for(var n=new c(r,16);;){for(;this.p=new c(t-e,1,i),0!=this.p.subtract(c.ONE).gcd(n).compareTo(c.ONE)||!this.p.isProbablePrime(10););for(;this.q=new c(e,1,i),0!=this.q.subtract(c.ONE).gcd(n).compareTo(c.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var o=this.p.subtract(c.ONE),h=this.q.subtract(c.ONE),a=o.multiply(h);if(0==a.gcd(n).compareTo(c.ONE)){this.n=this.p.multiply(this.q),this.d=n.modInverse(a),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}this.isPrivate=!0},decrypt:function(t){var r=Y(t,16),i=this.doPrivate(r);return null==i?null:function(t,r){for(var i=t.toByteArray(),e=0;e<i.length&&0==i[e];)++e;if(i.length-e!=r-1||2!=i[e])return null;for(++e;0!=i[e];)if(++e>=i.length)return null;for(var n="";++e<i.length;){var s=255&i[e];s<128?n+=String.fromCharCode(s):s>191&&s<224?(n+=String.fromCharCode((31&s)<<6|63&i[e+1]),++e):(n+=String.fromCharCode((15&s)<<12|(63&i[e+1])<<6|63&i[e+2]),e+=2)}return n}(i,this.n.bitLength()+7>>3)},decryptOAEP:function(t,r,i){var e=Y(t,16),n=this.doPrivate(e);return null==n?null:function(t,r,i,e){var n=X.MessageDigest,s=X.Util,o=null;for(i||(i="sha1"),"string"==typeof i&&(o=n.getCanonicalAlgName(i),e=n.getHashLength(o),i=function(t){return st(s.hashHex(ot(t),o))}),t=t.toByteArray(),h=0;h<t.length;h+=1)t[h]&=255;for(;t.length<r;)t.unshift(0);if((t=String.fromCharCode.apply(String,t)).length<2*e+2)throw"Cipher too short";var h,a=t.substr(1,e),u=t.substr(e+1),f=z(u,e,i),c=[];for(h=0;h<a.length;h+=1)c[h]=a.charCodeAt(h)^f.charCodeAt(h);var l=z(String.fromCharCode.apply(String,c),t.length-e,i),g=[];for(h=0;h<u.length;h+=1)g[h]=u.charCodeAt(h)^l.charCodeAt(h);if((g=String.fromCharCode.apply(String,g)).substr(0,e)!==i(""))throw"Hash mismatch";var d=(g=g.substr(e)).indexOf("");if((-1!=d?g.substr(0,d).lastIndexOf("\0"):-1)+1!=d)throw"Malformed data";return g.substr(d+1)}(n,this.n.bitLength()+7>>3,r,i)},readPrivateKeyFromPEMString:function(t){var r=ut(t),i=mt.getHexValueArrayOfChildrenFromHex(r);this.setPrivateEx(i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},readPKCS5PrvKeyHex:function(t){var r=mt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])},readPKCS8PrvKeyHex:function(t){var r,i,e,n,s,o,h,a,u=J,f=u.getVbyList;if(!1===u.isASN1HEX(t))throw"not ASN.1 hex string";try{r=f(t,0,[2,0,1],"02"),i=f(t,0,[2,0,2],"02"),e=f(t,0,[2,0,3],"02"),n=f(t,0,[2,0,4],"02"),s=f(t,0,[2,0,5],"02"),o=f(t,0,[2,0,6],"02"),h=f(t,0,[2,0,7],"02"),a=f(t,0,[2,0,8],"02")}catch(t){throw"malformed PKCS#8 plain RSA private key"}this.setPrivateEx(r,i,e,n,s,o,h,a)},readPKCS5PubKeyHex:function(t){var r=J,i=r.getV;if(!1===r.isASN1HEX(t))throw"keyHex is not ASN.1 hex string";var e=r.getChildIdx(t,0);if(2!==e.length||"02"!==t.substr(e[0],2)||"02"!==t.substr(e[1],2))throw"wrong hex for PKCS#5 public key";var n=i(t,e[0]),s=i(t,e[1]);this.setPublic(n,s)},readPKCS8PubKeyHex:function(t){var r=J;if(!1===r.isASN1HEX(t))throw"not ASN.1 hex string";if("06092a864886f70d010101"!==r.getTLVbyList(t,0,[0,0]))throw"not PKCS8 RSA public key";var i=r.getTLVbyList(t,0,[1,0]);this.readPKCS5PubKeyHex(i)},readCertPubKeyHex:function(t,r){var i,e;(i=new X509).readCertHex(t),e=i.getPublicKeyHex(),this.readPKCS8PubKeyHex(e)},sign:function(t,r){var i=function(t){return X.Util.hashString(t,r)}(t);return this.signWithMessageHash(i,r)},signWithMessageHash:function(t,r){var i=Y(X.Util.getPaddedDigestInfoHex(t,r,this.n.bitLength()),16);return dt(this.doPrivate(i).toString(16),this.n.bitLength())},verify:function(t,r){var i=Y(r=(r=r.replace(gt,"")).replace(/[ \n]+/g,""),16);if(i.bitLength()>this.n.bitLength())return 0;var e=vt(this.doPublic(i).toString(16).replace(/^1f+00/,""));if(0==e.length)return!1;var n=e[0];return e[1]==function(t){return X.Util.hashString(t,n)}(t)},verifyWithMessageHash:function(t,r){var i=Y(r=(r=r.replace(gt,"")).replace(/[ \n]+/g,""),16);if(i.bitLength()>this.n.bitLength())return 0;var e=vt(this.doPublic(i).toString(16).replace(/^1f+00/,""));if(0==e.length)return!1;e[0];return e[1]==t},verifyPSS:function(t,r,i,e){var n=function(t){return X.Util.hashHex(t,i)}(ot(t));return void 0===e&&(e=-1),this.verifyWithMessageHashPSS(n,r,i,e)},verifyWithMessageHashPSS:function(t,r,i,e){var n=new c(r,16);if(n.bitLength()>this.n.bitLength())return!1;var s,o=function(t){return X.Util.hashHex(t,i)},h=st(t),a=h.length,u=this.n.bitLength()-1,f=Math.ceil(u/8);if(-1===e||void 0===e)e=a;else if(-2===e)e=f-a-2;else if(e<-2)throw"invalid salt length";if(f<a+e+2)throw"data too long";var l=this.doPublic(n).toByteArray();for(s=0;s<l.length;s+=1)l[s]&=255;for(;l.length<f;)l.unshift(0);if(188!==l[f-1])throw"encoded message does not end in 0xbc";var g=(l=String.fromCharCode.apply(String,l)).substr(0,f-a-1),d=l.substr(g.length,a),p=65280>>8*f-u&255;if(0!=(g.charCodeAt(0)&p))throw"bits beyond keysize not zero";var v=pt(d,g.length,o),m=[];for(s=0;s<g.length;s+=1)m[s]=g.charCodeAt(s)^v.charCodeAt(s);m[0]&=~p;var y=f-a-e-2;for(s=0;s<y;s+=1)if(0!==m[s])throw"leftmost octets not zero";if(1!==m[y])throw"0x01 marker not found";return d===st(o(ot("\0\0\0\0\0\0\0\0"+h+String.fromCharCode.apply(String,m.slice(-e)))))},signPSS:function(t,r,i){var e=function(t){return X.Util.hashHex(t,r)}(ot(t));return void 0===i&&(i=-1),this.signWithMessageHashPSS(e,r,i)},signWithMessageHashPSS:function(t,r,i){var e,n=st(t),s=n.length,o=this.n.bitLength()-1,h=Math.ceil(o/8),a=function(t){return X.Util.hashHex(t,r)};if(-1===i||void 0===i)i=s;else if(-2===i)i=h-s-2;else if(i<-2)throw"invalid salt length";if(h<s+i+2)throw"data too long";var u="";i>0&&(u=new Array(i),(new K).nextBytes(u),u=String.fromCharCode.apply(String,u));var f=st(a(ot("\0\0\0\0\0\0\0\0"+n+u))),l=[];for(e=0;e<h-i-s-2;e+=1)l[e]=0;var g=String.fromCharCode.apply(String,l)+""+u,d=pt(f,g.length,a),p=[];for(e=0;e<g.length;e+=1)p[e]=g.charCodeAt(e)^d.charCodeAt(e);var v=65280>>8*h-o&255;for(p[0]&=~v,e=0;e<s;e++)p.push(f.charCodeAt(e));return p.push(188),dt(this.doPrivate(new c(p)).toString(16),this.n.bitLength())}},r.a=mt}).call(this,i(7).Buffer)},function(t,r,i){"use strict";i.r(r);var e=i(0),n=e.a.lib,s=n.WordArray,o=n.Hasher,h=[],a=e.a.algo.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,r){for(var i=this._hash.words,e=i[0],n=i[1],s=i[2],o=i[3],a=i[4],u=0;u<80;u++){if(u<16)h[u]=0|t[r+u];else{var f=h[u-3]^h[u-8]^h[u-14]^h[u-16];h[u]=f<<1|f>>>31}var c=(e<<5|e>>>27)+a+h[u];c+=u<20?1518500249+(n&s|~n&o):u<40?1859775393+(n^s^o):u<60?(n&s|n&o|s&o)-1894007588:(n^s^o)-899497514,a=o,o=s,s=n<<30|n>>>2,n=e,e=c}i[0]=i[0]+e|0,i[1]=i[1]+n|0,i[2]=i[2]+s|0,i[3]=i[3]+o|0,i[4]=i[4]+a|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,e=8*t.sigBytes;return r[e>>>5]|=128<<24-e%32,r[14+(e+64>>>9<<4)]=Math.floor(i/4294967296),r[15+(e+64>>>9<<4)]=i,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.a.SHA1=o._createHelper(a),e.a.HmacSHA1=o._createHmacHelper(a);e.a.SHA1;e.a,e.a.SHA1;for(var u=e.a.lib,f=e.a,c=(g=u).WordArray,l=g.Hasher,g=f.algo,d=[],p=[],v=function(t){return 4294967296*(t-(0|t))|0},m=2,y=0;64>y;){var S;t:{S=m;for(var A=Math.sqrt(S),w=2;w<=A;w++)if(!(S%w)){S=!1;break t}S=!0}S&&(8>y&&(d[y]=v(Math.pow(m,.5))),p[y]=v(Math.pow(m,1/3)),y++),m++}var b=[];g=g.SHA256=l.extend({_doReset:function(){this._hash=new c.init(d.slice(0))},_doProcessBlock:function(t,r){for(var i=this._hash.words,e=i[0],n=i[1],s=i[2],o=i[3],h=i[4],a=i[5],u=i[6],f=i[7],c=0;64>c;c++){if(16>c)b[c]=0|t[r+c];else{var l=b[c-15],g=b[c-2];b[c]=((l<<25|l>>>7)^(l<<14|l>>>18)^l>>>3)+b[c-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+b[c-16]}l=f+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&a^~h&u)+p[c]+b[c],g=((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+(e&n^e&s^n&s),f=u,u=a,a=h,h=o+l|0,o=s,s=n,n=e,e=l+g|0}i[0]=i[0]+e|0,i[1]=i[1]+n|0,i[2]=i[2]+s|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0,i[5]=i[5]+a|0,i[6]=i[6]+u|0,i[7]=i[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,e=8*t.sigBytes;return r[e>>>5]|=128<<24-e%32,r[14+(e+64>>>9<<4)]=Math.floor(i/4294967296),r[15+(e+64>>>9<<4)]=i,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=l.clone.call(this);return t._hash=this._hash.clone(),t}});f.SHA256=l._createHelper(g),f.HmacSHA256=l._createHmacHelper(g);e.a,e.a.SHA256;var E=i(1);function T(t,r){let i,e=function(){return i?r?Promise.resolve(i):i:(i=t.apply(this,arguments),r?i.then(t=>i=t):i)};return e.clearCache=(()=>{i=void 0}),e}let D="=",x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var R="0123456789abcdefghijklmnopqrstuvwxyz";function H(t){let r,i,e,n="",s=0;for(r=0;r<t.length&&t.charAt(r)!=D;++r)(e=x.indexOf(t.charAt(r)))<0||(0==s?(n+=R.charAt(e>>2),i=3&e,s=1):1==s?(n+=R.charAt(i<<2|e>>4),i=15&e,s=2):2==s?(n+=R.charAt(i),n+=R.charAt(e>>2),i=3&e,s=3):(n+=R.charAt(i<<2|e>>4),n+=R.charAt(15&e),s=0));return 1==s&&(n+=R.charAt(i<<2)),n}i.d(r,"encrypt",function(){return I}),i.d(r,"decrypt",function(){return O}),i.d(r,"verify",function(){return M}),i.d(r,"sign",function(){return C}),i.d(r,"setPub",function(){return j}),i.d(r,"setPrv",function(){return L}),i.d(r,"encryptOAEP",function(){return V}),i.d(r,"decryptOAEP",function(){return U});let P="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCygtF/1dPlCA6OW/ioRkXdewd8lLNXYh5nwGnbCY9dPqGG4O6w/LghFLbYDXbaTrbagIlZfg4CMY1JLGPG35c3D426DsLKMVXGp3gRKzcNt2xm3pnjWeML5pdrJ6cuHT8FQagDqW+wq86IRj90mX4YUdFg59073MdYv//HqT7YHwIDAQAB",B=T(function(t,r){let i=H(t||P),e=new E.a;return r?e["read"+r+"PubKeyHex"](i):e.readPKCS8PubKeyHex(i),e}),N=T(function(t,r){let i=new E.a,e=H(t||"MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALKC0X/V0+UIDo5b+KhGRd17B3yUs1diHmfAadsJj10+oYbg7rD8uCEUttgNdtpOttqAiVl+DgIxjUksY8bflzcPjboOwsoxVcaneBErNw23bGbemeNZ4wvml2snpy4dPwVBqAOpb7CrzohGP3SZfhhR0WDn3Tvcx1i//8epPtgfAgMBAAECgYAqfHQ8Rrot8qL0QvOFqWQLeLKpdgLRM2slKmiHV1klyjhLj9F/kkaIqRNzjJDTGJTwoFMQV64h24VS+xusQ58Ld/Ybkdw8m5Ei+tJdIR0H3qmO5ogEHhT/gXawmyG4hxru9oxiH9I/ZnVjhI4DZLEKrZ9jP0Xh6L7aicVRZLGe8QJBAN3XSxKUj4bJW6r0vOSPHjDw04lbsRk8cOq6qcwa60fhthg+ONV4tMLca6cs60U8yN9AX/LfmcdNl4Bp5E8eNoUCQQDN/4JRwf+Vveibdgk25cLjhHIDsPlEaEcsvDEpWoEfCDGP9+mMbwEE3dv9jLX986hLC1wqgmPFsvKCDtP9ae9TAkEAhBTnUcy6F9pThdnpjXvY0fLRP/sj2o6t/FPfPPLaGxY8QPrrA862cT6jqgmImtSyFJpThluzR4LfLUne8WxfsQJAHMrBpDvBRWStxkzRLOMgQjyY0vtBW9ZXXGFRXb5Qnc2/X6f+9KnvMobv4JhyN3R+6T5FO4vN9iv0yUjZSGouEQJAb4ZCfnMYSyUnvqciyJ4Kh1nCxjOI26idIRF7fMz+eZj2D8I9w27CG2L3hE1oqDunhDY9ryl5JsHT/wnv4mqTmA==");return r?i["read"+r+"PubKeyHex"](e):i.readPKCS8PrvKeyHex(e),i});function I(t){return B().encrypt(t)}function O(t){return N().decrypt(t)}function M(t,r){return B().verify(t,r)}function C(t,r){return N().sign(t,r||"sha1")}function j(t,r){N.clearCache(),B(P=t,r)}function L(t,r){N.clearCache(),N(P=t,r)}function V(t,r){return B().encryptOAEP(t,r)}function U(t,r){return N().decryptOAEP(t,r)}},function(t,r){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,r){r.read=function(t,r,i,e,n){var s,o,h=8*n-e-1,a=(1<<h)-1,u=a>>1,f=-7,c=i?n-1:0,l=i?-1:1,g=t[r+c];for(c+=l,s=g&(1<<-f)-1,g>>=-f,f+=h;f>0;s=256*s+t[r+c],c+=l,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=e;f>0;o=256*o+t[r+c],c+=l,f-=8);if(0===s)s=1-u;else{if(s===a)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,e),s-=u}return(g?-1:1)*o*Math.pow(2,s-e)},r.write=function(t,r,i,e,n,s){var o,h,a,u=8*s-n-1,f=(1<<u)-1,c=f>>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,g=e?0:s-1,d=e?1:-1,p=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(a=Math.pow(2,-o))<1&&(o--,a*=2),(r+=o+c>=1?l/a:l*Math.pow(2,1-c))*a>=2&&(o++,a/=2),o+c>=f?(h=0,o=f):o+c>=1?(h=(r*a-1)*Math.pow(2,n),o+=c):(h=r*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[i+g]=255&h,g+=d,h/=256,n-=8);for(o=o<<n|h,u+=n;u>0;t[i+g]=255&o,g+=d,o/=256,u-=8);t[i+g-d]|=128*p}},function(t,r,i){"use strict";r.byteLength=function(t){var r=u(t),i=r[0],e=r[1];return 3*(i+e)/4-e},r.toByteArray=function(t){for(var r,i=u(t),e=i[0],o=i[1],h=new s(function(t,r,i){return 3*(r+i)/4-i}(0,e,o)),a=0,f=o>0?e-4:e,c=0;c<f;c+=4)r=n[t.charCodeAt(c)]<<18|n[t.charCodeAt(c+1)]<<12|n[t.charCodeAt(c+2)]<<6|n[t.charCodeAt(c+3)],h[a++]=r>>16&255,h[a++]=r>>8&255,h[a++]=255&r;2===o&&(r=n[t.charCodeAt(c)]<<2|n[t.charCodeAt(c+1)]>>4,h[a++]=255&r);1===o&&(r=n[t.charCodeAt(c)]<<10|n[t.charCodeAt(c+1)]<<4|n[t.charCodeAt(c+2)]>>2,h[a++]=r>>8&255,h[a++]=255&r);return h},r.fromByteArray=function(t){for(var r,i=t.length,n=i%3,s=[],o=0,h=i-n;o<h;o+=16383)s.push(c(t,o,o+16383>h?h:o+16383));1===n?(r=t[i-1],s.push(e[r>>2]+e[r<<4&63]+"==")):2===n&&(r=(t[i-2]<<8)+t[i-1],s.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"="));return s.join("")};for(var e=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,a=o.length;h<a;++h)e[h]=o[h],n[o.charCodeAt(h)]=h;function u(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=r),[i,i===r?0:4-i%4]}function f(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function c(t,r,i){for(var e,n=[],s=r;s<i;s+=3)e=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),n.push(f(e));return n.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,r){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,r,i){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var e=i(5),n=i(4),s=i(3);function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=a.prototype:(null===t&&(t=new a(r)),t.length=r),t}function a(t,r,i){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,r,i);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,r,i)}function u(t,r,i,e){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,i,e){if(r.byteLength,i<0||r.byteLength<i)throw new RangeError("'offset' is out of bounds");if(r.byteLength<i+(e||0))throw new RangeError("'length' is out of bounds");r=void 0===i&&void 0===e?new Uint8Array(r):void 0===e?new Uint8Array(r,i):new Uint8Array(r,i,e);a.TYPED_ARRAY_SUPPORT?(t=r).__proto__=a.prototype:t=l(t,r);return t}(t,r,i,e):"string"==typeof r?function(t,r,i){"string"==typeof i&&""!==i||(i="utf8");if(!a.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var e=0|d(r,i),n=(t=h(t,e)).write(r,i);n!==e&&(t=t.slice(0,n));return t}(t,r,i):function(t,r){if(a.isBuffer(r)){var i=0|g(r.length);return 0===(t=h(t,i)).length?t:(r.copy(t,0,0,i),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||function(t){return t!=t}(r.length)?h(t,0):l(t,r);if("Buffer"===r.type&&s(r.data))return l(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,r){if(f(r),t=h(t,r<0?0:0|g(r)),!a.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)t[i]=0;return t}function l(t,r){var i=r.length<0?0:0|g(r.length);t=h(t,i);for(var e=0;e<i;e+=1)t[e]=255&r[e];return t}function g(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,r){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var e=!1;;)switch(r){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return _(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return F(t).length;default:if(e)return _(t).length;r=(""+r).toLowerCase(),e=!0}}function p(t,r,i){var e=t[r];t[r]=t[i],t[i]=e}function v(t,r,i,e,n){if(0===t.length)return-1;if("string"==typeof i?(e=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof r&&(r=a.from(r,e)),a.isBuffer(r))return 0===r.length?-1:m(t,r,i,e,n);if("number"==typeof r)return r&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,r,i):Uint8Array.prototype.lastIndexOf.call(t,r,i):m(t,[r],i,e,n);throw new TypeError("val must be string, number or Buffer")}function m(t,r,i,e,n){var s,o=1,h=t.length,a=r.length;if(void 0!==e&&("ucs2"===(e=String(e).toLowerCase())||"ucs-2"===e||"utf16le"===e||"utf-16le"===e)){if(t.length<2||r.length<2)return-1;o=2,h/=2,a/=2,i/=2}function u(t,r){return 1===o?t[r]:t.readUInt16BE(r*o)}if(n){var f=-1;for(s=i;s<h;s++)if(u(t,s)===u(r,-1===f?0:s-f)){if(-1===f&&(f=s),s-f+1===a)return f*o}else-1!==f&&(s-=s-f),f=-1}else for(i+a>h&&(i=h-a),s=i;s>=0;s--){for(var c=!0,l=0;l<a;l++)if(u(t,s+l)!==u(r,l)){c=!1;break}if(c)return s}return-1}function y(t,r,i,e){i=Number(i)||0;var n=t.length-i;e?(e=Number(e))>n&&(e=n):e=n;var s=r.length;if(s%2!=0)throw new TypeError("Invalid hex string");e>s/2&&(e=s/2);for(var o=0;o<e;++o){var h=parseInt(r.substr(2*o,2),16);if(isNaN(h))return o;t[i+o]=h}return o}function S(t,r,i,e){return k(_(r,t.length-i),t,i,e)}function A(t,r,i,e){return k(function(t){for(var r=[],i=0;i<t.length;++i)r.push(255&t.charCodeAt(i));return r}(r),t,i,e)}function w(t,r,i,e){return A(t,r,i,e)}function b(t,r,i,e){return k(F(r),t,i,e)}function E(t,r,i,e){return k(function(t,r){for(var i,e,n,s=[],o=0;o<t.length&&!((r-=2)<0);++o)i=t.charCodeAt(o),e=i>>8,n=i%256,s.push(n),s.push(e);return s}(r,t.length-i),t,i,e)}function T(t,r,i){return 0===r&&i===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,i))}function D(t,r,i){i=Math.min(t.length,i);for(var e=[],n=r;n<i;){var s,o,h,a,u=t[n],f=null,c=u>239?4:u>223?3:u>191?2:1;if(n+c<=i)switch(c){case 1:u<128&&(f=u);break;case 2:128==(192&(s=t[n+1]))&&(a=(31&u)<<6|63&s)>127&&(f=a);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&(a=(15&u)<<12|(63&s)<<6|63&o)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:s=t[n+1],o=t[n+2],h=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&h)&&(a=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&h)>65535&&a<1114112&&(f=a)}null===f?(f=65533,c=1):f>65535&&(f-=65536,e.push(f>>>10&1023|55296),f=56320|1023&f),e.push(f),n+=c}return function(t){var r=t.length;if(r<=x)return String.fromCharCode.apply(String,t);var i="",e=0;for(;e<r;)i+=String.fromCharCode.apply(String,t.slice(e,e+=x));return i}(e)}r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=o(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,r,i){return u(null,t,r,i)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,r,i){return function(t,r,i,e){return f(r),r<=0?h(t,r):void 0!==i?"string"==typeof e?h(t,r).fill(i,e):h(t,r).fill(i):h(t,r)}(null,t,r,i)},a.allocUnsafe=function(t){return c(null,t)},a.allocUnsafeSlow=function(t){return c(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,r){if(!a.isBuffer(t)||!a.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var i=t.length,e=r.length,n=0,s=Math.min(i,e);n<s;++n)if(t[n]!==r[n]){i=t[n],e=r[n];break}return i<e?-1:e<i?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,r){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var i;if(void 0===r)for(r=0,i=0;i<t.length;++i)r+=t[i].length;var e=a.allocUnsafe(r),n=0;for(i=0;i<t.length;++i){var o=t[i];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(e,n),n+=o.length}return e},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)p(this,r,r+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)p(this,r,r+3),p(this,r+1,r+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)p(this,r,r+7),p(this,r+1,r+6),p(this,r+2,r+5),p(this,r+3,r+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?D(this,0,t):function(t,r,i){var e=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,r,i);case"utf8":case"utf-8":return D(this,r,i);case"ascii":return R(this,r,i);case"latin1":case"binary":return H(this,r,i);case"base64":return T(this,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,r,i);default:if(e)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),e=!0}}.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",i=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,r,i,e,n){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===i&&(i=t?t.length:0),void 0===e&&(e=0),void 0===n&&(n=this.length),r<0||i>t.length||e<0||n>this.length)throw new RangeError("out of range index");if(e>=n&&r>=i)return 0;if(e>=n)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,e>>>=0,n>>>=0,this===t)return 0;for(var s=n-e,o=i-r,h=Math.min(s,o),u=this.slice(e,n),f=t.slice(r,i),c=0;c<h;++c)if(u[c]!==f[c]){s=u[c],o=f[c];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(t,r,i){return-1!==this.indexOf(t,r,i)},a.prototype.indexOf=function(t,r,i){return v(this,t,r,i,!0)},a.prototype.lastIndexOf=function(t,r,i){return v(this,t,r,i,!1)},a.prototype.write=function(t,r,i,e){if(void 0===r)e="utf8",i=this.length,r=0;else if(void 0===i&&"string"==typeof r)e=r,i=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(i)?(i|=0,void 0===e&&(e="utf8")):(e=i,i=void 0)}var n=this.length-r;if((void 0===i||i>n)&&(i=n),t.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(var s=!1;;)switch(e){case"hex":return y(this,t,r,i);case"utf8":case"utf-8":return S(this,t,r,i);case"ascii":return A(this,t,r,i);case"latin1":case"binary":return w(this,t,r,i);case"base64":return b(this,t,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r,i);default:if(s)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function R(t,r,i){var e="";i=Math.min(t.length,i);for(var n=r;n<i;++n)e+=String.fromCharCode(127&t[n]);return e}function H(t,r,i){var e="";i=Math.min(t.length,i);for(var n=r;n<i;++n)e+=String.fromCharCode(t[n]);return e}function P(t,r,i){var e=t.length;(!r||r<0)&&(r=0),(!i||i<0||i>e)&&(i=e);for(var n="",s=r;s<i;++s)n+=U(t[s]);return n}function B(t,r,i){for(var e=t.slice(r,i),n="",s=0;s<e.length;s+=2)n+=String.fromCharCode(e[s]+256*e[s+1]);return n}function N(t,r,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>i)throw new RangeError("Trying to access beyond buffer length")}function I(t,r,i,e,n,s){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<s)throw new RangeError('"value" argument is out of bounds');if(i+e>t.length)throw new RangeError("Index out of range")}function O(t,r,i,e){r<0&&(r=65535+r+1);for(var n=0,s=Math.min(t.length-i,2);n<s;++n)t[i+n]=(r&255<<8*(e?n:1-n))>>>8*(e?n:1-n)}function M(t,r,i,e){r<0&&(r=4294967295+r+1);for(var n=0,s=Math.min(t.length-i,4);n<s;++n)t[i+n]=r>>>8*(e?n:3-n)&255}function C(t,r,i,e,n,s){if(i+e>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function j(t,r,i,e,s){return s||C(t,0,i,4),n.write(t,r,i,e,23,4),i+4}function L(t,r,i,e,s){return s||C(t,0,i,8),n.write(t,r,i,e,52,8),i+8}a.prototype.slice=function(t,r){var i,e=this.length;if(t=~~t,r=void 0===r?e:~~r,t<0?(t+=e)<0&&(t=0):t>e&&(t=e),r<0?(r+=e)<0&&(r=0):r>e&&(r=e),r<t&&(r=t),a.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,r)).__proto__=a.prototype;else{var n=r-t;i=new a(n,void 0);for(var s=0;s<n;++s)i[s]=this[s+t]}return i},a.prototype.readUIntLE=function(t,r,i){t|=0,r|=0,i||N(t,r,this.length);for(var e=this[t],n=1,s=0;++s<r&&(n*=256);)e+=this[t+s]*n;return e},a.prototype.readUIntBE=function(t,r,i){t|=0,r|=0,i||N(t,r,this.length);for(var e=this[t+--r],n=1;r>0&&(n*=256);)e+=this[t+--r]*n;return e},a.prototype.readUInt8=function(t,r){return r||N(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,r){return r||N(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,r){return r||N(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,r){return r||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,r){return r||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,r,i){t|=0,r|=0,i||N(t,r,this.length);for(var e=this[t],n=1,s=0;++s<r&&(n*=256);)e+=this[t+s]*n;return e>=(n*=128)&&(e-=Math.pow(2,8*r)),e},a.prototype.readIntBE=function(t,r,i){t|=0,r|=0,i||N(t,r,this.length);for(var e=r,n=1,s=this[t+--e];e>0&&(n*=256);)s+=this[t+--e]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*r)),s},a.prototype.readInt8=function(t,r){return r||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,r){r||N(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt16BE=function(t,r){r||N(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt32LE=function(t,r){return r||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,r){return r||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,r){return r||N(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,r){return r||N(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,r){return r||N(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,r){return r||N(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,r,i,e){(t=+t,r|=0,i|=0,e)||I(this,t,r,i,Math.pow(2,8*i)-1,0);var n=1,s=0;for(this[r]=255&t;++s<i&&(n*=256);)this[r+s]=t/n&255;return r+i},a.prototype.writeUIntBE=function(t,r,i,e){(t=+t,r|=0,i|=0,e)||I(this,t,r,i,Math.pow(2,8*i)-1,0);var n=i-1,s=1;for(this[r+n]=255&t;--n>=0&&(s*=256);)this[r+n]=t/s&255;return r+i},a.prototype.writeUInt8=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},a.prototype.writeUInt16LE=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):O(this,t,r,!0),r+2},a.prototype.writeUInt16BE=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):O(this,t,r,!1),r+2},a.prototype.writeUInt32LE=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):M(this,t,r,!0),r+4},a.prototype.writeUInt32BE=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):M(this,t,r,!1),r+4},a.prototype.writeIntLE=function(t,r,i,e){if(t=+t,r|=0,!e){var n=Math.pow(2,8*i-1);I(this,t,r,i,n-1,-n)}var s=0,o=1,h=0;for(this[r]=255&t;++s<i&&(o*=256);)t<0&&0===h&&0!==this[r+s-1]&&(h=1),this[r+s]=(t/o>>0)-h&255;return r+i},a.prototype.writeIntBE=function(t,r,i,e){if(t=+t,r|=0,!e){var n=Math.pow(2,8*i-1);I(this,t,r,i,n-1,-n)}var s=i-1,o=1,h=0;for(this[r+s]=255&t;--s>=0&&(o*=256);)t<0&&0===h&&0!==this[r+s+1]&&(h=1),this[r+s]=(t/o>>0)-h&255;return r+i},a.prototype.writeInt8=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},a.prototype.writeInt16LE=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):O(this,t,r,!0),r+2},a.prototype.writeInt16BE=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):O(this,t,r,!1),r+2},a.prototype.writeInt32LE=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):M(this,t,r,!0),r+4},a.prototype.writeInt32BE=function(t,r,i){return t=+t,r|=0,i||I(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):M(this,t,r,!1),r+4},a.prototype.writeFloatLE=function(t,r,i){return j(this,t,r,!0,i)},a.prototype.writeFloatBE=function(t,r,i){return j(this,t,r,!1,i)},a.prototype.writeDoubleLE=function(t,r,i){return L(this,t,r,!0,i)},a.prototype.writeDoubleBE=function(t,r,i){return L(this,t,r,!1,i)},a.prototype.copy=function(t,r,i,e){if(i||(i=0),e||0===e||(e=this.length),r>=t.length&&(r=t.length),r||(r=0),e>0&&e<i&&(e=i),e===i)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),t.length-r<e-i&&(e=t.length-r+i);var n,s=e-i;if(this===t&&i<r&&r<e)for(n=s-1;n>=0;--n)t[n+r]=this[n+i];else if(s<1e3||!a.TYPED_ARRAY_SUPPORT)for(n=0;n<s;++n)t[n+r]=this[n+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+s),r);return s},a.prototype.fill=function(t,r,i,e){if("string"==typeof t){if("string"==typeof r?(e=r,r=0,i=this.length):"string"==typeof i&&(e=i,i=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}if(void 0!==e&&"string"!=typeof e)throw new TypeError("encoding must be a string");if("string"==typeof e&&!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;var s;if(r>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(s=r;s<i;++s)this[s]=t;else{var o=a.isBuffer(t)?t:_(new a(t,e).toString()),h=o.length;for(s=0;s<i-r;++s)this[s+r]=o[s%h]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function _(t,r){var i;r=r||1/0;for(var e=t.length,n=null,s=[],o=0;o<e;++o){if((i=t.charCodeAt(o))>55295&&i<57344){if(!n){if(i>56319){(r-=3)>-1&&s.push(239,191,189);continue}if(o+1===e){(r-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(r-=3)>-1&&s.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(r-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((r-=1)<0)break;s.push(i)}else if(i<2048){if((r-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((r-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function F(t){return e.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function k(t,r,i,e){for(var n=0;n<e&&!(n+i>=r.length||n>=t.length);++n)r[n+i]=t[n];return n}}).call(this,i(6))}])});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment