var Et="0123456789abcdefghijklmnopqrstuvwxyz";function A(r){return Et.charAt(r)}function Dt(r,t){return r&t}function Z(r,t){return r|t}function at(r,t){return r^t}function ut(r,t){return r&~t}function xt(r){if(r==0)return-1;var t=0;return r&65535||(r>>=16,t+=16),r&255||(r>>=8,t+=8),r&15||(r>>=4,t+=4),r&3||(r>>=2,t+=2),r&1||++t,t}function Rt(r){for(var t=0;r!=0;)r&=r-1,++t;return t}var C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tt="=";function W(r){var t,e,i="";for(t=0;t+3<=r.length;t+=3)e=parseInt(r.substring(t,t+3),16),i+=C.charAt(e>>6)+C.charAt(e&63);for(t+1==r.length?(e=parseInt(r.substring(t,t+1),16),i+=C.charAt(e<<2)):t+2==r.length&&(e=parseInt(r.substring(t,t+2),16),i+=C.charAt(e>>2)+C.charAt((e&3)<<4));(i.length&3)>0;)i+=Tt;return i}function lt(r){var t="",e,i=0,n=0;for(e=0;e>2),n=s&3,i=1):i==1?(t+=A(n<<2|s>>4),n=s&15,i=2):i==2?(t+=A(n),t+=A(s>>2),n=s&3,i=3):(t+=A(n<<2|s>>4),t+=A(s&15),i=0))}return i==1&&(t+=A(n<<2)),t}var H,Bt={decode:function(r){var t;if(H===void 0){var e="0123456789ABCDEF",i=` \f \r  \u2028\u2029`;for(H={},t=0;t<16;++t)H[e.charAt(t)]=t;for(e=e.toLowerCase(),t=10;t<16;++t)H[e.charAt(t)]=t;for(t=0;t=2?(n[n.length]=s,s=0,h=0):s<<=4}}if(h)throw new Error("Hex encoding incomplete: 4 bits missing");return n}},P,st={decode:function(r){var t;if(P===void 0){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=`= \f \r  \u2028\u2029`;for(P=Object.create(null),t=0;t<64;++t)P[e.charAt(t)]=t;for(P["-"]=62,P._=63,t=0;t=4?(n[n.length]=s>>16,n[n.length]=s>>8&255,n[n.length]=s&255,s=0,h=0):s<<=6}}switch(h){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=s>>10;break;case 3:n[n.length]=s>>16,n[n.length]=s>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(r){var t=st.re.exec(r);if(t)if(t[1])r=t[1];else if(t[2])r=t[2];else throw new Error("RegExp out of sync");return st.decode(r)}},_=1e13,j=function(){function r(t){this.buf=[+t||0]}return r.prototype.mulAdd=function(t,e){var i=this.buf,n=i.length,s,h;for(s=0;s0&&(i[s]=e)},r.prototype.sub=function(t){var e=this.buf,i=e.length,n,s;for(n=0;n=0;--n)i+=(_+e[n]).toString().substring(1);return i},r.prototype.valueOf=function(){for(var t=this.buf,e=0,i=t.length-1;i>=0;--i)e=e*_+t[i];return e},r.prototype.simplify=function(){var t=this.buf;return t.length==1?t[0]:this},r}(),mt="…",At=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,Ot=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function F(r,t){return r.length>t&&(r=r.substring(0,t)+mt),r}var it=function(){function r(t,e){this.hexDigits="0123456789ABCDEF",t instanceof r?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=e)}return r.prototype.get=function(t){if(t===void 0&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset ".concat(t," on a stream of length ").concat(this.enc.length));return typeof this.enc=="string"?this.enc.charCodeAt(t):this.enc[t]},r.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(t&15)},r.prototype.hexDump=function(t,e,i){for(var n="",s=t;s176)return!1}return!0},r.prototype.parseStringISO=function(t,e){for(var i="",n=t;n191&&s<224?i+=String.fromCharCode((s&31)<<6|this.get(n++)&63):i+=String.fromCharCode((s&15)<<12|(this.get(n++)&63)<<6|this.get(n++)&63)}return i},r.prototype.parseStringBMP=function(t,e){for(var i="",n,s,h=t;h127,s=n?255:0,h,o="";i==s&&++t4){for(o=i,h<<=3;!((+o^s)&128);)o=+o<<1,--h;o="("+h+` bit) `}n&&(i=i-256);for(var f=new j(i),u=t+1;u=l;--g)o+=u>>g&1?"1":"0";if(o.length>i)return h+F(o,i)}return h+o},r.prototype.parseOctetString=function(t,e,i){if(this.isASCII(t,e))return F(this.parseStringISO(t,e),i);var n=e-t,s="("+n+` byte) `;i/=2,n>i&&(e=t+i);for(var h=t;hi&&(s+=mt),s},r.prototype.parseOID=function(t,e,i){for(var n="",s=new j,h=0,o=t;oi)return F(n,i);s=new j,h=0}}return h>0&&(n+=".incomplete"),n},r}(),Vt=function(){function r(t,e,i,n,s){if(!(n instanceof ct))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=i,this.tag=n,this.sub=s}return r.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},r.prototype.content=function(t){if(this.tag===void 0)return null;t===void 0&&(t=1/0);var e=this.posContent(),i=Math.abs(this.length);if(!this.tag.isUniversal())return this.sub!==null?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);switch(this.tag.tagNumber){case 1:return this.stream.get(e)===0?"false":"true";case 2:return this.stream.parseInteger(e,e+i);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+i,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);case 6:return this.stream.parseOID(e,e+i,t);case 16:case 17:return this.sub!==null?"("+this.sub.length+" elem)":"(no elem)";case 12:return F(this.stream.parseStringUTF(e,e+i),t);case 18:case 19:case 20:case 21:case 22:case 26:return F(this.stream.parseStringISO(e,e+i),t);case 30:return F(this.stream.parseStringBMP(e,e+i),t);case 23:case 24:return this.stream.parseTime(e,e+i,this.tag.tagNumber==23)}return null},r.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(this.sub===null?"null":this.sub.length)+"]"},r.prototype.toPrettyString=function(t){t===void 0&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":this.tag.isUniversal()&&(this.tag.tagNumber==3||this.tag.tagNumber==4)&&this.sub!==null&&(e+=" (encapsulates)"),e+=` `,this.sub!==null){t+=" ";for(var i=0,n=this.sub.length;i6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(i===0)return null;e=0;for(var n=0;n>6,this.tagConstructed=(e&32)!==0,this.tagNumber=e&31,this.tagNumber==31){var i=new j;do e=t.get(),i.mulAdd(128,e&127);while(e&128);this.tagNumber=i.simplify()}}return r.prototype.isUniversal=function(){return this.tagClass===0},r.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},r}(),I,It=0xdeadbeefcafe,pt=(It&16777215)==15715070,w=[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],Nt=(1<<26)/w[w.length-1],c=function(){function r(t,e,i){t!=null&&(typeof t=="number"?this.fromNumber(t,e,i):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}return r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var i=(1<0)for(f>f)>0&&(s=!0,h=A(n));o>=0;)f>(f+=this.DB-e)):(n=this[o]>>(f-=e)&i,f<=0&&(f+=this.DB,--o)),n>0&&(s=!0),s&&(h+=A(n));return s?h:"0"},r.prototype.negate=function(){var t=p();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(e!=0)return e;var i=this.t;if(e=i-t.t,e!=0)return this.s<0?-e:e;for(;--i>=0;)if((e=this[i]-t[i])!=0)return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+G(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=p();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var i;return t<256||e.isEven()?i=new gt(e):i=new vt(e),this.exp(t,i)},r.prototype.clone=function(){var t=p();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<>24},r.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var i=this.DB-t*this.DB%8,n,s=0;if(t-- >0)for(i>i)!=(this.s&this.DM)>>i&&(e[s++]=n|this.s<=0;)i<8?(n=(this[t]&(1<>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),n&128&&(n|=-256),s==0&&(this.s&128)!=(n&128)&&++s,(s>0||n!=this.s)&&(e[s++]=n);return e},r.prototype.equals=function(t){return this.compareTo(t)==0},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=p();return this.bitwiseTo(t,Dt,e),e},r.prototype.or=function(t){var e=p();return this.bitwiseTo(t,Z,e),e},r.prototype.xor=function(t){var e=p();return this.bitwiseTo(t,at,e),e},r.prototype.andNot=function(t){var e=p();return this.bitwiseTo(t,ut,e),e},r.prototype.not=function(){for(var t=p(),e=0;e=this.t?this.s!=0:(this[e]&1<1){var g=p();for(h.sqrTo(o[1],g);f<=l;)o[f]=p(),h.mulTo(g,o[f-2],o[f]),f+=2}var d=t.t-1,y,T=!0,b=p(),E;for(i=G(t[d])-1;d>=0;){for(i>=u?y=t[d]>>i-u&l:(y=(t[d]&(1<0&&(y|=t[d-1]>>this.DB+i-u)),f=n;!(y&1);)y>>=1,--f;if((i-=f)<0&&(i+=this.DB,--d),T)o[y].copyTo(s),T=!1;else{for(;f>1;)h.sqrTo(s,b),h.sqrTo(b,s),f-=2;f>0?h.sqrTo(s,b):(E=s,s=b,b=E),h.mulTo(b,o[y],s)}for(;d>=0&&!(t[d]&1<=0?(i.subTo(n,i),e&&s.subTo(o,s),h.subTo(f,h)):(n.subTo(i,n),e&&o.subTo(s,o),f.subTo(h,f))}if(n.compareTo(r.ONE)!=0)return r.ZERO;if(f.compareTo(t)>=0)return f.subtract(t);if(f.signum()<0)f.addTo(t,f);else return f;return f.signum()<0?f.add(t):f},r.prototype.pow=function(t){return this.exp(t,new Pt)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var n=e;e=i,i=n}var s=e.getLowestSetBit(),h=i.getLowestSetBit();if(h<0)return e;for(s0&&(e.rShiftTo(h,e),i.rShiftTo(h,i));e.signum()>0;)(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return h>0&&i.lShiftTo(h,i),i},r.prototype.isProbablePrime=function(t){var e,i=this.abs();if(i.t==1&&i[0]<=w[w.length-1]){for(e=0;e=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.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},r.prototype.fromString=function(t,e){var i;if(e==16)i=4;else if(e==8)i=3;else if(e==256)i=8;else if(e==2)i=1;else if(e==32)i=5;else if(e==4)i=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,s=!1,h=0;--n>=0;){var o=i==8?+t[n]&255:yt(t,n);if(o<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,h==0?this[this.t++]=o:h+i>this.DB?(this[this.t-1]|=(o&(1<>this.DB-h):this[this.t-1]|=o<=this.DB&&(h-=this.DB)}i==8&&+t[0]&128&&(this.s=-1,h>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var i=t;i=0;--f)e[f+h+1]=this[f]>>n|o,o=(this[f]&s)<=0;--f)e[f]=0;e[h]=o,e.t=this.t+h+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t){e.t=0;return}var n=t%this.DB,s=this.DB-n,h=(1<>n;for(var o=i+1;o>n;n>0&&(e[this.t-i-1]|=(this.s&h)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;i>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()},r.prototype.multiplyTo=function(t,e){var i=this.abs(),n=t.abs(),s=i.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s=0;)t[i]=0;for(i=0;i=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t0?(n.lShiftTo(u,h),s.lShiftTo(u,i)):(n.copyTo(h),s.copyTo(i));var l=h.t,g=h[l-1];if(g!=0){var d=g*(1<1?h[l-2]>>this.F2:0),y=this.FV/d,T=(1<=0&&(i[i.t++]=1,i.subTo(B,i)),r.ONE.dlShiftTo(l,B),B.subTo(h,h);h.t=0;){var q=i[--E]==g?this.DM:Math.floor(i[E]*y+(i[E-1]+b)*T);if((i[E]+=h.am(0,q,i,M,0,l))0&&i.rShiftTo(u,i),o<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e},r.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var i=p(),n=p(),s=e.convert(this),h=G(t)-1;for(s.copyTo(i);--h>=0;)if(e.sqrTo(i,n),(t&1<0)e.mulTo(n,s,i);else{var o=i;i=n,n=o}return e.revert(i)},r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=O(i),s=p(),h=p(),o="";for(this.divRemTo(n,s,h);s.signum()>0;)o=(i+h.intValue()).toString(t).substr(1)+o,s.divRemTo(n,s,h);return h.intValue().toString(t)+o},r.prototype.fromRadix=function(t,e){this.fromInt(0),e==null&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),s=!1,h=0,o=0,f=0;f=i&&(this.dMultiply(n),this.dAddOffset(o,0),h=0,o=0)}h>0&&(this.dMultiply(Math.pow(e,h)),this.dAddOffset(o,0)),s&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,i){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),Z,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var n=[],s=t&7;n.length=(t>>3)+1,e.nextBytes(n),s>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;i>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(t!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,i){var n=Math.min(this.t+t.t,e);for(i.s=0,i.t=n;n>0;)i[--n]=0;for(var s=i.t-this.t;n=0;)i[n]=0;for(n=Math.max(e-this.t,0);n0)if(e==0)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var n=e.shiftRight(i);t=t+1>>1,t>w.length&&(t=w.length);for(var s=p(),h=0;h0&&(i.rShiftTo(o,i),n.rShiftTo(o,n));var f=function(){(h=i.getLowestSetBit())>0&&i.rShiftTo(h,i),(h=n.getLowestSetBit())>0&&n.rShiftTo(h,n),i.compareTo(n)>=0?(i.subTo(n,i),i.rShiftTo(1,i)):(n.subTo(i,n),n.rShiftTo(1,n)),i.signum()>0?setTimeout(f,0):(o>0&&n.lShiftTo(o,n),setTimeout(function(){e(n)},0))};setTimeout(f,10)},r.prototype.fromNumberAsync=function(t,e,i,n){if(typeof e=="number")if(t<2)this.fromInt(1);else{this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),Z,this),this.isEven()&&this.dAddOffset(1,0);var s=this,h=function(){s.dAddOffset(2,0),s.bitLength()>t&&s.subTo(r.ONE.shiftLeft(t-1),s),s.isProbablePrime(e)?setTimeout(function(){n()},0):setTimeout(h,0)};setTimeout(h,0)}else{var o=[],f=t&7;o.length=(t>>3)+1,e.nextBytes(o),f>0?o[0]&=(1<=0?t.mod(this.m):t},r.prototype.revert=function(t){return t},r.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},r.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}(),vt=function(){function r(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(e,e),e},r.prototype.revert=function(t){var e=p();return t.copyTo(e),this.reduce(e),e},r.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,n,t,e,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)},r.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}(),Mt=function(){function r(t){this.m=t,this.r2=p(),this.q3=p(),c.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return r.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 e=p();return t.copyTo(e),this.reduce(e),e},r.prototype.revert=function(t){return t},r.prototype.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)},r.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}();function p(){return new c(null)}function S(r,t){return new c(r,t)}var dt=typeof navigator<"u";dt&&pt&&navigator.appName=="Microsoft Internet Explorer"?(c.prototype.am=function(t,e,i,n,s,h){for(var o=e&32767,f=e>>15;--h>=0;){var u=this[t]&32767,l=this[t++]>>15,g=f*u+l*o;u=o*u+((g&32767)<<15)+i[n]+(s&1073741823),s=(u>>>30)+(g>>>15)+f*l+(s>>>30),i[n++]=u&1073741823}return s},I=30):dt&&pt&&navigator.appName!="Netscape"?(c.prototype.am=function(t,e,i,n,s,h){for(;--h>=0;){var o=e*this[t++]+i[n]+s;s=Math.floor(o/67108864),i[n++]=o&67108863}return s},I=26):(c.prototype.am=function(t,e,i,n,s,h){for(var o=e&16383,f=e>>14;--h>=0;){var u=this[t]&16383,l=this[t++]>>14,g=f*u+l*o;u=o*u+((g&16383)<<14)+i[n]+s,s=(u>>28)+(g>>14)+f*l,i[n++]=u&268435455}return s},I=28);c.prototype.DB=I;c.prototype.DM=(1<>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}c.ZERO=O(0);c.ONE=O(1);var qt=function(){function r(){this.i=0,this.j=0,this.S=[]}return r.prototype.init=function(t){var e,i,n;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[i],this.S[i]=n;this.i=0,this.j=0},r.prototype.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]},r}();function Ht(){return new qt}var bt=256,$,V=null,R;if(V==null){V=[],R=0;var J=void 0;if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){var rt=new Uint32Array(256);for(window.crypto.getRandomValues(rt),J=0;J=256||R>=bt){window.removeEventListener?window.removeEventListener("mousemove",X,!1):window.detachEvent&&window.detachEvent("onmousemove",X);return}try{var t=r.x+r.y;V[R++]=t&255,Y+=1}catch{}};typeof window<"u"&&(window.addEventListener?window.addEventListener("mousemove",X,!1):window.attachEvent&&window.attachEvent("onmousemove",X))}function _t(){if($==null){for($=Ht();R=0&&t>0;){var n=r.charCodeAt(i--);n<128?e[--t]=n:n>127&&n<2048?(e[--t]=n&63|128,e[--t]=n>>6|192):(e[--t]=n&63|128,e[--t]=n>>6&63|128,e[--t]=n>>12|224)}e[--t]=0;for(var s=new ot,h=[];t>2;){for(h[0]=0;h[0]==0;)s.nextBytes(h);e[--t]=h[0]}return e[--t]=2,e[--t]=0,new c(e)}var Lt=function(){function r(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return r.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},r.prototype.doPrivate=function(t){if(this.p==null||this.q==null)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(i)<0;)e=e.add(this.p);return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},r.prototype.setPublic=function(t,e){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=S(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},r.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,i=Ft(t,e);if(i==null)return null;var n=this.doPublic(i);if(n==null)return null;for(var s=n.toString(16),h=s.length,o=0;o0&&e.length>0?(this.n=S(t,16),this.e=parseInt(e,16),this.d=S(i,16)):console.error("Invalid RSA private key")},r.prototype.setPrivateEx=function(t,e,i,n,s,h,o,f){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=S(t,16),this.e=parseInt(e,16),this.d=S(i,16),this.p=S(n,16),this.q=S(s,16),this.dmp1=S(h,16),this.dmq1=S(o,16),this.coeff=S(f,16)):console.error("Invalid RSA private key")},r.prototype.generate=function(t,e){var i=new ot,n=t>>1;this.e=parseInt(e,16);for(var s=new c(e,16);;){for(;this.p=new c(t-n,1,i),!(this.p.subtract(c.ONE).gcd(s).compareTo(c.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new c(n,1,i),!(this.q.subtract(c.ONE).gcd(s).compareTo(c.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var h=this.p;this.p=this.q,this.q=h}var o=this.p.subtract(c.ONE),f=this.q.subtract(c.ONE),u=o.multiply(f);if(u.gcd(s).compareTo(c.ONE)==0){this.n=this.p.multiply(this.q),this.d=s.modInverse(u),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(f),this.coeff=this.q.modInverse(this.p);break}}},r.prototype.decrypt=function(t){var e=S(t,16),i=this.doPrivate(e);return i==null?null:Kt(i,this.n.bitLength()+7>>3)},r.prototype.generateAsync=function(t,e,i){var n=new ot,s=t>>1;this.e=parseInt(e,16);var h=new c(e,16),o=this,f=function(){var u=function(){if(o.p.compareTo(o.q)<=0){var d=o.p;o.p=o.q,o.q=d}var y=o.p.subtract(c.ONE),T=o.q.subtract(c.ONE),b=y.multiply(T);b.gcd(h).compareTo(c.ONE)==0?(o.n=o.p.multiply(o.q),o.d=h.modInverse(b),o.dmp1=o.d.mod(y),o.dmq1=o.d.mod(T),o.coeff=o.q.modInverse(o.p),setTimeout(function(){i()},0)):setTimeout(f,0)},l=function(){o.q=p(),o.q.fromNumberAsync(s,1,n,function(){o.q.subtract(c.ONE).gcda(h,function(d){d.compareTo(c.ONE)==0&&o.q.isProbablePrime(10)?setTimeout(u,0):setTimeout(l,0)})})},g=function(){o.p=p(),o.p.fromNumberAsync(t-s,1,n,function(){o.p.subtract(c.ONE).gcda(h,function(d){d.compareTo(c.ONE)==0&&o.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(g,0)})})};setTimeout(g,0)};setTimeout(f,0)},r.prototype.sign=function(t,e,i){var n=Ut(i),s=n+e(t).toString(),h=Ct(s,this.n.bitLength()/4);if(h==null)return null;var o=this.doPrivate(h);if(o==null)return null;var f=o.toString(16);return f.length&1?"0"+f:f},r.prototype.verify=function(t,e,i){var n=S(e,16),s=this.doPublic(n);if(s==null)return null;var h=s.toString(16).replace(/^1f+00/,""),o=jt(h);return o==i(t).toString()},r}();function Kt(r,t){for(var e=r.toByteArray(),i=0;i=e.length)return null;for(var n="";++i191&&s<224?(n+=String.fromCharCode((s&31)<<6|e[i+1]&63),++i):(n+=String.fromCharCode((s&15)<<12|(e[i+1]&63)<<6|e[i+2]&63),i+=2)}return n}var Q={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function Ut(r){return Q[r]||""}function jt(r){for(var t in Q)if(Q.hasOwnProperty(t)){var e=Q[t],i=e.length;if(r.substr(0,i)==e)return r.substr(i)}return r}/*! 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 */var m={};m.lang={extend:function(r,t,e){if(!t||!r)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var i=function(){};if(i.prototype=t.prototype,r.prototype=new i,r.prototype.constructor=r,r.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),e){var n;for(n in e)r.prototype[n]=e[n];var s=function(){},h=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(s=function(o,f){for(n=0;nMIT License */var a={};(typeof a.asn1>"u"||!a.asn1)&&(a.asn1={});a.asn1.ASN1Util=new function(){this.integerToByteHex=function(r){var t=r.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(r){var t=r.toString(16);if(t.substr(0,1)!="-")t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var e=t.substr(1),i=e.length;i%2==1?i+=1:t.match(/^[0-7]/)||(i+=2);for(var n="",s=0;s"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+r.length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var i=e.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var n=128+i;return n.toString(16)+e},this.getEncodedHex=function(){return(this.hTLV==null||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""}};a.asn1.DERAbstractString=function(r){a.asn1.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=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r=="string"?this.setString(r):typeof r.str<"u"?this.setString(r.str):typeof r.hex<"u"&&this.setStringHex(r.hex))};m.lang.extend(a.asn1.DERAbstractString,a.asn1.ASN1Object);a.asn1.DERAbstractTime=function(r){a.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+t.getTimezoneOffset()*6e4;var e=new Date(utc);return e},this.formatDate=function(t,e,i){var n=this.zeroPadding,s=this.localDateToUTC(t),h=String(s.getFullYear());e=="utc"&&(h=h.substr(2,2));var o=n(String(s.getMonth()+1),2),f=n(String(s.getDate()),2),u=n(String(s.getHours()),2),l=n(String(s.getMinutes()),2),g=n(String(s.getSeconds()),2),d=h+o+f+u+l+g;if(i===!0){var y=s.getMilliseconds();if(y!=0){var T=n(String(y),3);T=T.replace(/[0]+$/,""),d=d+"."+T}}return d+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-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=stohex(t)},this.setByDateValue=function(t,e,i,n,s,h){var o=new Date(Date.UTC(t,e-1,i,n,s,h,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}};m.lang.extend(a.asn1.DERAbstractTime,a.asn1.ASN1Object);a.asn1.DERAbstractStructured=function(r){a.asn1.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,typeof r<"u"&&typeof r.array<"u"&&(this.asn1Array=r.array)};m.lang.extend(a.asn1.DERAbstractStructured,a.asn1.ASN1Object);a.asn1.DERBoolean=function(){a.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"};m.lang.extend(a.asn1.DERBoolean,a.asn1.ASN1Object);a.asn1.DERInteger=function(r){a.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=a.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new c(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.bigint<"u"?this.setByBigInteger(r.bigint):typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))};m.lang.extend(a.asn1.DERInteger,a.asn1.ASN1Object);a.asn1.DERBitString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=a.asn1.ASN1Util.newObject(r.obj);r.hex="00"+t.getEncodedHex()}a.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,i){if(e<0||7"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{12}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date))};m.lang.extend(a.asn1.DERUTCTime,a.asn1.DERAbstractTime);a.asn1.DERGeneralizedTime=function(r){a.asn1.DERGeneralizedTime.superclass.constructor.call(this,r),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=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{14}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date),r.millis===!0&&(this.withMillis=!0))};m.lang.extend(a.asn1.DERGeneralizedTime,a.asn1.DERAbstractTime);a.asn1.DERSequence=function(r){a.asn1.DERSequence.superclass.constructor.call(this,r),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e