flagmint-js-sdk 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/flagmint.cjs.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/(function(h){const n=Rn,s=g0,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.Buffer=y,h.SlowBuffer=$,h.INSPECT_MAX_BYTES=50;const m=2147483647;h.kMaxLength=m,y.TYPED_ARRAY_SUPPORT=f(),!y.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const E=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(E,w),E.foo()===42}catch(E){return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function g(E){if(E>m)throw new RangeError('The value "'+E+'" is invalid for option "size"');const w=new Uint8Array(E);return Object.setPrototypeOf(w,y.prototype),w}function y(E,w,A){if(typeof E=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(E)}return S(E,w,A)}y.poolSize=8192;function S(E,w,A){if(typeof E=="string")return I(E,w);if(ArrayBuffer.isView(E))return D(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(dt(E,ArrayBuffer)||E&&dt(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(dt(E,SharedArrayBuffer)||E&&dt(E.buffer,SharedArrayBuffer)))return L(E,w,A);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=E.valueOf&&E.valueOf();if(T!=null&&T!==E)return y.from(T,w,A);const F=W(E);if(F)return F;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return y.from(E[Symbol.toPrimitive]("string"),w,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}y.from=function(E,w,A){return S(E,w,A)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array);function B(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function M(E,w,A){return B(E),E<=0?g(E):w!==void 0?typeof A=="string"?g(E).fill(w,A):g(E).fill(w):g(E)}y.alloc=function(E,w,A){return M(E,w,A)};function x(E){return B(E),g(E<0?0:z(E)|0)}y.allocUnsafe=function(E){return x(E)},y.allocUnsafeSlow=function(E){return x(E)};function I(E,w){if((typeof w!="string"||w==="")&&(w="utf8"),!y.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const A=lt(E,w)|0;let T=g(A);const F=T.write(E,w);return F!==A&&(T=T.slice(0,F)),T}function k(E){const w=E.length<0?0:z(E.length)|0,A=g(w);for(let T=0;T<w;T+=1)A[T]=E[T]&255;return A}function D(E){if(dt(E,Uint8Array)){const w=new Uint8Array(E);return L(w.buffer,w.byteOffset,w.byteLength)}return k(E)}function L(E,w,A){if(w<0||E.byteLength<w)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<w+(A||0))throw new RangeError('"length" is outside of buffer bounds');let T;return w===void 0&&A===void 0?T=new Uint8Array(E):A===void 0?T=new Uint8Array(E,w):T=new Uint8Array(E,w,A),Object.setPrototypeOf(T,y.prototype),T}function W(E){if(y.isBuffer(E)){const w=z(E.length)|0,A=g(w);return A.length===0||E.copy(A,0,0,w),A}if(E.length!==void 0)return typeof E.length!="number"||qt(E.length)?g(0):k(E);if(E.type==="Buffer"&&Array.isArray(E.data))return k(E.data)}function z(E){if(E>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return E|0}function $(E){return+E!=E&&(E=0),y.alloc(+E)}y.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==y.prototype},y.compare=function(w,A){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),dt(A,Uint8Array)&&(A=y.from(A,A.offset,A.byteLength)),!y.isBuffer(w)||!y.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===A)return 0;let T=w.length,F=A.length;for(let V=0,U=Math.min(T,F);V<U;++V)if(w[V]!==A[V]){T=w[V],F=A[V];break}return T<F?-1:F<T?1:0},y.isEncoding=function(w){switch(String(w).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}},y.concat=function(w,A){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return y.alloc(0);let T;if(A===void 0)for(A=0,T=0;T<w.length;++T)A+=w[T].length;const F=y.allocUnsafe(A);let V=0;for(T=0;T<w.length;++T){let U=w[T];if(dt(U,Uint8Array))V+U.length>F.length?(y.isBuffer(U)||(U=y.from(U)),U.copy(F,V)):Uint8Array.prototype.set.call(F,U,V);else if(y.isBuffer(U))U.copy(F,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=U.length}return F};function lt(E,w){if(y.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||dt(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const A=E.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&A===0)return 0;let F=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Dt(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Pt(E).length;default:if(F)return T?-1:Dt(E).length;w=(""+w).toLowerCase(),F=!0}}y.byteLength=lt;function H(E,w,A){let T=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,w>>>=0,A<=w))return"";for(E||(E="utf8");;)switch(E){case"hex":return u(this,w,A);case"utf8":case"utf-8":return i(this,w,A);case"ascii":return c(this,w,A);case"latin1":case"binary":return v(this,w,A);case"base64":return r(this,w,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e(this,w,A);default:if(T)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),T=!0}}y.prototype._isBuffer=!0;function At(E,w,A){const T=E[w];E[w]=E[A],E[A]=T}y.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<w;A+=2)At(this,A,A+1);return this},y.prototype.swap32=function(){const w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<w;A+=4)At(this,A,A+3),At(this,A+1,A+2);return this},y.prototype.swap64=function(){const w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<w;A+=8)At(this,A,A+7),At(this,A+1,A+6),At(this,A+2,A+5),At(this,A+3,A+4);return this},y.prototype.toString=function(){const w=this.length;return w===0?"":arguments.length===0?i(this,0,w):H.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(w){if(!y.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:y.compare(this,w)===0},y.prototype.inspect=function(){let w="";const A=h.INSPECT_MAX_BYTES;return w=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(w+=" ... "),"<Buffer "+w+">"},o&&(y.prototype[o]=y.prototype.inspect),y.prototype.compare=function(w,A,T,F,V){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),!y.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(A===void 0&&(A=0),T===void 0&&(T=w?w.length:0),F===void 0&&(F=0),V===void 0&&(V=this.length),A<0||T>w.length||F<0||V>this.length)throw new RangeError("out of range index");if(F>=V&&A>=T)return 0;if(F>=V)return-1;if(A>=T)return 1;if(A>>>=0,T>>>=0,F>>>=0,V>>>=0,this===w)return 0;let U=V-F,X=T-A;const Tt=Math.min(U,X),G=this.slice(F,V),rt=w.slice(A,T);for(let Rt=0;Rt<Tt;++Rt)if(G[Rt]!==rt[Rt]){U=G[Rt],X=rt[Rt];break}return U<X?-1:X<U?1:0};function Bt(E,w,A,T,F){if(E.length===0)return-1;if(typeof A=="string"?(T=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,qt(A)&&(A=F?0:E.length-1),A<0&&(A=E.length+A),A>=E.length){if(F)return-1;A=E.length-1}else if(A<0)if(F)A=0;else return-1;if(typeof w=="string"&&(w=y.from(w,T)),y.isBuffer(w))return w.length===0?-1:Ct(E,w,A,T,F);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(E,w,A):Uint8Array.prototype.lastIndexOf.call(E,w,A):Ct(E,[w],A,T,F);throw new TypeError("val must be string, number or Buffer")}function Ct(E,w,A,T,F){let V=1,U=E.length,X=w.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(E.length<2||w.length<2)return-1;V=2,U/=2,X/=2,A/=2}function Tt(rt,Rt){return V===1?rt[Rt]:rt.readUInt16BE(Rt*V)}let G;if(F){let rt=-1;for(G=A;G<U;G++)if(Tt(E,G)===Tt(w,rt===-1?0:G-rt)){if(rt===-1&&(rt=G),G-rt+1===X)return rt*V}else rt!==-1&&(G-=G-rt),rt=-1}else for(A+X>U&&(A=U-X),G=A;G>=0;G--){let rt=!0;for(let Rt=0;Rt<X;Rt++)if(Tt(E,G+Rt)!==Tt(w,Rt)){rt=!1;break}if(rt)return G}return-1}y.prototype.includes=function(w,A,T){return this.indexOf(w,A,T)!==-1},y.prototype.indexOf=function(w,A,T){return Bt(this,w,A,T,!0)},y.prototype.lastIndexOf=function(w,A,T){return Bt(this,w,A,T,!1)};function Et(E,w,A,T){A=Number(A)||0;const F=E.length-A;T?(T=Number(T),T>F&&(T=F)):T=F;const V=w.length;T>V/2&&(T=V/2);let U;for(U=0;U<T;++U){const X=parseInt(w.substr(U*2,2),16);if(qt(X))return U;E[A+U]=X}return U}function Y(E,w,A,T){return j(Dt(w,E.length-A),E,A,T)}function It(E,w,A,T){return j(et(w),E,A,T)}function p(E,w,A,T){return j(Pt(w),E,A,T)}function t(E,w,A,T){return j(pt(w,E.length-A),E,A,T)}y.prototype.write=function(w,A,T,F){if(A===void 0)F="utf8",T=this.length,A=0;else if(T===void 0&&typeof A=="string")F=A,T=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(T)?(T=T>>>0,F===void 0&&(F="utf8")):(F=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-A;if((T===void 0||T>V)&&(T=V),w.length>0&&(T<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let U=!1;for(;;)switch(F){case"hex":return Et(this,w,A,T);case"utf8":case"utf-8":return Y(this,w,A,T);case"ascii":case"latin1":case"binary":return It(this,w,A,T);case"base64":return p(this,w,A,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t(this,w,A,T);default:if(U)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),U=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function r(E,w,A){return w===0&&A===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(w,A))}function i(E,w,A){A=Math.min(E.length,A);const T=[];let F=w;for(;F<A;){const V=E[F];let U=null,X=V>239?4:V>223?3:V>191?2:1;if(F+X<=A){let Tt,G,rt,Rt;switch(X){case 1:V<128&&(U=V);break;case 2:Tt=E[F+1],(Tt&192)===128&&(Rt=(V&31)<<6|Tt&63,Rt>127&&(U=Rt));break;case 3:Tt=E[F+1],G=E[F+2],(Tt&192)===128&&(G&192)===128&&(Rt=(V&15)<<12|(Tt&63)<<6|G&63,Rt>2047&&(Rt<55296||Rt>57343)&&(U=Rt));break;case 4:Tt=E[F+1],G=E[F+2],rt=E[F+3],(Tt&192)===128&&(G&192)===128&&(rt&192)===128&&(Rt=(V&15)<<18|(Tt&63)<<12|(G&63)<<6|rt&63,Rt>65535&&Rt<1114112&&(U=Rt))}}U===null?(U=65533,X=1):U>65535&&(U-=65536,T.push(U>>>10&1023|55296),U=56320|U&1023),T.push(U),F+=X}return d(T)}const a=4096;function d(E){const w=E.length;if(w<=a)return String.fromCharCode.apply(String,E);let A="",T=0;for(;T<w;)A+=String.fromCharCode.apply(String,E.slice(T,T+=a));return A}function c(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]&127);return T}function v(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]);return T}function u(E,w,A){const T=E.length;(!w||w<0)&&(w=0),(!A||A<0||A>T)&&(A=T);let F="";for(let V=w;V<A;++V)F+=Q[E[V]];return F}function e(E,w,A){const T=E.slice(w,A);let F="";for(let V=0;V<T.length-1;V+=2)F+=String.fromCharCode(T[V]+T[V+1]*256);return F}y.prototype.slice=function(w,A){const T=this.length;w=~~w,A=A===void 0?T:~~A,w<0?(w+=T,w<0&&(w=0)):w>T&&(w=T),A<0?(A+=T,A<0&&(A=0)):A>T&&(A=T),A<w&&(A=w);const F=this.subarray(w,A);return Object.setPrototypeOf(F,y.prototype),F};function l(E,w,A){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+w>A)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return F},y.prototype.readUintBE=y.prototype.readUIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w+--A],V=1;for(;A>0&&(V*=256);)F+=this[w+--A]*V;return F},y.prototype.readUint8=y.prototype.readUInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]|this[w+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]<<8|this[w+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},y.prototype.readBigUInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=A+this[++w]*pe(2,8)+this[++w]*pe(2,16)+this[++w]*pe(2,24),V=this[++w]+this[++w]*pe(2,8)+this[++w]*pe(2,16)+T*pe(2,24);return BigInt(F)+(BigInt(V)<<BigInt(32))}),y.prototype.readBigUInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=A*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+this[++w],V=this[++w]*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+T;return(BigInt(F)<<BigInt(32))+BigInt(V)}),y.prototype.readIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return V*=128,F>=V&&(F-=Math.pow(2,8*A)),F},y.prototype.readIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=A,V=1,U=this[w+--F];for(;F>0&&(V*=256);)U+=this[w+--F]*V;return V*=128,U>=V&&(U-=Math.pow(2,8*A)),U},y.prototype.readInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},y.prototype.readInt16LE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w]|this[w+1]<<8;return T&32768?T|4294901760:T},y.prototype.readInt16BE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w+1]|this[w]<<8;return T&32768?T|4294901760:T},y.prototype.readInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},y.prototype.readInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},y.prototype.readBigInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=this[w+4]+this[w+5]*pe(2,8)+this[w+6]*pe(2,16)+(T<<24);return(BigInt(F)<<BigInt(32))+BigInt(A+this[++w]*pe(2,8)+this[++w]*pe(2,16)+this[++w]*pe(2,24))}),y.prototype.readBigInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=(A<<24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+this[++w];return(BigInt(F)<<BigInt(32))+BigInt(this[++w]*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+T)}),y.prototype.readFloatLE=function(w,A){return w=w>>>0,A||l(w,4,this.length),s.read(this,w,!0,23,4)},y.prototype.readFloatBE=function(w,A){return w=w>>>0,A||l(w,4,this.length),s.read(this,w,!1,23,4)},y.prototype.readDoubleLE=function(w,A){return w=w>>>0,A||l(w,8,this.length),s.read(this,w,!0,52,8)},y.prototype.readDoubleBE=function(w,A){return w=w>>>0,A||l(w,8,this.length),s.read(this,w,!1,52,8)};function b(E,w,A,T,F,V){if(!y.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>F||w<V)throw new RangeError('"value" argument is out of bounds');if(A+T>E.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=1,U=0;for(this[A]=w&255;++U<T&&(V*=256);)this[A+U]=w/V&255;return A+T},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=T-1,U=1;for(this[A+V]=w&255;--V>=0&&(U*=256);)this[A+V]=w/U&255;return A+T},y.prototype.writeUint8=y.prototype.writeUInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,255,0),this[A]=w&255,A+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A+3]=w>>>24,this[A+2]=w>>>16,this[A+1]=w>>>8,this[A]=w&255,A+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4};function _(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,A}function C(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A+7]=V,V=V>>8,E[A+6]=V,V=V>>8,E[A+5]=V,V=V>>8,E[A+4]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A+3]=U,U=U>>8,E[A+2]=U,U=U>>8,E[A+1]=U,U=U>>8,E[A]=U,A+8}y.prototype.writeBigUInt64LE=ct(function(w,A=0){return _(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=ct(function(w,A=0){return C(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=0,U=1,X=0;for(this[A]=w&255;++V<T&&(U*=256);)w<0&&X===0&&this[A+V-1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=T-1,U=1,X=0;for(this[A+V]=w&255;--V>=0&&(U*=256);)w<0&&X===0&&this[A+V+1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,127,-128),w<0&&(w=255+w+1),this[A]=w&255,A+1},y.prototype.writeInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),this[A]=w&255,this[A+1]=w>>>8,this[A+2]=w>>>16,this[A+3]=w>>>24,A+4},y.prototype.writeInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4},y.prototype.writeBigInt64LE=ct(function(w,A=0){return _(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=ct(function(w,A=0){return C(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function q(E,w,A,T,F,V){if(A+T>E.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function O(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,4),s.write(E,w,A,T,23,4),A+4}y.prototype.writeFloatLE=function(w,A,T){return O(this,w,A,!0,T)},y.prototype.writeFloatBE=function(w,A,T){return O(this,w,A,!1,T)};function R(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,8),s.write(E,w,A,T,52,8),A+8}y.prototype.writeDoubleLE=function(w,A,T){return R(this,w,A,!0,T)},y.prototype.writeDoubleBE=function(w,A,T){return R(this,w,A,!1,T)},y.prototype.copy=function(w,A,T,F){if(!y.isBuffer(w))throw new TypeError("argument should be a Buffer");if(T||(T=0),!F&&F!==0&&(F=this.length),A>=w.length&&(A=w.length),A||(A=0),F>0&&F<T&&(F=T),F===T||w.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("sourceEnd out of bounds");F>this.length&&(F=this.length),w.length-A<F-T&&(F=w.length-A+T);const V=F-T;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(A,T,F):Uint8Array.prototype.set.call(w,this.subarray(T,F),A),V},y.prototype.fill=function(w,A,T,F){if(typeof w=="string"){if(typeof A=="string"?(F=A,A=0,T=this.length):typeof T=="string"&&(F=T,T=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!y.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(w.length===1){const U=w.charCodeAt(0);(F==="utf8"&&U<128||F==="latin1")&&(w=U)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(A<0||this.length<A||this.length<T)throw new RangeError("Out of range index");if(T<=A)return this;A=A>>>0,T=T===void 0?this.length:T>>>0,w||(w=0);let V;if(typeof w=="number")for(V=A;V<T;++V)this[V]=w;else{const U=y.isBuffer(w)?w:y.from(w,F),X=U.length;if(X===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(V=0;V<T-A;++V)this[V+A]=U[V%X]}return this};const P={};function N(E,w,A){P[E]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:w.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(E,w){return`The "${E}" argument must be of type number. Received type ${typeof w}`},TypeError),N("ERR_OUT_OF_RANGE",function(E,w,A){let T=`The value of "${E}" is out of range.`,F=A;return Number.isInteger(A)&&Math.abs(A)>pe(2,32)?F=K(String(A)):typeof A=="bigint"&&(F=String(A),(A>pe(BigInt(2),BigInt(32))||A<-pe(BigInt(2),BigInt(32)))&&(F=K(F)),F+="n"),T+=` It must be ${w}. Received ${F}`,T},RangeError);function K(E){let w="",A=E.length;const T=E[0]==="-"?1:0;for(;A>=T+4;A-=3)w=`_${E.slice(A-3,A)}${w}`;return`${E.slice(0,A)}${w}`}function kt(E,w,A){J(w,"offset"),(E[w]===void 0||E[w+A]===void 0)&&Ft(w,E.length-(A+1))}function Z(E,w,A,T,F,V){if(E>A||E<w){const U=typeof w=="bigint"?"n":"";let X;throw V>3?w===0||w===BigInt(0)?X=`>= 0${U} and < 2${U} ** ${(V+1)*8}${U}`:X=`>= -(2${U} ** ${(V+1)*8-1}${U}) and < 2 ** ${(V+1)*8-1}${U}`:X=`>= ${w}${U} and <= ${A}${U}`,new P.ERR_OUT_OF_RANGE("value",X,E)}kt(T,F,V)}function J(E,w){if(typeof E!="number")throw new P.ERR_INVALID_ARG_TYPE(w,"number",E)}function Ft(E,w,A){throw Math.floor(E)!==E?(J(E,A),new P.ERR_OUT_OF_RANGE(A||"offset","an integer",E)):w<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${w}`,E)}const tt=/[^+/0-9A-Za-z-_]/g;function vt(E){if(E=E.split("=")[0],E=E.trim().replace(tt,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Dt(E,w){w=w||1/0;let A;const T=E.length;let F=null;const V=[];for(let U=0;U<T;++U){if(A=E.charCodeAt(U),A>55295&&A<57344){if(!F){if(A>56319){(w-=3)>-1&&V.push(239,191,189);continue}else if(U+1===T){(w-=3)>-1&&V.push(239,191,189);continue}F=A;continue}if(A<56320){(w-=3)>-1&&V.push(239,191,189),F=A;continue}A=(F-55296<<10|A-56320)+65536}else F&&(w-=3)>-1&&V.push(239,191,189);if(F=null,A<128){if((w-=1)<0)break;V.push(A)}else if(A<2048){if((w-=2)<0)break;V.push(A>>6|192,A&63|128)}else if(A<65536){if((w-=3)<0)break;V.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((w-=4)<0)break;V.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return V}function et(E){const w=[];for(let A=0;A<E.length;++A)w.push(E.charCodeAt(A)&255);return w}function pt(E,w){let A,T,F;const V=[];for(let U=0;U<E.length&&!((w-=2)<0);++U)A=E.charCodeAt(U),T=A>>8,F=A%256,V.push(F),V.push(T);return V}function Pt(E){return n.toByteArray(vt(E))}function j(E,w,A,T){let F;for(F=0;F<T&&!(F+A>=w.length||F>=E.length);++F)w[F+A]=E[F];return F}function dt(E,w){return E instanceof w||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===w.name}function qt(E){return E!==E}const Q=function(){const E="0123456789abcdef",w=new Array(256);for(let A=0;A<16;++A){const T=A*16;for(let F=0;F<16;++F)w[T+F]=E[A]+E[F]}return w}();function ct(E){return typeof BigInt=="undefined"?Lt:E}function Lt(){throw new Error("BigInt not supported")}})(gr);class xh{constructor(n,s,o,m={}){this.endpoint=n,this.apiKey=s,this.isStopped=!1,this.pollTimeoutId=null,this.currentFlags={},this.consecutiveErrors=0,this.currentBackoffMs=0,this.pollIntervalMs=m.pollIntervalMs||1e4,this.maxBackoffMs=m.maxBackoffMs||6e4,this.backoffMultiplier=m.backoffMultiplier||2,this.currentContext=o}init(){return ke(this,null,function*(){try{this.currentFlags=yield this.fetchFlags(this.currentContext),this.consecutiveErrors=0,console.log("[LongPollingTransport] Initial fetch complete")}catch(n){console.error("[LongPollingTransport] Initial fetch failed:",n)}this.scheduleNextPoll()})}scheduleNextPoll(){if(this.isStopped)return;const n=this.pollIntervalMs+this.currentBackoffMs;console.log(`[LongPollingTransport] Next poll in ${n}ms`+(this.currentBackoffMs>0?` (backoff: ${this.currentBackoffMs}ms)`:"")),this.pollTimeoutId=setTimeout(()=>ke(this,null,function*(){yield this.poll(),this.scheduleNextPoll()}),n)}poll(){return ke(this,null,function*(){var n;try{const s=yield this.fetchFlags(this.currentContext);this.consecutiveErrors>0&&(console.log("[LongPollingTransport] ✅ Recovered from errors"),this.consecutiveErrors=0,this.currentBackoffMs=0),this.flagsChanged(s)&&(console.log("[LongPollingTransport] Flags changed, notifying..."),this.currentFlags=s,(n=this.onUpdateCallback)==null||n.call(this,s))}catch(s){console.error("[LongPollingTransport] ❌ Poll error:",s),this.consecutiveErrors++,this.applyBackoff()}})}applyBackoff(){if(this.consecutiveErrors===1)this.currentBackoffMs=0;else{const n=this.pollIntervalMs*Math.pow(this.backoffMultiplier,this.consecutiveErrors-2);this.currentBackoffMs=Math.min(n,this.maxBackoffMs),console.warn(`[LongPollingTransport] Backing off ${this.currentBackoffMs}ms (${this.consecutiveErrors} consecutive errors)`)}}flagsChanged(n){return JSON.stringify(n)!==JSON.stringify(this.currentFlags)}fetchFlags(n){return ke(this,null,function*(){this.currentContext=n;const s=yield fetch(this.endpoint,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify({context:n})});if(s.status===401||s.status===403)throw new Error("Unauthorized: Invalid API key");if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);return(yield s.json()).data})}onFlagsUpdated(n){this.onUpdateCallback=n}destroy(){console.log("[LongPollingTransport] Destroying..."),this.isStopped=!0,this.pollTimeoutId!==null&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null),this.onUpdateCallback=void 0}}class _h{constructor(n,s,o=5,m=1e3){this.wsUrl=n,this.apiKey=s,this.maxRetries=o,this.initialBackoffMs=m,this.socket=null,this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.retries=0,this.reconnectTimeoutId=null,this.heartbeatIntervalId=null,this.lastHeartbeatTime=0,this.heartbeatTimeoutMs=3e4}init(){return ke(this,null,function*(){yield this.connectWithRetry(),yield this.waitForInitialFlags()})}waitForInitialFlags(){return this.initialFlagsReceived?Promise.resolve():(this.initialFlagsPromise||(this.initialFlagsPromise=new Promise(n=>{const s=setInterval(()=>{this.initialFlagsReceived&&(clearInterval(s),n())},50);setTimeout(()=>{clearInterval(s),console.warn("[WebSocketTransport] Initial flags timeout"),n()},5e3)})),this.initialFlagsPromise)}connectWithRetry(){return new Promise((n,s)=>{const o=()=>{try{this.cleanupSocket(),this.setConnectionState("connecting");const m=this.getWebSocketImplementation();this.socket=new m(`${this.wsUrl}?apiKey=${this.apiKey}`),this.socket.onopen=()=>{console.log("[WebSocketTransport] Connected"),this.isReady=!0,this.retries=0,this.setConnectionState("connected"),this.context&&this.sendContext(this.context),this.startHeartbeat(),n()},this.socket.onmessage=f=>{var g;this.lastHeartbeatTime=Date.now();try{const y=JSON.parse(f.data);if(console.log("[WebSocketTransport] Message received:",y),y.type==="ping"){this.socket&&this.socket.readyState===1?this.socket.send(JSON.stringify({type:"pong"})):console.warn("[WebSocketTransport] Cannot send pong: socket not ready");return}y.type==="flags"&&(console.log("[WebSocketTransport] Flags update received"),this.flags=y.flags,this.initialFlagsReceived=!0,(g=this.onFlagsUpdatedCallback)==null||g.call(this,this.flags))}catch(y){console.warn("[WebSocketTransport] Failed to parse message:",y)}},this.socket.onerror=f=>{console.error("[WebSocketTransport] Error:",f)},this.socket.onclose=f=>{if(console.log("[WebSocketTransport] Connection closed:",f.code),this.isReady=!1,this.stopHeartbeat(),this.setConnectionState("disconnected"),f.code===1008||f.code===4001){this.setConnectionState("failed"),s(new Error("Unauthorized: Invalid API key"));return}if(this.retries<this.maxRetries){const g=this.initialBackoffMs*Math.pow(2,this.retries);console.warn(`[WebSocketTransport] Reconnecting in ${g}ms (attempt ${this.retries+1})`),this.setConnectionState("reconnecting"),this.reconnectTimeoutId=setTimeout(o,g),this.retries++}else this.setConnectionState("failed"),s(new Error(`WebSocket failed after ${this.retries} retries`))}}catch(m){console.error("[WebSocketTransport] Failed to create socket:",m),this.setConnectionState("failed"),s(m)}};o()})}cleanupSocket(){this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===1&&this.socket.close(),this.socket=null)}startHeartbeat(){this.lastHeartbeatTime=Date.now(),this.heartbeatIntervalId=setInterval(()=>{var s,o;if(Date.now()-this.lastHeartbeatTime>this.heartbeatTimeoutMs){console.warn("[WebSocketTransport] Heartbeat timeout, reconnecting..."),(s=this.socket)==null||s.close();return}((o=this.socket)==null?void 0:o.readyState)===1&&this.socket.send(JSON.stringify({type:"ping"}))},1e4)}stopHeartbeat(){this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}setConnectionState(n){var s;(s=this.onConnectionStateCallback)==null||s.call(this,n)}getWebSocketImplementation(){if(typeof WebSocket!="undefined")return WebSocket;try{const n=require("ws");return n.default||n}catch(n){throw new Error('WebSocket not available. Install "ws" package for Node.js: npm install ws')}}fetchFlags(n){return ke(this,null,function*(){var s;return this.context=n,this.isReady&&((s=this.socket)==null?void 0:s.readyState)===1&&this.sendContext(n),this.flags})}onFlagsUpdated(n){this.onFlagsUpdatedCallback=n}onConnectionStateChanged(n){this.onConnectionStateCallback=n}destroy(){console.log("[WebSocketTransport] Destroying..."),this.stopHeartbeat(),this.reconnectTimeoutId!==null&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=null),this.cleanupSocket(),this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.onFlagsUpdatedCallback=void 0,this.onConnectionStateCallback=void 0,this.retries=0}sendContext(n){if(!this.socket||this.socket.readyState!==1){console.warn("[WebSocketTransport] Socket not ready, cannot send context");return}const s=JSON.stringify({type:"context",context:n});this.socket.send(s)}}function Sh(h,n){if(h.type!=="rule")return!1;const s=h.attribute.split(".").reduce((o,m)=>o==null?void 0:o[m],n);switch(h.operator){case"eq":return s===h.value;case"neq":return s!==h.value;case"in":return Array.isArray(h.value)&&h.value.includes(s);case"nin":return Array.isArray(h.value)&&!h.value.includes(s);case"gt":return typeof s=="number"&&typeof h.value=="number"&&s>h.value;case"lt":return typeof s=="number"&&typeof h.value=="number"&&s<h.value;case"exists":return s!=null;case"not_exists":return s==null;default:return!1}}function _u(h,n){return h.rules.every(s=>Sh(s,n))}var Ut={};const Li=typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{};function Ah(){throw new Error("setTimeout has not been defined")}function Bh(){throw new Error("clearTimeout has not been defined")}var Cr=Ah,Fr=Bh;typeof Li.setTimeout=="function"&&(Cr=setTimeout);typeof Li.clearTimeout=="function"&&(Fr=clearTimeout);function Eh(h){if(Cr===setTimeout)return setTimeout(h,0);if((Cr===Ah||!Cr)&&setTimeout)return Cr=setTimeout,setTimeout(h,0);try{return Cr(h,0)}catch(n){try{return Cr.call(null,h,0)}catch(s){return Cr.call(this,h,0)}}}function Su(h){if(Fr===clearTimeout)return clearTimeout(h);if((Fr===Bh||!Fr)&&clearTimeout)return Fr=clearTimeout,clearTimeout(h);try{return Fr(h)}catch(n){try{return Fr.call(null,h)}catch(s){return Fr.call(this,h)}}}var Mr=[],hi=!1,Zr,mn=-1;function Au(){!hi||!Zr||(hi=!1,Zr.length?Mr=Zr.concat(Mr):mn=-1,Mr.length&&kh())}function kh(){if(!hi){var h=Eh(Au);hi=!0;for(var n=Mr.length;n;){for(Zr=Mr,Mr=[];++mn<n;)Zr&&Zr[mn].run();mn=-1,n=Mr.length}Zr=null,hi=!1,Su(h)}}function Bu(h){var n=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)n[s-1]=arguments[s];Mr.push(new Ih(h,n)),Mr.length===1&&!hi&&Eh(kh)}function Ih(h,n){this.fun=h,this.array=n}Ih.prototype.run=function(){this.fun.apply(null,this.array)};var Eu="browser",ku="browser",Iu=!0,Ru={},Tu=[],Cu="",Fu={},qu={},Pu={};function Qr(){}var Du=Qr,Nu=Qr,$u=Qr,Uu=Qr,Lu=Qr,Ou=Qr,zu=Qr;function Ku(h){throw new Error("process.binding is not supported")}function Hu(){return"/"}function Zu(h){throw new Error("process.chdir is not supported")}function Wu(){return 0}var fi=Li.performance||{},Vu=fi.now||fi.mozNow||fi.msNow||fi.oNow||fi.webkitNow||function(){return new Date().getTime()};function Yu(h){var n=Vu.call(fi)*.001,s=Math.floor(n),o=Math.floor(n%1*1e9);return h&&(s=s-h[0],o=o-h[1],o<0&&(s--,o+=1e9)),[s,o]}var Ju=new Date;function Gu(){var h=new Date,n=h-Ju;return n/1e3}var ye={nextTick:Bu,title:Eu,browser:Iu,env:Ru,argv:Tu,version:Cu,versions:Fu,on:Du,addListener:Nu,once:$u,off:Uu,removeListener:Lu,removeAllListeners:Ou,emit:zu,binding:Ku,cwd:Hu,chdir:Zu,umask:Wu,hrtime:Yu,platform:ku,release:qu,config:Pu,uptime:Gu},Xf={exports:{}},jf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(h,n){var s=gr,o=s.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?h.exports=s:(m(s,n),n.Buffer=f);function f(g,y,S){return o(g,y,S)}f.prototype=Object.create(o.prototype),m(o,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=o(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(g)}})(jf,jf.exports);var Ot=jf.exports,df=65536,Xu=4294967295;function ju(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
6
|
+
*/(function(h){const n=Rn,s=g0,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;h.Buffer=y,h.SlowBuffer=$,h.INSPECT_MAX_BYTES=50;const m=2147483647;h.kMaxLength=m,y.TYPED_ARRAY_SUPPORT=f(),!y.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const E=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(E,w),E.foo()===42}catch(E){return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function g(E){if(E>m)throw new RangeError('The value "'+E+'" is invalid for option "size"');const w=new Uint8Array(E);return Object.setPrototypeOf(w,y.prototype),w}function y(E,w,A){if(typeof E=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(E)}return S(E,w,A)}y.poolSize=8192;function S(E,w,A){if(typeof E=="string")return I(E,w);if(ArrayBuffer.isView(E))return D(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(dt(E,ArrayBuffer)||E&&dt(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(dt(E,SharedArrayBuffer)||E&&dt(E.buffer,SharedArrayBuffer)))return L(E,w,A);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const T=E.valueOf&&E.valueOf();if(T!=null&&T!==E)return y.from(T,w,A);const F=W(E);if(F)return F;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return y.from(E[Symbol.toPrimitive]("string"),w,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}y.from=function(E,w,A){return S(E,w,A)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array);function B(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function M(E,w,A){return B(E),E<=0?g(E):w!==void 0?typeof A=="string"?g(E).fill(w,A):g(E).fill(w):g(E)}y.alloc=function(E,w,A){return M(E,w,A)};function x(E){return B(E),g(E<0?0:z(E)|0)}y.allocUnsafe=function(E){return x(E)},y.allocUnsafeSlow=function(E){return x(E)};function I(E,w){if((typeof w!="string"||w==="")&&(w="utf8"),!y.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const A=lt(E,w)|0;let T=g(A);const F=T.write(E,w);return F!==A&&(T=T.slice(0,F)),T}function k(E){const w=E.length<0?0:z(E.length)|0,A=g(w);for(let T=0;T<w;T+=1)A[T]=E[T]&255;return A}function D(E){if(dt(E,Uint8Array)){const w=new Uint8Array(E);return L(w.buffer,w.byteOffset,w.byteLength)}return k(E)}function L(E,w,A){if(w<0||E.byteLength<w)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<w+(A||0))throw new RangeError('"length" is outside of buffer bounds');let T;return w===void 0&&A===void 0?T=new Uint8Array(E):A===void 0?T=new Uint8Array(E,w):T=new Uint8Array(E,w,A),Object.setPrototypeOf(T,y.prototype),T}function W(E){if(y.isBuffer(E)){const w=z(E.length)|0,A=g(w);return A.length===0||E.copy(A,0,0,w),A}if(E.length!==void 0)return typeof E.length!="number"||qt(E.length)?g(0):k(E);if(E.type==="Buffer"&&Array.isArray(E.data))return k(E.data)}function z(E){if(E>=m)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m.toString(16)+" bytes");return E|0}function $(E){return+E!=E&&(E=0),y.alloc(+E)}y.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==y.prototype},y.compare=function(w,A){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),dt(A,Uint8Array)&&(A=y.from(A,A.offset,A.byteLength)),!y.isBuffer(w)||!y.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===A)return 0;let T=w.length,F=A.length;for(let V=0,U=Math.min(T,F);V<U;++V)if(w[V]!==A[V]){T=w[V],F=A[V];break}return T<F?-1:F<T?1:0},y.isEncoding=function(w){switch(String(w).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}},y.concat=function(w,A){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return y.alloc(0);let T;if(A===void 0)for(A=0,T=0;T<w.length;++T)A+=w[T].length;const F=y.allocUnsafe(A);let V=0;for(T=0;T<w.length;++T){let U=w[T];if(dt(U,Uint8Array))V+U.length>F.length?(y.isBuffer(U)||(U=y.from(U)),U.copy(F,V)):Uint8Array.prototype.set.call(F,U,V);else if(y.isBuffer(U))U.copy(F,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=U.length}return F};function lt(E,w){if(y.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||dt(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const A=E.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&A===0)return 0;let F=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Dt(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Pt(E).length;default:if(F)return T?-1:Dt(E).length;w=(""+w).toLowerCase(),F=!0}}y.byteLength=lt;function H(E,w,A){let T=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,w>>>=0,A<=w))return"";for(E||(E="utf8");;)switch(E){case"hex":return u(this,w,A);case"utf8":case"utf-8":return i(this,w,A);case"ascii":return c(this,w,A);case"latin1":case"binary":return v(this,w,A);case"base64":return r(this,w,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e(this,w,A);default:if(T)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),T=!0}}y.prototype._isBuffer=!0;function At(E,w,A){const T=E[w];E[w]=E[A],E[A]=T}y.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<w;A+=2)At(this,A,A+1);return this},y.prototype.swap32=function(){const w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<w;A+=4)At(this,A,A+3),At(this,A+1,A+2);return this},y.prototype.swap64=function(){const w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<w;A+=8)At(this,A,A+7),At(this,A+1,A+6),At(this,A+2,A+5),At(this,A+3,A+4);return this},y.prototype.toString=function(){const w=this.length;return w===0?"":arguments.length===0?i(this,0,w):H.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(w){if(!y.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:y.compare(this,w)===0},y.prototype.inspect=function(){let w="";const A=h.INSPECT_MAX_BYTES;return w=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(w+=" ... "),"<Buffer "+w+">"},o&&(y.prototype[o]=y.prototype.inspect),y.prototype.compare=function(w,A,T,F,V){if(dt(w,Uint8Array)&&(w=y.from(w,w.offset,w.byteLength)),!y.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(A===void 0&&(A=0),T===void 0&&(T=w?w.length:0),F===void 0&&(F=0),V===void 0&&(V=this.length),A<0||T>w.length||F<0||V>this.length)throw new RangeError("out of range index");if(F>=V&&A>=T)return 0;if(F>=V)return-1;if(A>=T)return 1;if(A>>>=0,T>>>=0,F>>>=0,V>>>=0,this===w)return 0;let U=V-F,X=T-A;const Tt=Math.min(U,X),G=this.slice(F,V),rt=w.slice(A,T);for(let Rt=0;Rt<Tt;++Rt)if(G[Rt]!==rt[Rt]){U=G[Rt],X=rt[Rt];break}return U<X?-1:X<U?1:0};function Bt(E,w,A,T,F){if(E.length===0)return-1;if(typeof A=="string"?(T=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,qt(A)&&(A=F?0:E.length-1),A<0&&(A=E.length+A),A>=E.length){if(F)return-1;A=E.length-1}else if(A<0)if(F)A=0;else return-1;if(typeof w=="string"&&(w=y.from(w,T)),y.isBuffer(w))return w.length===0?-1:Ct(E,w,A,T,F);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(E,w,A):Uint8Array.prototype.lastIndexOf.call(E,w,A):Ct(E,[w],A,T,F);throw new TypeError("val must be string, number or Buffer")}function Ct(E,w,A,T,F){let V=1,U=E.length,X=w.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(E.length<2||w.length<2)return-1;V=2,U/=2,X/=2,A/=2}function Tt(rt,Rt){return V===1?rt[Rt]:rt.readUInt16BE(Rt*V)}let G;if(F){let rt=-1;for(G=A;G<U;G++)if(Tt(E,G)===Tt(w,rt===-1?0:G-rt)){if(rt===-1&&(rt=G),G-rt+1===X)return rt*V}else rt!==-1&&(G-=G-rt),rt=-1}else for(A+X>U&&(A=U-X),G=A;G>=0;G--){let rt=!0;for(let Rt=0;Rt<X;Rt++)if(Tt(E,G+Rt)!==Tt(w,Rt)){rt=!1;break}if(rt)return G}return-1}y.prototype.includes=function(w,A,T){return this.indexOf(w,A,T)!==-1},y.prototype.indexOf=function(w,A,T){return Bt(this,w,A,T,!0)},y.prototype.lastIndexOf=function(w,A,T){return Bt(this,w,A,T,!1)};function Et(E,w,A,T){A=Number(A)||0;const F=E.length-A;T?(T=Number(T),T>F&&(T=F)):T=F;const V=w.length;T>V/2&&(T=V/2);let U;for(U=0;U<T;++U){const X=parseInt(w.substr(U*2,2),16);if(qt(X))return U;E[A+U]=X}return U}function Y(E,w,A,T){return j(Dt(w,E.length-A),E,A,T)}function It(E,w,A,T){return j(et(w),E,A,T)}function p(E,w,A,T){return j(Pt(w),E,A,T)}function t(E,w,A,T){return j(pt(w,E.length-A),E,A,T)}y.prototype.write=function(w,A,T,F){if(A===void 0)F="utf8",T=this.length,A=0;else if(T===void 0&&typeof A=="string")F=A,T=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(T)?(T=T>>>0,F===void 0&&(F="utf8")):(F=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-A;if((T===void 0||T>V)&&(T=V),w.length>0&&(T<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");let U=!1;for(;;)switch(F){case"hex":return Et(this,w,A,T);case"utf8":case"utf-8":return Y(this,w,A,T);case"ascii":case"latin1":case"binary":return It(this,w,A,T);case"base64":return p(this,w,A,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t(this,w,A,T);default:if(U)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),U=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function r(E,w,A){return w===0&&A===E.length?n.fromByteArray(E):n.fromByteArray(E.slice(w,A))}function i(E,w,A){A=Math.min(E.length,A);const T=[];let F=w;for(;F<A;){const V=E[F];let U=null,X=V>239?4:V>223?3:V>191?2:1;if(F+X<=A){let Tt,G,rt,Rt;switch(X){case 1:V<128&&(U=V);break;case 2:Tt=E[F+1],(Tt&192)===128&&(Rt=(V&31)<<6|Tt&63,Rt>127&&(U=Rt));break;case 3:Tt=E[F+1],G=E[F+2],(Tt&192)===128&&(G&192)===128&&(Rt=(V&15)<<12|(Tt&63)<<6|G&63,Rt>2047&&(Rt<55296||Rt>57343)&&(U=Rt));break;case 4:Tt=E[F+1],G=E[F+2],rt=E[F+3],(Tt&192)===128&&(G&192)===128&&(rt&192)===128&&(Rt=(V&15)<<18|(Tt&63)<<12|(G&63)<<6|rt&63,Rt>65535&&Rt<1114112&&(U=Rt))}}U===null?(U=65533,X=1):U>65535&&(U-=65536,T.push(U>>>10&1023|55296),U=56320|U&1023),T.push(U),F+=X}return d(T)}const a=4096;function d(E){const w=E.length;if(w<=a)return String.fromCharCode.apply(String,E);let A="",T=0;for(;T<w;)A+=String.fromCharCode.apply(String,E.slice(T,T+=a));return A}function c(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]&127);return T}function v(E,w,A){let T="";A=Math.min(E.length,A);for(let F=w;F<A;++F)T+=String.fromCharCode(E[F]);return T}function u(E,w,A){const T=E.length;(!w||w<0)&&(w=0),(!A||A<0||A>T)&&(A=T);let F="";for(let V=w;V<A;++V)F+=Q[E[V]];return F}function e(E,w,A){const T=E.slice(w,A);let F="";for(let V=0;V<T.length-1;V+=2)F+=String.fromCharCode(T[V]+T[V+1]*256);return F}y.prototype.slice=function(w,A){const T=this.length;w=~~w,A=A===void 0?T:~~A,w<0?(w+=T,w<0&&(w=0)):w>T&&(w=T),A<0?(A+=T,A<0&&(A=0)):A>T&&(A=T),A<w&&(A=w);const F=this.subarray(w,A);return Object.setPrototypeOf(F,y.prototype),F};function l(E,w,A){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+w>A)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return F},y.prototype.readUintBE=y.prototype.readUIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w+--A],V=1;for(;A>0&&(V*=256);)F+=this[w+--A]*V;return F},y.prototype.readUint8=y.prototype.readUInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]|this[w+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(w,A){return w=w>>>0,A||l(w,2,this.length),this[w]<<8|this[w+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},y.prototype.readBigUInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=A+this[++w]*pe(2,8)+this[++w]*pe(2,16)+this[++w]*pe(2,24),V=this[++w]+this[++w]*pe(2,8)+this[++w]*pe(2,16)+T*pe(2,24);return BigInt(F)+(BigInt(V)<<BigInt(32))}),y.prototype.readBigUInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=A*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+this[++w],V=this[++w]*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+T;return(BigInt(F)<<BigInt(32))+BigInt(V)}),y.prototype.readIntLE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=this[w],V=1,U=0;for(;++U<A&&(V*=256);)F+=this[w+U]*V;return V*=128,F>=V&&(F-=Math.pow(2,8*A)),F},y.prototype.readIntBE=function(w,A,T){w=w>>>0,A=A>>>0,T||l(w,A,this.length);let F=A,V=1,U=this[w+--F];for(;F>0&&(V*=256);)U+=this[w+--F]*V;return V*=128,U>=V&&(U-=Math.pow(2,8*A)),U},y.prototype.readInt8=function(w,A){return w=w>>>0,A||l(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},y.prototype.readInt16LE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w]|this[w+1]<<8;return T&32768?T|4294901760:T},y.prototype.readInt16BE=function(w,A){w=w>>>0,A||l(w,2,this.length);const T=this[w+1]|this[w]<<8;return T&32768?T|4294901760:T},y.prototype.readInt32LE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},y.prototype.readInt32BE=function(w,A){return w=w>>>0,A||l(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},y.prototype.readBigInt64LE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=this[w+4]+this[w+5]*pe(2,8)+this[w+6]*pe(2,16)+(T<<24);return(BigInt(F)<<BigInt(32))+BigInt(A+this[++w]*pe(2,8)+this[++w]*pe(2,16)+this[++w]*pe(2,24))}),y.prototype.readBigInt64BE=ct(function(w){w=w>>>0,J(w,"offset");const A=this[w],T=this[w+7];(A===void 0||T===void 0)&&Ft(w,this.length-8);const F=(A<<24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+this[++w];return(BigInt(F)<<BigInt(32))+BigInt(this[++w]*pe(2,24)+this[++w]*pe(2,16)+this[++w]*pe(2,8)+T)}),y.prototype.readFloatLE=function(w,A){return w=w>>>0,A||l(w,4,this.length),s.read(this,w,!0,23,4)},y.prototype.readFloatBE=function(w,A){return w=w>>>0,A||l(w,4,this.length),s.read(this,w,!1,23,4)},y.prototype.readDoubleLE=function(w,A){return w=w>>>0,A||l(w,8,this.length),s.read(this,w,!0,52,8)},y.prototype.readDoubleBE=function(w,A){return w=w>>>0,A||l(w,8,this.length),s.read(this,w,!1,52,8)};function b(E,w,A,T,F,V){if(!y.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>F||w<V)throw new RangeError('"value" argument is out of bounds');if(A+T>E.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=1,U=0;for(this[A]=w&255;++U<T&&(V*=256);)this[A+U]=w/V&255;return A+T},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,T=T>>>0,!F){const X=Math.pow(2,8*T)-1;b(this,w,A,T,X,0)}let V=T-1,U=1;for(this[A+V]=w&255;--V>=0&&(U*=256);)this[A+V]=w/U&255;return A+T},y.prototype.writeUint8=y.prototype.writeUInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,255,0),this[A]=w&255,A+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,65535,0),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A+3]=w>>>24,this[A+2]=w>>>16,this[A+1]=w>>>8,this[A]=w&255,A+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,4294967295,0),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4};function _(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V,V=V>>8,E[A++]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,U=U>>8,E[A++]=U,A}function C(E,w,A,T,F){Z(w,T,F,E,A,7);let V=Number(w&BigInt(4294967295));E[A+7]=V,V=V>>8,E[A+6]=V,V=V>>8,E[A+5]=V,V=V>>8,E[A+4]=V;let U=Number(w>>BigInt(32)&BigInt(4294967295));return E[A+3]=U,U=U>>8,E[A+2]=U,U=U>>8,E[A+1]=U,U=U>>8,E[A]=U,A+8}y.prototype.writeBigUInt64LE=ct(function(w,A=0){return _(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=ct(function(w,A=0){return C(this,w,A,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=0,U=1,X=0;for(this[A]=w&255;++V<T&&(U*=256);)w<0&&X===0&&this[A+V-1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeIntBE=function(w,A,T,F){if(w=+w,A=A>>>0,!F){const Tt=Math.pow(2,8*T-1);b(this,w,A,T,Tt-1,-Tt)}let V=T-1,U=1,X=0;for(this[A+V]=w&255;--V>=0&&(U*=256);)w<0&&X===0&&this[A+V+1]!==0&&(X=1),this[A+V]=(w/U>>0)-X&255;return A+T},y.prototype.writeInt8=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,1,127,-128),w<0&&(w=255+w+1),this[A]=w&255,A+1},y.prototype.writeInt16LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w&255,this[A+1]=w>>>8,A+2},y.prototype.writeInt16BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,2,32767,-32768),this[A]=w>>>8,this[A+1]=w&255,A+2},y.prototype.writeInt32LE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),this[A]=w&255,this[A+1]=w>>>8,this[A+2]=w>>>16,this[A+3]=w>>>24,A+4},y.prototype.writeInt32BE=function(w,A,T){return w=+w,A=A>>>0,T||b(this,w,A,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[A]=w>>>24,this[A+1]=w>>>16,this[A+2]=w>>>8,this[A+3]=w&255,A+4},y.prototype.writeBigInt64LE=ct(function(w,A=0){return _(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=ct(function(w,A=0){return C(this,w,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function q(E,w,A,T,F,V){if(A+T>E.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function O(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,4),s.write(E,w,A,T,23,4),A+4}y.prototype.writeFloatLE=function(w,A,T){return O(this,w,A,!0,T)},y.prototype.writeFloatBE=function(w,A,T){return O(this,w,A,!1,T)};function R(E,w,A,T,F){return w=+w,A=A>>>0,F||q(E,w,A,8),s.write(E,w,A,T,52,8),A+8}y.prototype.writeDoubleLE=function(w,A,T){return R(this,w,A,!0,T)},y.prototype.writeDoubleBE=function(w,A,T){return R(this,w,A,!1,T)},y.prototype.copy=function(w,A,T,F){if(!y.isBuffer(w))throw new TypeError("argument should be a Buffer");if(T||(T=0),!F&&F!==0&&(F=this.length),A>=w.length&&(A=w.length),A||(A=0),F>0&&F<T&&(F=T),F===T||w.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("sourceEnd out of bounds");F>this.length&&(F=this.length),w.length-A<F-T&&(F=w.length-A+T);const V=F-T;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(A,T,F):Uint8Array.prototype.set.call(w,this.subarray(T,F),A),V},y.prototype.fill=function(w,A,T,F){if(typeof w=="string"){if(typeof A=="string"?(F=A,A=0,T=this.length):typeof T=="string"&&(F=T,T=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!y.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(w.length===1){const U=w.charCodeAt(0);(F==="utf8"&&U<128||F==="latin1")&&(w=U)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(A<0||this.length<A||this.length<T)throw new RangeError("Out of range index");if(T<=A)return this;A=A>>>0,T=T===void 0?this.length:T>>>0,w||(w=0);let V;if(typeof w=="number")for(V=A;V<T;++V)this[V]=w;else{const U=y.isBuffer(w)?w:y.from(w,F),X=U.length;if(X===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(V=0;V<T-A;++V)this[V+A]=U[V%X]}return this};const P={};function N(E,w,A){P[E]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:w.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(F){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:F,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}N("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),N("ERR_INVALID_ARG_TYPE",function(E,w){return`The "${E}" argument must be of type number. Received type ${typeof w}`},TypeError),N("ERR_OUT_OF_RANGE",function(E,w,A){let T=`The value of "${E}" is out of range.`,F=A;return Number.isInteger(A)&&Math.abs(A)>pe(2,32)?F=K(String(A)):typeof A=="bigint"&&(F=String(A),(A>pe(BigInt(2),BigInt(32))||A<-pe(BigInt(2),BigInt(32)))&&(F=K(F)),F+="n"),T+=` It must be ${w}. Received ${F}`,T},RangeError);function K(E){let w="",A=E.length;const T=E[0]==="-"?1:0;for(;A>=T+4;A-=3)w=`_${E.slice(A-3,A)}${w}`;return`${E.slice(0,A)}${w}`}function kt(E,w,A){J(w,"offset"),(E[w]===void 0||E[w+A]===void 0)&&Ft(w,E.length-(A+1))}function Z(E,w,A,T,F,V){if(E>A||E<w){const U=typeof w=="bigint"?"n":"";let X;throw V>3?w===0||w===BigInt(0)?X=`>= 0${U} and < 2${U} ** ${(V+1)*8}${U}`:X=`>= -(2${U} ** ${(V+1)*8-1}${U}) and < 2 ** ${(V+1)*8-1}${U}`:X=`>= ${w}${U} and <= ${A}${U}`,new P.ERR_OUT_OF_RANGE("value",X,E)}kt(T,F,V)}function J(E,w){if(typeof E!="number")throw new P.ERR_INVALID_ARG_TYPE(w,"number",E)}function Ft(E,w,A){throw Math.floor(E)!==E?(J(E,A),new P.ERR_OUT_OF_RANGE(A||"offset","an integer",E)):w<0?new P.ERR_BUFFER_OUT_OF_BOUNDS:new P.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${w}`,E)}const tt=/[^+/0-9A-Za-z-_]/g;function vt(E){if(E=E.split("=")[0],E=E.trim().replace(tt,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Dt(E,w){w=w||1/0;let A;const T=E.length;let F=null;const V=[];for(let U=0;U<T;++U){if(A=E.charCodeAt(U),A>55295&&A<57344){if(!F){if(A>56319){(w-=3)>-1&&V.push(239,191,189);continue}else if(U+1===T){(w-=3)>-1&&V.push(239,191,189);continue}F=A;continue}if(A<56320){(w-=3)>-1&&V.push(239,191,189),F=A;continue}A=(F-55296<<10|A-56320)+65536}else F&&(w-=3)>-1&&V.push(239,191,189);if(F=null,A<128){if((w-=1)<0)break;V.push(A)}else if(A<2048){if((w-=2)<0)break;V.push(A>>6|192,A&63|128)}else if(A<65536){if((w-=3)<0)break;V.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((w-=4)<0)break;V.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return V}function et(E){const w=[];for(let A=0;A<E.length;++A)w.push(E.charCodeAt(A)&255);return w}function pt(E,w){let A,T,F;const V=[];for(let U=0;U<E.length&&!((w-=2)<0);++U)A=E.charCodeAt(U),T=A>>8,F=A%256,V.push(F),V.push(T);return V}function Pt(E){return n.toByteArray(vt(E))}function j(E,w,A,T){let F;for(F=0;F<T&&!(F+A>=w.length||F>=E.length);++F)w[F+A]=E[F];return F}function dt(E,w){return E instanceof w||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===w.name}function qt(E){return E!==E}const Q=function(){const E="0123456789abcdef",w=new Array(256);for(let A=0;A<16;++A){const T=A*16;for(let F=0;F<16;++F)w[T+F]=E[A]+E[F]}return w}();function ct(E){return typeof BigInt=="undefined"?Lt:E}function Lt(){throw new Error("BigInt not supported")}})(gr);class xh{constructor(n,s,o,m={}){this.endpoint=n,this.apiKey=s,this.isStopped=!1,this.pollTimeoutId=null,this.currentFlags={},this.consecutiveErrors=0,this.currentBackoffMs=0,this.pollIntervalMs=m.pollIntervalMs||1e4,this.maxBackoffMs=m.maxBackoffMs||6e4,this.backoffMultiplier=m.backoffMultiplier||2,this.currentContext=o}init(){return ke(this,null,function*(){try{this.currentFlags=yield this.fetchFlags(this.currentContext),this.consecutiveErrors=0,console.log("[LongPollingTransport] Initial fetch complete")}catch(n){console.error("[LongPollingTransport] Initial fetch failed:",n)}this.scheduleNextPoll()})}scheduleNextPoll(){if(this.isStopped)return;const n=this.pollIntervalMs+this.currentBackoffMs;console.log(`[LongPollingTransport] Next poll in ${n}ms`+(this.currentBackoffMs>0?` (backoff: ${this.currentBackoffMs}ms)`:"")),this.pollTimeoutId=setTimeout(()=>ke(this,null,function*(){yield this.poll(),this.scheduleNextPoll()}),n)}poll(){return ke(this,null,function*(){var n;try{const s=yield this.fetchFlags(this.currentContext);this.consecutiveErrors>0&&(console.log("[LongPollingTransport] ✅ Recovered from errors"),this.consecutiveErrors=0,this.currentBackoffMs=0),this.flagsChanged(s)&&(console.log("[LongPollingTransport] Flags changed, notifying..."),this.currentFlags=s,(n=this.onUpdateCallback)==null||n.call(this,s))}catch(s){console.error("[LongPollingTransport] ❌ Poll error:",s),this.consecutiveErrors++,this.applyBackoff()}})}applyBackoff(){if(this.consecutiveErrors===1)this.currentBackoffMs=0;else{const n=this.pollIntervalMs*Math.pow(this.backoffMultiplier,this.consecutiveErrors-2);this.currentBackoffMs=Math.min(n,this.maxBackoffMs),console.warn(`[LongPollingTransport] Backing off ${this.currentBackoffMs}ms (${this.consecutiveErrors} consecutive errors)`)}}flagsChanged(n){return JSON.stringify(n)!==JSON.stringify(this.currentFlags)}fetchFlags(n){return ke(this,null,function*(){this.currentContext=n;const s=yield fetch(this.endpoint,{method:"POST",headers:{"x-api-key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify({context:n})});if(s.status===401||s.status===403)throw new Error("Unauthorized: Invalid API key");if(!s.ok)throw new Error(`HTTP ${s.status}: ${s.statusText}`);return(yield s.json()).data})}onFlagsUpdated(n){this.onUpdateCallback=n}destroy(){console.log("[LongPollingTransport] Destroying..."),this.isStopped=!0,this.pollTimeoutId!==null&&(clearTimeout(this.pollTimeoutId),this.pollTimeoutId=null),this.onUpdateCallback=void 0}}class _h{constructor(n,s,o=5,m=1e3){this.wsUrl=n,this.apiKey=s,this.maxRetries=o,this.initialBackoffMs=m,this.socket=null,this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.retries=0,this.reconnectTimeoutId=null}init(){return ke(this,null,function*(){yield this.connectWithRetry(),yield this.waitForInitialFlags()})}waitForInitialFlags(){return this.initialFlagsReceived?Promise.resolve():(this.initialFlagsPromise||(this.initialFlagsPromise=new Promise(n=>{const s=setInterval(()=>{this.initialFlagsReceived&&(clearInterval(s),n())},50);setTimeout(()=>{clearInterval(s),console.warn("[WebSocketTransport] Initial flags timeout"),n()},5e3)})),this.initialFlagsPromise)}connectWithRetry(){return new Promise((n,s)=>{const o=()=>{try{this.cleanupSocket(),this.setConnectionState("connecting");const m=this.getWebSocketImplementation();this.socket=new m(`${this.wsUrl}?apiKey=${this.apiKey}`),this.socket.onopen=()=>{console.log("[WebSocketTransport] Connected"),this.isReady=!0,this.retries=0,this.setConnectionState("connected"),this.context&&this.sendContext(this.context),n()},this.socket.onmessage=f=>{var g;try{const y=JSON.parse(f.data);if(console.log("[WebSocketTransport] Message received:",y),y.type==="ping"){this.socket&&this.socket.readyState===1&&this.socket.send(JSON.stringify({type:"pong"}));return}if(y.type==="pong"){console.log("[WebSocketTransport] Pong received");return}y.type==="flags"&&(console.log("[WebSocketTransport] Flags update received"),this.flags=y.flags,this.initialFlagsReceived=!0,(g=this.onFlagsUpdatedCallback)==null||g.call(this,this.flags))}catch(y){console.warn("[WebSocketTransport] Failed to parse message:",y)}},this.socket.onerror=f=>{console.error("[WebSocketTransport] Error:",f)},this.socket.onclose=f=>{if(console.log("[WebSocketTransport] Connection closed:",f.code),this.isReady=!1,this.setConnectionState("disconnected"),f.code===1008||f.code===4001){this.setConnectionState("failed"),s(new Error("Unauthorized: Invalid API key"));return}if(this.retries<this.maxRetries){const g=this.initialBackoffMs*Math.pow(2,this.retries);console.warn(`[WebSocketTransport] Reconnecting in ${g}ms (attempt ${this.retries+1})`),this.setConnectionState("reconnecting"),this.reconnectTimeoutId=setTimeout(o,g),this.retries++}else this.setConnectionState("failed"),s(new Error(`WebSocket failed after ${this.retries} retries`))}}catch(m){console.error("[WebSocketTransport] Failed to create socket:",m),this.setConnectionState("failed"),s(m)}};o()})}cleanupSocket(){this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===1&&this.socket.close(),this.socket=null)}setConnectionState(n){var s;(s=this.onConnectionStateCallback)==null||s.call(this,n)}getWebSocketImplementation(){if(typeof WebSocket!="undefined")return WebSocket;try{const n=require("ws");return n.default||n}catch(n){throw new Error('WebSocket not available. Install "ws" package for Node.js: npm install ws')}}fetchFlags(n){return ke(this,null,function*(){var s;return this.context=n,this.isReady&&((s=this.socket)==null?void 0:s.readyState)===1&&this.sendContext(n),this.flags})}onFlagsUpdated(n){this.onFlagsUpdatedCallback=n}onConnectionStateChanged(n){this.onConnectionStateCallback=n}destroy(){console.log("[WebSocketTransport] Destroying..."),this.reconnectTimeoutId!==null&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=null),this.cleanupSocket(),this.flags={},this.context=null,this.isReady=!1,this.initialFlagsReceived=!1,this.initialFlagsPromise=null,this.onFlagsUpdatedCallback=void 0,this.onConnectionStateCallback=void 0,this.retries=0}sendContext(n){if(!this.socket||this.socket.readyState!==1){console.warn("[WebSocketTransport] Socket not ready, cannot send context");return}const s=JSON.stringify({type:"context",context:n});this.socket.send(s)}}function Sh(h,n){if(h.type!=="rule")return!1;const s=h.attribute.split(".").reduce((o,m)=>o==null?void 0:o[m],n);switch(h.operator){case"eq":return s===h.value;case"neq":return s!==h.value;case"in":return Array.isArray(h.value)&&h.value.includes(s);case"nin":return Array.isArray(h.value)&&!h.value.includes(s);case"gt":return typeof s=="number"&&typeof h.value=="number"&&s>h.value;case"lt":return typeof s=="number"&&typeof h.value=="number"&&s<h.value;case"exists":return s!=null;case"not_exists":return s==null;default:return!1}}function _u(h,n){return h.rules.every(s=>Sh(s,n))}var Ut={};const Li=typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{};function Ah(){throw new Error("setTimeout has not been defined")}function Bh(){throw new Error("clearTimeout has not been defined")}var Cr=Ah,Fr=Bh;typeof Li.setTimeout=="function"&&(Cr=setTimeout);typeof Li.clearTimeout=="function"&&(Fr=clearTimeout);function Eh(h){if(Cr===setTimeout)return setTimeout(h,0);if((Cr===Ah||!Cr)&&setTimeout)return Cr=setTimeout,setTimeout(h,0);try{return Cr(h,0)}catch(n){try{return Cr.call(null,h,0)}catch(s){return Cr.call(this,h,0)}}}function Su(h){if(Fr===clearTimeout)return clearTimeout(h);if((Fr===Bh||!Fr)&&clearTimeout)return Fr=clearTimeout,clearTimeout(h);try{return Fr(h)}catch(n){try{return Fr.call(null,h)}catch(s){return Fr.call(this,h)}}}var Mr=[],hi=!1,Zr,mn=-1;function Au(){!hi||!Zr||(hi=!1,Zr.length?Mr=Zr.concat(Mr):mn=-1,Mr.length&&kh())}function kh(){if(!hi){var h=Eh(Au);hi=!0;for(var n=Mr.length;n;){for(Zr=Mr,Mr=[];++mn<n;)Zr&&Zr[mn].run();mn=-1,n=Mr.length}Zr=null,hi=!1,Su(h)}}function Bu(h){var n=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)n[s-1]=arguments[s];Mr.push(new Ih(h,n)),Mr.length===1&&!hi&&Eh(kh)}function Ih(h,n){this.fun=h,this.array=n}Ih.prototype.run=function(){this.fun.apply(null,this.array)};var Eu="browser",ku="browser",Iu=!0,Ru={},Tu=[],Cu="",Fu={},qu={},Pu={};function Qr(){}var Du=Qr,Nu=Qr,$u=Qr,Uu=Qr,Lu=Qr,Ou=Qr,zu=Qr;function Ku(h){throw new Error("process.binding is not supported")}function Hu(){return"/"}function Zu(h){throw new Error("process.chdir is not supported")}function Wu(){return 0}var fi=Li.performance||{},Vu=fi.now||fi.mozNow||fi.msNow||fi.oNow||fi.webkitNow||function(){return new Date().getTime()};function Yu(h){var n=Vu.call(fi)*.001,s=Math.floor(n),o=Math.floor(n%1*1e9);return h&&(s=s-h[0],o=o-h[1],o<0&&(s--,o+=1e9)),[s,o]}var Ju=new Date;function Gu(){var h=new Date,n=h-Ju;return n/1e3}var ye={nextTick:Bu,title:Eu,browser:Iu,env:Ru,argv:Tu,version:Cu,versions:Fu,on:Du,addListener:Nu,once:$u,off:Uu,removeListener:Lu,removeAllListeners:Ou,emit:zu,binding:Ku,cwd:Hu,chdir:Zu,umask:Wu,hrtime:Yu,platform:ku,release:qu,config:Pu,uptime:Gu},Xf={exports:{}},jf={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(h,n){var s=gr,o=s.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?h.exports=s:(m(s,n),n.Buffer=f);function f(g,y,S){return o(g,y,S)}f.prototype=Object.create(o.prototype),m(o,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=o(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(g)}})(jf,jf.exports);var Ot=jf.exports,df=65536,Xu=4294967295;function ju(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
7
7
|
Use Chrome, Firefox or Internet Explorer 11`)}var Qu=Ot.Buffer,Mn=Gt.crypto||Gt.msCrypto;Mn&&Mn.getRandomValues?Xf.exports=tl:Xf.exports=ju;function tl(h,n){if(h>Xu)throw new RangeError("requested too many random bytes");var s=Qu.allocUnsafe(h);if(h>0)if(h>df)for(var o=0;o<h;o+=df)Mn.getRandomValues(s.slice(o,o+df));else Mn.getRandomValues(s);return typeof n=="function"?ye.nextTick(function(){n(null,s)}):s}var gi=Xf.exports,Qf={exports:{}};typeof Object.create=="function"?Qf.exports=function(n,s){s&&(n.super_=s,n.prototype=Object.create(s.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))}:Qf.exports=function(n,s){if(s){n.super_=s;var o=function(){};o.prototype=s.prototype,n.prototype=new o,n.prototype.constructor=n}};var Jt=Qf.exports;const el={},rl=Object.freeze(Object.defineProperty({__proto__:null,default:el},Symbol.toStringTag,{value:"Module"})),De=vu(rl);var fr=Ot.Buffer,Rh=De.Transform,il=Jt;function Nr(h){Rh.call(this),this._block=fr.allocUnsafe(h),this._blockSize=h,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}il(Nr,Rh);Nr.prototype._transform=function(h,n,s){var o=null;try{this.update(h,n)}catch(m){o=m}s(o)};Nr.prototype._flush=function(h){var n=null;try{this.push(this.digest())}catch(s){n=s}h(n)};var nl=typeof Uint8Array!="undefined",fl=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&ArrayBuffer.isView&&(fr.prototype instanceof Uint8Array||fr.TYPED_ARRAY_SUPPORT);function al(h,n){if(h instanceof fr)return h;if(typeof h=="string")return fr.from(h,n);if(fl&&ArrayBuffer.isView(h)){if(h.byteLength===0)return fr.alloc(0);var s=fr.from(h.buffer,h.byteOffset,h.byteLength);if(s.byteLength===h.byteLength)return s}if(nl&&h instanceof Uint8Array||fr.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return fr.from(h);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}Nr.prototype.update=function(h,n){if(this._finalized)throw new Error("Digest already called");h=al(h,n);for(var s=this._block,o=0;this._blockOffset+h.length-o>=this._blockSize;){for(var m=this._blockOffset;m<this._blockSize;)s[m++]=h[o++];this._update(),this._blockOffset=0}for(;o<h.length;)s[this._blockOffset++]=h[o++];for(var f=0,g=h.length*8;g>0;++f)this._length[f]+=g,g=this._length[f]/4294967296|0,g>0&&(this._length[f]-=4294967296*g);return this};Nr.prototype._update=function(){throw new Error("_update is not implemented")};Nr.prototype.digest=function(h){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var n=this._digest();h!==void 0&&(n=n.toString(h)),this._block.fill(0),this._blockOffset=0;for(var s=0;s<4;++s)this._length[s]=0;return n};Nr.prototype._digest=function(){throw new Error("_digest is not implemented")};var Th=Nr,hl=Jt,Ch=Th,sl=Ot.Buffer,ol=new Array(16);function Tn(){Ch.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}hl(Tn,Ch);Tn.prototype._update=function(){for(var h=ol,n=0;n<16;++n)h[n]=this._block.readInt32LE(n*4);var s=this._a,o=this._b,m=this._c,f=this._d;s=Ie(s,o,m,f,h[0],3614090360,7),f=Ie(f,s,o,m,h[1],3905402710,12),m=Ie(m,f,s,o,h[2],606105819,17),o=Ie(o,m,f,s,h[3],3250441966,22),s=Ie(s,o,m,f,h[4],4118548399,7),f=Ie(f,s,o,m,h[5],1200080426,12),m=Ie(m,f,s,o,h[6],2821735955,17),o=Ie(o,m,f,s,h[7],4249261313,22),s=Ie(s,o,m,f,h[8],1770035416,7),f=Ie(f,s,o,m,h[9],2336552879,12),m=Ie(m,f,s,o,h[10],4294925233,17),o=Ie(o,m,f,s,h[11],2304563134,22),s=Ie(s,o,m,f,h[12],1804603682,7),f=Ie(f,s,o,m,h[13],4254626195,12),m=Ie(m,f,s,o,h[14],2792965006,17),o=Ie(o,m,f,s,h[15],1236535329,22),s=Re(s,o,m,f,h[1],4129170786,5),f=Re(f,s,o,m,h[6],3225465664,9),m=Re(m,f,s,o,h[11],643717713,14),o=Re(o,m,f,s,h[0],3921069994,20),s=Re(s,o,m,f,h[5],3593408605,5),f=Re(f,s,o,m,h[10],38016083,9),m=Re(m,f,s,o,h[15],3634488961,14),o=Re(o,m,f,s,h[4],3889429448,20),s=Re(s,o,m,f,h[9],568446438,5),f=Re(f,s,o,m,h[14],3275163606,9),m=Re(m,f,s,o,h[3],4107603335,14),o=Re(o,m,f,s,h[8],1163531501,20),s=Re(s,o,m,f,h[13],2850285829,5),f=Re(f,s,o,m,h[2],4243563512,9),m=Re(m,f,s,o,h[7],1735328473,14),o=Re(o,m,f,s,h[12],2368359562,20),s=Te(s,o,m,f,h[5],4294588738,4),f=Te(f,s,o,m,h[8],2272392833,11),m=Te(m,f,s,o,h[11],1839030562,16),o=Te(o,m,f,s,h[14],4259657740,23),s=Te(s,o,m,f,h[1],2763975236,4),f=Te(f,s,o,m,h[4],1272893353,11),m=Te(m,f,s,o,h[7],4139469664,16),o=Te(o,m,f,s,h[10],3200236656,23),s=Te(s,o,m,f,h[13],681279174,4),f=Te(f,s,o,m,h[0],3936430074,11),m=Te(m,f,s,o,h[3],3572445317,16),o=Te(o,m,f,s,h[6],76029189,23),s=Te(s,o,m,f,h[9],3654602809,4),f=Te(f,s,o,m,h[12],3873151461,11),m=Te(m,f,s,o,h[15],530742520,16),o=Te(o,m,f,s,h[2],3299628645,23),s=Ce(s,o,m,f,h[0],4096336452,6),f=Ce(f,s,o,m,h[7],1126891415,10),m=Ce(m,f,s,o,h[14],2878612391,15),o=Ce(o,m,f,s,h[5],4237533241,21),s=Ce(s,o,m,f,h[12],1700485571,6),f=Ce(f,s,o,m,h[3],2399980690,10),m=Ce(m,f,s,o,h[10],4293915773,15),o=Ce(o,m,f,s,h[1],2240044497,21),s=Ce(s,o,m,f,h[8],1873313359,6),f=Ce(f,s,o,m,h[15],4264355552,10),m=Ce(m,f,s,o,h[6],2734768916,15),o=Ce(o,m,f,s,h[13],1309151649,21),s=Ce(s,o,m,f,h[4],4149444226,6),f=Ce(f,s,o,m,h[11],3174756917,10),m=Ce(m,f,s,o,h[2],718787259,15),o=Ce(o,m,f,s,h[9],3951481745,21),this._a=this._a+s|0,this._b=this._b+o|0,this._c=this._c+m|0,this._d=this._d+f|0};Tn.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var h=sl.allocUnsafe(16);return h.writeInt32LE(this._a,0),h.writeInt32LE(this._b,4),h.writeInt32LE(this._c,8),h.writeInt32LE(this._d,12),h};function Cn(h,n){return h<<n|h>>>32-n}function Ie(h,n,s,o,m,f,g){return Cn(h+(n&s|~n&o)+m+f|0,g)+n|0}function Re(h,n,s,o,m,f,g){return Cn(h+(n&o|s&~o)+m+f|0,g)+n|0}function Te(h,n,s,o,m,f,g){return Cn(h+(n^s^o)+m+f|0,g)+n|0}function Ce(h,n,s,o,m,f,g){return Cn(h+(s^(n|~o))+m+f|0,g)+n|0}var b0=Tn,cf=gr.Buffer,ul=Jt,Fh=Th,ll=new Array(16),Bi=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ei=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],ki=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Ii=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Ri=[0,1518500249,1859775393,2400959708,2840853838],Ti=[1352829926,1548603684,1836072691,2053994217,0];function Fn(){Fh.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}ul(Fn,Fh);Fn.prototype._update=function(){for(var h=ll,n=0;n<16;++n)h[n]=this._block.readInt32LE(n*4);for(var s=this._a|0,o=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=this._a|0,S=this._b|0,B=this._c|0,M=this._d|0,x=this._e|0,I=0;I<80;I+=1){var k,D;I<16?(k=ea(s,o,m,f,g,h[Bi[I]],Ri[0],ki[I]),D=fa(y,S,B,M,x,h[Ei[I]],Ti[0],Ii[I])):I<32?(k=ra(s,o,m,f,g,h[Bi[I]],Ri[1],ki[I]),D=na(y,S,B,M,x,h[Ei[I]],Ti[1],Ii[I])):I<48?(k=ia(s,o,m,f,g,h[Bi[I]],Ri[2],ki[I]),D=ia(y,S,B,M,x,h[Ei[I]],Ti[2],Ii[I])):I<64?(k=na(s,o,m,f,g,h[Bi[I]],Ri[3],ki[I]),D=ra(y,S,B,M,x,h[Ei[I]],Ti[3],Ii[I])):(k=fa(s,o,m,f,g,h[Bi[I]],Ri[4],ki[I]),D=ea(y,S,B,M,x,h[Ei[I]],Ti[4],Ii[I])),s=g,g=f,f=Gr(m,10),m=o,o=k,y=x,x=M,M=Gr(B,10),B=S,S=D}var L=this._b+m+M|0;this._b=this._c+f+x|0,this._c=this._d+g+y|0,this._d=this._e+s+S|0,this._e=this._a+o+B|0,this._a=L};Fn.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var h=cf.alloc?cf.alloc(20):new cf(20);return h.writeInt32LE(this._a,0),h.writeInt32LE(this._b,4),h.writeInt32LE(this._c,8),h.writeInt32LE(this._d,12),h.writeInt32LE(this._e,16),h};function Gr(h,n){return h<<n|h>>>32-n}function ea(h,n,s,o,m,f,g,y){return Gr(h+(n^s^o)+f+g|0,y)+m|0}function ra(h,n,s,o,m,f,g,y){return Gr(h+(n&s|~n&o)+f+g|0,y)+m|0}function ia(h,n,s,o,m,f,g,y){return Gr(h+((n|~s)^o)+f+g|0,y)+m|0}function na(h,n,s,o,m,f,g,y){return Gr(h+(n&o|s&~o)+f+g|0,y)+m|0}function fa(h,n,s,o,m,f,g,y){return Gr(h+(n^(s|~o))+f+g|0,y)+m|0}var y0=Fn,qh={exports:{}},Ph=Ot.Buffer;function qn(h,n){this._block=Ph.alloc(h),this._finalSize=n,this._blockSize=h,this._len=0}qn.prototype.update=function(h,n){typeof h=="string"&&(n=n||"utf8",h=Ph.from(h,n));for(var s=this._block,o=this._blockSize,m=h.length,f=this._len,g=0;g<m;){for(var y=f%o,S=Math.min(m-g,o-y),B=0;B<S;B++)s[y+B]=h[g+B];f+=S,g+=S,f%o===0&&this._update(s)}return this._len+=m,this};qn.prototype.digest=function(h){var n=this._len%this._blockSize;this._block[n]=128,this._block.fill(0,n+1),n>=this._finalSize&&(this._update(this._block),this._block.fill(0));var s=this._len*8;if(s<=4294967295)this._block.writeUInt32BE(s,this._blockSize-4);else{var o=(s&4294967295)>>>0,m=(s-o)/4294967296;this._block.writeUInt32BE(m,this._blockSize-8),this._block.writeUInt32BE(o,this._blockSize-4)}this._update(this._block);var f=this._hash();return h?f.toString(h):f};qn.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var bi=qn,dl=Jt,Dh=bi,cl=Ot.Buffer,vl=[1518500249,1859775393,-1894007588,-899497514],pl=new Array(80);function Zi(){this.init(),this._w=pl,Dh.call(this,64,56)}dl(Zi,Dh);Zi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function ml(h){return h<<5|h>>>27}function gl(h){return h<<30|h>>>2}function bl(h,n,s,o){return h===0?n&s|~n&o:h===2?n&s|n&o|s&o:n^s^o}Zi.prototype._update=function(h){for(var n=this._w,s=this._a|0,o=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=0;y<16;++y)n[y]=h.readInt32BE(y*4);for(;y<80;++y)n[y]=n[y-3]^n[y-8]^n[y-14]^n[y-16];for(var S=0;S<80;++S){var B=~~(S/20),M=ml(s)+bl(B,o,m,f)+g+n[S]+vl[B]|0;g=f,f=m,m=gl(o),o=s,s=M}this._a=s+this._a|0,this._b=o+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0};Zi.prototype._hash=function(){var h=cl.allocUnsafe(20);return h.writeInt32BE(this._a|0,0),h.writeInt32BE(this._b|0,4),h.writeInt32BE(this._c|0,8),h.writeInt32BE(this._d|0,12),h.writeInt32BE(this._e|0,16),h};var yl=Zi,wl=Jt,Nh=bi,Ml=Ot.Buffer,xl=[1518500249,1859775393,-1894007588,-899497514],_l=new Array(80);function Wi(){this.init(),this._w=_l,Nh.call(this,64,56)}wl(Wi,Nh);Wi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Sl(h){return h<<1|h>>>31}function Al(h){return h<<5|h>>>27}function Bl(h){return h<<30|h>>>2}function El(h,n,s,o){return h===0?n&s|~n&o:h===2?n&s|n&o|s&o:n^s^o}Wi.prototype._update=function(h){for(var n=this._w,s=this._a|0,o=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=0;y<16;++y)n[y]=h.readInt32BE(y*4);for(;y<80;++y)n[y]=Sl(n[y-3]^n[y-8]^n[y-14]^n[y-16]);for(var S=0;S<80;++S){var B=~~(S/20),M=Al(s)+El(B,o,m,f)+g+n[S]+xl[B]|0;g=f,f=m,m=Bl(o),o=s,s=M}this._a=s+this._a|0,this._b=o+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0};Wi.prototype._hash=function(){var h=Ml.allocUnsafe(20);return h.writeInt32BE(this._a|0,0),h.writeInt32BE(this._b|0,4),h.writeInt32BE(this._c|0,8),h.writeInt32BE(this._d|0,12),h.writeInt32BE(this._e|0,16),h};var kl=Wi,Il=Jt,$h=bi,Rl=Ot.Buffer,Tl=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Cl=new Array(64);function Vi(){this.init(),this._w=Cl,$h.call(this,64,56)}Il(Vi,$h);Vi.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Fl(h,n,s){return s^h&(n^s)}function ql(h,n,s){return h&n|s&(h|n)}function Pl(h){return(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10)}function Dl(h){return(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7)}function Nl(h){return(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3}function $l(h){return(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10}Vi.prototype._update=function(h){for(var n=this._w,s=this._a|0,o=this._b|0,m=this._c|0,f=this._d|0,g=this._e|0,y=this._f|0,S=this._g|0,B=this._h|0,M=0;M<16;++M)n[M]=h.readInt32BE(M*4);for(;M<64;++M)n[M]=$l(n[M-2])+n[M-7]+Nl(n[M-15])+n[M-16]|0;for(var x=0;x<64;++x){var I=B+Dl(g)+Fl(g,y,S)+Tl[x]+n[x]|0,k=Pl(s)+ql(s,o,m)|0;B=S,S=y,y=g,g=f+I|0,f=m,m=o,o=s,s=I+k|0}this._a=s+this._a|0,this._b=o+this._b|0,this._c=m+this._c|0,this._d=f+this._d|0,this._e=g+this._e|0,this._f=y+this._f|0,this._g=S+this._g|0,this._h=B+this._h|0};Vi.prototype._hash=function(){var h=Rl.allocUnsafe(32);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h.writeInt32BE(this._h,28),h};var Uh=Vi,Ul=Jt,Ll=Uh,Ol=bi,zl=Ot.Buffer,Kl=new Array(64);function Pn(){this.init(),this._w=Kl,Ol.call(this,64,56)}Ul(Pn,Ll);Pn.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Pn.prototype._hash=function(){var h=zl.allocUnsafe(28);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h};var Hl=Pn,Zl=Jt,Lh=bi,Wl=Ot.Buffer,aa=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Vl=new Array(160);function Yi(){this.init(),this._w=Vl,Lh.call(this,128,112)}Zl(Yi,Lh);Yi.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function ha(h,n,s){return s^h&(n^s)}function sa(h,n,s){return h&n|s&(h|n)}function oa(h,n){return(h>>>28|n<<4)^(n>>>2|h<<30)^(n>>>7|h<<25)}function ua(h,n){return(h>>>14|n<<18)^(h>>>18|n<<14)^(n>>>9|h<<23)}function Yl(h,n){return(h>>>1|n<<31)^(h>>>8|n<<24)^h>>>7}function Jl(h,n){return(h>>>1|n<<31)^(h>>>8|n<<24)^(h>>>7|n<<25)}function Gl(h,n){return(h>>>19|n<<13)^(n>>>29|h<<3)^h>>>6}function Xl(h,n){return(h>>>19|n<<13)^(n>>>29|h<<3)^(h>>>6|n<<26)}function xe(h,n){return h>>>0<n>>>0?1:0}Yi.prototype._update=function(h){for(var n=this._w,s=this._ah|0,o=this._bh|0,m=this._ch|0,f=this._dh|0,g=this._eh|0,y=this._fh|0,S=this._gh|0,B=this._hh|0,M=this._al|0,x=this._bl|0,I=this._cl|0,k=this._dl|0,D=this._el|0,L=this._fl|0,W=this._gl|0,z=this._hl|0,$=0;$<32;$+=2)n[$]=h.readInt32BE($*4),n[$+1]=h.readInt32BE($*4+4);for(;$<160;$+=2){var lt=n[$-30],H=n[$-15*2+1],At=Yl(lt,H),Bt=Jl(H,lt);lt=n[$-2*2],H=n[$-2*2+1];var Ct=Gl(lt,H),Et=Xl(H,lt),Y=n[$-7*2],It=n[$-7*2+1],p=n[$-16*2],t=n[$-16*2+1],r=Bt+It|0,i=At+Y+xe(r,Bt)|0;r=r+Et|0,i=i+Ct+xe(r,Et)|0,r=r+t|0,i=i+p+xe(r,t)|0,n[$]=i,n[$+1]=r}for(var a=0;a<160;a+=2){i=n[a],r=n[a+1];var d=sa(s,o,m),c=sa(M,x,I),v=oa(s,M),u=oa(M,s),e=ua(g,D),l=ua(D,g),b=aa[a],_=aa[a+1],C=ha(g,y,S),q=ha(D,L,W),O=z+l|0,R=B+e+xe(O,z)|0;O=O+q|0,R=R+C+xe(O,q)|0,O=O+_|0,R=R+b+xe(O,_)|0,O=O+r|0,R=R+i+xe(O,r)|0;var P=u+c|0,N=v+d+xe(P,u)|0;B=S,z=W,S=y,W=L,y=g,L=D,D=k+O|0,g=f+R+xe(D,k)|0,f=m,k=I,m=o,I=x,o=s,x=M,M=O+P|0,s=R+N+xe(M,O)|0}this._al=this._al+M|0,this._bl=this._bl+x|0,this._cl=this._cl+I|0,this._dl=this._dl+k|0,this._el=this._el+D|0,this._fl=this._fl+L|0,this._gl=this._gl+W|0,this._hl=this._hl+z|0,this._ah=this._ah+s+xe(this._al,M)|0,this._bh=this._bh+o+xe(this._bl,x)|0,this._ch=this._ch+m+xe(this._cl,I)|0,this._dh=this._dh+f+xe(this._dl,k)|0,this._eh=this._eh+g+xe(this._el,D)|0,this._fh=this._fh+y+xe(this._fl,L)|0,this._gh=this._gh+S+xe(this._gl,W)|0,this._hh=this._hh+B+xe(this._hl,z)|0};Yi.prototype._hash=function(){var h=Wl.allocUnsafe(64);function n(s,o,m){h.writeInt32BE(s,m),h.writeInt32BE(o,m+4)}return n(this._ah,this._al,0),n(this._bh,this._bl,8),n(this._ch,this._cl,16),n(this._dh,this._dl,24),n(this._eh,this._el,32),n(this._fh,this._fl,40),n(this._gh,this._gl,48),n(this._hh,this._hl,56),h};var Oh=Yi,jl=Jt,Ql=Oh,td=bi,ed=Ot.Buffer,rd=new Array(160);function Dn(){this.init(),this._w=rd,td.call(this,128,112)}jl(Dn,Ql);Dn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Dn.prototype._hash=function(){var h=ed.allocUnsafe(48);function n(s,o,m){h.writeInt32BE(s,m),h.writeInt32BE(o,m+4)}return n(this._ah,this._al,0),n(this._bh,this._bl,8),n(this._ch,this._cl,16),n(this._dh,this._dl,24),n(this._eh,this._el,32),n(this._fh,this._fl,40),h};var id=Dn,ti=qh.exports=function(n){n=n.toLowerCase();var s=ti[n];if(!s)throw new Error(n+" is not supported (we accept pull requests)");return new s};ti.sha=yl;ti.sha1=kl;ti.sha224=Hl;ti.sha256=Uh;ti.sha384=id;ti.sha512=Oh;var w0=qh.exports,xn={},t0={exports:{}};(function(h,n){var s=gr,o=s.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?h.exports=s:(m(s,n),n.Buffer=f);function f(g,y,S){return o(g,y,S)}m(o,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=o(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(g)}})(t0,t0.exports);var nd=t0.exports,M0=nd.Buffer,la=M0.isEncoding||function(h){switch(h=""+h,h&&h.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function fd(h){if(!h)return"utf8";for(var n;;)switch(h){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return h;default:if(n)return;h=(""+h).toLowerCase(),n=!0}}function ad(h){var n=fd(h);if(typeof n!="string"&&(M0.isEncoding===la||!la(h)))throw new Error("Unknown encoding: "+h);return n||h}xn.StringDecoder=Ji;function Ji(h){this.encoding=ad(h);var n;switch(this.encoding){case"utf16le":this.text=dd,this.end=cd,n=4;break;case"utf8":this.fillLast=od,n=4;break;case"base64":this.text=vd,this.end=pd,n=3;break;default:this.write=md,this.end=gd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=M0.allocUnsafe(n)}Ji.prototype.write=function(h){if(h.length===0)return"";var n,s;if(this.lastNeed){if(n=this.fillLast(h),n===void 0)return"";s=this.lastNeed,this.lastNeed=0}else s=0;return s<h.length?n?n+this.text(h,s):this.text(h,s):n||""};Ji.prototype.end=ld;Ji.prototype.text=ud;Ji.prototype.fillLast=function(h){if(this.lastNeed<=h.length)return h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,h.length),this.lastNeed-=h.length};function vf(h){return h<=127?0:h>>5===6?2:h>>4===14?3:h>>3===30?4:h>>6===2?-1:-2}function hd(h,n,s){var o=n.length-1;if(o<s)return 0;var m=vf(n[o]);return m>=0?(m>0&&(h.lastNeed=m-1),m):--o<s||m===-2?0:(m=vf(n[o]),m>=0?(m>0&&(h.lastNeed=m-2),m):--o<s||m===-2?0:(m=vf(n[o]),m>=0?(m>0&&(m===2?m=0:h.lastNeed=m-3),m):0))}function sd(h,n,s){if((n[0]&192)!==128)return h.lastNeed=0,"�";if(h.lastNeed>1&&n.length>1){if((n[1]&192)!==128)return h.lastNeed=1,"�";if(h.lastNeed>2&&n.length>2&&(n[2]&192)!==128)return h.lastNeed=2,"�"}}function od(h){var n=this.lastTotal-this.lastNeed,s=sd(this,h);if(s!==void 0)return s;if(this.lastNeed<=h.length)return h.copy(this.lastChar,n,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);h.copy(this.lastChar,n,0,h.length),this.lastNeed-=h.length}function ud(h,n){var s=hd(this,h,n);if(!this.lastNeed)return h.toString("utf8",n);this.lastTotal=s;var o=h.length-(s-this.lastNeed);return h.copy(this.lastChar,0,o),h.toString("utf8",n,o)}function ld(h){var n=h&&h.length?this.write(h):"";return this.lastNeed?n+"�":n}function dd(h,n){if((h.length-n)%2===0){var s=h.toString("utf16le",n);if(s){var o=s.charCodeAt(s.length-1);if(o>=55296&&o<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1],s.slice(0,-1)}return s}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=h[h.length-1],h.toString("utf16le",n,h.length-1)}function cd(h){var n=h&&h.length?this.write(h):"";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return n+this.lastChar.toString("utf16le",0,s)}return n}function vd(h,n){var s=(h.length-n)%3;return s===0?h.toString("base64",n):(this.lastNeed=3-s,this.lastTotal=3,s===1?this.lastChar[0]=h[h.length-1]:(this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1]),h.toString("base64",n,h.length-s))}function pd(h){var n=h&&h.length?this.write(h):"";return this.lastNeed?n+this.lastChar.toString("base64",0,3-this.lastNeed):n}function md(h){return h.toString(this.encoding)}function gd(h){return h&&h.length?this.write(h):""}var ar=Ot.Buffer,zh=De.Transform,bd=xn.StringDecoder,yd=Jt;function er(h){zh.call(this),this.hashMode=typeof h=="string",this.hashMode?this[h]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}yd(er,zh);var wd=typeof Uint8Array!="undefined",Md=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined"&&ArrayBuffer.isView&&(ar.prototype instanceof Uint8Array||ar.TYPED_ARRAY_SUPPORT);function xd(h,n){if(h instanceof ar)return h;if(typeof h=="string")return ar.from(h,n);if(Md&&ArrayBuffer.isView(h)){if(h.byteLength===0)return ar.alloc(0);var s=ar.from(h.buffer,h.byteOffset,h.byteLength);if(s.byteLength===h.byteLength)return s}if(wd&&h instanceof Uint8Array||ar.isBuffer(h)&&h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h))return ar.from(h);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}er.prototype.update=function(h,n,s){var o=xd(h,n),m=this._update(o);return this.hashMode?this:(s&&(m=this._toString(m,s)),m)};er.prototype.setAutoPadding=function(){};er.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};er.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};er.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};er.prototype._transform=function(h,n,s){var o;try{this.hashMode?this._update(h):this.push(this._update(h))}catch(m){o=m}finally{s(o)}};er.prototype._flush=function(h){var n;try{this.push(this.__final())}catch(s){n=s}h(n)};er.prototype._finalOrDigest=function(h){var n=this.__final()||ar.alloc(0);return h&&(n=this._toString(n,h,!0)),n};er.prototype._toString=function(h,n,s){if(this._decoder||(this._decoder=new bd(n),this._encoding=n),this._encoding!==n)throw new Error("can’t switch encodings");var o=this._decoder.write(h);return s&&(o+=this._decoder.end()),o};var $r=er,_d=Jt,Sd=b0,Ad=y0,Bd=w0,Kh=$r;function Nn(h){Kh.call(this,"digest"),this._hash=h}_d(Nn,Kh);Nn.prototype._update=function(h){this._hash.update(h)};Nn.prototype._final=function(){return this._hash.digest()};var Gi=function(n){return n=n.toLowerCase(),n==="md5"?new Sd:n==="rmd160"||n==="ripemd160"?new Ad:new Nn(Bd(n))},Ed=Jt,Wr=Ot.Buffer,Hh=$r,kd=Wr.alloc(128),ni=64;function $n(h,n){Hh.call(this,"digest"),typeof n=="string"&&(n=Wr.from(n)),this._alg=h,this._key=n,n.length>ni?n=h(n):n.length<ni&&(n=Wr.concat([n,kd],ni));for(var s=this._ipad=Wr.allocUnsafe(ni),o=this._opad=Wr.allocUnsafe(ni),m=0;m<ni;m++)s[m]=n[m]^54,o[m]=n[m]^92;this._hash=[s]}Ed($n,Hh);$n.prototype._update=function(h){this._hash.push(h)};$n.prototype._final=function(){var h=this._alg(Wr.concat(this._hash));return this._alg(Wr.concat([this._opad,h]))};var Id=$n,Rd=b0,Zh=function(h){return new Rd().update(h).digest()},Td=Jt,Cd=Id,Wh=$r,Pi=Ot.Buffer,Fd=Zh,e0=y0,r0=w0,qd=Pi.alloc(128);function Oi(h,n){Wh.call(this,"digest"),typeof n=="string"&&(n=Pi.from(n));var s=h==="sha512"||h==="sha384"?128:64;if(this._alg=h,this._key=n,n.length>s){var o=h==="rmd160"?new e0:r0(h);n=o.update(n).digest()}else n.length<s&&(n=Pi.concat([n,qd],s));for(var m=this._ipad=Pi.allocUnsafe(s),f=this._opad=Pi.allocUnsafe(s),g=0;g<s;g++)m[g]=n[g]^54,f[g]=n[g]^92;this._hash=h==="rmd160"?new e0:r0(h),this._hash.update(m)}Td(Oi,Wh);Oi.prototype._update=function(h){this._hash.update(h)};Oi.prototype._final=function(){var h=this._hash.digest(),n=this._alg==="rmd160"?new e0:r0(this._alg);return n.update(this._opad).update(h).digest()};var Vh=function(n,s){return n=n.toLowerCase(),n==="rmd160"||n==="ripemd160"?new Oi("rmd160",s):n==="md5"?new Cd(Fd,s):new Oi(n,s)};const Pd={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},Dd={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},Nd={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},$d={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},Ud={sign:"ecdsa",hash:"sha256",id:""},Ld={sign:"ecdsa",hash:"sha224",id:""},Od={sign:"ecdsa",hash:"sha384",id:""},zd={sign:"ecdsa",hash:"sha512",id:""},Kd={sign:"dsa",hash:"sha1",id:""},Hd={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},Zd={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},Yh={sha224WithRSAEncryption:Pd,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:Dd,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:Nd,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:$d,"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:Ud,sha224:Ld,sha384:Od,sha512:zd,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:Kd,"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:Hd,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:Zd,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var Wd=Yh,Un={},Vd=Math.pow(2,30)-1,Jh=function(h,n){if(typeof h!="number")throw new TypeError("Iterations not a number");if(h<0)throw new TypeError("Bad iterations");if(typeof n!="number")throw new TypeError("Key length not a number");if(n<0||n>Vd||n!==n)throw new TypeError("Bad key length")},gn;if(Gt.process&&Gt.process.browser)gn="utf-8";else if(Gt.process&&Gt.process.version){var Yd=parseInt(ye.version.split(".")[0].slice(1),10);gn=Yd>=6?"utf-8":"binary"}else gn="utf-8";var Gh=gn,pf=Ot.Buffer,Xh=function(h,n,s){if(pf.isBuffer(h))return h;if(typeof h=="string")return pf.from(h,n);if(ArrayBuffer.isView(h))return pf.from(h.buffer);throw new TypeError(s+" must be a string, a Buffer, a typed array or a DataView")},Jd=Zh,Gd=y0,Xd=w0,Vr=Ot.Buffer,jd=Jh,da=Gh,ca=Xh,Qd=Vr.alloc(128),bn={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function jh(h,n,s){var o=tc(h),m=h==="sha512"||h==="sha384"?128:64;n.length>m?n=o(n):n.length<m&&(n=Vr.concat([n,Qd],m));for(var f=Vr.allocUnsafe(m+bn[h]),g=Vr.allocUnsafe(m+bn[h]),y=0;y<m;y++)f[y]=n[y]^54,g[y]=n[y]^92;var S=Vr.allocUnsafe(m+s+4);f.copy(S,0,0,m),this.ipad1=S,this.ipad2=f,this.opad=g,this.alg=h,this.blocksize=m,this.hash=o,this.size=bn[h]}jh.prototype.run=function(h,n){h.copy(n,this.blocksize);var s=this.hash(n);return s.copy(this.opad,this.blocksize),this.hash(this.opad)};function tc(h){function n(o){return Xd(h).update(o).digest()}function s(o){return new Gd().update(o).digest()}return h==="rmd160"||h==="ripemd160"?s:h==="md5"?Jd:n}function ec(h,n,s,o,m){jd(s,o),h=ca(h,da,"Password"),n=ca(n,da,"Salt"),m=m||"sha1";var f=new jh(m,h,n.length),g=Vr.allocUnsafe(o),y=Vr.allocUnsafe(n.length+4);n.copy(y,0,0,n.length);for(var S=0,B=bn[m],M=Math.ceil(o/B),x=1;x<=M;x++){y.writeUInt32BE(x,n.length);for(var I=f.run(y,f.ipad1),k=I,D=1;D<s;D++){k=f.run(k,f.ipad2);for(var L=0;L<B;L++)I[L]^=k[L]}I.copy(g,S),S+=B}return g}var Qh=ec,ts=Ot.Buffer,rc=Jh,va=Gh,pa=Qh,ma=Xh,sn,$i=Gt.crypto&&Gt.crypto.subtle,ic={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},mf=[];function nc(h){if(Gt.process&&!Gt.process.browser||!$i||!$i.importKey||!$i.deriveBits)return Promise.resolve(!1);if(mf[h]!==void 0)return mf[h];sn=sn||ts.alloc(8);var n=es(sn,sn,10,128,h).then(function(){return!0}).catch(function(){return!1});return mf[h]=n,n}var Lr;function i0(){return Lr||(Gt.process&&Gt.process.nextTick?Lr=Gt.process.nextTick:Gt.queueMicrotask?Lr=Gt.queueMicrotask:Gt.setImmediate?Lr=Gt.setImmediate:Lr=Gt.setTimeout,Lr)}function es(h,n,s,o,m){return $i.importKey("raw",h,{name:"PBKDF2"},!1,["deriveBits"]).then(function(f){return $i.deriveBits({name:"PBKDF2",salt:n,iterations:s,hash:{name:m}},f,o<<3)}).then(function(f){return ts.from(f)})}function fc(h,n){h.then(function(s){i0()(function(){n(null,s)})},function(s){i0()(function(){n(s)})})}var ac=function(h,n,s,o,m,f){typeof m=="function"&&(f=m,m=void 0),m=m||"sha1";var g=ic[m.toLowerCase()];if(!g||typeof Gt.Promise!="function"){i0()(function(){var y;try{y=pa(h,n,s,o,m)}catch(S){return f(S)}f(null,y)});return}if(rc(s,o),h=ma(h,va,"Password"),n=ma(n,va,"Salt"),typeof f!="function")throw new Error("No callback provided to pbkdf2");fc(nc(g).then(function(y){return y?es(h,n,s,o,g):pa(h,n,s,o,m)}),f)};Un.pbkdf2=ac;Un.pbkdf2Sync=Qh;var Qe={},yi={},Oe={};Oe.readUInt32BE=function(n,s){var o=n[0+s]<<24|n[1+s]<<16|n[2+s]<<8|n[3+s];return o>>>0};Oe.writeUInt32BE=function(n,s,o){n[0+o]=s>>>24,n[1+o]=s>>>16&255,n[2+o]=s>>>8&255,n[3+o]=s&255};Oe.ip=function(n,s,o,m){for(var f=0,g=0,y=6;y>=0;y-=2){for(var S=0;S<=24;S+=8)f<<=1,f|=s>>>S+y&1;for(var S=0;S<=24;S+=8)f<<=1,f|=n>>>S+y&1}for(var y=6;y>=0;y-=2){for(var S=1;S<=25;S+=8)g<<=1,g|=s>>>S+y&1;for(var S=1;S<=25;S+=8)g<<=1,g|=n>>>S+y&1}o[m+0]=f>>>0,o[m+1]=g>>>0};Oe.rip=function(n,s,o,m){for(var f=0,g=0,y=0;y<4;y++)for(var S=24;S>=0;S-=8)f<<=1,f|=s>>>S+y&1,f<<=1,f|=n>>>S+y&1;for(var y=4;y<8;y++)for(var S=24;S>=0;S-=8)g<<=1,g|=s>>>S+y&1,g<<=1,g|=n>>>S+y&1;o[m+0]=f>>>0,o[m+1]=g>>>0};Oe.pc1=function(n,s,o,m){for(var f=0,g=0,y=7;y>=5;y--){for(var S=0;S<=24;S+=8)f<<=1,f|=s>>S+y&1;for(var S=0;S<=24;S+=8)f<<=1,f|=n>>S+y&1}for(var S=0;S<=24;S+=8)f<<=1,f|=s>>S+y&1;for(var y=1;y<=3;y++){for(var S=0;S<=24;S+=8)g<<=1,g|=s>>S+y&1;for(var S=0;S<=24;S+=8)g<<=1,g|=n>>S+y&1}for(var S=0;S<=24;S+=8)g<<=1,g|=n>>S+y&1;o[m+0]=f>>>0,o[m+1]=g>>>0};Oe.r28shl=function(n,s){return n<<s&268435455|n>>>28-s};var on=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];Oe.pc2=function(n,s,o,m){for(var f=0,g=0,y=on.length>>>1,S=0;S<y;S++)f<<=1,f|=n>>>on[S]&1;for(var S=y;S<on.length;S++)g<<=1,g|=s>>>on[S]&1;o[m+0]=f>>>0,o[m+1]=g>>>0};Oe.expand=function(n,s,o){var m=0,f=0;m=(n&1)<<5|n>>>27;for(var g=23;g>=15;g-=4)m<<=6,m|=n>>>g&63;for(var g=11;g>=3;g-=4)f|=n>>>g&63,f<<=6;f|=(n&31)<<1|n>>>31,s[o+0]=m>>>0,s[o+1]=f>>>0};var ga=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];Oe.substitute=function(n,s){for(var o=0,m=0;m<4;m++){var f=n>>>18-m*6&63,g=ga[m*64+f];o<<=4,o|=g}for(var m=0;m<4;m++){var f=s>>>18-m*6&63,g=ga[4*64+m*64+f];o<<=4,o|=g}return o>>>0};var ba=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];Oe.permute=function(n){for(var s=0,o=0;o<ba.length;o++)s<<=1,s|=n>>>ba[o]&1;return s>>>0};Oe.padSplit=function(n,s,o){for(var m=n.toString(2);m.length<s;)m="0"+m;for(var f=[],g=0;g<s;g+=o)f.push(m.slice(g,g+o));return f.join(" ")};var We=rs;function rs(h,n){if(!h)throw new Error(n||"Assertion failed")}rs.equal=function(n,s,o){if(n!=s)throw new Error(o||"Assertion failed: "+n+" != "+s)};var hc=We;function Ve(h){this.options=h,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=h.padding!==!1}var x0=Ve;Ve.prototype._init=function(){};Ve.prototype.update=function(n){return n.length===0?[]:this.type==="decrypt"?this._updateDecrypt(n):this._updateEncrypt(n)};Ve.prototype._buffer=function(n,s){for(var o=Math.min(this.buffer.length-this.bufferOff,n.length-s),m=0;m<o;m++)this.buffer[this.bufferOff+m]=n[s+m];return this.bufferOff+=o,o};Ve.prototype._flushBuffer=function(n,s){return this._update(this.buffer,0,n,s),this.bufferOff=0,this.blockSize};Ve.prototype._updateEncrypt=function(n){var s=0,o=0,m=(this.bufferOff+n.length)/this.blockSize|0,f=new Array(m*this.blockSize);this.bufferOff!==0&&(s+=this._buffer(n,s),this.bufferOff===this.buffer.length&&(o+=this._flushBuffer(f,o)));for(var g=n.length-(n.length-s)%this.blockSize;s<g;s+=this.blockSize)this._update(n,s,f,o),o+=this.blockSize;for(;s<n.length;s++,this.bufferOff++)this.buffer[this.bufferOff]=n[s];return f};Ve.prototype._updateDecrypt=function(n){for(var s=0,o=0,m=Math.ceil((this.bufferOff+n.length)/this.blockSize)-1,f=new Array(m*this.blockSize);m>0;m--)s+=this._buffer(n,s),o+=this._flushBuffer(f,o);return s+=this._buffer(n,s),f};Ve.prototype.final=function(n){var s;n&&(s=this.update(n));var o;return this.type==="encrypt"?o=this._finalEncrypt():o=this._finalDecrypt(),s?s.concat(o):o};Ve.prototype._pad=function(n,s){if(s===0)return!1;for(;s<n.length;)n[s++]=0;return!0};Ve.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var n=new Array(this.blockSize);return this._update(this.buffer,0,n,0),n};Ve.prototype._unpad=function(n){return n};Ve.prototype._finalDecrypt=function(){hc.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var n=new Array(this.blockSize);return this._flushBuffer(n,0),this._unpad(n)};var is=We,sc=Jt,Me=Oe,ns=x0;function oc(){this.tmp=new Array(2),this.keys=null}function dr(h){ns.call(this,h);var n=new oc;this._desState=n,this.deriveKeys(n,h.key)}sc(dr,ns);var fs=dr;dr.create=function(n){return new dr(n)};var uc=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];dr.prototype.deriveKeys=function(n,s){n.keys=new Array(16*2),is.equal(s.length,this.blockSize,"Invalid key length");var o=Me.readUInt32BE(s,0),m=Me.readUInt32BE(s,4);Me.pc1(o,m,n.tmp,0),o=n.tmp[0],m=n.tmp[1];for(var f=0;f<n.keys.length;f+=2){var g=uc[f>>>1];o=Me.r28shl(o,g),m=Me.r28shl(m,g),Me.pc2(o,m,n.keys,f)}};dr.prototype._update=function(n,s,o,m){var f=this._desState,g=Me.readUInt32BE(n,s),y=Me.readUInt32BE(n,s+4);Me.ip(g,y,f.tmp,0),g=f.tmp[0],y=f.tmp[1],this.type==="encrypt"?this._encrypt(f,g,y,f.tmp,0):this._decrypt(f,g,y,f.tmp,0),g=f.tmp[0],y=f.tmp[1],Me.writeUInt32BE(o,g,m),Me.writeUInt32BE(o,y,m+4)};dr.prototype._pad=function(n,s){if(this.padding===!1)return!1;for(var o=n.length-s,m=s;m<n.length;m++)n[m]=o;return!0};dr.prototype._unpad=function(n){if(this.padding===!1)return n;for(var s=n[n.length-1],o=n.length-s;o<n.length;o++)is.equal(n[o],s);return n.slice(0,n.length-s)};dr.prototype._encrypt=function(n,s,o,m,f){for(var g=s,y=o,S=0;S<n.keys.length;S+=2){var B=n.keys[S],M=n.keys[S+1];Me.expand(y,n.tmp,0),B^=n.tmp[0],M^=n.tmp[1];var x=Me.substitute(B,M),I=Me.permute(x),k=y;y=(g^I)>>>0,g=k}Me.rip(y,g,m,f)};dr.prototype._decrypt=function(n,s,o,m,f){for(var g=o,y=s,S=n.keys.length-2;S>=0;S-=2){var B=n.keys[S],M=n.keys[S+1];Me.expand(g,n.tmp,0),B^=n.tmp[0],M^=n.tmp[1];var x=Me.substitute(B,M),I=Me.permute(x),k=g;g=(y^I)>>>0,y=k}Me.rip(g,y,m,f)};var as={},lc=We,dc=Jt,_n={};function cc(h){lc.equal(h.length,8,"Invalid IV length"),this.iv=new Array(8);for(var n=0;n<this.iv.length;n++)this.iv[n]=h[n]}function vc(h){function n(f){h.call(this,f),this._cbcInit()}dc(n,h);for(var s=Object.keys(_n),o=0;o<s.length;o++){var m=s[o];n.prototype[m]=_n[m]}return n.create=function(g){return new n(g)},n}as.instantiate=vc;_n._cbcInit=function(){var n=new cc(this.options.iv);this._cbcState=n};_n._update=function(n,s,o,m){var f=this._cbcState,g=this.constructor.super_.prototype,y=f.iv;if(this.type==="encrypt"){for(var S=0;S<this.blockSize;S++)y[S]^=n[s+S];g._update.call(this,y,0,o,m);for(var S=0;S<this.blockSize;S++)y[S]=o[m+S]}else{g._update.call(this,n,s,o,m);for(var S=0;S<this.blockSize;S++)o[m+S]^=y[S];for(var S=0;S<this.blockSize;S++)y[S]=n[s+S]}};var pc=We,mc=Jt,hs=x0,qr=fs;function gc(h,n){pc.equal(n.length,24,"Invalid key length");var s=n.slice(0,8),o=n.slice(8,16),m=n.slice(16,24);h==="encrypt"?this.ciphers=[qr.create({type:"encrypt",key:s}),qr.create({type:"decrypt",key:o}),qr.create({type:"encrypt",key:m})]:this.ciphers=[qr.create({type:"decrypt",key:m}),qr.create({type:"encrypt",key:o}),qr.create({type:"decrypt",key:s})]}function Xr(h){hs.call(this,h);var n=new gc(this.type,this.options.key);this._edeState=n}mc(Xr,hs);var bc=Xr;Xr.create=function(n){return new Xr(n)};Xr.prototype._update=function(n,s,o,m){var f=this._edeState;f.ciphers[0]._update(n,s,o,m),f.ciphers[1]._update(o,m,o,m),f.ciphers[2]._update(o,m,o,m)};Xr.prototype._pad=qr.prototype._pad;Xr.prototype._unpad=qr.prototype._unpad;yi.utils=Oe;yi.Cipher=x0;yi.DES=fs;yi.CBC=as;yi.EDE=bc;var ss=$r,wr=yi,yc=Jt,Hr=Ot.Buffer,zi={"des-ede3-cbc":wr.CBC.instantiate(wr.EDE),"des-ede3":wr.EDE,"des-ede-cbc":wr.CBC.instantiate(wr.EDE),"des-ede":wr.EDE,"des-cbc":wr.CBC.instantiate(wr.DES),"des-ecb":wr.DES};zi.des=zi["des-cbc"];zi.des3=zi["des-ede3-cbc"];var wc=Ln;yc(Ln,ss);function Ln(h){ss.call(this);var n=h.mode.toLowerCase(),s=zi[n],o;h.decrypt?o="decrypt":o="encrypt";var m=h.key;Hr.isBuffer(m)||(m=Hr.from(m)),(n==="des-ede"||n==="des-ede-cbc")&&(m=Hr.concat([m,m.slice(0,8)]));var f=h.iv;Hr.isBuffer(f)||(f=Hr.from(f)),this._des=s.create({key:m,iv:f,type:o})}Ln.prototype._update=function(h){return Hr.from(this._des.update(h))};Ln.prototype._final=function(){return Hr.from(this._des.final())};var Le={},_0={},S0={};S0.encrypt=function(h,n){return h._cipher.encryptBlock(n)};S0.decrypt=function(h,n){return h._cipher.decryptBlock(n)};var A0={},sr=[],He=[],Mc=typeof Uint8Array!="undefined"?Uint8Array:Array,B0=!1;function os(){B0=!0;for(var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=h.length;n<s;++n)sr[n]=h[n],He[h.charCodeAt(n)]=n;He["-".charCodeAt(0)]=62,He["_".charCodeAt(0)]=63}function xc(h){B0||os();var n,s,o,m,f,g,y=h.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");f=h[y-2]==="="?2:h[y-1]==="="?1:0,g=new Mc(y*3/4-f),o=f>0?y-4:y;var S=0;for(n=0,s=0;n<o;n+=4,s+=3)m=He[h.charCodeAt(n)]<<18|He[h.charCodeAt(n+1)]<<12|He[h.charCodeAt(n+2)]<<6|He[h.charCodeAt(n+3)],g[S++]=m>>16&255,g[S++]=m>>8&255,g[S++]=m&255;return f===2?(m=He[h.charCodeAt(n)]<<2|He[h.charCodeAt(n+1)]>>4,g[S++]=m&255):f===1&&(m=He[h.charCodeAt(n)]<<10|He[h.charCodeAt(n+1)]<<4|He[h.charCodeAt(n+2)]>>2,g[S++]=m>>8&255,g[S++]=m&255),g}function _c(h){return sr[h>>18&63]+sr[h>>12&63]+sr[h>>6&63]+sr[h&63]}function Sc(h,n,s){for(var o,m=[],f=n;f<s;f+=3)o=(h[f]<<16)+(h[f+1]<<8)+h[f+2],m.push(_c(o));return m.join("")}function ya(h){B0||os();for(var n,s=h.length,o=s%3,m="",f=[],g=16383,y=0,S=s-o;y<S;y+=g)f.push(Sc(h,y,y+g>S?S:y+g));return o===1?(n=h[s-1],m+=sr[n>>2],m+=sr[n<<4&63],m+="=="):o===2&&(n=(h[s-2]<<8)+h[s-1],m+=sr[n>>10],m+=sr[n>>4&63],m+=sr[n<<2&63],m+="="),f.push(m),f.join("")}function On(h,n,s,o,m){var f,g,y=m*8-o-1,S=(1<<y)-1,B=S>>1,M=-7,x=s?m-1:0,I=s?-1:1,k=h[n+x];for(x+=I,f=k&(1<<-M)-1,k>>=-M,M+=y;M>0;f=f*256+h[n+x],x+=I,M-=8);for(g=f&(1<<-M)-1,f>>=-M,M+=o;M>0;g=g*256+h[n+x],x+=I,M-=8);if(f===0)f=1-B;else{if(f===S)return g?NaN:(k?-1:1)*(1/0);g=g+Math.pow(2,o),f=f-B}return(k?-1:1)*g*Math.pow(2,f-o)}function us(h,n,s,o,m,f){var g,y,S,B=f*8-m-1,M=(1<<B)-1,x=M>>1,I=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=o?0:f-1,D=o?1:-1,L=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(y=isNaN(n)?1:0,g=M):(g=Math.floor(Math.log(n)/Math.LN2),n*(S=Math.pow(2,-g))<1&&(g--,S*=2),g+x>=1?n+=I/S:n+=I*Math.pow(2,1-x),n*S>=2&&(g++,S/=2),g+x>=M?(y=0,g=M):g+x>=1?(y=(n*S-1)*Math.pow(2,m),g=g+x):(y=n*Math.pow(2,x-1)*Math.pow(2,m),g=0));m>=8;h[s+k]=y&255,k+=D,y/=256,m-=8);for(g=g<<m|y,B+=m;B>0;h[s+k]=g&255,k+=D,g/=256,B-=8);h[s+k-D]|=L*128}var Ac={}.toString,ls=Array.isArray||function(h){return Ac.call(h)=="[object Array]"};/*!
|
|
8
8
|
* The buffer module from node.js, for the browser.
|
|
9
9
|
*
|
|
10
10
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
11
11
|
* @license MIT
|
|
12
|
-
*/var Bc=50;mt.TYPED_ARRAY_SUPPORT=Li.TYPED_ARRAY_SUPPORT!==void 0?Li.TYPED_ARRAY_SUPPORT:!0;Sn();function Sn(){return mt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function xr(h,n){if(Sn()<n)throw new RangeError("Invalid typed array length");return mt.TYPED_ARRAY_SUPPORT?(h=new Uint8Array(n),h.__proto__=mt.prototype):(h===null&&(h=new mt(n)),h.length=n),h}function mt(h,n,s){if(!mt.TYPED_ARRAY_SUPPORT&&!(this instanceof mt))return new mt(h,n,s);if(typeof h=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return E0(this,h)}return ds(this,h,n,s)}mt.poolSize=8192;mt._augment=function(h){return h.__proto__=mt.prototype,h};function ds(h,n,s,o){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&n instanceof ArrayBuffer?Ic(h,n,s,o):typeof n=="string"?kc(h,n,s):Rc(h,n)}mt.from=function(h,n,s){return ds(null,h,n,s)};mt.TYPED_ARRAY_SUPPORT&&(mt.prototype.__proto__=Uint8Array.prototype,mt.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&mt[Symbol.species]);function cs(h){if(typeof h!="number")throw new TypeError('"size" argument must be a number');if(h<0)throw new RangeError('"size" argument must not be negative')}function Ec(h,n,s,o){return cs(n),n<=0?xr(h,n):s!==void 0?typeof o=="string"?xr(h,n).fill(s,o):xr(h,n).fill(s):xr(h,n)}mt.alloc=function(h,n,s){return Ec(null,h,n,s)};function E0(h,n){if(cs(n),h=xr(h,n<0?0:k0(n)|0),!mt.TYPED_ARRAY_SUPPORT)for(var s=0;s<n;++s)h[s]=0;return h}mt.allocUnsafe=function(h){return E0(null,h)};mt.allocUnsafeSlow=function(h){return E0(null,h)};function kc(h,n,s){if((typeof s!="string"||s==="")&&(s="utf8"),!mt.isEncoding(s))throw new TypeError('"encoding" must be a valid string encoding');var o=vs(n,s)|0;h=xr(h,o);var m=h.write(n,s);return m!==o&&(h=h.slice(0,m)),h}function n0(h,n){var s=n.length<0?0:k0(n.length)|0;h=xr(h,s);for(var o=0;o<s;o+=1)h[o]=n[o]&255;return h}function Ic(h,n,s,o){if(n.byteLength,s<0||n.byteLength<s)throw new RangeError("'offset' is out of bounds");if(n.byteLength<s+(o||0))throw new RangeError("'length' is out of bounds");return s===void 0&&o===void 0?n=new Uint8Array(n):o===void 0?n=new Uint8Array(n,s):n=new Uint8Array(n,s,o),mt.TYPED_ARRAY_SUPPORT?(h=n,h.__proto__=mt.prototype):h=n0(h,n),h}function Rc(h,n){if(cr(n)){var s=k0(n.length)|0;return h=xr(h,s),h.length===0||n.copy(h,0,0,s),h}if(n){if(typeof ArrayBuffer!="undefined"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||Jc(n.length)?xr(h,0):n0(h,n);if(n.type==="Buffer"&&ls(n.data))return n0(h,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function k0(h){if(h>=Sn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Sn().toString(16)+" bytes");return h|0}mt.isBuffer=Gc;function cr(h){return!!(h!=null&&h._isBuffer)}mt.compare=function(n,s){if(!cr(n)||!cr(s))throw new TypeError("Arguments must be Buffers");if(n===s)return 0;for(var o=n.length,m=s.length,f=0,g=Math.min(o,m);f<g;++f)if(n[f]!==s[f]){o=n[f],m=s[f];break}return o<m?-1:m<o?1:0};mt.isEncoding=function(n){switch(String(n).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}};mt.concat=function(n,s){if(!ls(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return mt.alloc(0);var o;if(s===void 0)for(s=0,o=0;o<n.length;++o)s+=n[o].length;var m=mt.allocUnsafe(s),f=0;for(o=0;o<n.length;++o){var g=n[o];if(!cr(g))throw new TypeError('"list" argument must be an Array of Buffers');g.copy(m,f),f+=g.length}return m};function vs(h,n){if(cr(h))return h.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(h)||h instanceof ArrayBuffer))return h.byteLength;typeof h!="string"&&(h=""+h);var s=h.length;if(s===0)return 0;for(var o=!1;;)switch(n){case"ascii":case"latin1":case"binary":return s;case"utf8":case"utf-8":case void 0:return An(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s*2;case"hex":return s>>>1;case"base64":return Ms(h).length;default:if(o)return An(h).length;n=(""+n).toLowerCase(),o=!0}}mt.byteLength=vs;function Tc(h,n,s){var o=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((s===void 0||s>this.length)&&(s=this.length),s<=0)||(s>>>=0,n>>>=0,s<=n))return"";for(h||(h="utf8");;)switch(h){case"hex":return Oc(this,n,s);case"utf8":case"utf-8":return gs(this,n,s);case"ascii":return Uc(this,n,s);case"latin1":case"binary":return Lc(this,n,s);case"base64":return Nc(this,n,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zc(this,n,s);default:if(o)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),o=!0}}mt.prototype._isBuffer=!0;function Yr(h,n,s){var o=h[n];h[n]=h[s],h[s]=o}mt.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var s=0;s<n;s+=2)Yr(this,s,s+1);return this};mt.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var s=0;s<n;s+=4)Yr(this,s,s+3),Yr(this,s+1,s+2);return this};mt.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var s=0;s<n;s+=8)Yr(this,s,s+7),Yr(this,s+1,s+6),Yr(this,s+2,s+5),Yr(this,s+3,s+4);return this};mt.prototype.toString=function(){var n=this.length|0;return n===0?"":arguments.length===0?gs(this,0,n):Tc.apply(this,arguments)};mt.prototype.equals=function(n){if(!cr(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:mt.compare(this,n)===0};mt.prototype.inspect=function(){var n="",s=Bc;return this.length>0&&(n=this.toString("hex",0,s).match(/.{2}/g).join(" "),this.length>s&&(n+=" ... ")),"<Buffer "+n+">"};mt.prototype.compare=function(n,s,o,m,f){if(!cr(n))throw new TypeError("Argument must be a Buffer");if(s===void 0&&(s=0),o===void 0&&(o=n?n.length:0),m===void 0&&(m=0),f===void 0&&(f=this.length),s<0||o>n.length||m<0||f>this.length)throw new RangeError("out of range index");if(m>=f&&s>=o)return 0;if(m>=f)return-1;if(s>=o)return 1;if(s>>>=0,o>>>=0,m>>>=0,f>>>=0,this===n)return 0;for(var g=f-m,y=o-s,S=Math.min(g,y),B=this.slice(m,f),M=n.slice(s,o),x=0;x<S;++x)if(B[x]!==M[x]){g=B[x],y=M[x];break}return g<y?-1:y<g?1:0};function ps(h,n,s,o,m){if(h.length===0)return-1;if(typeof s=="string"?(o=s,s=0):s>2147483647?s=2147483647:s<-2147483648&&(s=-2147483648),s=+s,isNaN(s)&&(s=m?0:h.length-1),s<0&&(s=h.length+s),s>=h.length){if(m)return-1;s=h.length-1}else if(s<0)if(m)s=0;else return-1;if(typeof n=="string"&&(n=mt.from(n,o)),cr(n))return n.length===0?-1:wa(h,n,s,o,m);if(typeof n=="number")return n=n&255,mt.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?m?Uint8Array.prototype.indexOf.call(h,n,s):Uint8Array.prototype.lastIndexOf.call(h,n,s):wa(h,[n],s,o,m);throw new TypeError("val must be string, number or Buffer")}function wa(h,n,s,o,m){var f=1,g=h.length,y=n.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(h.length<2||n.length<2)return-1;f=2,g/=2,y/=2,s/=2}function S(k,D){return f===1?k[D]:k.readUInt16BE(D*f)}var B;if(m){var M=-1;for(B=s;B<g;B++)if(S(h,B)===S(n,M===-1?0:B-M)){if(M===-1&&(M=B),B-M+1===y)return M*f}else M!==-1&&(B-=B-M),M=-1}else for(s+y>g&&(s=g-y),B=s;B>=0;B--){for(var x=!0,I=0;I<y;I++)if(S(h,B+I)!==S(n,I)){x=!1;break}if(x)return B}return-1}mt.prototype.includes=function(n,s,o){return this.indexOf(n,s,o)!==-1};mt.prototype.indexOf=function(n,s,o){return ps(this,n,s,o,!0)};mt.prototype.lastIndexOf=function(n,s,o){return ps(this,n,s,o,!1)};function Cc(h,n,s,o){s=Number(s)||0;var m=h.length-s;o?(o=Number(o),o>m&&(o=m)):o=m;var f=n.length;if(f%2!==0)throw new TypeError("Invalid hex string");o>f/2&&(o=f/2);for(var g=0;g<o;++g){var y=parseInt(n.substr(g*2,2),16);if(isNaN(y))return g;h[s+g]=y}return g}function Fc(h,n,s,o){return Hn(An(n,h.length-s),h,s,o)}function ms(h,n,s,o){return Hn(Vc(n),h,s,o)}function qc(h,n,s,o){return ms(h,n,s,o)}function Pc(h,n,s,o){return Hn(Ms(n),h,s,o)}function Dc(h,n,s,o){return Hn(Yc(n,h.length-s),h,s,o)}mt.prototype.write=function(n,s,o,m){if(s===void 0)m="utf8",o=this.length,s=0;else if(o===void 0&&typeof s=="string")m=s,o=this.length,s=0;else if(isFinite(s))s=s|0,isFinite(o)?(o=o|0,m===void 0&&(m="utf8")):(m=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-s;if((o===void 0||o>f)&&(o=f),n.length>0&&(o<0||s<0)||s>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");for(var g=!1;;)switch(m){case"hex":return Cc(this,n,s,o);case"utf8":case"utf-8":return Fc(this,n,s,o);case"ascii":return ms(this,n,s,o);case"latin1":case"binary":return qc(this,n,s,o);case"base64":return Pc(this,n,s,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dc(this,n,s,o);default:if(g)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),g=!0}};mt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nc(h,n,s){return n===0&&s===h.length?ya(h):ya(h.slice(n,s))}function gs(h,n,s){s=Math.min(h.length,s);for(var o=[],m=n;m<s;){var f=h[m],g=null,y=f>239?4:f>223?3:f>191?2:1;if(m+y<=s){var S,B,M,x;switch(y){case 1:f<128&&(g=f);break;case 2:S=h[m+1],(S&192)===128&&(x=(f&31)<<6|S&63,x>127&&(g=x));break;case 3:S=h[m+1],B=h[m+2],(S&192)===128&&(B&192)===128&&(x=(f&15)<<12|(S&63)<<6|B&63,x>2047&&(x<55296||x>57343)&&(g=x));break;case 4:S=h[m+1],B=h[m+2],M=h[m+3],(S&192)===128&&(B&192)===128&&(M&192)===128&&(x=(f&15)<<18|(S&63)<<12|(B&63)<<6|M&63,x>65535&&x<1114112&&(g=x))}}g===null?(g=65533,y=1):g>65535&&(g-=65536,o.push(g>>>10&1023|55296),g=56320|g&1023),o.push(g),m+=y}return $c(o)}var Ma=4096;function $c(h){var n=h.length;if(n<=Ma)return String.fromCharCode.apply(String,h);for(var s="",o=0;o<n;)s+=String.fromCharCode.apply(String,h.slice(o,o+=Ma));return s}function Uc(h,n,s){var o="";s=Math.min(h.length,s);for(var m=n;m<s;++m)o+=String.fromCharCode(h[m]&127);return o}function Lc(h,n,s){var o="";s=Math.min(h.length,s);for(var m=n;m<s;++m)o+=String.fromCharCode(h[m]);return o}function Oc(h,n,s){var o=h.length;(!n||n<0)&&(n=0),(!s||s<0||s>o)&&(s=o);for(var m="",f=n;f<s;++f)m+=Wc(h[f]);return m}function zc(h,n,s){for(var o=h.slice(n,s),m="",f=0;f<o.length;f+=2)m+=String.fromCharCode(o[f]+o[f+1]*256);return m}mt.prototype.slice=function(n,s){var o=this.length;n=~~n,s=s===void 0?o:~~s,n<0?(n+=o,n<0&&(n=0)):n>o&&(n=o),s<0?(s+=o,s<0&&(s=0)):s>o&&(s=o),s<n&&(s=n);var m;if(mt.TYPED_ARRAY_SUPPORT)m=this.subarray(n,s),m.__proto__=mt.prototype;else{var f=s-n;m=new mt(f,void 0);for(var g=0;g<f;++g)m[g]=this[g+n]}return m};function Ae(h,n,s){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+n>s)throw new RangeError("Trying to access beyond buffer length")}mt.prototype.readUIntLE=function(n,s,o){n=n|0,s=s|0,o||Ae(n,s,this.length);for(var m=this[n],f=1,g=0;++g<s&&(f*=256);)m+=this[n+g]*f;return m};mt.prototype.readUIntBE=function(n,s,o){n=n|0,s=s|0,o||Ae(n,s,this.length);for(var m=this[n+--s],f=1;s>0&&(f*=256);)m+=this[n+--s]*f;return m};mt.prototype.readUInt8=function(n,s){return s||Ae(n,1,this.length),this[n]};mt.prototype.readUInt16LE=function(n,s){return s||Ae(n,2,this.length),this[n]|this[n+1]<<8};mt.prototype.readUInt16BE=function(n,s){return s||Ae(n,2,this.length),this[n]<<8|this[n+1]};mt.prototype.readUInt32LE=function(n,s){return s||Ae(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216};mt.prototype.readUInt32BE=function(n,s){return s||Ae(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])};mt.prototype.readIntLE=function(n,s,o){n=n|0,s=s|0,o||Ae(n,s,this.length);for(var m=this[n],f=1,g=0;++g<s&&(f*=256);)m+=this[n+g]*f;return f*=128,m>=f&&(m-=Math.pow(2,8*s)),m};mt.prototype.readIntBE=function(n,s,o){n=n|0,s=s|0,o||Ae(n,s,this.length);for(var m=s,f=1,g=this[n+--m];m>0&&(f*=256);)g+=this[n+--m]*f;return f*=128,g>=f&&(g-=Math.pow(2,8*s)),g};mt.prototype.readInt8=function(n,s){return s||Ae(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]};mt.prototype.readInt16LE=function(n,s){s||Ae(n,2,this.length);var o=this[n]|this[n+1]<<8;return o&32768?o|4294901760:o};mt.prototype.readInt16BE=function(n,s){s||Ae(n,2,this.length);var o=this[n+1]|this[n]<<8;return o&32768?o|4294901760:o};mt.prototype.readInt32LE=function(n,s){return s||Ae(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24};mt.prototype.readInt32BE=function(n,s){return s||Ae(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]};mt.prototype.readFloatLE=function(n,s){return s||Ae(n,4,this.length),On(this,n,!0,23,4)};mt.prototype.readFloatBE=function(n,s){return s||Ae(n,4,this.length),On(this,n,!1,23,4)};mt.prototype.readDoubleLE=function(n,s){return s||Ae(n,8,this.length),On(this,n,!0,52,8)};mt.prototype.readDoubleBE=function(n,s){return s||Ae(n,8,this.length),On(this,n,!1,52,8)};function Ue(h,n,s,o,m,f){if(!cr(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>m||n<f)throw new RangeError('"value" argument is out of bounds');if(s+o>h.length)throw new RangeError("Index out of range")}mt.prototype.writeUIntLE=function(n,s,o,m){if(n=+n,s=s|0,o=o|0,!m){var f=Math.pow(2,8*o)-1;Ue(this,n,s,o,f,0)}var g=1,y=0;for(this[s]=n&255;++y<o&&(g*=256);)this[s+y]=n/g&255;return s+o};mt.prototype.writeUIntBE=function(n,s,o,m){if(n=+n,s=s|0,o=o|0,!m){var f=Math.pow(2,8*o)-1;Ue(this,n,s,o,f,0)}var g=o-1,y=1;for(this[s+g]=n&255;--g>=0&&(y*=256);)this[s+g]=n/y&255;return s+o};mt.prototype.writeUInt8=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,1,255,0),mt.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[s]=n&255,s+1};function zn(h,n,s,o){n<0&&(n=65535+n+1);for(var m=0,f=Math.min(h.length-s,2);m<f;++m)h[s+m]=(n&255<<8*(o?m:1-m))>>>(o?m:1-m)*8}mt.prototype.writeUInt16LE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,2,65535,0),mt.TYPED_ARRAY_SUPPORT?(this[s]=n&255,this[s+1]=n>>>8):zn(this,n,s,!0),s+2};mt.prototype.writeUInt16BE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,2,65535,0),mt.TYPED_ARRAY_SUPPORT?(this[s]=n>>>8,this[s+1]=n&255):zn(this,n,s,!1),s+2};function Kn(h,n,s,o){n<0&&(n=4294967295+n+1);for(var m=0,f=Math.min(h.length-s,4);m<f;++m)h[s+m]=n>>>(o?m:3-m)*8&255}mt.prototype.writeUInt32LE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,4,4294967295,0),mt.TYPED_ARRAY_SUPPORT?(this[s+3]=n>>>24,this[s+2]=n>>>16,this[s+1]=n>>>8,this[s]=n&255):Kn(this,n,s,!0),s+4};mt.prototype.writeUInt32BE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,4,4294967295,0),mt.TYPED_ARRAY_SUPPORT?(this[s]=n>>>24,this[s+1]=n>>>16,this[s+2]=n>>>8,this[s+3]=n&255):Kn(this,n,s,!1),s+4};mt.prototype.writeIntLE=function(n,s,o,m){if(n=+n,s=s|0,!m){var f=Math.pow(2,8*o-1);Ue(this,n,s,o,f-1,-f)}var g=0,y=1,S=0;for(this[s]=n&255;++g<o&&(y*=256);)n<0&&S===0&&this[s+g-1]!==0&&(S=1),this[s+g]=(n/y>>0)-S&255;return s+o};mt.prototype.writeIntBE=function(n,s,o,m){if(n=+n,s=s|0,!m){var f=Math.pow(2,8*o-1);Ue(this,n,s,o,f-1,-f)}var g=o-1,y=1,S=0;for(this[s+g]=n&255;--g>=0&&(y*=256);)n<0&&S===0&&this[s+g+1]!==0&&(S=1),this[s+g]=(n/y>>0)-S&255;return s+o};mt.prototype.writeInt8=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,1,127,-128),mt.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[s]=n&255,s+1};mt.prototype.writeInt16LE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,2,32767,-32768),mt.TYPED_ARRAY_SUPPORT?(this[s]=n&255,this[s+1]=n>>>8):zn(this,n,s,!0),s+2};mt.prototype.writeInt16BE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,2,32767,-32768),mt.TYPED_ARRAY_SUPPORT?(this[s]=n>>>8,this[s+1]=n&255):zn(this,n,s,!1),s+2};mt.prototype.writeInt32LE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,4,2147483647,-2147483648),mt.TYPED_ARRAY_SUPPORT?(this[s]=n&255,this[s+1]=n>>>8,this[s+2]=n>>>16,this[s+3]=n>>>24):Kn(this,n,s,!0),s+4};mt.prototype.writeInt32BE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),mt.TYPED_ARRAY_SUPPORT?(this[s]=n>>>24,this[s+1]=n>>>16,this[s+2]=n>>>8,this[s+3]=n&255):Kn(this,n,s,!1),s+4};function bs(h,n,s,o,m,f){if(s+o>h.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("Index out of range")}function ys(h,n,s,o,m){return m||bs(h,n,s,4),us(h,n,s,o,23,4),s+4}mt.prototype.writeFloatLE=function(n,s,o){return ys(this,n,s,!0,o)};mt.prototype.writeFloatBE=function(n,s,o){return ys(this,n,s,!1,o)};function ws(h,n,s,o,m){return m||bs(h,n,s,8),us(h,n,s,o,52,8),s+8}mt.prototype.writeDoubleLE=function(n,s,o){return ws(this,n,s,!0,o)};mt.prototype.writeDoubleBE=function(n,s,o){return ws(this,n,s,!1,o)};mt.prototype.copy=function(n,s,o,m){if(o||(o=0),!m&&m!==0&&(m=this.length),s>=n.length&&(s=n.length),s||(s=0),m>0&&m<o&&(m=o),m===o||n.length===0||this.length===0)return 0;if(s<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("sourceStart out of bounds");if(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),n.length-s<m-o&&(m=n.length-s+o);var f=m-o,g;if(this===n&&o<s&&s<m)for(g=f-1;g>=0;--g)n[g+s]=this[g+o];else if(f<1e3||!mt.TYPED_ARRAY_SUPPORT)for(g=0;g<f;++g)n[g+s]=this[g+o];else Uint8Array.prototype.set.call(n,this.subarray(o,o+f),s);return f};mt.prototype.fill=function(n,s,o,m){if(typeof n=="string"){if(typeof s=="string"?(m=s,s=0,o=this.length):typeof o=="string"&&(m=o,o=this.length),n.length===1){var f=n.charCodeAt(0);f<256&&(n=f)}if(m!==void 0&&typeof m!="string")throw new TypeError("encoding must be a string");if(typeof m=="string"&&!mt.isEncoding(m))throw new TypeError("Unknown encoding: "+m)}else typeof n=="number"&&(n=n&255);if(s<0||this.length<s||this.length<o)throw new RangeError("Out of range index");if(o<=s)return this;s=s>>>0,o=o===void 0?this.length:o>>>0,n||(n=0);var g;if(typeof n=="number")for(g=s;g<o;++g)this[g]=n;else{var y=cr(n)?n:An(new mt(n,m).toString()),S=y.length;for(g=0;g<o-s;++g)this[g+s]=y[g%S]}return this};var Kc=/[^+\/0-9A-Za-z-_]/g;function Hc(h){if(h=Zc(h).replace(Kc,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Zc(h){return h.trim?h.trim():h.replace(/^\s+|\s+$/g,"")}function Wc(h){return h<16?"0"+h.toString(16):h.toString(16)}function An(h,n){n=n||1/0;for(var s,o=h.length,m=null,f=[],g=0;g<o;++g){if(s=h.charCodeAt(g),s>55295&&s<57344){if(!m){if(s>56319){(n-=3)>-1&&f.push(239,191,189);continue}else if(g+1===o){(n-=3)>-1&&f.push(239,191,189);continue}m=s;continue}if(s<56320){(n-=3)>-1&&f.push(239,191,189),m=s;continue}s=(m-55296<<10|s-56320)+65536}else m&&(n-=3)>-1&&f.push(239,191,189);if(m=null,s<128){if((n-=1)<0)break;f.push(s)}else if(s<2048){if((n-=2)<0)break;f.push(s>>6|192,s&63|128)}else if(s<65536){if((n-=3)<0)break;f.push(s>>12|224,s>>6&63|128,s&63|128)}else if(s<1114112){if((n-=4)<0)break;f.push(s>>18|240,s>>12&63|128,s>>6&63|128,s&63|128)}else throw new Error("Invalid code point")}return f}function Vc(h){for(var n=[],s=0;s<h.length;++s)n.push(h.charCodeAt(s)&255);return n}function Yc(h,n){for(var s,o,m,f=[],g=0;g<h.length&&!((n-=2)<0);++g)s=h.charCodeAt(g),o=s>>8,m=s%256,f.push(m),f.push(o);return f}function Ms(h){return xc(Hc(h))}function Hn(h,n,s,o){for(var m=0;m<o&&!(m+s>=n.length||m>=h.length);++m)n[m+s]=h[m];return m}function Jc(h){return h!==h}function Gc(h){return h!=null&&(!!h._isBuffer||xs(h)||Xc(h))}function xs(h){return!!h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h)}function Xc(h){return typeof h.readFloatLE=="function"&&typeof h.slice=="function"&&xs(h.slice(0,0))}var Xi=function(n,s){for(var o=Math.min(n.length,s.length),m=new mt(o),f=0;f<o;++f)m[f]=n[f]^s[f];return m},_s=Xi;A0.encrypt=function(h,n){var s=_s(n,h._prev);return h._prev=h._cipher.encryptBlock(s),h._prev};A0.decrypt=function(h,n){var s=h._prev;h._prev=n;var o=h._cipher.decryptBlock(n);return _s(o,s)};var Ss={},Di=Ot.Buffer,jc=Xi;function xa(h,n,s){var o=n.length,m=jc(n,h._cache);return h._cache=h._cache.slice(o),h._prev=Di.concat([h._prev,s?n:m]),m}Ss.encrypt=function(h,n,s){for(var o=Di.allocUnsafe(0),m;n.length;)if(h._cache.length===0&&(h._cache=h._cipher.encryptBlock(h._prev),h._prev=Di.allocUnsafe(0)),h._cache.length<=n.length)m=h._cache.length,o=Di.concat([o,xa(h,n.slice(0,m),s)]),n=n.slice(m);else{o=Di.concat([o,xa(h,n,s)]);break}return o};var As={},f0=Ot.Buffer;function Qc(h,n,s){var o=h._cipher.encryptBlock(h._prev),m=o[0]^n;return h._prev=f0.concat([h._prev.slice(1),f0.from([s?n:m])]),m}As.encrypt=function(h,n,s){for(var o=n.length,m=f0.allocUnsafe(o),f=-1;++f<o;)m[f]=Qc(h,n[f],s);return m};var Bs={},yn=Ot.Buffer;function t1(h,n,s){for(var o,m=-1,f=8,g=0,y,S;++m<f;)o=h._cipher.encryptBlock(h._prev),y=n&1<<7-m?128:0,S=o[0]^y,g+=(S&128)>>m%8,h._prev=e1(h._prev,s?y:S);return g}function e1(h,n){var s=h.length,o=-1,m=yn.allocUnsafe(h.length);for(h=yn.concat([h,yn.from([n])]);++o<s;)m[o]=h[o]<<1|h[o+1]>>7;return m}Bs.encrypt=function(h,n,s){for(var o=n.length,m=yn.allocUnsafe(o),f=-1;++f<o;)m[f]=t1(h,n[f],s);return m};var Es={},r1=Xi;function i1(h){return h._prev=h._cipher.encryptBlock(h._prev),h._prev}Es.encrypt=function(h,n){for(;h._cache.length<n.length;)h._cache=mt.concat([h._cache,i1(h)]);var s=h._cache.slice(0,n.length);return h._cache=h._cache.slice(n.length),r1(n,s)};var a0={};function n1(h){for(var n=h.length,s;n--;)if(s=h.readUInt8(n),s===255)h.writeUInt8(0,n);else{s++,h.writeUInt8(s,n);break}}var ks=n1,f1=Xi,_a=Ot.Buffer,a1=ks;function h1(h){var n=h._cipher.encryptBlockRaw(h._prev);return a1(h._prev),n}var gf=16;a0.encrypt=function(h,n){var s=Math.ceil(n.length/gf),o=h._cache.length;h._cache=_a.concat([h._cache,_a.allocUnsafe(s*gf)]);for(var m=0;m<s;m++){var f=h1(h),g=o+m*gf;h._cache.writeUInt32BE(f[0],g+0),h._cache.writeUInt32BE(f[1],g+4),h._cache.writeUInt32BE(f[2],g+8),h._cache.writeUInt32BE(f[3],g+12)}var y=h._cache.slice(0,n.length);return h._cache=h._cache.slice(n.length),f1(n,y)};const s1={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},o1={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},u1={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},Is={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:s1,aes192:o1,aes256:u1,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var l1={ECB:S0,CBC:A0,CFB:Ss,CFB8:As,CFB1:Bs,OFB:Es,CTR:a0,GCM:a0},wn=Is;for(var Sa in wn)wn[Sa].module=l1[wn[Sa].mode];var I0=wn,ji={},Bn=Ot.Buffer;function R0(h){Bn.isBuffer(h)||(h=Bn.from(h));for(var n=h.length/4|0,s=new Array(n),o=0;o<n;o++)s[o]=h.readUInt32BE(o*4);return s}function bf(h){for(var n=0;n<h.length;h++)h[n]=0}function Rs(h,n,s,o,m){for(var f=s[0],g=s[1],y=s[2],S=s[3],B=h[0]^n[0],M=h[1]^n[1],x=h[2]^n[2],I=h[3]^n[3],k,D,L,W,z=4,$=1;$<m;$++)k=f[B>>>24]^g[M>>>16&255]^y[x>>>8&255]^S[I&255]^n[z++],D=f[M>>>24]^g[x>>>16&255]^y[I>>>8&255]^S[B&255]^n[z++],L=f[x>>>24]^g[I>>>16&255]^y[B>>>8&255]^S[M&255]^n[z++],W=f[I>>>24]^g[B>>>16&255]^y[M>>>8&255]^S[x&255]^n[z++],B=k,M=D,x=L,I=W;return k=(o[B>>>24]<<24|o[M>>>16&255]<<16|o[x>>>8&255]<<8|o[I&255])^n[z++],D=(o[M>>>24]<<24|o[x>>>16&255]<<16|o[I>>>8&255]<<8|o[B&255])^n[z++],L=(o[x>>>24]<<24|o[I>>>16&255]<<16|o[B>>>8&255]<<8|o[M&255])^n[z++],W=(o[I>>>24]<<24|o[B>>>16&255]<<16|o[M>>>8&255]<<8|o[x&255])^n[z++],k=k>>>0,D=D>>>0,L=L>>>0,W=W>>>0,[k,D,L,W]}var d1=[0,1,2,4,8,16,32,64,128,27,54],be=function(){for(var h=new Array(256),n=0;n<256;n++)n<128?h[n]=n<<1:h[n]=n<<1^283;for(var s=[],o=[],m=[[],[],[],[]],f=[[],[],[],[]],g=0,y=0,S=0;S<256;++S){var B=y^y<<1^y<<2^y<<3^y<<4;B=B>>>8^B&255^99,s[g]=B,o[B]=g;var M=h[g],x=h[M],I=h[x],k=h[B]*257^B*16843008;m[0][g]=k<<24|k>>>8,m[1][g]=k<<16|k>>>16,m[2][g]=k<<8|k>>>24,m[3][g]=k,k=I*16843009^x*65537^M*257^g*16843008,f[0][B]=k<<24|k>>>8,f[1][B]=k<<16|k>>>16,f[2][B]=k<<8|k>>>24,f[3][B]=k,g===0?g=y=1:(g=M^h[h[h[I^M]]],y^=h[h[y]])}return{SBOX:s,INV_SBOX:o,SUB_MIX:m,INV_SUB_MIX:f}}();function Ze(h){this._key=R0(h),this._reset()}Ze.blockSize=4*4;Ze.keySize=256/8;Ze.prototype.blockSize=Ze.blockSize;Ze.prototype.keySize=Ze.keySize;Ze.prototype._reset=function(){for(var h=this._key,n=h.length,s=n+6,o=(s+1)*4,m=[],f=0;f<n;f++)m[f]=h[f];for(f=n;f<o;f++){var g=m[f-1];f%n===0?(g=g<<8|g>>>24,g=be.SBOX[g>>>24]<<24|be.SBOX[g>>>16&255]<<16|be.SBOX[g>>>8&255]<<8|be.SBOX[g&255],g^=d1[f/n|0]<<24):n>6&&f%n===4&&(g=be.SBOX[g>>>24]<<24|be.SBOX[g>>>16&255]<<16|be.SBOX[g>>>8&255]<<8|be.SBOX[g&255]),m[f]=m[f-n]^g}for(var y=[],S=0;S<o;S++){var B=o-S,M=m[B-(S%4?0:4)];S<4||B<=4?y[S]=M:y[S]=be.INV_SUB_MIX[0][be.SBOX[M>>>24]]^be.INV_SUB_MIX[1][be.SBOX[M>>>16&255]]^be.INV_SUB_MIX[2][be.SBOX[M>>>8&255]]^be.INV_SUB_MIX[3][be.SBOX[M&255]]}this._nRounds=s,this._keySchedule=m,this._invKeySchedule=y};Ze.prototype.encryptBlockRaw=function(h){return h=R0(h),Rs(h,this._keySchedule,be.SUB_MIX,be.SBOX,this._nRounds)};Ze.prototype.encryptBlock=function(h){var n=this.encryptBlockRaw(h),s=Bn.allocUnsafe(16);return s.writeUInt32BE(n[0],0),s.writeUInt32BE(n[1],4),s.writeUInt32BE(n[2],8),s.writeUInt32BE(n[3],12),s};Ze.prototype.decryptBlock=function(h){h=R0(h);var n=h[1];h[1]=h[3],h[3]=n;var s=Rs(h,this._invKeySchedule,be.INV_SUB_MIX,be.INV_SBOX,this._nRounds),o=Bn.allocUnsafe(16);return o.writeUInt32BE(s[0],0),o.writeUInt32BE(s[3],4),o.writeUInt32BE(s[2],8),o.writeUInt32BE(s[1],12),o};Ze.prototype.scrub=function(){bf(this._keySchedule),bf(this._invKeySchedule),bf(this._key)};ji.AES=Ze;var oi=Ot.Buffer,c1=oi.alloc(16,0);function v1(h){return[h.readUInt32BE(0),h.readUInt32BE(4),h.readUInt32BE(8),h.readUInt32BE(12)]}function Ts(h){var n=oi.allocUnsafe(16);return n.writeUInt32BE(h[0]>>>0,0),n.writeUInt32BE(h[1]>>>0,4),n.writeUInt32BE(h[2]>>>0,8),n.writeUInt32BE(h[3]>>>0,12),n}function Qi(h){this.h=h,this.state=oi.alloc(16,0),this.cache=oi.allocUnsafe(0)}Qi.prototype.ghash=function(h){for(var n=-1;++n<h.length;)this.state[n]^=h[n];this._multiply()};Qi.prototype._multiply=function(){for(var h=v1(this.h),n=[0,0,0,0],s,o,m,f=-1;++f<128;){for(o=(this.state[~~(f/8)]&1<<7-f%8)!==0,o&&(n[0]^=h[0],n[1]^=h[1],n[2]^=h[2],n[3]^=h[3]),m=(h[3]&1)!==0,s=3;s>0;s--)h[s]=h[s]>>>1|(h[s-1]&1)<<31;h[0]=h[0]>>>1,m&&(h[0]=h[0]^225<<24)}this.state=Ts(n)};Qi.prototype.update=function(h){this.cache=oi.concat([this.cache,h]);for(var n;this.cache.length>=16;)n=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(n)};Qi.prototype.final=function(h,n){return this.cache.length&&this.ghash(oi.concat([this.cache,c1],16)),this.ghash(Ts([0,h,0,n])),this.state};var p1=Qi,m1=ji,Pe=Ot.Buffer,Cs=$r,g1=Jt,Fs=p1,b1=Xi,y1=ks;function w1(h,n){var s=0;h.length!==n.length&&s++;for(var o=Math.min(h.length,n.length),m=0;m<o;++m)s+=h[m]^n[m];return s}function M1(h,n,s){if(n.length===12)return h._finID=Pe.concat([n,Pe.from([0,0,0,1])]),Pe.concat([n,Pe.from([0,0,0,2])]);var o=new Fs(s),m=n.length,f=m%16;o.update(n),f&&(f=16-f,o.update(Pe.alloc(f,0))),o.update(Pe.alloc(8,0));var g=m*8,y=Pe.alloc(8);y.writeUIntBE(g,0,8),o.update(y),h._finID=o.state;var S=Pe.from(h._finID);return y1(S),S}function ei(h,n,s,o){Cs.call(this);var m=Pe.alloc(4,0);this._cipher=new m1.AES(n);var f=this._cipher.encryptBlock(m);this._ghash=new Fs(f),s=M1(this,s,f),this._prev=Pe.from(s),this._cache=Pe.allocUnsafe(0),this._secCache=Pe.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=h,this._authTag=null,this._called=!1}g1(ei,Cs);ei.prototype._update=function(h){if(!this._called&&this._alen){var n=16-this._alen%16;n<16&&(n=Pe.alloc(n,0),this._ghash.update(n))}this._called=!0;var s=this._mode.encrypt(this,h);return this._decrypt?this._ghash.update(h):this._ghash.update(s),this._len+=h.length,s};ei.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var h=b1(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&w1(h,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=h,this._cipher.scrub()};ei.prototype.getAuthTag=function(){if(this._decrypt||!Pe.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag};ei.prototype.setAuthTag=function(n){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=n};ei.prototype.setAAD=function(n){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(n),this._alen+=n.length};var qs=ei,x1=ji,yf=Ot.Buffer,Ps=$r,_1=Jt;function Zn(h,n,s,o){Ps.call(this),this._cipher=new x1.AES(n),this._prev=yf.from(s),this._cache=yf.allocUnsafe(0),this._secCache=yf.allocUnsafe(0),this._decrypt=o,this._mode=h}_1(Zn,Ps);Zn.prototype._update=function(h){return this._mode.encrypt(this,h,this._decrypt)};Zn.prototype._final=function(){this._cipher.scrub()};var Ds=Zn,Or=Ot.Buffer,S1=b0;function A1(h,n,s,o){if(Or.isBuffer(h)||(h=Or.from(h,"binary")),n&&(Or.isBuffer(n)||(n=Or.from(n,"binary")),n.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var m=s/8,f=Or.alloc(m),g=Or.alloc(o||0),y=Or.alloc(0);m>0||o>0;){var S=new S1;S.update(y),S.update(h),n&&S.update(n),y=S.digest();var B=0;if(m>0){var M=f.length-m;B=Math.min(m,y.length),y.copy(f,M,0,B),m-=B}if(B<y.length&&o>0){var x=g.length-o,I=Math.min(o,y.length-B);y.copy(g,x,B,B+I),o-=I}}return y.fill(0),{key:f,iv:g}}var Wn=A1,Ns=I0,B1=qs,Ar=Ot.Buffer,E1=Ds,$s=$r,k1=ji,I1=Wn,R1=Jt;function tn(h,n,s){$s.call(this),this._cache=new Vn,this._cipher=new k1.AES(n),this._prev=Ar.from(s),this._mode=h,this._autopadding=!0}R1(tn,$s);tn.prototype._update=function(h){this._cache.add(h);for(var n,s,o=[];n=this._cache.get();)s=this._mode.encrypt(this,n),o.push(s);return Ar.concat(o)};var T1=Ar.alloc(16,16);tn.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return h=this._mode.encrypt(this,h),this._cipher.scrub(),h;if(!h.equals(T1))throw this._cipher.scrub(),new Error("data not multiple of block length")};tn.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function Vn(){this.cache=Ar.allocUnsafe(0)}Vn.prototype.add=function(h){this.cache=Ar.concat([this.cache,h])};Vn.prototype.get=function(){if(this.cache.length>15){var h=this.cache.slice(0,16);return this.cache=this.cache.slice(16),h}return null};Vn.prototype.flush=function(){for(var h=16-this.cache.length,n=Ar.allocUnsafe(h),s=-1;++s<h;)n.writeUInt8(h,s);return Ar.concat([this.cache,n])};function Us(h,n,s){var o=Ns[h.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if(typeof n=="string"&&(n=Ar.from(n)),n.length!==o.key/8)throw new TypeError("invalid key length "+n.length);if(typeof s=="string"&&(s=Ar.from(s)),o.mode!=="GCM"&&s.length!==o.iv)throw new TypeError("invalid iv length "+s.length);return o.type==="stream"?new E1(o.module,n,s):o.type==="auth"?new B1(o.module,n,s):new tn(o.module,n,s)}function C1(h,n){var s=Ns[h.toLowerCase()];if(!s)throw new TypeError("invalid suite type");var o=I1(n,!1,s.key,s.iv);return Us(h,o.key,o.iv)}_0.createCipheriv=Us;_0.createCipher=C1;var T0={},F1=qs,ui=Ot.Buffer,Ls=I0,q1=Ds,Os=$r,P1=ji,D1=Wn,N1=Jt;function en(h,n,s){Os.call(this),this._cache=new Yn,this._last=void 0,this._cipher=new P1.AES(n),this._prev=ui.from(s),this._mode=h,this._autopadding=!0}N1(en,Os);en.prototype._update=function(h){this._cache.add(h);for(var n,s,o=[];n=this._cache.get(this._autopadding);)s=this._mode.decrypt(this,n),o.push(s);return ui.concat(o)};en.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return $1(this._mode.decrypt(this,h));if(h)throw new Error("data not multiple of block length")};en.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function Yn(){this.cache=ui.allocUnsafe(0)}Yn.prototype.add=function(h){this.cache=ui.concat([this.cache,h])};Yn.prototype.get=function(h){var n;if(h){if(this.cache.length>16)return n=this.cache.slice(0,16),this.cache=this.cache.slice(16),n}else if(this.cache.length>=16)return n=this.cache.slice(0,16),this.cache=this.cache.slice(16),n;return null};Yn.prototype.flush=function(){if(this.cache.length)return this.cache};function $1(h){var n=h[15];if(n<1||n>16)throw new Error("unable to decrypt data");for(var s=-1;++s<n;)if(h[s+(16-n)]!==n)throw new Error("unable to decrypt data");if(n!==16)return h.slice(0,16-n)}function zs(h,n,s){var o=Ls[h.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if(typeof s=="string"&&(s=ui.from(s)),o.mode!=="GCM"&&s.length!==o.iv)throw new TypeError("invalid iv length "+s.length);if(typeof n=="string"&&(n=ui.from(n)),n.length!==o.key/8)throw new TypeError("invalid key length "+n.length);return o.type==="stream"?new q1(o.module,n,s,!0):o.type==="auth"?new F1(o.module,n,s,!0):new en(o.module,n,s)}function U1(h,n){var s=Ls[h.toLowerCase()];if(!s)throw new TypeError("invalid suite type");var o=D1(n,!1,s.key,s.iv);return zs(h,o.key,o.iv)}T0.createDecipher=U1;T0.createDecipheriv=zs;var Ks=_0,Hs=T0,L1=Is;function O1(){return Object.keys(L1)}Le.createCipher=Le.Cipher=Ks.createCipher;Le.createCipheriv=Le.Cipheriv=Ks.createCipheriv;Le.createDecipher=Le.Decipher=Hs.createDecipher;Le.createDecipheriv=Le.Decipheriv=Hs.createDecipheriv;Le.listCiphers=Le.getCiphers=O1;var Zs={};(function(h){h["des-ecb"]={key:8,iv:0},h["des-cbc"]=h.des={key:8,iv:8},h["des-ede3-cbc"]=h.des3={key:24,iv:8},h["des-ede3"]={key:24,iv:0},h["des-ede-cbc"]={key:16,iv:8},h["des-ede"]={key:16,iv:0}})(Zs);var Ws=wc,C0=Le,Pr=I0,Sr=Zs,Vs=Wn;function z1(h,n){h=h.toLowerCase();var s,o;if(Pr[h])s=Pr[h].key,o=Pr[h].iv;else if(Sr[h])s=Sr[h].key*8,o=Sr[h].iv;else throw new TypeError("invalid suite type");var m=Vs(n,!1,s,o);return Ys(h,m.key,m.iv)}function K1(h,n){h=h.toLowerCase();var s,o;if(Pr[h])s=Pr[h].key,o=Pr[h].iv;else if(Sr[h])s=Sr[h].key*8,o=Sr[h].iv;else throw new TypeError("invalid suite type");var m=Vs(n,!1,s,o);return Js(h,m.key,m.iv)}function Ys(h,n,s){if(h=h.toLowerCase(),Pr[h])return C0.createCipheriv(h,n,s);if(Sr[h])return new Ws({key:n,iv:s,mode:h});throw new TypeError("invalid suite type")}function Js(h,n,s){if(h=h.toLowerCase(),Pr[h])return C0.createDecipheriv(h,n,s);if(Sr[h])return new Ws({key:n,iv:s,mode:h,decrypt:!0});throw new TypeError("invalid suite type")}function H1(){return Object.keys(Sr).concat(C0.getCiphers())}Qe.createCipher=Qe.Cipher=z1;Qe.createCipheriv=Qe.Cipheriv=Ys;Qe.createDecipher=Qe.Decipher=K1;Qe.createDecipheriv=Qe.Decipheriv=Js;Qe.listCiphers=Qe.getCiphers=H1;var zr={},F0={exports:{}};F0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(F0);var Gs=F0.exports,q0={exports:{}};q0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(q0);var Z1=q0.exports,un={exports:{}},Aa;function P0(){if(Aa)return un.exports;Aa=1;var h;un.exports=function(m){return h||(h=new n(null)),h.generate(m)};function n(o){this.rand=o}if(un.exports.Rand=n,n.prototype.generate=function(m){return this._rand(m)},n.prototype._rand=function(m){if(this.rand.getBytes)return this.rand.getBytes(m);for(var f=new Uint8Array(m),g=0;g<f.length;g++)f[g]=this.rand.getByte();return f},typeof self=="object")self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(m){var f=new Uint8Array(m);return self.crypto.getRandomValues(f),f}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(m){var f=new Uint8Array(m);return self.msCrypto.getRandomValues(f),f}:typeof window=="object"&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=Xo();if(typeof s.randomBytes!="function")throw new Error("Not supported");n.prototype._rand=function(m){return s.randomBytes(m)}}catch(o){}return un.exports}var wf,Ba;function Xs(){if(Ba)return wf;Ba=1;var h=Z1,n=P0();function s(o){this.rand=o||new n.Rand}return wf=s,s.create=function(m){return new s(m)},s.prototype._randbelow=function(m){var f=m.bitLength(),g=Math.ceil(f/8);do var y=new h(this.rand.generate(g));while(y.cmp(m)>=0);return y},s.prototype._randrange=function(m,f){var g=f.sub(m);return m.add(this._randbelow(g))},s.prototype.test=function(m,f,g){var y=m.bitLength(),S=h.mont(m),B=new h(1).toRed(S);f||(f=Math.max(1,y/48|0));for(var M=m.subn(1),x=0;!M.testn(x);x++);for(var I=m.shrn(x),k=M.toRed(S),D=!0;f>0;f--){var L=this._randrange(new h(2),M);g&&g(L);var W=L.toRed(S).redPow(I);if(!(W.cmp(B)===0||W.cmp(k)===0)){for(var z=1;z<x;z++){if(W=W.redSqr(),W.cmp(B)===0)return!1;if(W.cmp(k)===0)break}if(z===x)return!1}}return D},s.prototype.getDivisor=function(m,f){var g=m.bitLength(),y=h.mont(m),S=new h(1).toRed(y);f||(f=Math.max(1,g/48|0));for(var B=m.subn(1),M=0;!B.testn(M);M++);for(var x=m.shrn(M),I=B.toRed(y);f>0;f--){var k=this._randrange(new h(2),B),D=m.gcd(k);if(D.cmpn(1)!==0)return D;var L=k.toRed(y).redPow(x);if(!(L.cmp(S)===0||L.cmp(I)===0)){for(var W=1;W<M;W++){if(L=L.redSqr(),L.cmp(S)===0)return L.fromRed().subn(1).gcd(m);if(L.cmp(I)===0)break}if(W===M)return L=L.redSqr(),L.fromRed().subn(1).gcd(m)}}return!1},wf}var Mf,Ea;function js(){if(Ea)return Mf;Ea=1;var h=gi;Mf=W,W.simpleSieve=D,W.fermatTest=L;var n=Gs,s=new n(24),o=Xs(),m=new o,f=new n(1),g=new n(2),y=new n(5);new n(16),new n(8);var S=new n(10),B=new n(3);new n(7);var M=new n(11),x=new n(4);new n(12);var I=null;function k(){if(I!==null)return I;var z=1048576,$=[];$[0]=2;for(var lt=1,H=3;H<z;H+=2){for(var At=Math.ceil(Math.sqrt(H)),Bt=0;Bt<lt&&$[Bt]<=At&&H%$[Bt]!==0;Bt++);lt!==Bt&&$[Bt]<=At||($[lt++]=H)}return I=$,$}function D(z){for(var $=k(),lt=0;lt<$.length;lt++)if(z.modn($[lt])===0)return z.cmpn($[lt])===0;return!0}function L(z){var $=n.mont(z);return g.toRed($).redPow(z.subn(1)).fromRed().cmpn(1)===0}function W(z,$){if(z<16)return $===2||$===5?new n([140,123]):new n([140,39]);$=new n($);for(var lt,H;;){for(lt=new n(h(Math.ceil(z/8)));lt.bitLength()>z;)lt.ishrn(1);if(lt.isEven()&<.iadd(f),lt.testn(1)||lt.iadd(g),$.cmp(g)){if(!$.cmp(y))for(;lt.mod(S).cmp(B);)lt.iadd(x)}else for(;lt.mod(s).cmp(M);)lt.iadd(x);if(H=lt.shrn(1),D(H)&&D(lt)&&L(H)&&L(lt)&&m.test(H)&&m.test(lt))return lt}}return Mf}const W1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},V1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},Y1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},J1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},G1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},X1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},j1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},Q1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},tv={modp1:W1,modp2:V1,modp5:Y1,modp14:J1,modp15:G1,modp16:X1,modp17:j1,modp18:Q1};var xf,ka;function ev(){if(ka)return xf;ka=1;var h=Gs,n=Xs(),s=new n,o=new h(24),m=new h(11),f=new h(10),g=new h(3),y=new h(7),S=js(),B=gi;xf=D;function M(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this._pub=new h(W),this}function x(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this._priv=new h(W),this}var I={};function k(W,z){var $=z.toString("hex"),lt=[$,W.toString(16)].join("_");if(lt in I)return I[lt];var H=0;if(W.isEven()||!S.simpleSieve||!S.fermatTest(W)||!s.test(W))return H+=1,$==="02"||$==="05"?H+=8:H+=4,I[lt]=H,H;s.test(W.shrn(1))||(H+=2);var At;switch($){case"02":W.mod(o).cmp(m)&&(H+=8);break;case"05":At=W.mod(f),At.cmp(g)&&At.cmp(y)&&(H+=8);break;default:H+=4}return I[lt]=H,H}function D(W,z,$){this.setGenerator(z),this.__prime=new h(W),this._prime=h.mont(this.__prime),this._primeLen=W.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,$?(this.setPublicKey=M,this.setPrivateKey=x):this._primeCode=8}Object.defineProperty(D.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=k(this.__prime,this.__gen)),this._primeCode}}),D.prototype.generateKeys=function(){return this._priv||(this._priv=new h(B(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},D.prototype.computeSecret=function(W){W=new h(W),W=W.toRed(this._prime);var z=W.redPow(this._priv).fromRed(),$=new mt(z.toArray()),lt=this.getPrime();if($.length<lt.length){var H=new mt(lt.length-$.length);H.fill(0),$=mt.concat([H,$])}return $},D.prototype.getPublicKey=function(z){return L(this._pub,z)},D.prototype.getPrivateKey=function(z){return L(this._priv,z)},D.prototype.getPrime=function(W){return L(this.__prime,W)},D.prototype.getGenerator=function(W){return L(this._gen,W)},D.prototype.setGenerator=function(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this.__gen=W,this._gen=new h(W),this};function L(W,z){var $=new mt(W.toArray());return z?$.toString(z):$}return xf}var Ia;function rv(){if(Ia)return zr;Ia=1;var h=js(),n=tv,s=ev();function o(g){var y=new mt(n[g].prime,"hex"),S=new mt(n[g].gen,"hex");return new s(y,S)}var m={binary:!0,hex:!0,base64:!0};function f(g,y,S,B){return mt.isBuffer(y)||m[y]===void 0?f(g,"binary",y,S):(y=y||"binary",B=B||"binary",S=S||new mt([2]),mt.isBuffer(S)||(S=new mt(S,B)),typeof g=="number"?new s(h(g,S),S,!0):(mt.isBuffer(g)||(g=new mt(g,y)),new s(g,S,!0)))}return zr.DiffieHellmanGroup=zr.createDiffieHellmanGroup=zr.getDiffieHellman=o,zr.createDiffieHellman=zr.DiffieHellman=f,zr}var h0={exports:{}},s0={exports:{}};typeof ye=="undefined"||!ye.version||ye.version.indexOf("v0.")===0||ye.version.indexOf("v1.")===0&&ye.version.indexOf("v1.8.")!==0?s0.exports={nextTick:iv}:s0.exports=ye;function iv(h,n,s,o){if(typeof h!="function")throw new TypeError('"callback" argument must be a function');var m=arguments.length,f,g;switch(m){case 0:case 1:return ye.nextTick(h);case 2:return ye.nextTick(function(){h.call(null,n)});case 3:return ye.nextTick(function(){h.call(null,n,s)});case 4:return ye.nextTick(function(){h.call(null,n,s,o)});default:for(f=new Array(m-1),g=0;g<f.length;)f[g++]=arguments[g];return ye.nextTick(function(){h.apply(null,f)})}}var Jn=s0.exports,nv={}.toString,fv=Array.isArray||function(h){return nv.call(h)=="[object Array]"},Qs=De.EventEmitter,o0={exports:{}};(function(h,n){var s=gr,o=s.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?h.exports=s:(m(s,n),n.Buffer=f);function f(g,y,S){return o(g,y,S)}m(o,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=o(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(g)}})(o0,o0.exports);var D0=o0.exports,we={};function av(h){return Array.isArray?Array.isArray(h):Gn(h)==="[object Array]"}we.isArray=av;function hv(h){return typeof h=="boolean"}we.isBoolean=hv;function sv(h){return h===null}we.isNull=sv;function ov(h){return h==null}we.isNullOrUndefined=ov;function uv(h){return typeof h=="number"}we.isNumber=uv;function lv(h){return typeof h=="string"}we.isString=lv;function dv(h){return typeof h=="symbol"}we.isSymbol=dv;function cv(h){return h===void 0}we.isUndefined=cv;function vv(h){return Gn(h)==="[object RegExp]"}we.isRegExp=vv;function pv(h){return typeof h=="object"&&h!==null}we.isObject=pv;function mv(h){return Gn(h)==="[object Date]"}we.isDate=mv;function gv(h){return Gn(h)==="[object Error]"||h instanceof Error}we.isError=gv;function bv(h){return typeof h=="function"}we.isFunction=bv;function yv(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h=="undefined"}we.isPrimitive=yv;we.isBuffer=gr.Buffer.isBuffer;function Gn(h){return Object.prototype.toString.call(h)}var _f={exports:{}},Ra;function wv(){return Ra||(Ra=1,function(h){function n(f,g){if(!(f instanceof g))throw new TypeError("Cannot call a class as a function")}var s=D0.Buffer,o=De;function m(f,g,y){f.copy(g,y)}h.exports=function(){function f(){n(this,f),this.head=null,this.tail=null,this.length=0}return f.prototype.push=function(y){var S={data:y,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length},f.prototype.unshift=function(y){var S={data:y,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length},f.prototype.shift=function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}},f.prototype.clear=function(){this.head=this.tail=null,this.length=0},f.prototype.join=function(y){if(this.length===0)return"";for(var S=this.head,B=""+S.data;S=S.next;)B+=y+S.data;return B},f.prototype.concat=function(y){if(this.length===0)return s.alloc(0);for(var S=s.allocUnsafe(y>>>0),B=this.head,M=0;B;)m(B.data,S,M),M+=B.data.length,B=B.next;return S},f}(),o&&o.inspect&&o.inspect.custom&&(h.exports.prototype[o.inspect.custom]=function(){var f=o.inspect({length:this.length});return this.constructor.name+" "+f})}(_f)),_f.exports}var ln=Jn;function Mv(h,n){var s=this,o=this._readableState&&this._readableState.destroyed,m=this._writableState&&this._writableState.destroyed;return o||m?(n?n(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ln.nextTick(dn,this,h)):ln.nextTick(dn,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(f){!n&&f?s._writableState?s._writableState.errorEmitted||(s._writableState.errorEmitted=!0,ln.nextTick(dn,s,f)):ln.nextTick(dn,s,f):n&&n(f)}),this)}function xv(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function dn(h,n){h.emit("error",n)}var to={destroy:Mv,undestroy:xv},_v=Sv;function Sv(h,n){if(Sf("noDeprecation"))return h;var s=!1;function o(){if(!s){if(Sf("throwDeprecation"))throw new Error(n);Sf("traceDeprecation")?console.trace(n):console.warn(n),s=!0}return h.apply(this,arguments)}return o}function Sf(h){try{if(!Gt.localStorage)return!1}catch(s){return!1}var n=Gt.localStorage[h];return n==null?!1:String(n).toLowerCase()==="true"}var Af,Ta;function eo(){if(Ta)return Af;Ta=1;var h=Jn;Af=L;function n(c){var v=this;this.next=null,this.entry=null,this.finish=function(){d(v,c)}}var s=!ye.browser&&["v0.10","v0.9."].indexOf(ye.version.slice(0,5))>-1?setImmediate:h.nextTick,o;L.WritableState=k;var m=Object.create(we);m.inherits=Jt;var f={deprecate:_v},g=Qs,y=D0.Buffer,S=(typeof Gt!="undefined"?Gt:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function B(c){return y.from(c)}function M(c){return y.isBuffer(c)||c instanceof S}var x=to;m.inherits(L,g);function I(){}function k(c,v){o=o||li(),c=c||{};var u=v instanceof o;this.objectMode=!!c.objectMode,u&&(this.objectMode=this.objectMode||!!c.writableObjectMode);var e=c.highWaterMark,l=c.writableHighWaterMark,b=this.objectMode?16:16*1024;e||e===0?this.highWaterMark=e:u&&(l||l===0)?this.highWaterMark=l:this.highWaterMark=b,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var _=c.decodeStrings===!1;this.decodeStrings=!_,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(C){Ct(v,C)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}k.prototype.getBuffer=function(){for(var v=this.bufferedRequest,u=[];v;)u.push(v),v=v.next;return u},function(){try{Object.defineProperty(k.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(c){}}();var D;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(D=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(c){return D.call(this,c)?!0:this!==L?!1:c&&c._writableState instanceof k}})):D=function(c){return c instanceof this};function L(c){if(o=o||li(),!D.call(L,this)&&!(this instanceof o))return new L(c);this._writableState=new k(c,this),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),g.call(this)}L.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function W(c,v){var u=new Error("write after end");c.emit("error",u),h.nextTick(v,u)}function z(c,v,u,e){var l=!0,b=!1;return u===null?b=new TypeError("May not write null values to stream"):typeof u!="string"&&u!==void 0&&!v.objectMode&&(b=new TypeError("Invalid non-string/buffer chunk")),b&&(c.emit("error",b),h.nextTick(e,b),l=!1),l}L.prototype.write=function(c,v,u){var e=this._writableState,l=!1,b=!e.objectMode&&M(c);return b&&!y.isBuffer(c)&&(c=B(c)),typeof v=="function"&&(u=v,v=null),b?v="buffer":v||(v=e.defaultEncoding),typeof u!="function"&&(u=I),e.ended?W(this,u):(b||z(this,e,c,u))&&(e.pendingcb++,l=lt(this,e,b,c,v,u)),l},L.prototype.cork=function(){var c=this._writableState;c.corked++},L.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&It(this,c))},L.prototype.setDefaultEncoding=function(v){if(typeof v=="string"&&(v=v.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((v+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+v);return this._writableState.defaultEncoding=v,this};function $(c,v,u){return!c.objectMode&&c.decodeStrings!==!1&&typeof v=="string"&&(v=y.from(v,u)),v}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function lt(c,v,u,e,l,b){if(!u){var _=$(v,e,l);e!==_&&(u=!0,l="buffer",e=_)}var C=v.objectMode?1:e.length;v.length+=C;var q=v.length<v.highWaterMark;if(q||(v.needDrain=!0),v.writing||v.corked){var O=v.lastBufferedRequest;v.lastBufferedRequest={chunk:e,encoding:l,isBuf:u,callback:b,next:null},O?O.next=v.lastBufferedRequest:v.bufferedRequest=v.lastBufferedRequest,v.bufferedRequestCount+=1}else H(c,v,!1,C,e,l,b);return q}function H(c,v,u,e,l,b,_){v.writelen=e,v.writecb=_,v.writing=!0,v.sync=!0,u?c._writev(l,v.onwrite):c._write(l,b,v.onwrite),v.sync=!1}function At(c,v,u,e,l){--v.pendingcb,u?(h.nextTick(l,e),h.nextTick(i,c,v),c._writableState.errorEmitted=!0,c.emit("error",e)):(l(e),c._writableState.errorEmitted=!0,c.emit("error",e),i(c,v))}function Bt(c){c.writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0}function Ct(c,v){var u=c._writableState,e=u.sync,l=u.writecb;if(Bt(u),v)At(c,u,e,v,l);else{var b=p(u);!b&&!u.corked&&!u.bufferProcessing&&u.bufferedRequest&&It(c,u),e?s(Et,c,u,b,l):Et(c,u,b,l)}}function Et(c,v,u,e){u||Y(c,v),v.pendingcb--,e(),i(c,v)}function Y(c,v){v.length===0&&v.needDrain&&(v.needDrain=!1,c.emit("drain"))}function It(c,v){v.bufferProcessing=!0;var u=v.bufferedRequest;if(c._writev&&u&&u.next){var e=v.bufferedRequestCount,l=new Array(e),b=v.corkedRequestsFree;b.entry=u;for(var _=0,C=!0;u;)l[_]=u,u.isBuf||(C=!1),u=u.next,_+=1;l.allBuffers=C,H(c,v,!0,v.length,l,"",b.finish),v.pendingcb++,v.lastBufferedRequest=null,b.next?(v.corkedRequestsFree=b.next,b.next=null):v.corkedRequestsFree=new n(v),v.bufferedRequestCount=0}else{for(;u;){var q=u.chunk,O=u.encoding,R=u.callback,P=v.objectMode?1:q.length;if(H(c,v,!1,P,q,O,R),u=u.next,v.bufferedRequestCount--,v.writing)break}u===null&&(v.lastBufferedRequest=null)}v.bufferedRequest=u,v.bufferProcessing=!1}L.prototype._write=function(c,v,u){u(new Error("_write() is not implemented"))},L.prototype._writev=null,L.prototype.end=function(c,v,u){var e=this._writableState;typeof c=="function"?(u=c,c=null,v=null):typeof v=="function"&&(u=v,v=null),c!=null&&this.write(c,v),e.corked&&(e.corked=1,this.uncork()),e.ending||a(this,e,u)};function p(c){return c.ending&&c.length===0&&c.bufferedRequest===null&&!c.finished&&!c.writing}function t(c,v){c._final(function(u){v.pendingcb--,u&&c.emit("error",u),v.prefinished=!0,c.emit("prefinish"),i(c,v)})}function r(c,v){!v.prefinished&&!v.finalCalled&&(typeof c._final=="function"?(v.pendingcb++,v.finalCalled=!0,h.nextTick(t,c,v)):(v.prefinished=!0,c.emit("prefinish")))}function i(c,v){var u=p(v);return u&&(r(c,v),v.pendingcb===0&&(v.finished=!0,c.emit("finish"))),u}function a(c,v,u){v.ending=!0,i(c,v),u&&(v.finished?h.nextTick(u):c.once("finish",u)),v.ended=!0,c.writable=!1}function d(c,v,u){var e=c.entry;for(c.entry=null;e;){var l=e.callback;v.pendingcb--,l(u),e=e.next}v.corkedRequestsFree.next=c}return Object.defineProperty(L.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(c){this._writableState&&(this._writableState.destroyed=c)}}),L.prototype.destroy=x.destroy,L.prototype._undestroy=x.undestroy,L.prototype._destroy=function(c,v){this.end(),v(c)},Af}var Bf,Ca;function li(){if(Ca)return Bf;Ca=1;var h=Jn,n=Object.keys||function(x){var I=[];for(var k in x)I.push(k);return I};Bf=S;var s=Object.create(we);s.inherits=Jt;var o=ro(),m=eo();s.inherits(S,o);for(var f=n(m.prototype),g=0;g<f.length;g++){var y=f[g];S.prototype[y]||(S.prototype[y]=m.prototype[y])}function S(x){if(!(this instanceof S))return new S(x);o.call(this,x),m.call(this,x),x&&x.readable===!1&&(this.readable=!1),x&&x.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,x&&x.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",B)}Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function B(){this.allowHalfOpen||this._writableState.ended||h.nextTick(M,this)}function M(x){x.end()}return Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(x){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=x,this._writableState.destroyed=x)}}),S.prototype._destroy=function(x,I){this.push(null),this.end(),h.nextTick(I,x)},Bf}var Ef,Fa;function ro(){if(Fa)return Ef;Fa=1;var h=Jn;Ef=$;var n=fv,s;$.ReadableState=z,De.EventEmitter;var o=function(R,P){return R.listeners(P).length},m=Qs,f=D0.Buffer,g=(typeof Gt!="undefined"?Gt:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function y(R){return f.from(R)}function S(R){return f.isBuffer(R)||R instanceof g}var B=Object.create(we);B.inherits=Jt;var M=De,x=void 0;M&&M.debuglog?x=M.debuglog("stream"):x=function(){};var I=wv(),k=to,D;B.inherits($,m);var L=["error","close","destroy","pause","resume"];function W(R,P,N){if(typeof R.prependListener=="function")return R.prependListener(P,N);!R._events||!R._events[P]?R.on(P,N):n(R._events[P])?R._events[P].unshift(N):R._events[P]=[N,R._events[P]]}function z(R,P){s=s||li(),R=R||{};var N=P instanceof s;this.objectMode=!!R.objectMode,N&&(this.objectMode=this.objectMode||!!R.readableObjectMode);var K=R.highWaterMark,kt=R.readableHighWaterMark,Z=this.objectMode?16:16*1024;K||K===0?this.highWaterMark=K:N&&(kt||kt===0)?this.highWaterMark=kt:this.highWaterMark=Z,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new I,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(D||(D=xn.StringDecoder),this.decoder=new D(R.encoding),this.encoding=R.encoding)}function $(R){if(s=s||li(),!(this instanceof $))return new $(R);this._readableState=new z(R,this),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),m.call(this)}Object.defineProperty($.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),$.prototype.destroy=k.destroy,$.prototype._undestroy=k.undestroy,$.prototype._destroy=function(R,P){this.push(null),P(R)},$.prototype.push=function(R,P){var N=this._readableState,K;return N.objectMode?K=!0:typeof R=="string"&&(P=P||N.defaultEncoding,P!==N.encoding&&(R=f.from(R,P),P=""),K=!0),lt(this,R,P,!1,K)},$.prototype.unshift=function(R){return lt(this,R,null,!0,!1)};function lt(R,P,N,K,kt){var Z=R._readableState;if(P===null)Z.reading=!1,It(R,Z);else{var J;kt||(J=At(Z,P)),J?R.emit("error",J):Z.objectMode||P&&P.length>0?(typeof P!="string"&&!Z.objectMode&&Object.getPrototypeOf(P)!==f.prototype&&(P=y(P)),K?Z.endEmitted?R.emit("error",new Error("stream.unshift() after end event")):H(R,Z,P,!0):Z.ended?R.emit("error",new Error("stream.push() after EOF")):(Z.reading=!1,Z.decoder&&!N?(P=Z.decoder.write(P),Z.objectMode||P.length!==0?H(R,Z,P,!1):r(R,Z)):H(R,Z,P,!1))):K||(Z.reading=!1)}return Bt(Z)}function H(R,P,N,K){P.flowing&&P.length===0&&!P.sync?(R.emit("data",N),R.read(0)):(P.length+=P.objectMode?1:N.length,K?P.buffer.unshift(N):P.buffer.push(N),P.needReadable&&p(R)),r(R,P)}function At(R,P){var N;return!S(P)&&typeof P!="string"&&P!==void 0&&!R.objectMode&&(N=new TypeError("Invalid non-string/buffer chunk")),N}function Bt(R){return!R.ended&&(R.needReadable||R.length<R.highWaterMark||R.length===0)}$.prototype.isPaused=function(){return this._readableState.flowing===!1},$.prototype.setEncoding=function(R){return D||(D=xn.StringDecoder),this._readableState.decoder=new D(R),this._readableState.encoding=R,this};var Ct=8388608;function Et(R){return R>=Ct?R=Ct:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function Y(R,P){return R<=0||P.length===0&&P.ended?0:P.objectMode?1:R!==R?P.flowing&&P.length?P.buffer.head.data.length:P.length:(R>P.highWaterMark&&(P.highWaterMark=Et(R)),R<=P.length?R:P.ended?P.length:(P.needReadable=!0,0))}$.prototype.read=function(R){x("read",R),R=parseInt(R,10);var P=this._readableState,N=R;if(R!==0&&(P.emittedReadable=!1),R===0&&P.needReadable&&(P.length>=P.highWaterMark||P.ended))return x("read: emitReadable",P.length,P.ended),P.length===0&&P.ended?C(this):p(this),null;if(R=Y(R,P),R===0&&P.ended)return P.length===0&&C(this),null;var K=P.needReadable;x("need readable",K),(P.length===0||P.length-R<P.highWaterMark)&&(K=!0,x("length less than watermark",K)),P.ended||P.reading?(K=!1,x("reading or ended",K)):K&&(x("do read"),P.reading=!0,P.sync=!0,P.length===0&&(P.needReadable=!0),this._read(P.highWaterMark),P.sync=!1,P.reading||(R=Y(N,P)));var kt;return R>0?kt=e(R,P):kt=null,kt===null?(P.needReadable=!0,R=0):P.length-=R,P.length===0&&(P.ended||(P.needReadable=!0),N!==R&&P.ended&&C(this)),kt!==null&&this.emit("data",kt),kt};function It(R,P){if(!P.ended){if(P.decoder){var N=P.decoder.end();N&&N.length&&(P.buffer.push(N),P.length+=P.objectMode?1:N.length)}P.ended=!0,p(R)}}function p(R){var P=R._readableState;P.needReadable=!1,P.emittedReadable||(x("emitReadable",P.flowing),P.emittedReadable=!0,P.sync?h.nextTick(t,R):t(R))}function t(R){x("emit readable"),R.emit("readable"),u(R)}function r(R,P){P.readingMore||(P.readingMore=!0,h.nextTick(i,R,P))}function i(R,P){for(var N=P.length;!P.reading&&!P.flowing&&!P.ended&&P.length<P.highWaterMark&&(x("maybeReadMore read 0"),R.read(0),N!==P.length);)N=P.length;P.readingMore=!1}$.prototype._read=function(R){this.emit("error",new Error("_read() is not implemented"))},$.prototype.pipe=function(R,P){var N=this,K=this._readableState;switch(K.pipesCount){case 0:K.pipes=R;break;case 1:K.pipes=[K.pipes,R];break;default:K.pipes.push(R);break}K.pipesCount+=1,x("pipe count=%d opts=%j",K.pipesCount,P);var kt=(!P||P.end!==!1)&&R!==ye.stdout&&R!==ye.stderr,Z=kt?Ft:qt;K.endEmitted?h.nextTick(Z):N.once("end",Z),R.on("unpipe",J);function J(Q,ct){x("onunpipe"),Q===N&&ct&&ct.hasUnpiped===!1&&(ct.hasUnpiped=!0,Dt())}function Ft(){x("onend"),R.end()}var tt=a(N);R.on("drain",tt);var vt=!1;function Dt(){x("cleanup"),R.removeListener("close",j),R.removeListener("finish",dt),R.removeListener("drain",tt),R.removeListener("error",Pt),R.removeListener("unpipe",J),N.removeListener("end",Ft),N.removeListener("end",qt),N.removeListener("data",pt),vt=!0,K.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&tt()}var et=!1;N.on("data",pt);function pt(Q){x("ondata"),et=!1;var ct=R.write(Q);ct===!1&&!et&&((K.pipesCount===1&&K.pipes===R||K.pipesCount>1&&O(K.pipes,R)!==-1)&&!vt&&(x("false write response, pause",K.awaitDrain),K.awaitDrain++,et=!0),N.pause())}function Pt(Q){x("onerror",Q),qt(),R.removeListener("error",Pt),o(R,"error")===0&&R.emit("error",Q)}W(R,"error",Pt);function j(){R.removeListener("finish",dt),qt()}R.once("close",j);function dt(){x("onfinish"),R.removeListener("close",j),qt()}R.once("finish",dt);function qt(){x("unpipe"),N.unpipe(R)}return R.emit("pipe",N),K.flowing||(x("pipe resume"),N.resume()),R};function a(R){return function(){var P=R._readableState;x("pipeOnDrain",P.awaitDrain),P.awaitDrain&&P.awaitDrain--,P.awaitDrain===0&&o(R,"data")&&(P.flowing=!0,u(R))}}$.prototype.unpipe=function(R){var P=this._readableState,N={hasUnpiped:!1};if(P.pipesCount===0)return this;if(P.pipesCount===1)return R&&R!==P.pipes?this:(R||(R=P.pipes),P.pipes=null,P.pipesCount=0,P.flowing=!1,R&&R.emit("unpipe",this,N),this);if(!R){var K=P.pipes,kt=P.pipesCount;P.pipes=null,P.pipesCount=0,P.flowing=!1;for(var Z=0;Z<kt;Z++)K[Z].emit("unpipe",this,{hasUnpiped:!1});return this}var J=O(P.pipes,R);return J===-1?this:(P.pipes.splice(J,1),P.pipesCount-=1,P.pipesCount===1&&(P.pipes=P.pipes[0]),R.emit("unpipe",this,N),this)},$.prototype.on=function(R,P){var N=m.prototype.on.call(this,R,P);if(R==="data")this._readableState.flowing!==!1&&this.resume();else if(R==="readable"){var K=this._readableState;!K.endEmitted&&!K.readableListening&&(K.readableListening=K.needReadable=!0,K.emittedReadable=!1,K.reading?K.length&&p(this):h.nextTick(d,this))}return N},$.prototype.addListener=$.prototype.on;function d(R){x("readable nexttick read 0"),R.read(0)}$.prototype.resume=function(){var R=this._readableState;return R.flowing||(x("resume"),R.flowing=!0,c(this,R)),this};function c(R,P){P.resumeScheduled||(P.resumeScheduled=!0,h.nextTick(v,R,P))}function v(R,P){P.reading||(x("resume read 0"),R.read(0)),P.resumeScheduled=!1,P.awaitDrain=0,R.emit("resume"),u(R),P.flowing&&!P.reading&&R.read(0)}$.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function u(R){var P=R._readableState;for(x("flow",P.flowing);P.flowing&&R.read()!==null;);}$.prototype.wrap=function(R){var P=this,N=this._readableState,K=!1;R.on("end",function(){if(x("wrapped end"),N.decoder&&!N.ended){var J=N.decoder.end();J&&J.length&&P.push(J)}P.push(null)}),R.on("data",function(J){if(x("wrapped data"),N.decoder&&(J=N.decoder.write(J)),!(N.objectMode&&J==null)&&!(!N.objectMode&&(!J||!J.length))){var Ft=P.push(J);Ft||(K=!0,R.pause())}});for(var kt in R)this[kt]===void 0&&typeof R[kt]=="function"&&(this[kt]=function(J){return function(){return R[J].apply(R,arguments)}}(kt));for(var Z=0;Z<L.length;Z++)R.on(L[Z],this.emit.bind(this,L[Z]));return this._read=function(J){x("wrapped _read",J),K&&(K=!1,R.resume())},this},Object.defineProperty($.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),$._fromList=e;function e(R,P){if(P.length===0)return null;var N;return P.objectMode?N=P.buffer.shift():!R||R>=P.length?(P.decoder?N=P.buffer.join(""):P.buffer.length===1?N=P.buffer.head.data:N=P.buffer.concat(P.length),P.buffer.clear()):N=l(R,P.buffer,P.decoder),N}function l(R,P,N){var K;return R<P.head.data.length?(K=P.head.data.slice(0,R),P.head.data=P.head.data.slice(R)):R===P.head.data.length?K=P.shift():K=N?b(R,P):_(R,P),K}function b(R,P){var N=P.head,K=1,kt=N.data;for(R-=kt.length;N=N.next;){var Z=N.data,J=R>Z.length?Z.length:R;if(J===Z.length?kt+=Z:kt+=Z.slice(0,R),R-=J,R===0){J===Z.length?(++K,N.next?P.head=N.next:P.head=P.tail=null):(P.head=N,N.data=Z.slice(J));break}++K}return P.length-=K,kt}function _(R,P){var N=f.allocUnsafe(R),K=P.head,kt=1;for(K.data.copy(N),R-=K.data.length;K=K.next;){var Z=K.data,J=R>Z.length?Z.length:R;if(Z.copy(N,N.length-R,0,J),R-=J,R===0){J===Z.length?(++kt,K.next?P.head=K.next:P.head=P.tail=null):(P.head=K,K.data=Z.slice(J));break}++kt}return P.length-=kt,N}function C(R){var P=R._readableState;if(P.length>0)throw new Error('"endReadable()" called on non-empty stream');P.endEmitted||(P.ended=!0,h.nextTick(q,P,R))}function q(R,P){!R.endEmitted&&R.length===0&&(R.endEmitted=!0,P.readable=!1,P.emit("end"))}function O(R,P){for(var N=0,K=R.length;N<K;N++)if(R[N]===P)return N;return-1}return Ef}var io=Br,Xn=li(),no=Object.create(we);no.inherits=Jt;no.inherits(Br,Xn);function Av(h,n){var s=this._transformState;s.transforming=!1;var o=s.writecb;if(!o)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,n!=null&&this.push(n),o(h);var m=this._readableState;m.reading=!1,(m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}function Br(h){if(!(this instanceof Br))return new Br(h);Xn.call(this,h),this._transformState={afterTransform:Av.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",Bv)}function Bv(){var h=this;typeof this._flush=="function"?this._flush(function(n,s){qa(h,n,s)}):qa(this,null,null)}Br.prototype.push=function(h,n){return this._transformState.needTransform=!1,Xn.prototype.push.call(this,h,n)};Br.prototype._transform=function(h,n,s){throw new Error("_transform() is not implemented")};Br.prototype._write=function(h,n,s){var o=this._transformState;if(o.writecb=s,o.writechunk=h,o.writeencoding=n,!o.transforming){var m=this._readableState;(o.needTransform||m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}};Br.prototype._read=function(h){var n=this._transformState;n.writechunk!==null&&n.writecb&&!n.transforming?(n.transforming=!0,this._transform(n.writechunk,n.writeencoding,n.afterTransform)):n.needTransform=!0};Br.prototype._destroy=function(h,n){var s=this;Xn.prototype._destroy.call(this,h,function(o){n(o),s.emit("close")})};function qa(h,n,s){if(n)return h.emit("error",n);if(s!=null&&h.push(s),h._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(h._transformState.transforming)throw new Error("Calling transform done when still transforming");return h.push(null)}var Ev=Ki,fo=io,ao=Object.create(we);ao.inherits=Jt;ao.inherits(Ki,fo);function Ki(h){if(!(this instanceof Ki))return new Ki(h);fo.call(this,h)}Ki.prototype._transform=function(h,n,s){s(null,h)};(function(h,n){n=h.exports=ro(),n.Stream=n,n.Readable=n,n.Writable=eo(),n.Duplex=li(),n.Transform=io,n.PassThrough=Ev})(h0,h0.exports);var kv=h0.exports,Ci={exports:{}},N0={exports:{}};N0.exports;(function(h){(function(n,s){function o(r,i){if(!r)throw new Error(i||"Assertion failed")}function m(r,i){r.super_=i;var a=function(){};a.prototype=i.prototype,r.prototype=new a,r.prototype.constructor=r}function f(r,i,a){if(f.isBN(r))return r;this.negative=0,this.words=null,this.length=0,this.red=null,r!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(r||0,i||10,a||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(r){}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,a){return i.cmp(a)>0?i:a},f.min=function(i,a){return i.cmp(a)<0?i:a},f.prototype._init=function(i,a,d){if(typeof i=="number")return this._initNumber(i,a,d);if(typeof i=="object")return this._initArray(i,a,d);a==="hex"&&(a=16),o(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\s+/g,"");var c=0;i[0]==="-"&&(c++,this.negative=1),c<i.length&&(a===16?this._parseHex(i,c,d):(this._parseBase(i,a,c),d==="le"&&this._initArray(this.toArray(),a,d)))},f.prototype._initNumber=function(i,a,d){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(o(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),a,d)},f.prototype._initArray=function(i,a,d){if(o(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var v,u,e=0;if(d==="be")for(c=i.length-1,v=0;c>=0;c-=3)u=i[c]|i[c-1]<<8|i[c-2]<<16,this.words[v]|=u<<e&67108863,this.words[v+1]=u>>>26-e&67108863,e+=24,e>=26&&(e-=26,v++);else if(d==="le")for(c=0,v=0;c<i.length;c+=3)u=i[c]|i[c+1]<<8|i[c+2]<<16,this.words[v]|=u<<e&67108863,this.words[v+1]=u>>>26-e&67108863,e+=24,e>=26&&(e-=26,v++);return this._strip()};function y(r,i){var a=r.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;o(!1,"Invalid character in "+r)}function S(r,i,a){var d=y(r,a);return a-1>=i&&(d|=y(r,a-1)<<4),d}f.prototype._parseHex=function(i,a,d){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var v=0,u=0,e;if(d==="be")for(c=i.length-1;c>=a;c-=2)e=S(i,a,c)<<v,this.words[u]|=e&67108863,v>=18?(v-=18,u+=1,this.words[u]|=e>>>26):v+=8;else{var l=i.length-a;for(c=l%2===0?a+1:a;c<i.length;c+=2)e=S(i,a,c)<<v,this.words[u]|=e&67108863,v>=18?(v-=18,u+=1,this.words[u]|=e>>>26):v+=8}this._strip()};function B(r,i,a,d){for(var c=0,v=0,u=Math.min(r.length,a),e=i;e<u;e++){var l=r.charCodeAt(e)-48;c*=d,l>=49?v=l-49+10:l>=17?v=l-17+10:v=l,o(l>=0&&v<d,"Invalid character"),c+=v}return c}f.prototype._parseBase=function(i,a,d){this.words=[0],this.length=1;for(var c=0,v=1;v<=67108863;v*=a)c++;c--,v=v/a|0;for(var u=i.length-d,e=u%c,l=Math.min(u,u-e)+d,b=0,_=d;_<l;_+=c)b=B(i,_,_+c,a),this.imuln(v),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(e!==0){var C=1;for(b=B(i,_,i.length,a),_=0;_<e;_++)C*=a;this.imuln(C),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var a=0;a<this.length;a++)i.words[a]=this.words[a];i.length=this.length,i.negative=this.negative,i.red=this.red};function M(r,i){r.words=i.words,r.length=i.length,r.negative=i.negative,r.red=i.red}if(f.prototype._move=function(i){M(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=x}catch(r){f.prototype.inspect=x}else f.prototype.inspect=x;function x(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var I=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],k=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],D=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(i,a){i=i||10,a=a|0||1;var d;if(i===16||i==="hex"){d="";for(var c=0,v=0,u=0;u<this.length;u++){var e=this.words[u],l=((e<<c|v)&16777215).toString(16);v=e>>>24-c&16777215,c+=2,c>=26&&(c-=26,u--),v!==0||u!==this.length-1?d=I[6-l.length]+l+d:d=l+d}for(v!==0&&(d=v.toString(16)+d);d.length%a!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(i===(i|0)&&i>=2&&i<=36){var b=k[i],_=D[i];d="";var C=this.clone();for(C.negative=0;!C.isZero();){var q=C.modrn(_).toString(i);C=C.idivn(_),C.isZero()?d=q+d:d=I[b-q.length]+q+d}for(this.isZero()&&(d="0"+d);d.length%a!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},g&&(f.prototype.toBuffer=function(i,a){return this.toArrayLike(g,i,a)}),f.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var L=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};f.prototype.toArrayLike=function(i,a,d){this._strip();var c=this.byteLength(),v=d||Math.max(1,c);o(c<=v,"byte array longer than desired length"),o(v>0,"Requested array length <= 0");var u=L(i,v),e=a==="le"?"LE":"BE";return this["_toArrayLike"+e](u,c),u},f.prototype._toArrayLikeLE=function(i,a){for(var d=0,c=0,v=0,u=0;v<this.length;v++){var e=this.words[v]<<u|c;i[d++]=e&255,d<i.length&&(i[d++]=e>>8&255),d<i.length&&(i[d++]=e>>16&255),u===6?(d<i.length&&(i[d++]=e>>24&255),c=0,u=0):(c=e>>>24,u+=2)}if(d<i.length)for(i[d++]=c;d<i.length;)i[d++]=0},f.prototype._toArrayLikeBE=function(i,a){for(var d=i.length-1,c=0,v=0,u=0;v<this.length;v++){var e=this.words[v]<<u|c;i[d--]=e&255,d>=0&&(i[d--]=e>>8&255),d>=0&&(i[d--]=e>>16&255),u===6?(d>=0&&(i[d--]=e>>24&255),c=0,u=0):(c=e>>>24,u+=2)}if(d>=0)for(i[d--]=c;d>=0;)i[d--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var a=i,d=0;return a>=4096&&(d+=13,a>>>=13),a>=64&&(d+=7,a>>>=7),a>=8&&(d+=4,a>>>=4),a>=2&&(d+=2,a>>>=2),d+a},f.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,d=0;return a&8191||(d+=13,a>>>=13),a&127||(d+=7,a>>>=7),a&15||(d+=4,a>>>=4),a&3||(d+=2,a>>>=2),a&1||d++,d},f.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function W(r){for(var i=new Array(r.bitLength()),a=0;a<i.length;a++){var d=a/26|0,c=a%26;i[a]=r.words[d]>>>c&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;a<this.length;a++){var d=this._zeroBits(this.words[a]);if(i+=d,d!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var a=0;a<i.length;a++)this.words[a]=this.words[a]|i.words[a];return this._strip()},f.prototype.ior=function(i){return o((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var d=0;d<a.length;d++)this.words[d]=this.words[d]&i.words[d];return this.length=a.length,this._strip()},f.prototype.iand=function(i){return o((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var a,d;this.length>i.length?(a=this,d=i):(a=i,d=this);for(var c=0;c<d.length;c++)this.words[c]=a.words[c]^d.words[c];if(this!==a)for(;c<a.length;c++)this.words[c]=a.words[c];return this.length=a.length,this._strip()},f.prototype.ixor=function(i){return o((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){o(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,d=i%26;this._expand(a),d>0&&a--;for(var c=0;c<a;c++)this.words[c]=~this.words[c]&67108863;return d>0&&(this.words[c]=~this.words[c]&67108863>>26-d),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,a){o(typeof i=="number"&&i>=0);var d=i/26|0,c=i%26;return this._expand(d+1),a?this.words[d]=this.words[d]|1<<c:this.words[d]=this.words[d]&~(1<<c),this._strip()},f.prototype.iadd=function(i){var a;if(this.negative!==0&&i.negative===0)return this.negative=0,a=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,a=this.isub(i),i.negative=1,a._normSign();var d,c;this.length>i.length?(d=this,c=i):(d=i,c=this);for(var v=0,u=0;u<c.length;u++)a=(d.words[u]|0)+(c.words[u]|0)+v,this.words[u]=a&67108863,v=a>>>26;for(;v!==0&&u<d.length;u++)a=(d.words[u]|0)+v,this.words[u]=a&67108863,v=a>>>26;if(this.length=d.length,v!==0)this.words[this.length]=v,this.length++;else if(d!==this)for(;u<d.length;u++)this.words[u]=d.words[u];return this},f.prototype.add=function(i){var a;return i.negative!==0&&this.negative===0?(i.negative=0,a=this.sub(i),i.negative^=1,a):i.negative===0&&this.negative!==0?(this.negative=0,a=i.sub(this),this.negative=1,a):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var d=this.cmp(i);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,v;d>0?(c=this,v=i):(c=i,v=this);for(var u=0,e=0;e<v.length;e++)a=(c.words[e]|0)-(v.words[e]|0)+u,u=a>>26,this.words[e]=a&67108863;for(;u!==0&&e<c.length;e++)a=(c.words[e]|0)+u,u=a>>26,this.words[e]=a&67108863;if(u===0&&e<c.length&&c!==this)for(;e<c.length;e++)this.words[e]=c.words[e];return this.length=Math.max(this.length,e),c!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function z(r,i,a){a.negative=i.negative^r.negative;var d=r.length+i.length|0;a.length=d,d=d-1|0;var c=r.words[0]|0,v=i.words[0]|0,u=c*v,e=u&67108863,l=u/67108864|0;a.words[0]=e;for(var b=1;b<d;b++){for(var _=l>>>26,C=l&67108863,q=Math.min(b,i.length-1),O=Math.max(0,b-r.length+1);O<=q;O++){var R=b-O|0;c=r.words[R]|0,v=i.words[O]|0,u=c*v+C,_+=u/67108864|0,C=u&67108863}a.words[b]=C|0,l=_|0}return l!==0?a.words[b]=l|0:a.length--,a._strip()}var $=function(i,a,d){var c=i.words,v=a.words,u=d.words,e=0,l,b,_,C=c[0]|0,q=C&8191,O=C>>>13,R=c[1]|0,P=R&8191,N=R>>>13,K=c[2]|0,kt=K&8191,Z=K>>>13,J=c[3]|0,Ft=J&8191,tt=J>>>13,vt=c[4]|0,Dt=vt&8191,et=vt>>>13,pt=c[5]|0,Pt=pt&8191,j=pt>>>13,dt=c[6]|0,qt=dt&8191,Q=dt>>>13,ct=c[7]|0,Lt=ct&8191,E=ct>>>13,w=c[8]|0,A=w&8191,T=w>>>13,F=c[9]|0,V=F&8191,U=F>>>13,X=v[0]|0,Tt=X&8191,G=X>>>13,rt=v[1]|0,Rt=rt&8191,it=rt>>>13,gt=v[2]|0,zt=gt&8191,nt=gt>>>13,bt=v[3]|0,Kt=bt&8191,ft=bt>>>13,yt=v[4]|0,Ht=yt&8191,at=yt>>>13,wt=v[5]|0,Zt=wt&8191,ht=wt>>>13,Mt=v[6]|0,Wt=Mt&8191,st=Mt>>>13,xt=v[7]|0,Vt=xt&8191,ot=xt>>>13,_t=v[8]|0,Yt=_t&8191,ut=_t>>>13,St=v[9]|0,Nt=St&8191,$t=St>>>13;d.negative=i.negative^a.negative,d.length=19,l=Math.imul(q,Tt),b=Math.imul(q,G),b=b+Math.imul(O,Tt)|0,_=Math.imul(O,G);var jt=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul(P,Tt),b=Math.imul(P,G),b=b+Math.imul(N,Tt)|0,_=Math.imul(N,G),l=l+Math.imul(q,Rt)|0,b=b+Math.imul(q,it)|0,b=b+Math.imul(O,Rt)|0,_=_+Math.imul(O,it)|0;var Qt=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(kt,Tt),b=Math.imul(kt,G),b=b+Math.imul(Z,Tt)|0,_=Math.imul(Z,G),l=l+Math.imul(P,Rt)|0,b=b+Math.imul(P,it)|0,b=b+Math.imul(N,Rt)|0,_=_+Math.imul(N,it)|0,l=l+Math.imul(q,zt)|0,b=b+Math.imul(q,nt)|0,b=b+Math.imul(O,zt)|0,_=_+Math.imul(O,nt)|0;var te=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(Ft,Tt),b=Math.imul(Ft,G),b=b+Math.imul(tt,Tt)|0,_=Math.imul(tt,G),l=l+Math.imul(kt,Rt)|0,b=b+Math.imul(kt,it)|0,b=b+Math.imul(Z,Rt)|0,_=_+Math.imul(Z,it)|0,l=l+Math.imul(P,zt)|0,b=b+Math.imul(P,nt)|0,b=b+Math.imul(N,zt)|0,_=_+Math.imul(N,nt)|0,l=l+Math.imul(q,Kt)|0,b=b+Math.imul(q,ft)|0,b=b+Math.imul(O,Kt)|0,_=_+Math.imul(O,ft)|0;var ee=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(Dt,Tt),b=Math.imul(Dt,G),b=b+Math.imul(et,Tt)|0,_=Math.imul(et,G),l=l+Math.imul(Ft,Rt)|0,b=b+Math.imul(Ft,it)|0,b=b+Math.imul(tt,Rt)|0,_=_+Math.imul(tt,it)|0,l=l+Math.imul(kt,zt)|0,b=b+Math.imul(kt,nt)|0,b=b+Math.imul(Z,zt)|0,_=_+Math.imul(Z,nt)|0,l=l+Math.imul(P,Kt)|0,b=b+Math.imul(P,ft)|0,b=b+Math.imul(N,Kt)|0,_=_+Math.imul(N,ft)|0,l=l+Math.imul(q,Ht)|0,b=b+Math.imul(q,at)|0,b=b+Math.imul(O,Ht)|0,_=_+Math.imul(O,at)|0;var re=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(Pt,Tt),b=Math.imul(Pt,G),b=b+Math.imul(j,Tt)|0,_=Math.imul(j,G),l=l+Math.imul(Dt,Rt)|0,b=b+Math.imul(Dt,it)|0,b=b+Math.imul(et,Rt)|0,_=_+Math.imul(et,it)|0,l=l+Math.imul(Ft,zt)|0,b=b+Math.imul(Ft,nt)|0,b=b+Math.imul(tt,zt)|0,_=_+Math.imul(tt,nt)|0,l=l+Math.imul(kt,Kt)|0,b=b+Math.imul(kt,ft)|0,b=b+Math.imul(Z,Kt)|0,_=_+Math.imul(Z,ft)|0,l=l+Math.imul(P,Ht)|0,b=b+Math.imul(P,at)|0,b=b+Math.imul(N,Ht)|0,_=_+Math.imul(N,at)|0,l=l+Math.imul(q,Zt)|0,b=b+Math.imul(q,ht)|0,b=b+Math.imul(O,Zt)|0,_=_+Math.imul(O,ht)|0;var ie=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(qt,Tt),b=Math.imul(qt,G),b=b+Math.imul(Q,Tt)|0,_=Math.imul(Q,G),l=l+Math.imul(Pt,Rt)|0,b=b+Math.imul(Pt,it)|0,b=b+Math.imul(j,Rt)|0,_=_+Math.imul(j,it)|0,l=l+Math.imul(Dt,zt)|0,b=b+Math.imul(Dt,nt)|0,b=b+Math.imul(et,zt)|0,_=_+Math.imul(et,nt)|0,l=l+Math.imul(Ft,Kt)|0,b=b+Math.imul(Ft,ft)|0,b=b+Math.imul(tt,Kt)|0,_=_+Math.imul(tt,ft)|0,l=l+Math.imul(kt,Ht)|0,b=b+Math.imul(kt,at)|0,b=b+Math.imul(Z,Ht)|0,_=_+Math.imul(Z,at)|0,l=l+Math.imul(P,Zt)|0,b=b+Math.imul(P,ht)|0,b=b+Math.imul(N,Zt)|0,_=_+Math.imul(N,ht)|0,l=l+Math.imul(q,Wt)|0,b=b+Math.imul(q,st)|0,b=b+Math.imul(O,Wt)|0,_=_+Math.imul(O,st)|0;var ne=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(Lt,Tt),b=Math.imul(Lt,G),b=b+Math.imul(E,Tt)|0,_=Math.imul(E,G),l=l+Math.imul(qt,Rt)|0,b=b+Math.imul(qt,it)|0,b=b+Math.imul(Q,Rt)|0,_=_+Math.imul(Q,it)|0,l=l+Math.imul(Pt,zt)|0,b=b+Math.imul(Pt,nt)|0,b=b+Math.imul(j,zt)|0,_=_+Math.imul(j,nt)|0,l=l+Math.imul(Dt,Kt)|0,b=b+Math.imul(Dt,ft)|0,b=b+Math.imul(et,Kt)|0,_=_+Math.imul(et,ft)|0,l=l+Math.imul(Ft,Ht)|0,b=b+Math.imul(Ft,at)|0,b=b+Math.imul(tt,Ht)|0,_=_+Math.imul(tt,at)|0,l=l+Math.imul(kt,Zt)|0,b=b+Math.imul(kt,ht)|0,b=b+Math.imul(Z,Zt)|0,_=_+Math.imul(Z,ht)|0,l=l+Math.imul(P,Wt)|0,b=b+Math.imul(P,st)|0,b=b+Math.imul(N,Wt)|0,_=_+Math.imul(N,st)|0,l=l+Math.imul(q,Vt)|0,b=b+Math.imul(q,ot)|0,b=b+Math.imul(O,Vt)|0,_=_+Math.imul(O,ot)|0;var fe=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(A,Tt),b=Math.imul(A,G),b=b+Math.imul(T,Tt)|0,_=Math.imul(T,G),l=l+Math.imul(Lt,Rt)|0,b=b+Math.imul(Lt,it)|0,b=b+Math.imul(E,Rt)|0,_=_+Math.imul(E,it)|0,l=l+Math.imul(qt,zt)|0,b=b+Math.imul(qt,nt)|0,b=b+Math.imul(Q,zt)|0,_=_+Math.imul(Q,nt)|0,l=l+Math.imul(Pt,Kt)|0,b=b+Math.imul(Pt,ft)|0,b=b+Math.imul(j,Kt)|0,_=_+Math.imul(j,ft)|0,l=l+Math.imul(Dt,Ht)|0,b=b+Math.imul(Dt,at)|0,b=b+Math.imul(et,Ht)|0,_=_+Math.imul(et,at)|0,l=l+Math.imul(Ft,Zt)|0,b=b+Math.imul(Ft,ht)|0,b=b+Math.imul(tt,Zt)|0,_=_+Math.imul(tt,ht)|0,l=l+Math.imul(kt,Wt)|0,b=b+Math.imul(kt,st)|0,b=b+Math.imul(Z,Wt)|0,_=_+Math.imul(Z,st)|0,l=l+Math.imul(P,Vt)|0,b=b+Math.imul(P,ot)|0,b=b+Math.imul(N,Vt)|0,_=_+Math.imul(N,ot)|0,l=l+Math.imul(q,Yt)|0,b=b+Math.imul(q,ut)|0,b=b+Math.imul(O,Yt)|0,_=_+Math.imul(O,ut)|0;var ae=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(V,Tt),b=Math.imul(V,G),b=b+Math.imul(U,Tt)|0,_=Math.imul(U,G),l=l+Math.imul(A,Rt)|0,b=b+Math.imul(A,it)|0,b=b+Math.imul(T,Rt)|0,_=_+Math.imul(T,it)|0,l=l+Math.imul(Lt,zt)|0,b=b+Math.imul(Lt,nt)|0,b=b+Math.imul(E,zt)|0,_=_+Math.imul(E,nt)|0,l=l+Math.imul(qt,Kt)|0,b=b+Math.imul(qt,ft)|0,b=b+Math.imul(Q,Kt)|0,_=_+Math.imul(Q,ft)|0,l=l+Math.imul(Pt,Ht)|0,b=b+Math.imul(Pt,at)|0,b=b+Math.imul(j,Ht)|0,_=_+Math.imul(j,at)|0,l=l+Math.imul(Dt,Zt)|0,b=b+Math.imul(Dt,ht)|0,b=b+Math.imul(et,Zt)|0,_=_+Math.imul(et,ht)|0,l=l+Math.imul(Ft,Wt)|0,b=b+Math.imul(Ft,st)|0,b=b+Math.imul(tt,Wt)|0,_=_+Math.imul(tt,st)|0,l=l+Math.imul(kt,Vt)|0,b=b+Math.imul(kt,ot)|0,b=b+Math.imul(Z,Vt)|0,_=_+Math.imul(Z,ot)|0,l=l+Math.imul(P,Yt)|0,b=b+Math.imul(P,ut)|0,b=b+Math.imul(N,Yt)|0,_=_+Math.imul(N,ut)|0,l=l+Math.imul(q,Nt)|0,b=b+Math.imul(q,$t)|0,b=b+Math.imul(O,Nt)|0,_=_+Math.imul(O,$t)|0;var he=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(he>>>26)|0,he&=67108863,l=Math.imul(V,Rt),b=Math.imul(V,it),b=b+Math.imul(U,Rt)|0,_=Math.imul(U,it),l=l+Math.imul(A,zt)|0,b=b+Math.imul(A,nt)|0,b=b+Math.imul(T,zt)|0,_=_+Math.imul(T,nt)|0,l=l+Math.imul(Lt,Kt)|0,b=b+Math.imul(Lt,ft)|0,b=b+Math.imul(E,Kt)|0,_=_+Math.imul(E,ft)|0,l=l+Math.imul(qt,Ht)|0,b=b+Math.imul(qt,at)|0,b=b+Math.imul(Q,Ht)|0,_=_+Math.imul(Q,at)|0,l=l+Math.imul(Pt,Zt)|0,b=b+Math.imul(Pt,ht)|0,b=b+Math.imul(j,Zt)|0,_=_+Math.imul(j,ht)|0,l=l+Math.imul(Dt,Wt)|0,b=b+Math.imul(Dt,st)|0,b=b+Math.imul(et,Wt)|0,_=_+Math.imul(et,st)|0,l=l+Math.imul(Ft,Vt)|0,b=b+Math.imul(Ft,ot)|0,b=b+Math.imul(tt,Vt)|0,_=_+Math.imul(tt,ot)|0,l=l+Math.imul(kt,Yt)|0,b=b+Math.imul(kt,ut)|0,b=b+Math.imul(Z,Yt)|0,_=_+Math.imul(Z,ut)|0,l=l+Math.imul(P,Nt)|0,b=b+Math.imul(P,$t)|0,b=b+Math.imul(N,Nt)|0,_=_+Math.imul(N,$t)|0;var se=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(se>>>26)|0,se&=67108863,l=Math.imul(V,zt),b=Math.imul(V,nt),b=b+Math.imul(U,zt)|0,_=Math.imul(U,nt),l=l+Math.imul(A,Kt)|0,b=b+Math.imul(A,ft)|0,b=b+Math.imul(T,Kt)|0,_=_+Math.imul(T,ft)|0,l=l+Math.imul(Lt,Ht)|0,b=b+Math.imul(Lt,at)|0,b=b+Math.imul(E,Ht)|0,_=_+Math.imul(E,at)|0,l=l+Math.imul(qt,Zt)|0,b=b+Math.imul(qt,ht)|0,b=b+Math.imul(Q,Zt)|0,_=_+Math.imul(Q,ht)|0,l=l+Math.imul(Pt,Wt)|0,b=b+Math.imul(Pt,st)|0,b=b+Math.imul(j,Wt)|0,_=_+Math.imul(j,st)|0,l=l+Math.imul(Dt,Vt)|0,b=b+Math.imul(Dt,ot)|0,b=b+Math.imul(et,Vt)|0,_=_+Math.imul(et,ot)|0,l=l+Math.imul(Ft,Yt)|0,b=b+Math.imul(Ft,ut)|0,b=b+Math.imul(tt,Yt)|0,_=_+Math.imul(tt,ut)|0,l=l+Math.imul(kt,Nt)|0,b=b+Math.imul(kt,$t)|0,b=b+Math.imul(Z,Nt)|0,_=_+Math.imul(Z,$t)|0;var oe=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(V,Kt),b=Math.imul(V,ft),b=b+Math.imul(U,Kt)|0,_=Math.imul(U,ft),l=l+Math.imul(A,Ht)|0,b=b+Math.imul(A,at)|0,b=b+Math.imul(T,Ht)|0,_=_+Math.imul(T,at)|0,l=l+Math.imul(Lt,Zt)|0,b=b+Math.imul(Lt,ht)|0,b=b+Math.imul(E,Zt)|0,_=_+Math.imul(E,ht)|0,l=l+Math.imul(qt,Wt)|0,b=b+Math.imul(qt,st)|0,b=b+Math.imul(Q,Wt)|0,_=_+Math.imul(Q,st)|0,l=l+Math.imul(Pt,Vt)|0,b=b+Math.imul(Pt,ot)|0,b=b+Math.imul(j,Vt)|0,_=_+Math.imul(j,ot)|0,l=l+Math.imul(Dt,Yt)|0,b=b+Math.imul(Dt,ut)|0,b=b+Math.imul(et,Yt)|0,_=_+Math.imul(et,ut)|0,l=l+Math.imul(Ft,Nt)|0,b=b+Math.imul(Ft,$t)|0,b=b+Math.imul(tt,Nt)|0,_=_+Math.imul(tt,$t)|0;var ue=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ue>>>26)|0,ue&=67108863,l=Math.imul(V,Ht),b=Math.imul(V,at),b=b+Math.imul(U,Ht)|0,_=Math.imul(U,at),l=l+Math.imul(A,Zt)|0,b=b+Math.imul(A,ht)|0,b=b+Math.imul(T,Zt)|0,_=_+Math.imul(T,ht)|0,l=l+Math.imul(Lt,Wt)|0,b=b+Math.imul(Lt,st)|0,b=b+Math.imul(E,Wt)|0,_=_+Math.imul(E,st)|0,l=l+Math.imul(qt,Vt)|0,b=b+Math.imul(qt,ot)|0,b=b+Math.imul(Q,Vt)|0,_=_+Math.imul(Q,ot)|0,l=l+Math.imul(Pt,Yt)|0,b=b+Math.imul(Pt,ut)|0,b=b+Math.imul(j,Yt)|0,_=_+Math.imul(j,ut)|0,l=l+Math.imul(Dt,Nt)|0,b=b+Math.imul(Dt,$t)|0,b=b+Math.imul(et,Nt)|0,_=_+Math.imul(et,$t)|0;var le=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(V,Zt),b=Math.imul(V,ht),b=b+Math.imul(U,Zt)|0,_=Math.imul(U,ht),l=l+Math.imul(A,Wt)|0,b=b+Math.imul(A,st)|0,b=b+Math.imul(T,Wt)|0,_=_+Math.imul(T,st)|0,l=l+Math.imul(Lt,Vt)|0,b=b+Math.imul(Lt,ot)|0,b=b+Math.imul(E,Vt)|0,_=_+Math.imul(E,ot)|0,l=l+Math.imul(qt,Yt)|0,b=b+Math.imul(qt,ut)|0,b=b+Math.imul(Q,Yt)|0,_=_+Math.imul(Q,ut)|0,l=l+Math.imul(Pt,Nt)|0,b=b+Math.imul(Pt,$t)|0,b=b+Math.imul(j,Nt)|0,_=_+Math.imul(j,$t)|0;var de=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(de>>>26)|0,de&=67108863,l=Math.imul(V,Wt),b=Math.imul(V,st),b=b+Math.imul(U,Wt)|0,_=Math.imul(U,st),l=l+Math.imul(A,Vt)|0,b=b+Math.imul(A,ot)|0,b=b+Math.imul(T,Vt)|0,_=_+Math.imul(T,ot)|0,l=l+Math.imul(Lt,Yt)|0,b=b+Math.imul(Lt,ut)|0,b=b+Math.imul(E,Yt)|0,_=_+Math.imul(E,ut)|0,l=l+Math.imul(qt,Nt)|0,b=b+Math.imul(qt,$t)|0,b=b+Math.imul(Q,Nt)|0,_=_+Math.imul(Q,$t)|0;var ce=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ce>>>26)|0,ce&=67108863,l=Math.imul(V,Vt),b=Math.imul(V,ot),b=b+Math.imul(U,Vt)|0,_=Math.imul(U,ot),l=l+Math.imul(A,Yt)|0,b=b+Math.imul(A,ut)|0,b=b+Math.imul(T,Yt)|0,_=_+Math.imul(T,ut)|0,l=l+Math.imul(Lt,Nt)|0,b=b+Math.imul(Lt,$t)|0,b=b+Math.imul(E,Nt)|0,_=_+Math.imul(E,$t)|0;var ve=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ve>>>26)|0,ve&=67108863,l=Math.imul(V,Yt),b=Math.imul(V,ut),b=b+Math.imul(U,Yt)|0,_=Math.imul(U,ut),l=l+Math.imul(A,Nt)|0,b=b+Math.imul(A,$t)|0,b=b+Math.imul(T,Nt)|0,_=_+Math.imul(T,$t)|0;var of=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(of>>>26)|0,of&=67108863,l=Math.imul(V,Nt),b=Math.imul(V,$t),b=b+Math.imul(U,Nt)|0,_=Math.imul(U,$t);var uf=(e+l|0)+((b&8191)<<13)|0;return e=(_+(b>>>13)|0)+(uf>>>26)|0,uf&=67108863,u[0]=jt,u[1]=Qt,u[2]=te,u[3]=ee,u[4]=re,u[5]=ie,u[6]=ne,u[7]=fe,u[8]=ae,u[9]=he,u[10]=se,u[11]=oe,u[12]=ue,u[13]=le,u[14]=de,u[15]=ce,u[16]=ve,u[17]=of,u[18]=uf,e!==0&&(u[19]=e,d.length++),d};Math.imul||($=z);function lt(r,i,a){a.negative=i.negative^r.negative,a.length=r.length+i.length;for(var d=0,c=0,v=0;v<a.length-1;v++){var u=c;c=0;for(var e=d&67108863,l=Math.min(v,i.length-1),b=Math.max(0,v-r.length+1);b<=l;b++){var _=v-b,C=r.words[_]|0,q=i.words[b]|0,O=C*q,R=O&67108863;u=u+(O/67108864|0)|0,R=R+e|0,e=R&67108863,u=u+(R>>>26)|0,c+=u>>>26,u&=67108863}a.words[v]=e,d=u,u=c}return d!==0?a.words[v]=d:a.length--,a._strip()}function H(r,i,a){return lt(r,i,a)}f.prototype.mulTo=function(i,a){var d,c=this.length+i.length;return this.length===10&&i.length===10?d=$(this,i,a):c<63?d=z(this,i,a):c<1024?d=lt(this,i,a):d=H(this,i,a),d},f.prototype.mul=function(i){var a=new f(null);return a.words=new Array(this.length+i.length),this.mulTo(i,a)},f.prototype.mulf=function(i){var a=new f(null);return a.words=new Array(this.length+i.length),H(this,i,a)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var a=i<0;a&&(i=-i),o(typeof i=="number"),o(i<67108864);for(var d=0,c=0;c<this.length;c++){var v=(this.words[c]|0)*i,u=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=u>>>26,this.words[c]=u&67108863}return d!==0&&(this.words[c]=d,this.length++),this.length=i===0?1:this.length,a?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var a=W(i);if(a.length===0)return new f(1);for(var d=this,c=0;c<a.length&&a[c]===0;c++,d=d.sqr());if(++c<a.length)for(var v=d.sqr();c<a.length;c++,v=v.sqr())a[c]!==0&&(d=d.mul(v));return d},f.prototype.iushln=function(i){o(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26,c=67108863>>>26-a<<26-a,v;if(a!==0){var u=0;for(v=0;v<this.length;v++){var e=this.words[v]&c,l=(this.words[v]|0)-e<<a;this.words[v]=l|u,u=e>>>26-a}u&&(this.words[v]=u,this.length++)}if(d!==0){for(v=this.length-1;v>=0;v--)this.words[v+d]=this.words[v];for(v=0;v<d;v++)this.words[v]=0;this.length+=d}return this._strip()},f.prototype.ishln=function(i){return o(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,a,d){o(typeof i=="number"&&i>=0);var c;a?c=(a-a%26)/26:c=0;var v=i%26,u=Math.min((i-v)/26,this.length),e=67108863^67108863>>>v<<v,l=d;if(c-=u,c=Math.max(0,c),l){for(var b=0;b<u;b++)l.words[b]=this.words[b];l.length=u}if(u!==0)if(this.length>u)for(this.length-=u,b=0;b<this.length;b++)this.words[b]=this.words[b+u];else this.words[0]=0,this.length=1;var _=0;for(b=this.length-1;b>=0&&(_!==0||b>=c);b--){var C=this.words[b]|0;this.words[b]=_<<26-v|C>>>v,_=C&e}return l&&_!==0&&(l.words[l.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,a,d){return o(this.negative===0),this.iushrn(i,a,d)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){o(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26,c=1<<a;if(this.length<=d)return!1;var v=this.words[d];return!!(v&c)},f.prototype.imaskn=function(i){o(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(a!==0&&d++,this.length=Math.min(d,this.length),a!==0){var c=67108863^67108863>>>a<<a;this.words[this.length-1]&=c}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return o(typeof i=="number"),o(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var a=0;a<this.length&&this.words[a]>=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},f.prototype.isubn=function(i){if(o(typeof i=="number"),o(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a<this.length&&this.words[a]<0;a++)this.words[a]+=67108864,this.words[a+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,a,d){var c=i.length+d,v;this._expand(c);var u,e=0;for(v=0;v<i.length;v++){u=(this.words[v+d]|0)+e;var l=(i.words[v]|0)*a;u-=l&67108863,e=(u>>26)-(l/67108864|0),this.words[v+d]=u&67108863}for(;v<this.length-d;v++)u=(this.words[v+d]|0)+e,e=u>>26,this.words[v+d]=u&67108863;if(e===0)return this._strip();for(o(e===-1),e=0,v=0;v<this.length;v++)u=-(this.words[v]|0)+e,e=u>>26,this.words[v]=u&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,a){var d=this.length-i.length,c=this.clone(),v=i,u=v.words[v.length-1]|0,e=this._countBits(u);d=26-e,d!==0&&(v=v.ushln(d),c.iushln(d),u=v.words[v.length-1]|0);var l=c.length-v.length,b;if(a!=="mod"){b=new f(null),b.length=l+1,b.words=new Array(b.length);for(var _=0;_<b.length;_++)b.words[_]=0}var C=c.clone()._ishlnsubmul(v,1,l);C.negative===0&&(c=C,b&&(b.words[l]=1));for(var q=l-1;q>=0;q--){var O=(c.words[v.length+q]|0)*67108864+(c.words[v.length+q-1]|0);for(O=Math.min(O/u|0,67108863),c._ishlnsubmul(v,O,q);c.negative!==0;)O--,c.negative=0,c._ishlnsubmul(v,1,q),c.isZero()||(c.negative^=1);b&&(b.words[q]=O)}return b&&b._strip(),c._strip(),a!=="div"&&d!==0&&c.iushrn(d),{div:b||null,mod:c}},f.prototype.divmod=function(i,a,d){if(o(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var c,v,u;return this.negative!==0&&i.negative===0?(u=this.neg().divmod(i,a),a!=="mod"&&(c=u.div.neg()),a!=="div"&&(v=u.mod.neg(),d&&v.negative!==0&&v.iadd(i)),{div:c,mod:v}):this.negative===0&&i.negative!==0?(u=this.divmod(i.neg(),a),a!=="mod"&&(c=u.div.neg()),{div:c,mod:u.mod}):this.negative&i.negative?(u=this.neg().divmod(i.neg(),a),a!=="div"&&(v=u.mod.neg(),d&&v.negative!==0&&v.isub(i)),{div:u.div,mod:v}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,a)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var d=a.div.negative!==0?a.mod.isub(i):a.mod,c=i.ushrn(1),v=i.andln(1),u=d.cmp(c);return u<0||v===1&&u===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},f.prototype.modrn=function(i){var a=i<0;a&&(i=-i),o(i<=67108863);for(var d=(1<<26)%i,c=0,v=this.length-1;v>=0;v--)c=(d*c+(this.words[v]|0))%i;return a?-c:c},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var a=i<0;a&&(i=-i),o(i<=67108863);for(var d=0,c=this.length-1;c>=0;c--){var v=(this.words[c]|0)+d*67108864;this.words[c]=v/i|0,d=v%i}return this._strip(),a?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){o(i.negative===0),o(!i.isZero());var a=this,d=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new f(1),v=new f(0),u=new f(0),e=new f(1),l=0;a.isEven()&&d.isEven();)a.iushrn(1),d.iushrn(1),++l;for(var b=d.clone(),_=a.clone();!a.isZero();){for(var C=0,q=1;!(a.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(a.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(b),v.isub(_)),c.iushrn(1),v.iushrn(1);for(var O=0,R=1;!(d.words[0]&R)&&O<26;++O,R<<=1);if(O>0)for(d.iushrn(O);O-- >0;)(u.isOdd()||e.isOdd())&&(u.iadd(b),e.isub(_)),u.iushrn(1),e.iushrn(1);a.cmp(d)>=0?(a.isub(d),c.isub(u),v.isub(e)):(d.isub(a),u.isub(c),e.isub(v))}return{a:u,b:e,gcd:d.iushln(l)}},f.prototype._invmp=function(i){o(i.negative===0),o(!i.isZero());var a=this,d=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new f(1),v=new f(0),u=d.clone();a.cmpn(1)>0&&d.cmpn(1)>0;){for(var e=0,l=1;!(a.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(a.iushrn(e);e-- >0;)c.isOdd()&&c.iadd(u),c.iushrn(1);for(var b=0,_=1;!(d.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(d.iushrn(b);b-- >0;)v.isOdd()&&v.iadd(u),v.iushrn(1);a.cmp(d)>=0?(a.isub(d),c.isub(v)):(d.isub(a),v.isub(c))}var C;return a.cmpn(1)===0?C=c:C=v,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),d=i.clone();a.negative=0,d.negative=0;for(var c=0;a.isEven()&&d.isEven();c++)a.iushrn(1),d.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;d.isEven();)d.iushrn(1);var v=a.cmp(d);if(v<0){var u=a;a=d,d=u}else if(v===0||d.cmpn(1)===0)break;a.isub(d)}while(!0);return d.iushln(c)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){o(typeof i=="number");var a=i%26,d=(i-a)/26,c=1<<a;if(this.length<=d)return this._expand(d+1),this.words[d]|=c,this;for(var v=c,u=d;v!==0&&u<this.length;u++){var e=this.words[u]|0;e+=v,v=e>>>26,e&=67108863,this.words[u]=e}return v!==0&&(this.words[u]=v,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var d;if(this.length>1)d=1;else{a&&(i=-i),o(i<=67108863,"Number is too big");var c=this.words[0]|0;d=c===i?0:c<i?-1:1}return this.negative!==0?-d|0:d},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var a=this.ucmp(i);return this.negative!==0?-a|0:a},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var a=0,d=this.length-1;d>=0;d--){var c=this.words[d]|0,v=i.words[d]|0;if(c!==v){c<v?a=-1:c>v&&(a=1);break}}return a},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new p(i)},f.prototype.toRed=function(i){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return o(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return o(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var At={k256:null,p224:null,p192:null,p25519:null};function Bt(r,i){this.name=r,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Bt.prototype.ireduce=function(i){var a=i,d;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),d=a.bitLength();while(d>this.n);var c=d<this.n?-1:a.ucmp(this.p);return c===0?(a.words[0]=0,a.length=1):c>0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},Bt.prototype.split=function(i,a){i.iushrn(this.n,0,a)},Bt.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(Ct,Bt),Ct.prototype.split=function(i,a){for(var d=4194303,c=Math.min(i.length,9),v=0;v<c;v++)a.words[v]=i.words[v];if(a.length=c,i.length<=9){i.words[0]=0,i.length=1;return}var u=i.words[9];for(a.words[a.length++]=u&d,v=10;v<i.length;v++){var e=i.words[v]|0;i.words[v-10]=(e&d)<<4|u>>>22,u=e}u>>>=22,i.words[v-10]=u,u===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,d=0;d<i.length;d++){var c=i.words[d]|0;a+=c*977,i.words[d]=a&67108863,a=c*64+(a/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Et(){Bt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Et,Bt);function Y(){Bt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Y,Bt);function It(){Bt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(It,Bt),It.prototype.imulK=function(i){for(var a=0,d=0;d<i.length;d++){var c=(i.words[d]|0)*19+a,v=c&67108863;c>>>=26,i.words[d]=v,a=c}return a!==0&&(i.words[i.length++]=a),i},f._prime=function(i){if(At[i])return At[i];var a;if(i==="k256")a=new Ct;else if(i==="p224")a=new Et;else if(i==="p192")a=new Y;else if(i==="p25519")a=new It;else throw new Error("Unknown prime "+i);return At[i]=a,a};function p(r){if(typeof r=="string"){var i=f._prime(r);this.m=i.p,this.prime=i}else o(r.gtn(1),"modulus must be greater than 1"),this.m=r,this.prime=null}p.prototype._verify1=function(i){o(i.negative===0,"red works only with positives"),o(i.red,"red works only with red numbers")},p.prototype._verify2=function(i,a){o((i.negative|a.negative)===0,"red works only with positives"),o(i.red&&i.red===a.red,"red works only with red numbers")},p.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(M(i,i.umod(this.m)._forceRed(this)),i)},p.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},p.prototype.add=function(i,a){this._verify2(i,a);var d=i.add(a);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},p.prototype.iadd=function(i,a){this._verify2(i,a);var d=i.iadd(a);return d.cmp(this.m)>=0&&d.isub(this.m),d},p.prototype.sub=function(i,a){this._verify2(i,a);var d=i.sub(a);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},p.prototype.isub=function(i,a){this._verify2(i,a);var d=i.isub(a);return d.cmpn(0)<0&&d.iadd(this.m),d},p.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},p.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},p.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},p.prototype.isqr=function(i){return this.imul(i,i.clone())},p.prototype.sqr=function(i){return this.mul(i,i)},p.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(o(a%2===1),a===3){var d=this.m.add(new f(1)).iushrn(2);return this.pow(i,d)}for(var c=this.m.subn(1),v=0;!c.isZero()&&c.andln(1)===0;)v++,c.iushrn(1);o(!c.isZero());var u=new f(1).toRed(this),e=u.redNeg(),l=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new f(2*b*b).toRed(this);this.pow(b,l).cmp(e)!==0;)b.redIAdd(e);for(var _=this.pow(b,c),C=this.pow(i,c.addn(1).iushrn(1)),q=this.pow(i,c),O=v;q.cmp(u)!==0;){for(var R=q,P=0;R.cmp(u)!==0;P++)R=R.redSqr();o(P<O);var N=this.pow(_,new f(1).iushln(O-P-1));C=C.redMul(N),_=N.redSqr(),q=q.redMul(_),O=P}return C},p.prototype.invm=function(i){var a=i._invmp(this.m);return a.negative!==0?(a.negative=0,this.imod(a).redNeg()):this.imod(a)},p.prototype.pow=function(i,a){if(a.isZero())return new f(1).toRed(this);if(a.cmpn(1)===0)return i.clone();var d=4,c=new Array(1<<d);c[0]=new f(1).toRed(this),c[1]=i;for(var v=2;v<c.length;v++)c[v]=this.mul(c[v-1],i);var u=c[0],e=0,l=0,b=a.bitLength()%26;for(b===0&&(b=26),v=a.length-1;v>=0;v--){for(var _=a.words[v],C=b-1;C>=0;C--){var q=_>>C&1;if(u!==c[0]&&(u=this.sqr(u)),q===0&&e===0){l=0;continue}e<<=1,e|=q,l++,!(l!==d&&(v!==0||C!==0))&&(u=this.mul(u,c[e]),l=0,e=0)}b=26}return u},p.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},p.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},f.mont=function(i){return new t(i)};function t(r){p.call(this,r),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(t,p),t.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},t.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},t.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var d=i.imul(a),c=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(c).iushrn(this.shift),u=v;return v.cmp(this.m)>=0?u=v.isub(this.m):v.cmpn(0)<0&&(u=v.iadd(this.m)),u._forceRed(this)},t.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new f(0)._forceRed(this);var d=i.mul(a),c=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(c).iushrn(this.shift),u=v;return v.cmp(this.m)>=0?u=v.isub(this.m):v.cmpn(0)<0&&(u=v.iadd(this.m)),u._forceRed(this)},t.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(h,Gt)})(N0);var $0=N0.exports,si=$0,Iv=gi,Rv=Ot.Buffer;function ho(h){var n=h.modulus.byteLength(),s;do s=new si(Iv(n));while(s.cmp(h.modulus)>=0||!s.umod(h.prime1)||!s.umod(h.prime2));return s}function Tv(h){var n=ho(h),s=n.toRed(si.mont(h.modulus)).redPow(new si(h.publicExponent)).fromRed();return{blinder:s,unblinder:n.invm(h.modulus)}}function so(h,n){var s=Tv(n),o=n.modulus.byteLength(),m=new si(h).mul(s.blinder).umod(n.modulus),f=m.toRed(si.mont(n.prime1)),g=m.toRed(si.mont(n.prime2)),y=n.coefficient,S=n.prime1,B=n.prime2,M=f.redPow(n.exponent1).fromRed(),x=g.redPow(n.exponent2).fromRed(),I=M.isub(x).imul(y).umod(S).imul(B);return x.iadd(I).imul(s.unblinder).umod(n.modulus).toArrayLike(Rv,"be",o)}so.getr=ho;var U0=so,kf={};const Cv="elliptic",Fv="6.6.1",qv="EC cryptography",Pv="lib/elliptic.js",Dv=["lib"],Nv={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},$v={type:"git",url:"git@github.com:indutny/elliptic"},Uv=["EC","Elliptic","curve","Cryptography"],Lv="Fedor Indutny <fedor@indutny.com>",Ov="MIT",zv={url:"https://github.com/indutny/elliptic/issues"},Kv="https://github.com/indutny/elliptic",Hv={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},Zv={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},Wv={name:Cv,version:Fv,description:qv,main:Pv,files:Dv,scripts:Nv,repository:$v,keywords:Uv,author:Lv,license:Ov,bugs:zv,homepage:Kv,devDependencies:Hv,dependencies:Zv};var ze={},L0={exports:{}};L0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(L0);var Rr=L0.exports,O0={};(function(h){var n=h;function s(f,g){if(Array.isArray(f))return f.slice();if(!f)return[];var y=[];if(typeof f!="string"){for(var S=0;S<f.length;S++)y[S]=f[S]|0;return y}if(g==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var S=0;S<f.length;S+=2)y.push(parseInt(f[S]+f[S+1],16))}else for(var S=0;S<f.length;S++){var B=f.charCodeAt(S),M=B>>8,x=B&255;M?y.push(M,x):y.push(x)}return y}n.toArray=s;function o(f){return f.length===1?"0"+f:f}n.zero2=o;function m(f){for(var g="",y=0;y<f.length;y++)g+=o(f[y].toString(16));return g}n.toHex=m,n.encode=function(g,y){return y==="hex"?m(g):g}})(O0);(function(h){var n=h,s=Rr,o=We,m=O0;n.assert=o,n.toArray=m.toArray,n.zero2=m.zero2,n.toHex=m.toHex,n.encode=m.encode;function f(M,x,I){var k=new Array(Math.max(M.bitLength(),I)+1),D;for(D=0;D<k.length;D+=1)k[D]=0;var L=1<<x+1,W=M.clone();for(D=0;D<k.length;D++){var z,$=W.andln(L-1);W.isOdd()?($>(L>>1)-1?z=(L>>1)-$:z=$,W.isubn(z)):z=0,k[D]=z,W.iushrn(1)}return k}n.getNAF=f;function g(M,x){var I=[[],[]];M=M.clone(),x=x.clone();for(var k=0,D=0,L;M.cmpn(-k)>0||x.cmpn(-D)>0;){var W=M.andln(3)+k&3,z=x.andln(3)+D&3;W===3&&(W=-1),z===3&&(z=-1);var $;W&1?(L=M.andln(7)+k&7,(L===3||L===5)&&z===2?$=-W:$=W):$=0,I[0].push($);var lt;z&1?(L=x.andln(7)+D&7,(L===3||L===5)&&W===2?lt=-z:lt=z):lt=0,I[1].push(lt),2*k===$+1&&(k=1-k),2*D===lt+1&&(D=1-D),M.iushrn(1),x.iushrn(1)}return I}n.getJSF=g;function y(M,x,I){var k="_"+x;M.prototype[x]=function(){return this[k]!==void 0?this[k]:this[k]=I.call(this)}}n.cachedProperty=y;function S(M){return typeof M=="string"?n.toArray(M,"hex"):M}n.parseBytes=S;function B(M){return new s(M,"hex","le")}n.intFromLE=B})(ze);var z0={},Kr=Rr,rn=ze,En=rn.getNAF,Vv=rn.getJSF,kn=rn.assert;function Ur(h,n){this.type=h,this.p=new Kr(n.p,16),this.red=n.prime?Kr.red(n.prime):Kr.mont(this.p),this.zero=new Kr(0).toRed(this.red),this.one=new Kr(1).toRed(this.red),this.two=new Kr(2).toRed(this.red),this.n=n.n&&new Kr(n.n,16),this.g=n.g&&this.pointFromJSON(n.g,n.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var s=this.n&&this.p.div(this.n);!s||s.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var jn=Ur;Ur.prototype.point=function(){throw new Error("Not implemented")};Ur.prototype.validate=function(){throw new Error("Not implemented")};Ur.prototype._fixedNafMul=function(n,s){kn(n.precomputed);var o=n._getDoubles(),m=En(s,1,this._bitLength),f=(1<<o.step+1)-(o.step%2===0?2:1);f/=3;var g=[],y,S;for(y=0;y<m.length;y+=o.step){S=0;for(var B=y+o.step-1;B>=y;B--)S=(S<<1)+m[B];g.push(S)}for(var M=this.jpoint(null,null,null),x=this.jpoint(null,null,null),I=f;I>0;I--){for(y=0;y<g.length;y++)S=g[y],S===I?x=x.mixedAdd(o.points[y]):S===-I&&(x=x.mixedAdd(o.points[y].neg()));M=M.add(x)}return M.toP()};Ur.prototype._wnafMul=function(n,s){var o=4,m=n._getNAFPoints(o);o=m.wnd;for(var f=m.points,g=En(s,o,this._bitLength),y=this.jpoint(null,null,null),S=g.length-1;S>=0;S--){for(var B=0;S>=0&&g[S]===0;S--)B++;if(S>=0&&B++,y=y.dblp(B),S<0)break;var M=g[S];kn(M!==0),n.type==="affine"?M>0?y=y.mixedAdd(f[M-1>>1]):y=y.mixedAdd(f[-M-1>>1].neg()):M>0?y=y.add(f[M-1>>1]):y=y.add(f[-M-1>>1].neg())}return n.type==="affine"?y.toP():y};Ur.prototype._wnafMulAdd=function(n,s,o,m,f){var g=this._wnafT1,y=this._wnafT2,S=this._wnafT3,B=0,M,x,I;for(M=0;M<m;M++){I=s[M];var k=I._getNAFPoints(n);g[M]=k.wnd,y[M]=k.points}for(M=m-1;M>=1;M-=2){var D=M-1,L=M;if(g[D]!==1||g[L]!==1){S[D]=En(o[D],g[D],this._bitLength),S[L]=En(o[L],g[L],this._bitLength),B=Math.max(S[D].length,B),B=Math.max(S[L].length,B);continue}var W=[s[D],null,null,s[L]];s[D].y.cmp(s[L].y)===0?(W[1]=s[D].add(s[L]),W[2]=s[D].toJ().mixedAdd(s[L].neg())):s[D].y.cmp(s[L].y.redNeg())===0?(W[1]=s[D].toJ().mixedAdd(s[L]),W[2]=s[D].add(s[L].neg())):(W[1]=s[D].toJ().mixedAdd(s[L]),W[2]=s[D].toJ().mixedAdd(s[L].neg()));var z=[-3,-1,-5,-7,0,7,5,1,3],$=Vv(o[D],o[L]);for(B=Math.max($[0].length,B),S[D]=new Array(B),S[L]=new Array(B),x=0;x<B;x++){var lt=$[0][x]|0,H=$[1][x]|0;S[D][x]=z[(lt+1)*3+(H+1)],S[L][x]=0,y[D]=W}}var At=this.jpoint(null,null,null),Bt=this._wnafT4;for(M=B;M>=0;M--){for(var Ct=0;M>=0;){var Et=!0;for(x=0;x<m;x++)Bt[x]=S[x][M]|0,Bt[x]!==0&&(Et=!1);if(!Et)break;Ct++,M--}if(M>=0&&Ct++,At=At.dblp(Ct),M<0)break;for(x=0;x<m;x++){var Y=Bt[x];Y!==0&&(Y>0?I=y[x][Y-1>>1]:Y<0&&(I=y[x][-Y-1>>1].neg()),I.type==="affine"?At=At.mixedAdd(I):At=At.add(I))}}for(M=0;M<m;M++)y[M]=null;return f?At:At.toP()};function Ye(h,n){this.curve=h,this.type=n,this.precomputed=null}Ur.BasePoint=Ye;Ye.prototype.eq=function(){throw new Error("Not implemented")};Ye.prototype.validate=function(){return this.curve.validate(this)};Ur.prototype.decodePoint=function(n,s){n=rn.toArray(n,s);var o=this.p.byteLength();if((n[0]===4||n[0]===6||n[0]===7)&&n.length-1===2*o){n[0]===6?kn(n[n.length-1]%2===0):n[0]===7&&kn(n[n.length-1]%2===1);var m=this.point(n.slice(1,1+o),n.slice(1+o,1+2*o));return m}else if((n[0]===2||n[0]===3)&&n.length-1===o)return this.pointFromX(n.slice(1,1+o),n[0]===3);throw new Error("Unknown point format")};Ye.prototype.encodeCompressed=function(n){return this.encode(n,!0)};Ye.prototype._encode=function(n){var s=this.curve.p.byteLength(),o=this.getX().toArray("be",s);return n?[this.getY().isEven()?2:3].concat(o):[4].concat(o,this.getY().toArray("be",s))};Ye.prototype.encode=function(n,s){return rn.encode(this._encode(s),n)};Ye.prototype.precompute=function(n){if(this.precomputed)return this;var s={doubles:null,naf:null,beta:null};return s.naf=this._getNAFPoints(8),s.doubles=this._getDoubles(4,n),s.beta=this._getBeta(),this.precomputed=s,this};Ye.prototype._hasDoubles=function(n){if(!this.precomputed)return!1;var s=this.precomputed.doubles;return s?s.points.length>=Math.ceil((n.bitLength()+1)/s.step):!1};Ye.prototype._getDoubles=function(n,s){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var o=[this],m=this,f=0;f<s;f+=n){for(var g=0;g<n;g++)m=m.dbl();o.push(m)}return{step:n,points:o}};Ye.prototype._getNAFPoints=function(n){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var s=[this],o=(1<<n)-1,m=o===1?null:this.dbl(),f=1;f<o;f++)s[f]=s[f-1].add(m);return{wnd:n,points:s}};Ye.prototype._getBeta=function(){return null};Ye.prototype.dblp=function(n){for(var s=this,o=0;o<n;o++)s=s.dbl();return s};var Yv=ze,ge=Rr,K0=Jt,wi=jn,Jv=Yv.assert;function Je(h){wi.call(this,"short",h),this.a=new ge(h.a,16).toRed(this.red),this.b=new ge(h.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(h),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}K0(Je,wi);var Gv=Je;Je.prototype._getEndomorphism=function(n){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var s,o;if(n.beta)s=new ge(n.beta,16).toRed(this.red);else{var m=this._getEndoRoots(this.p);s=m[0].cmp(m[1])<0?m[0]:m[1],s=s.toRed(this.red)}if(n.lambda)o=new ge(n.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(s))===0?o=f[0]:(o=f[1],Jv(this.g.mul(o).x.cmp(this.g.x.redMul(s))===0))}var g;return n.basis?g=n.basis.map(function(y){return{a:new ge(y.a,16),b:new ge(y.b,16)}}):g=this._getEndoBasis(o),{beta:s,lambda:o,basis:g}}};Je.prototype._getEndoRoots=function(n){var s=n===this.p?this.red:ge.mont(n),o=new ge(2).toRed(s).redInvm(),m=o.redNeg(),f=new ge(3).toRed(s).redNeg().redSqrt().redMul(o),g=m.redAdd(f).fromRed(),y=m.redSub(f).fromRed();return[g,y]};Je.prototype._getEndoBasis=function(n){for(var s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),o=n,m=this.n.clone(),f=new ge(1),g=new ge(0),y=new ge(0),S=new ge(1),B,M,x,I,k,D,L,W=0,z,$;o.cmpn(0)!==0;){var lt=m.div(o);z=m.sub(lt.mul(o)),$=y.sub(lt.mul(f));var H=S.sub(lt.mul(g));if(!x&&z.cmp(s)<0)B=L.neg(),M=f,x=z.neg(),I=$;else if(x&&++W===2)break;L=z,m=o,o=z,y=f,f=$,S=g,g=H}k=z.neg(),D=$;var At=x.sqr().add(I.sqr()),Bt=k.sqr().add(D.sqr());return Bt.cmp(At)>=0&&(k=B,D=M),x.negative&&(x=x.neg(),I=I.neg()),k.negative&&(k=k.neg(),D=D.neg()),[{a:x,b:I},{a:k,b:D}]};Je.prototype._endoSplit=function(n){var s=this.endo.basis,o=s[0],m=s[1],f=m.b.mul(n).divRound(this.n),g=o.b.neg().mul(n).divRound(this.n),y=f.mul(o.a),S=g.mul(m.a),B=f.mul(o.b),M=g.mul(m.b),x=n.sub(y).sub(S),I=B.add(M).neg();return{k1:x,k2:I}};Je.prototype.pointFromX=function(n,s){n=new ge(n,16),n.red||(n=n.toRed(this.red));var o=n.redSqr().redMul(n).redIAdd(n.redMul(this.a)).redIAdd(this.b),m=o.redSqrt();if(m.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var f=m.fromRed().isOdd();return(s&&!f||!s&&f)&&(m=m.redNeg()),this.point(n,m)};Je.prototype.validate=function(n){if(n.inf)return!0;var s=n.x,o=n.y,m=this.a.redMul(s),f=s.redSqr().redMul(s).redIAdd(m).redIAdd(this.b);return o.redSqr().redISub(f).cmpn(0)===0};Je.prototype._endoWnafMulAdd=function(n,s,o){for(var m=this._endoWnafT1,f=this._endoWnafT2,g=0;g<n.length;g++){var y=this._endoSplit(s[g]),S=n[g],B=S._getBeta();y.k1.negative&&(y.k1.ineg(),S=S.neg(!0)),y.k2.negative&&(y.k2.ineg(),B=B.neg(!0)),m[g*2]=S,m[g*2+1]=B,f[g*2]=y.k1,f[g*2+1]=y.k2}for(var M=this._wnafMulAdd(1,m,f,g*2,o),x=0;x<g*2;x++)m[x]=null,f[x]=null;return M};function Be(h,n,s,o){wi.BasePoint.call(this,h,"affine"),n===null&&s===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ge(n,16),this.y=new ge(s,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}K0(Be,wi.BasePoint);Je.prototype.point=function(n,s,o){return new Be(this,n,s,o)};Je.prototype.pointFromJSON=function(n,s){return Be.fromJSON(this,n,s)};Be.prototype._getBeta=function(){if(this.curve.endo){var n=this.precomputed;if(n&&n.beta)return n.beta;var s=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(n){var o=this.curve,m=function(f){return o.point(f.x.redMul(o.endo.beta),f.y)};n.beta=s,s.precomputed={beta:null,naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(m)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(m)}}}return s}};Be.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Be.fromJSON=function(n,s,o){typeof s=="string"&&(s=JSON.parse(s));var m=n.point(s[0],s[1],o);if(!s[2])return m;function f(y){return n.point(y[0],y[1],o)}var g=s[2];return m.precomputed={beta:null,doubles:g.doubles&&{step:g.doubles.step,points:[m].concat(g.doubles.points.map(f))},naf:g.naf&&{wnd:g.naf.wnd,points:[m].concat(g.naf.points.map(f))}},m};Be.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Be.prototype.isInfinity=function(){return this.inf};Be.prototype.add=function(n){if(this.inf)return n;if(n.inf)return this;if(this.eq(n))return this.dbl();if(this.neg().eq(n))return this.curve.point(null,null);if(this.x.cmp(n.x)===0)return this.curve.point(null,null);var s=this.y.redSub(n.y);s.cmpn(0)!==0&&(s=s.redMul(this.x.redSub(n.x).redInvm()));var o=s.redSqr().redISub(this.x).redISub(n.x),m=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,m)};Be.prototype.dbl=function(){if(this.inf)return this;var n=this.y.redAdd(this.y);if(n.cmpn(0)===0)return this.curve.point(null,null);var s=this.curve.a,o=this.x.redSqr(),m=n.redInvm(),f=o.redAdd(o).redIAdd(o).redIAdd(s).redMul(m),g=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,y)};Be.prototype.getX=function(){return this.x.fromRed()};Be.prototype.getY=function(){return this.y.fromRed()};Be.prototype.mul=function(n){return n=new ge(n,16),this.isInfinity()?this:this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve.endo?this.curve._endoWnafMulAdd([this],[n]):this.curve._wnafMul(this,n)};Be.prototype.mulAdd=function(n,s,o){var m=[this,s],f=[n,o];return this.curve.endo?this.curve._endoWnafMulAdd(m,f):this.curve._wnafMulAdd(1,m,f,2)};Be.prototype.jmulAdd=function(n,s,o){var m=[this,s],f=[n,o];return this.curve.endo?this.curve._endoWnafMulAdd(m,f,!0):this.curve._wnafMulAdd(1,m,f,2,!0)};Be.prototype.eq=function(n){return this===n||this.inf===n.inf&&(this.inf||this.x.cmp(n.x)===0&&this.y.cmp(n.y)===0)};Be.prototype.neg=function(n){if(this.inf)return this;var s=this.curve.point(this.x,this.y.redNeg());if(n&&this.precomputed){var o=this.precomputed,m=function(f){return f.neg()};s.precomputed={naf:o.naf&&{wnd:o.naf.wnd,points:o.naf.points.map(m)},doubles:o.doubles&&{step:o.doubles.step,points:o.doubles.points.map(m)}}}return s};Be.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var n=this.curve.jpoint(this.x,this.y,this.curve.one);return n};function Ee(h,n,s,o){wi.BasePoint.call(this,h,"jacobian"),n===null&&s===null&&o===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ge(0)):(this.x=new ge(n,16),this.y=new ge(s,16),this.z=new ge(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}K0(Ee,wi.BasePoint);Je.prototype.jpoint=function(n,s,o){return new Ee(this,n,s,o)};Ee.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var n=this.z.redInvm(),s=n.redSqr(),o=this.x.redMul(s),m=this.y.redMul(s).redMul(n);return this.curve.point(o,m)};Ee.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Ee.prototype.add=function(n){if(this.isInfinity())return n;if(n.isInfinity())return this;var s=n.z.redSqr(),o=this.z.redSqr(),m=this.x.redMul(s),f=n.x.redMul(o),g=this.y.redMul(s.redMul(n.z)),y=n.y.redMul(o.redMul(this.z)),S=m.redSub(f),B=g.redSub(y);if(S.cmpn(0)===0)return B.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var M=S.redSqr(),x=M.redMul(S),I=m.redMul(M),k=B.redSqr().redIAdd(x).redISub(I).redISub(I),D=B.redMul(I.redISub(k)).redISub(g.redMul(x)),L=this.z.redMul(n.z).redMul(S);return this.curve.jpoint(k,D,L)};Ee.prototype.mixedAdd=function(n){if(this.isInfinity())return n.toJ();if(n.isInfinity())return this;var s=this.z.redSqr(),o=this.x,m=n.x.redMul(s),f=this.y,g=n.y.redMul(s).redMul(this.z),y=o.redSub(m),S=f.redSub(g);if(y.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var B=y.redSqr(),M=B.redMul(y),x=o.redMul(B),I=S.redSqr().redIAdd(M).redISub(x).redISub(x),k=S.redMul(x.redISub(I)).redISub(f.redMul(M)),D=this.z.redMul(y);return this.curve.jpoint(I,k,D)};Ee.prototype.dblp=function(n){if(n===0)return this;if(this.isInfinity())return this;if(!n)return this.dbl();var s;if(this.curve.zeroA||this.curve.threeA){var o=this;for(s=0;s<n;s++)o=o.dbl();return o}var m=this.curve.a,f=this.curve.tinv,g=this.x,y=this.y,S=this.z,B=S.redSqr().redSqr(),M=y.redAdd(y);for(s=0;s<n;s++){var x=g.redSqr(),I=M.redSqr(),k=I.redSqr(),D=x.redAdd(x).redIAdd(x).redIAdd(m.redMul(B)),L=g.redMul(I),W=D.redSqr().redISub(L.redAdd(L)),z=L.redISub(W),$=D.redMul(z);$=$.redIAdd($).redISub(k);var lt=M.redMul(S);s+1<n&&(B=B.redMul(k)),g=W,S=lt,M=$}return this.curve.jpoint(g,M.redMul(f),S)};Ee.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};Ee.prototype._zeroDbl=function(){var n,s,o;if(this.zOne){var m=this.x.redSqr(),f=this.y.redSqr(),g=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(m).redISub(g);y=y.redIAdd(y);var S=m.redAdd(m).redIAdd(m),B=S.redSqr().redISub(y).redISub(y),M=g.redIAdd(g);M=M.redIAdd(M),M=M.redIAdd(M),n=B,s=S.redMul(y.redISub(B)).redISub(M),o=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),I=this.y.redSqr(),k=I.redSqr(),D=this.x.redAdd(I).redSqr().redISub(x).redISub(k);D=D.redIAdd(D);var L=x.redAdd(x).redIAdd(x),W=L.redSqr(),z=k.redIAdd(k);z=z.redIAdd(z),z=z.redIAdd(z),n=W.redISub(D).redISub(D),s=L.redMul(D.redISub(n)).redISub(z),o=this.y.redMul(this.z),o=o.redIAdd(o)}return this.curve.jpoint(n,s,o)};Ee.prototype._threeDbl=function(){var n,s,o;if(this.zOne){var m=this.x.redSqr(),f=this.y.redSqr(),g=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(m).redISub(g);y=y.redIAdd(y);var S=m.redAdd(m).redIAdd(m).redIAdd(this.curve.a),B=S.redSqr().redISub(y).redISub(y);n=B;var M=g.redIAdd(g);M=M.redIAdd(M),M=M.redIAdd(M),s=S.redMul(y.redISub(B)).redISub(M),o=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),I=this.y.redSqr(),k=this.x.redMul(I),D=this.x.redSub(x).redMul(this.x.redAdd(x));D=D.redAdd(D).redIAdd(D);var L=k.redIAdd(k);L=L.redIAdd(L);var W=L.redAdd(L);n=D.redSqr().redISub(W),o=this.y.redAdd(this.z).redSqr().redISub(I).redISub(x);var z=I.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),s=D.redMul(L.redISub(n)).redISub(z)}return this.curve.jpoint(n,s,o)};Ee.prototype._dbl=function(){var n=this.curve.a,s=this.x,o=this.y,m=this.z,f=m.redSqr().redSqr(),g=s.redSqr(),y=o.redSqr(),S=g.redAdd(g).redIAdd(g).redIAdd(n.redMul(f)),B=s.redAdd(s);B=B.redIAdd(B);var M=B.redMul(y),x=S.redSqr().redISub(M.redAdd(M)),I=M.redISub(x),k=y.redSqr();k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var D=S.redMul(I).redISub(k),L=o.redAdd(o).redMul(m);return this.curve.jpoint(x,D,L)};Ee.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var n=this.x.redSqr(),s=this.y.redSqr(),o=this.z.redSqr(),m=s.redSqr(),f=n.redAdd(n).redIAdd(n),g=f.redSqr(),y=this.x.redAdd(s).redSqr().redISub(n).redISub(m);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(g);var S=y.redSqr(),B=m.redIAdd(m);B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B);var M=f.redIAdd(y).redSqr().redISub(g).redISub(S).redISub(B),x=s.redMul(M);x=x.redIAdd(x),x=x.redIAdd(x);var I=this.x.redMul(S).redISub(x);I=I.redIAdd(I),I=I.redIAdd(I);var k=this.y.redMul(M.redMul(B.redISub(M)).redISub(y.redMul(S)));k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var D=this.z.redAdd(y).redSqr().redISub(o).redISub(S);return this.curve.jpoint(I,k,D)};Ee.prototype.mul=function(n,s){return n=new ge(n,s),this.curve._wnafMul(this,n)};Ee.prototype.eq=function(n){if(n.type==="affine")return this.eq(n.toJ());if(this===n)return!0;var s=this.z.redSqr(),o=n.z.redSqr();if(this.x.redMul(o).redISub(n.x.redMul(s)).cmpn(0)!==0)return!1;var m=s.redMul(this.z),f=o.redMul(n.z);return this.y.redMul(f).redISub(n.y.redMul(m)).cmpn(0)===0};Ee.prototype.eqXToP=function(n){var s=this.z.redSqr(),o=n.toRed(this.curve.red).redMul(s);if(this.x.cmp(o)===0)return!0;for(var m=n.clone(),f=this.curve.redN.redMul(s);;){if(m.iadd(this.curve.n),m.cmp(this.curve.p)>=0)return!1;if(o.redIAdd(f),this.x.cmp(o)===0)return!0}};Ee.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};Ee.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var ai=Rr,oo=Jt,Qn=jn,Xv=ze;function Mi(h){Qn.call(this,"mont",h),this.a=new ai(h.a,16).toRed(this.red),this.b=new ai(h.b,16).toRed(this.red),this.i4=new ai(4).toRed(this.red).redInvm(),this.two=new ai(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}oo(Mi,Qn);var jv=Mi;Mi.prototype.validate=function(n){var s=n.normalize().x,o=s.redSqr(),m=o.redMul(s).redAdd(o.redMul(this.a)).redAdd(s),f=m.redSqrt();return f.redSqr().cmp(m)===0};function Se(h,n,s){Qn.BasePoint.call(this,h,"projective"),n===null&&s===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new ai(n,16),this.z=new ai(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}oo(Se,Qn.BasePoint);Mi.prototype.decodePoint=function(n,s){return this.point(Xv.toArray(n,s),1)};Mi.prototype.point=function(n,s){return new Se(this,n,s)};Mi.prototype.pointFromJSON=function(n){return Se.fromJSON(this,n)};Se.prototype.precompute=function(){};Se.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Se.fromJSON=function(n,s){return new Se(n,s[0],s[1]||n.one)};Se.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Se.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Se.prototype.dbl=function(){var n=this.x.redAdd(this.z),s=n.redSqr(),o=this.x.redSub(this.z),m=o.redSqr(),f=s.redSub(m),g=s.redMul(m),y=f.redMul(m.redAdd(this.curve.a24.redMul(f)));return this.curve.point(g,y)};Se.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Se.prototype.diffAdd=function(n,s){var o=this.x.redAdd(this.z),m=this.x.redSub(this.z),f=n.x.redAdd(n.z),g=n.x.redSub(n.z),y=g.redMul(o),S=f.redMul(m),B=s.z.redMul(y.redAdd(S).redSqr()),M=s.x.redMul(y.redISub(S).redSqr());return this.curve.point(B,M)};Se.prototype.mul=function(n){for(var s=n.clone(),o=this,m=this.curve.point(null,null),f=this,g=[];s.cmpn(0)!==0;s.iushrn(1))g.push(s.andln(1));for(var y=g.length-1;y>=0;y--)g[y]===0?(o=o.diffAdd(m,f),m=m.dbl()):(m=o.diffAdd(m,f),o=o.dbl());return m};Se.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Se.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Se.prototype.eq=function(n){return this.getX().cmp(n.getX())===0};Se.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Se.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Qv=ze,_r=Rr,uo=Jt,tf=jn,tp=Qv.assert;function br(h){this.twisted=(h.a|0)!==1,this.mOneA=this.twisted&&(h.a|0)===-1,this.extended=this.mOneA,tf.call(this,"edwards",h),this.a=new _r(h.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _r(h.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _r(h.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),tp(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(h.c|0)===1}uo(br,tf);var ep=br;br.prototype._mulA=function(n){return this.mOneA?n.redNeg():this.a.redMul(n)};br.prototype._mulC=function(n){return this.oneC?n:this.c.redMul(n)};br.prototype.jpoint=function(n,s,o,m){return this.point(n,s,o,m)};br.prototype.pointFromX=function(n,s){n=new _r(n,16),n.red||(n=n.toRed(this.red));var o=n.redSqr(),m=this.c2.redSub(this.a.redMul(o)),f=this.one.redSub(this.c2.redMul(this.d).redMul(o)),g=m.redMul(f.redInvm()),y=g.redSqrt();if(y.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");var S=y.fromRed().isOdd();return(s&&!S||!s&&S)&&(y=y.redNeg()),this.point(n,y)};br.prototype.pointFromY=function(n,s){n=new _r(n,16),n.red||(n=n.toRed(this.red));var o=n.redSqr(),m=o.redSub(this.c2),f=o.redMul(this.d).redMul(this.c2).redSub(this.a),g=m.redMul(f.redInvm());if(g.cmp(this.zero)===0){if(s)throw new Error("invalid point");return this.point(this.zero,n)}var y=g.redSqrt();if(y.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");return y.fromRed().isOdd()!==s&&(y=y.redNeg()),this.point(y,n)};br.prototype.validate=function(n){if(n.isInfinity())return!0;n.normalize();var s=n.x.redSqr(),o=n.y.redSqr(),m=s.redMul(this.a).redAdd(o),f=this.c2.redMul(this.one.redAdd(this.d.redMul(s).redMul(o)));return m.cmp(f)===0};function me(h,n,s,o,m){tf.BasePoint.call(this,h,"projective"),n===null&&s===null&&o===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new _r(n,16),this.y=new _r(s,16),this.z=o?new _r(o,16):this.curve.one,this.t=m&&new _r(m,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}uo(me,tf.BasePoint);br.prototype.pointFromJSON=function(n){return me.fromJSON(this,n)};br.prototype.point=function(n,s,o,m){return new me(this,n,s,o,m)};me.fromJSON=function(n,s){return new me(n,s[0],s[1],s[2])};me.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};me.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};me.prototype._extDbl=function(){var n=this.x.redSqr(),s=this.y.redSqr(),o=this.z.redSqr();o=o.redIAdd(o);var m=this.curve._mulA(n),f=this.x.redAdd(this.y).redSqr().redISub(n).redISub(s),g=m.redAdd(s),y=g.redSub(o),S=m.redSub(s),B=f.redMul(y),M=g.redMul(S),x=f.redMul(S),I=y.redMul(g);return this.curve.point(B,M,I,x)};me.prototype._projDbl=function(){var n=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),o=this.y.redSqr(),m,f,g,y,S,B;if(this.curve.twisted){y=this.curve._mulA(s);var M=y.redAdd(o);this.zOne?(m=n.redSub(s).redSub(o).redMul(M.redSub(this.curve.two)),f=M.redMul(y.redSub(o)),g=M.redSqr().redSub(M).redSub(M)):(S=this.z.redSqr(),B=M.redSub(S).redISub(S),m=n.redSub(s).redISub(o).redMul(B),f=M.redMul(y.redSub(o)),g=M.redMul(B))}else y=s.redAdd(o),S=this.curve._mulC(this.z).redSqr(),B=y.redSub(S).redSub(S),m=this.curve._mulC(n.redISub(y)).redMul(B),f=this.curve._mulC(y).redMul(s.redISub(o)),g=y.redMul(B);return this.curve.point(m,f,g)};me.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};me.prototype._extAdd=function(n){var s=this.y.redSub(this.x).redMul(n.y.redSub(n.x)),o=this.y.redAdd(this.x).redMul(n.y.redAdd(n.x)),m=this.t.redMul(this.curve.dd).redMul(n.t),f=this.z.redMul(n.z.redAdd(n.z)),g=o.redSub(s),y=f.redSub(m),S=f.redAdd(m),B=o.redAdd(s),M=g.redMul(y),x=S.redMul(B),I=g.redMul(B),k=y.redMul(S);return this.curve.point(M,x,k,I)};me.prototype._projAdd=function(n){var s=this.z.redMul(n.z),o=s.redSqr(),m=this.x.redMul(n.x),f=this.y.redMul(n.y),g=this.curve.d.redMul(m).redMul(f),y=o.redSub(g),S=o.redAdd(g),B=this.x.redAdd(this.y).redMul(n.x.redAdd(n.y)).redISub(m).redISub(f),M=s.redMul(y).redMul(B),x,I;return this.curve.twisted?(x=s.redMul(S).redMul(f.redSub(this.curve._mulA(m))),I=y.redMul(S)):(x=s.redMul(S).redMul(f.redSub(m)),I=this.curve._mulC(y).redMul(S)),this.curve.point(M,x,I)};me.prototype.add=function(n){return this.isInfinity()?n:n.isInfinity()?this:this.curve.extended?this._extAdd(n):this._projAdd(n)};me.prototype.mul=function(n){return this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve._wnafMul(this,n)};me.prototype.mulAdd=function(n,s,o){return this.curve._wnafMulAdd(1,[this,s],[n,o],2,!1)};me.prototype.jmulAdd=function(n,s,o){return this.curve._wnafMulAdd(1,[this,s],[n,o],2,!0)};me.prototype.normalize=function(){if(this.zOne)return this;var n=this.z.redInvm();return this.x=this.x.redMul(n),this.y=this.y.redMul(n),this.t&&(this.t=this.t.redMul(n)),this.z=this.curve.one,this.zOne=!0,this};me.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};me.prototype.getX=function(){return this.normalize(),this.x.fromRed()};me.prototype.getY=function(){return this.normalize(),this.y.fromRed()};me.prototype.eq=function(n){return this===n||this.getX().cmp(n.getX())===0&&this.getY().cmp(n.getY())===0};me.prototype.eqXToP=function(n){var s=n.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(s)===0)return!0;for(var o=n.clone(),m=this.curve.redN.redMul(this.z);;){if(o.iadd(this.curve.n),o.cmp(this.curve.p)>=0)return!1;if(s.redIAdd(m),this.x.cmp(s)===0)return!0}};me.prototype.toP=me.prototype.normalize;me.prototype.mixedAdd=me.prototype.add;(function(h){var n=h;n.base=jn,n.short=Gv,n.mont=jv,n.edwards=ep})(z0);var ef={},rf={},Xt={},rp=We,ip=Jt;Xt.inherits=ip;function np(h,n){return(h.charCodeAt(n)&64512)!==55296||n<0||n+1>=h.length?!1:(h.charCodeAt(n+1)&64512)===56320}function fp(h,n){if(Array.isArray(h))return h.slice();if(!h)return[];var s=[];if(typeof h=="string")if(n){if(n==="hex")for(h=h.replace(/[^a-z0-9]+/ig,""),h.length%2!==0&&(h="0"+h),m=0;m<h.length;m+=2)s.push(parseInt(h[m]+h[m+1],16))}else for(var o=0,m=0;m<h.length;m++){var f=h.charCodeAt(m);f<128?s[o++]=f:f<2048?(s[o++]=f>>6|192,s[o++]=f&63|128):np(h,m)?(f=65536+((f&1023)<<10)+(h.charCodeAt(++m)&1023),s[o++]=f>>18|240,s[o++]=f>>12&63|128,s[o++]=f>>6&63|128,s[o++]=f&63|128):(s[o++]=f>>12|224,s[o++]=f>>6&63|128,s[o++]=f&63|128)}else for(m=0;m<h.length;m++)s[m]=h[m]|0;return s}Xt.toArray=fp;function ap(h){for(var n="",s=0;s<h.length;s++)n+=co(h[s].toString(16));return n}Xt.toHex=ap;function lo(h){var n=h>>>24|h>>>8&65280|h<<8&16711680|(h&255)<<24;return n>>>0}Xt.htonl=lo;function hp(h,n){for(var s="",o=0;o<h.length;o++){var m=h[o];n==="little"&&(m=lo(m)),s+=vo(m.toString(16))}return s}Xt.toHex32=hp;function co(h){return h.length===1?"0"+h:h}Xt.zero2=co;function vo(h){return h.length===7?"0"+h:h.length===6?"00"+h:h.length===5?"000"+h:h.length===4?"0000"+h:h.length===3?"00000"+h:h.length===2?"000000"+h:h.length===1?"0000000"+h:h}Xt.zero8=vo;function sp(h,n,s,o){var m=s-n;rp(m%4===0);for(var f=new Array(m/4),g=0,y=n;g<f.length;g++,y+=4){var S;o==="big"?S=h[y]<<24|h[y+1]<<16|h[y+2]<<8|h[y+3]:S=h[y+3]<<24|h[y+2]<<16|h[y+1]<<8|h[y],f[g]=S>>>0}return f}Xt.join32=sp;function op(h,n){for(var s=new Array(h.length*4),o=0,m=0;o<h.length;o++,m+=4){var f=h[o];n==="big"?(s[m]=f>>>24,s[m+1]=f>>>16&255,s[m+2]=f>>>8&255,s[m+3]=f&255):(s[m+3]=f>>>24,s[m+2]=f>>>16&255,s[m+1]=f>>>8&255,s[m]=f&255)}return s}Xt.split32=op;function up(h,n){return h>>>n|h<<32-n}Xt.rotr32=up;function lp(h,n){return h<<n|h>>>32-n}Xt.rotl32=lp;function dp(h,n){return h+n>>>0}Xt.sum32=dp;function cp(h,n,s){return h+n+s>>>0}Xt.sum32_3=cp;function vp(h,n,s,o){return h+n+s+o>>>0}Xt.sum32_4=vp;function pp(h,n,s,o,m){return h+n+s+o+m>>>0}Xt.sum32_5=pp;function mp(h,n,s,o){var m=h[n],f=h[n+1],g=o+f>>>0,y=(g<o?1:0)+s+m;h[n]=y>>>0,h[n+1]=g}Xt.sum64=mp;function gp(h,n,s,o){var m=n+o>>>0,f=(m<n?1:0)+h+s;return f>>>0}Xt.sum64_hi=gp;function bp(h,n,s,o){var m=n+o;return m>>>0}Xt.sum64_lo=bp;function yp(h,n,s,o,m,f,g,y){var S=0,B=n;B=B+o>>>0,S+=B<n?1:0,B=B+f>>>0,S+=B<f?1:0,B=B+y>>>0,S+=B<y?1:0;var M=h+s+m+g+S;return M>>>0}Xt.sum64_4_hi=yp;function wp(h,n,s,o,m,f,g,y){var S=n+o+f+y;return S>>>0}Xt.sum64_4_lo=wp;function Mp(h,n,s,o,m,f,g,y,S,B){var M=0,x=n;x=x+o>>>0,M+=x<n?1:0,x=x+f>>>0,M+=x<f?1:0,x=x+y>>>0,M+=x<y?1:0,x=x+B>>>0,M+=x<B?1:0;var I=h+s+m+g+S+M;return I>>>0}Xt.sum64_5_hi=Mp;function xp(h,n,s,o,m,f,g,y,S,B){var M=n+o+f+y+B;return M>>>0}Xt.sum64_5_lo=xp;function _p(h,n,s){var o=n<<32-s|h>>>s;return o>>>0}Xt.rotr64_hi=_p;function Sp(h,n,s){var o=h<<32-s|n>>>s;return o>>>0}Xt.rotr64_lo=Sp;function Ap(h,n,s){return h>>>s}Xt.shr64_hi=Ap;function Bp(h,n,s){var o=h<<32-s|n>>>s;return o>>>0}Xt.shr64_lo=Bp;var xi={},Pa=Xt,Ep=We;function nf(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}xi.BlockHash=nf;nf.prototype.update=function(n,s){if(n=Pa.toArray(n,s),this.pending?this.pending=this.pending.concat(n):this.pending=n,this.pendingTotal+=n.length,this.pending.length>=this._delta8){n=this.pending;var o=n.length%this._delta8;this.pending=n.slice(n.length-o,n.length),this.pending.length===0&&(this.pending=null),n=Pa.join32(n,0,n.length-o,this.endian);for(var m=0;m<n.length;m+=this._delta32)this._update(n,m,m+this._delta32)}return this};nf.prototype.digest=function(n){return this.update(this._pad()),Ep(this.pending===null),this._digest(n)};nf.prototype._pad=function(){var n=this.pendingTotal,s=this._delta8,o=s-(n+this.padLength)%s,m=new Array(o+this.padLength);m[0]=128;for(var f=1;f<o;f++)m[f]=0;if(n<<=3,this.endian==="big"){for(var g=8;g<this.padLength;g++)m[f++]=0;m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=n>>>24&255,m[f++]=n>>>16&255,m[f++]=n>>>8&255,m[f++]=n&255}else for(m[f++]=n&255,m[f++]=n>>>8&255,m[f++]=n>>>16&255,m[f++]=n>>>24&255,m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=0,g=8;g<this.padLength;g++)m[f++]=0;return m};var _i={},yr={},kp=Xt,or=kp.rotr32;function Ip(h,n,s,o){if(h===0)return po(n,s,o);if(h===1||h===3)return go(n,s,o);if(h===2)return mo(n,s,o)}yr.ft_1=Ip;function po(h,n,s){return h&n^~h&s}yr.ch32=po;function mo(h,n,s){return h&n^h&s^n&s}yr.maj32=mo;function go(h,n,s){return h^n^s}yr.p32=go;function Rp(h){return or(h,2)^or(h,13)^or(h,22)}yr.s0_256=Rp;function Tp(h){return or(h,6)^or(h,11)^or(h,25)}yr.s1_256=Tp;function Cp(h){return or(h,7)^or(h,18)^h>>>3}yr.g0_256=Cp;function Fp(h){return or(h,17)^or(h,19)^h>>>10}yr.g1_256=Fp;var di=Xt,qp=xi,Pp=yr,If=di.rotl32,Fi=di.sum32,Dp=di.sum32_5,Np=Pp.ft_1,bo=qp.BlockHash,$p=[1518500249,1859775393,2400959708,3395469782];function vr(){if(!(this instanceof vr))return new vr;bo.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}di.inherits(vr,bo);var Up=vr;vr.blockSize=512;vr.outSize=160;vr.hmacStrength=80;vr.padLength=64;vr.prototype._update=function(n,s){for(var o=this.W,m=0;m<16;m++)o[m]=n[s+m];for(;m<o.length;m++)o[m]=If(o[m-3]^o[m-8]^o[m-14]^o[m-16],1);var f=this.h[0],g=this.h[1],y=this.h[2],S=this.h[3],B=this.h[4];for(m=0;m<o.length;m++){var M=~~(m/20),x=Dp(If(f,5),Np(M,g,y,S),B,o[m],$p[M]);B=S,S=y,y=If(g,30),g=f,f=x}this.h[0]=Fi(this.h[0],f),this.h[1]=Fi(this.h[1],g),this.h[2]=Fi(this.h[2],y),this.h[3]=Fi(this.h[3],S),this.h[4]=Fi(this.h[4],B)};vr.prototype._digest=function(n){return n==="hex"?di.toHex32(this.h,"big"):di.split32(this.h,"big")};var ci=Xt,Lp=xi,Si=yr,Op=We,Xe=ci.sum32,zp=ci.sum32_4,Kp=ci.sum32_5,Hp=Si.ch32,Zp=Si.maj32,Wp=Si.s0_256,Vp=Si.s1_256,Yp=Si.g0_256,Jp=Si.g1_256,yo=Lp.BlockHash,Gp=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function pr(){if(!(this instanceof pr))return new pr;yo.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Gp,this.W=new Array(64)}ci.inherits(pr,yo);var wo=pr;pr.blockSize=512;pr.outSize=256;pr.hmacStrength=192;pr.padLength=64;pr.prototype._update=function(n,s){for(var o=this.W,m=0;m<16;m++)o[m]=n[s+m];for(;m<o.length;m++)o[m]=zp(Jp(o[m-2]),o[m-7],Yp(o[m-15]),o[m-16]);var f=this.h[0],g=this.h[1],y=this.h[2],S=this.h[3],B=this.h[4],M=this.h[5],x=this.h[6],I=this.h[7];for(Op(this.k.length===o.length),m=0;m<o.length;m++){var k=Kp(I,Vp(B),Hp(B,M,x),this.k[m],o[m]),D=Xe(Wp(f),Zp(f,g,y));I=x,x=M,M=B,B=Xe(S,k),S=y,y=g,g=f,f=Xe(k,D)}this.h[0]=Xe(this.h[0],f),this.h[1]=Xe(this.h[1],g),this.h[2]=Xe(this.h[2],y),this.h[3]=Xe(this.h[3],S),this.h[4]=Xe(this.h[4],B),this.h[5]=Xe(this.h[5],M),this.h[6]=Xe(this.h[6],x),this.h[7]=Xe(this.h[7],I)};pr.prototype._digest=function(n){return n==="hex"?ci.toHex32(this.h,"big"):ci.split32(this.h,"big")};var u0=Xt,Mo=wo;function Er(){if(!(this instanceof Er))return new Er;Mo.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}u0.inherits(Er,Mo);var Xp=Er;Er.blockSize=512;Er.outSize=224;Er.hmacStrength=192;Er.padLength=64;Er.prototype._digest=function(n){return n==="hex"?u0.toHex32(this.h.slice(0,7),"big"):u0.split32(this.h.slice(0,7),"big")};var Ne=Xt,jp=xi,Qp=We,ur=Ne.rotr64_hi,lr=Ne.rotr64_lo,xo=Ne.shr64_hi,_o=Ne.shr64_lo,Tr=Ne.sum64,Rf=Ne.sum64_hi,Tf=Ne.sum64_lo,tm=Ne.sum64_4_hi,em=Ne.sum64_4_lo,rm=Ne.sum64_5_hi,im=Ne.sum64_5_lo,So=jp.BlockHash,nm=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function tr(){if(!(this instanceof tr))return new tr;So.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=nm,this.W=new Array(160)}Ne.inherits(tr,So);var Ao=tr;tr.blockSize=1024;tr.outSize=512;tr.hmacStrength=192;tr.padLength=128;tr.prototype._prepareBlock=function(n,s){for(var o=this.W,m=0;m<32;m++)o[m]=n[s+m];for(;m<o.length;m+=2){var f=pm(o[m-4],o[m-3]),g=mm(o[m-4],o[m-3]),y=o[m-14],S=o[m-13],B=cm(o[m-30],o[m-29]),M=vm(o[m-30],o[m-29]),x=o[m-32],I=o[m-31];o[m]=tm(f,g,y,S,B,M,x,I),o[m+1]=em(f,g,y,S,B,M,x,I)}};tr.prototype._update=function(n,s){this._prepareBlock(n,s);var o=this.W,m=this.h[0],f=this.h[1],g=this.h[2],y=this.h[3],S=this.h[4],B=this.h[5],M=this.h[6],x=this.h[7],I=this.h[8],k=this.h[9],D=this.h[10],L=this.h[11],W=this.h[12],z=this.h[13],$=this.h[14],lt=this.h[15];Qp(this.k.length===o.length);for(var H=0;H<o.length;H+=2){var At=$,Bt=lt,Ct=lm(I,k),Et=dm(I,k),Y=fm(I,k,D,L,W),It=am(I,k,D,L,W,z),p=this.k[H],t=this.k[H+1],r=o[H],i=o[H+1],a=rm(At,Bt,Ct,Et,Y,It,p,t,r,i),d=im(At,Bt,Ct,Et,Y,It,p,t,r,i);At=om(m,f),Bt=um(m,f),Ct=hm(m,f,g,y,S),Et=sm(m,f,g,y,S,B);var c=Rf(At,Bt,Ct,Et),v=Tf(At,Bt,Ct,Et);$=W,lt=z,W=D,z=L,D=I,L=k,I=Rf(M,x,a,d),k=Tf(x,x,a,d),M=S,x=B,S=g,B=y,g=m,y=f,m=Rf(a,d,c,v),f=Tf(a,d,c,v)}Tr(this.h,0,m,f),Tr(this.h,2,g,y),Tr(this.h,4,S,B),Tr(this.h,6,M,x),Tr(this.h,8,I,k),Tr(this.h,10,D,L),Tr(this.h,12,W,z),Tr(this.h,14,$,lt)};tr.prototype._digest=function(n){return n==="hex"?Ne.toHex32(this.h,"big"):Ne.split32(this.h,"big")};function fm(h,n,s,o,m){var f=h&s^~h&m;return f<0&&(f+=4294967296),f}function am(h,n,s,o,m,f){var g=n&o^~n&f;return g<0&&(g+=4294967296),g}function hm(h,n,s,o,m){var f=h&s^h&m^s&m;return f<0&&(f+=4294967296),f}function sm(h,n,s,o,m,f){var g=n&o^n&f^o&f;return g<0&&(g+=4294967296),g}function om(h,n){var s=ur(h,n,28),o=ur(n,h,2),m=ur(n,h,7),f=s^o^m;return f<0&&(f+=4294967296),f}function um(h,n){var s=lr(h,n,28),o=lr(n,h,2),m=lr(n,h,7),f=s^o^m;return f<0&&(f+=4294967296),f}function lm(h,n){var s=ur(h,n,14),o=ur(h,n,18),m=ur(n,h,9),f=s^o^m;return f<0&&(f+=4294967296),f}function dm(h,n){var s=lr(h,n,14),o=lr(h,n,18),m=lr(n,h,9),f=s^o^m;return f<0&&(f+=4294967296),f}function cm(h,n){var s=ur(h,n,1),o=ur(h,n,8),m=xo(h,n,7),f=s^o^m;return f<0&&(f+=4294967296),f}function vm(h,n){var s=lr(h,n,1),o=lr(h,n,8),m=_o(h,n,7),f=s^o^m;return f<0&&(f+=4294967296),f}function pm(h,n){var s=ur(h,n,19),o=ur(n,h,29),m=xo(h,n,6),f=s^o^m;return f<0&&(f+=4294967296),f}function mm(h,n){var s=lr(h,n,19),o=lr(n,h,29),m=_o(h,n,6),f=s^o^m;return f<0&&(f+=4294967296),f}var l0=Xt,Bo=Ao;function kr(){if(!(this instanceof kr))return new kr;Bo.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}l0.inherits(kr,Bo);var gm=kr;kr.blockSize=1024;kr.outSize=384;kr.hmacStrength=192;kr.padLength=128;kr.prototype._digest=function(n){return n==="hex"?l0.toHex32(this.h.slice(0,12),"big"):l0.split32(this.h.slice(0,12),"big")};_i.sha1=Up;_i.sha224=Xp;_i.sha256=wo;_i.sha384=gm;_i.sha512=Ao;var Eo={},jr=Xt,bm=xi,cn=jr.rotl32,Da=jr.sum32,qi=jr.sum32_3,Na=jr.sum32_4,ko=bm.BlockHash;function mr(){if(!(this instanceof mr))return new mr;ko.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}jr.inherits(mr,ko);Eo.ripemd160=mr;mr.blockSize=512;mr.outSize=160;mr.hmacStrength=192;mr.padLength=64;mr.prototype._update=function(n,s){for(var o=this.h[0],m=this.h[1],f=this.h[2],g=this.h[3],y=this.h[4],S=o,B=m,M=f,x=g,I=y,k=0;k<80;k++){var D=Da(cn(Na(o,$a(k,m,f,g),n[Mm[k]+s],ym(k)),_m[k]),y);o=y,y=g,g=cn(f,10),f=m,m=D,D=Da(cn(Na(S,$a(79-k,B,M,x),n[xm[k]+s],wm(k)),Sm[k]),I),S=I,I=x,x=cn(M,10),M=B,B=D}D=qi(this.h[1],f,x),this.h[1]=qi(this.h[2],g,I),this.h[2]=qi(this.h[3],y,S),this.h[3]=qi(this.h[4],o,B),this.h[4]=qi(this.h[0],m,M),this.h[0]=D};mr.prototype._digest=function(n){return n==="hex"?jr.toHex32(this.h,"little"):jr.split32(this.h,"little")};function $a(h,n,s,o){return h<=15?n^s^o:h<=31?n&s|~n&o:h<=47?(n|~s)^o:h<=63?n&o|s&~o:n^(s|~o)}function ym(h){return h<=15?0:h<=31?1518500249:h<=47?1859775393:h<=63?2400959708:2840853838}function wm(h){return h<=15?1352829926:h<=31?1548603684:h<=47?1836072691:h<=63?2053994217:0}var Mm=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],xm=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],_m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Sm=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Am=Xt,Bm=We;function vi(h,n,s){if(!(this instanceof vi))return new vi(h,n,s);this.Hash=h,this.blockSize=h.blockSize/8,this.outSize=h.outSize/8,this.inner=null,this.outer=null,this._init(Am.toArray(n,s))}var Em=vi;vi.prototype._init=function(n){n.length>this.blockSize&&(n=new this.Hash().update(n).digest()),Bm(n.length<=this.blockSize);for(var s=n.length;s<this.blockSize;s++)n.push(0);for(s=0;s<n.length;s++)n[s]^=54;for(this.inner=new this.Hash().update(n),s=0;s<n.length;s++)n[s]^=106;this.outer=new this.Hash().update(n)};vi.prototype.update=function(n,s){return this.inner.update(n,s),this};vi.prototype.digest=function(n){return this.outer.update(this.inner.digest()),this.outer.digest(n)};(function(h){var n=h;n.utils=Xt,n.common=xi,n.sha=_i,n.ripemd=Eo,n.hmac=Em,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})(rf);var Cf,Ua;function km(){return Ua||(Ua=1,Cf={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),Cf}(function(h){var n=h,s=rf,o=z0,m=ze,f=m.assert;function g(B){B.type==="short"?this.curve=new o.short(B):B.type==="edwards"?this.curve=new o.edwards(B):this.curve=new o.mont(B),this.g=this.curve.g,this.n=this.curve.n,this.hash=B.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}n.PresetCurve=g;function y(B,M){Object.defineProperty(n,B,{configurable:!0,enumerable:!0,get:function(){var x=new g(M);return Object.defineProperty(n,B,{configurable:!0,enumerable:!0,value:x}),x}})}y("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),y("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),y("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),y("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),y("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),y("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),y("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var S;try{S=km()}catch(B){S=void 0}y("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",S]})})(ef);var Im=rf,Jr=O0,Io=We;function Dr(h){if(!(this instanceof Dr))return new Dr(h);this.hash=h.hash,this.predResist=!!h.predResist,this.outLen=this.hash.outSize,this.minEntropy=h.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=Jr.toArray(h.entropy,h.entropyEnc||"hex"),s=Jr.toArray(h.nonce,h.nonceEnc||"hex"),o=Jr.toArray(h.pers,h.persEnc||"hex");Io(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,s,o)}var Rm=Dr;Dr.prototype._init=function(n,s,o){var m=n.concat(s).concat(o);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(m),this._reseed=1,this.reseedInterval=281474976710656};Dr.prototype._hmac=function(){return new Im.hmac(this.hash,this.K)};Dr.prototype._update=function(n){var s=this._hmac().update(this.V).update([0]);n&&(s=s.update(n)),this.K=s.digest(),this.V=this._hmac().update(this.V).digest(),n&&(this.K=this._hmac().update(this.V).update([1]).update(n).digest(),this.V=this._hmac().update(this.V).digest())};Dr.prototype.reseed=function(n,s,o,m){typeof s!="string"&&(m=o,o=s,s=null),n=Jr.toArray(n,s),o=Jr.toArray(o,m),Io(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(n.concat(o||[])),this._reseed=1};Dr.prototype.generate=function(n,s,o,m){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof s!="string"&&(m=o,o=s,s=null),o&&(o=Jr.toArray(o,m||"hex"),this._update(o));for(var f=[];f.length<n;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var g=f.slice(0,n);return this._update(o),this._reseed++,Jr.encode(g,s)};var Tm=Rr,Cm=ze,d0=Cm.assert;function Fe(h,n){this.ec=h,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}var Fm=Fe;Fe.fromPublic=function(n,s,o){return s instanceof Fe?s:new Fe(n,{pub:s,pubEnc:o})};Fe.fromPrivate=function(n,s,o){return s instanceof Fe?s:new Fe(n,{priv:s,privEnc:o})};Fe.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Fe.prototype.getPublic=function(n,s){return typeof n=="string"&&(s=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),s?this.pub.encode(s,n):this.pub};Fe.prototype.getPrivate=function(n){return n==="hex"?this.priv.toString(16,2):this.priv};Fe.prototype._importPrivate=function(n,s){this.priv=new Tm(n,s||16),this.priv=this.priv.umod(this.ec.curve.n)};Fe.prototype._importPublic=function(n,s){if(n.x||n.y){this.ec.curve.type==="mont"?d0(n.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&d0(n.x&&n.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(n.x,n.y);return}this.pub=this.ec.curve.decodePoint(n,s)};Fe.prototype.derive=function(n){return n.validate()||d0(n.validate(),"public point not validated"),n.mul(this.priv).getX()};Fe.prototype.sign=function(n,s,o){return this.ec.sign(n,this,s,o)};Fe.prototype.verify=function(n,s,o){return this.ec.verify(n,s,this,void 0,o)};Fe.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var In=Rr,H0=ze,qm=H0.assert;function ff(h,n){if(h instanceof ff)return h;this._importDER(h,n)||(qm(h.r&&h.s,"Signature without r or s"),this.r=new In(h.r,16),this.s=new In(h.s,16),h.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=h.recoveryParam)}var Pm=ff;function Dm(){this.place=0}function Ff(h,n){var s=h[n.place++];if(!(s&128))return s;var o=s&15;if(o===0||o>4||h[n.place]===0)return!1;for(var m=0,f=0,g=n.place;f<o;f++,g++)m<<=8,m|=h[g],m>>>=0;return m<=127?!1:(n.place=g,m)}function La(h){for(var n=0,s=h.length-1;!h[n]&&!(h[n+1]&128)&&n<s;)n++;return n===0?h:h.slice(n)}ff.prototype._importDER=function(n,s){n=H0.toArray(n,s);var o=new Dm;if(n[o.place++]!==48)return!1;var m=Ff(n,o);if(m===!1||m+o.place!==n.length||n[o.place++]!==2)return!1;var f=Ff(n,o);if(f===!1||n[o.place]&128)return!1;var g=n.slice(o.place,f+o.place);if(o.place+=f,n[o.place++]!==2)return!1;var y=Ff(n,o);if(y===!1||n.length!==y+o.place||n[o.place]&128)return!1;var S=n.slice(o.place,y+o.place);if(g[0]===0)if(g[1]&128)g=g.slice(1);else return!1;if(S[0]===0)if(S[1]&128)S=S.slice(1);else return!1;return this.r=new In(g),this.s=new In(S),this.recoveryParam=null,!0};function qf(h,n){if(n<128){h.push(n);return}var s=1+(Math.log(n)/Math.LN2>>>3);for(h.push(s|128);--s;)h.push(n>>>(s<<3)&255);h.push(n)}ff.prototype.toDER=function(n){var s=this.r.toArray(),o=this.s.toArray();for(s[0]&128&&(s=[0].concat(s)),o[0]&128&&(o=[0].concat(o)),s=La(s),o=La(o);!o[0]&&!(o[1]&128);)o=o.slice(1);var m=[2];qf(m,s.length),m=m.concat(s),m.push(2),qf(m,o.length);var f=m.concat(o),g=[48];return qf(g,f.length),g=g.concat(f),H0.encode(g,n)};var Pf,Oa;function Nm(){if(Oa)return Pf;Oa=1;var h=Rr,n=Rm,s=ze,o=ef,m=P0(),f=s.assert,g=Fm,y=Pm;function S(B){if(!(this instanceof S))return new S(B);typeof B=="string"&&(f(Object.prototype.hasOwnProperty.call(o,B),"Unknown curve "+B),B=o[B]),B instanceof o.PresetCurve&&(B={curve:B}),this.curve=B.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=B.curve.g,this.g.precompute(B.curve.n.bitLength()+1),this.hash=B.hash||B.curve.hash}return Pf=S,S.prototype.keyPair=function(M){return new g(this,M)},S.prototype.keyFromPrivate=function(M,x){return g.fromPrivate(this,M,x)},S.prototype.keyFromPublic=function(M,x){return g.fromPublic(this,M,x)},S.prototype.genKeyPair=function(M){M||(M={});for(var x=new n({hash:this.hash,pers:M.pers,persEnc:M.persEnc||"utf8",entropy:M.entropy||m(this.hash.hmacStrength),entropyEnc:M.entropy&&M.entropyEnc||"utf8",nonce:this.n.toArray()}),I=this.n.byteLength(),k=this.n.sub(new h(2));;){var D=new h(x.generate(I));if(!(D.cmp(k)>0))return D.iaddn(1),this.keyFromPrivate(D)}},S.prototype._truncateToN=function(M,x,I){var k;if(h.isBN(M)||typeof M=="number")M=new h(M,16),k=M.byteLength();else if(typeof M=="object")k=M.length,M=new h(M,16);else{var D=M.toString();k=D.length+1>>>1,M=new h(D,16)}typeof I!="number"&&(I=k*8);var L=I-this.n.bitLength();return L>0&&(M=M.ushrn(L)),!x&&M.cmp(this.n)>=0?M.sub(this.n):M},S.prototype.sign=function(M,x,I,k){if(typeof I=="object"&&(k=I,I=null),k||(k={}),typeof M!="string"&&typeof M!="number"&&!h.isBN(M)){f(typeof M=="object"&&M&&typeof M.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),f(M.length>>>0===M.length);for(var D=0;D<M.length;D++)f((M[D]&255)===M[D])}x=this.keyFromPrivate(x,I),M=this._truncateToN(M,!1,k.msgBitLength),f(!M.isNeg(),"Can not sign a negative message");var L=this.n.byteLength(),W=x.getPrivate().toArray("be",L),z=M.toArray("be",L);f(new h(z).eq(M),"Can not sign message");for(var $=new n({hash:this.hash,entropy:W,nonce:z,pers:k.pers,persEnc:k.persEnc||"utf8"}),lt=this.n.sub(new h(1)),H=0;;H++){var At=k.k?k.k(H):new h($.generate(this.n.byteLength()));if(At=this._truncateToN(At,!0),!(At.cmpn(1)<=0||At.cmp(lt)>=0)){var Bt=this.g.mul(At);if(!Bt.isInfinity()){var Ct=Bt.getX(),Et=Ct.umod(this.n);if(Et.cmpn(0)!==0){var Y=At.invm(this.n).mul(Et.mul(x.getPrivate()).iadd(M));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var It=(Bt.getY().isOdd()?1:0)|(Ct.cmp(Et)!==0?2:0);return k.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),It^=1),new y({r:Et,s:Y,recoveryParam:It})}}}}}},S.prototype.verify=function(M,x,I,k,D){D||(D={}),M=this._truncateToN(M,!1,D.msgBitLength),I=this.keyFromPublic(I,k),x=new y(x,"hex");var L=x.r,W=x.s;if(L.cmpn(1)<0||L.cmp(this.n)>=0||W.cmpn(1)<0||W.cmp(this.n)>=0)return!1;var z=W.invm(this.n),$=z.mul(M).umod(this.n),lt=z.mul(L).umod(this.n),H;return this.curve._maxwellTrick?(H=this.g.jmulAdd($,I.getPublic(),lt),H.isInfinity()?!1:H.eqXToP(L)):(H=this.g.mulAdd($,I.getPublic(),lt),H.isInfinity()?!1:H.getX().umod(this.n).cmp(L)===0)},S.prototype.recoverPubKey=function(B,M,x,I){f((3&x)===x,"The recovery param is more than two bits"),M=new y(M,I);var k=this.n,D=new h(B),L=M.r,W=M.s,z=x&1,$=x>>1;if(L.cmp(this.curve.p.umod(this.curve.n))>=0&&$)throw new Error("Unable to find sencond key candinate");$?L=this.curve.pointFromX(L.add(this.curve.n),z):L=this.curve.pointFromX(L,z);var lt=M.r.invm(k),H=k.sub(D).mul(lt).umod(k),At=W.mul(lt).umod(k);return this.g.mulAdd(H,L,At)},S.prototype.getKeyRecoveryParam=function(B,M,x,I){if(M=new y(M,I),M.recoveryParam!==null)return M.recoveryParam;for(var k=0;k<4;k++){var D;try{D=this.recoverPubKey(B,M,k)}catch(L){continue}if(D.eq(x))return k}throw new Error("Unable to find valid recovery factor")},Pf}var nn=ze,Ro=nn.assert,za=nn.parseBytes,Ai=nn.cachedProperty;function _e(h,n){this.eddsa=h,this._secret=za(n.secret),h.isPoint(n.pub)?this._pub=n.pub:this._pubBytes=za(n.pub)}_e.fromPublic=function(n,s){return s instanceof _e?s:new _e(n,{pub:s})};_e.fromSecret=function(n,s){return s instanceof _e?s:new _e(n,{secret:s})};_e.prototype.secret=function(){return this._secret};Ai(_e,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Ai(_e,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Ai(_e,"privBytes",function(){var n=this.eddsa,s=this.hash(),o=n.encodingLength-1,m=s.slice(0,n.encodingLength);return m[0]&=248,m[o]&=127,m[o]|=64,m});Ai(_e,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Ai(_e,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Ai(_e,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});_e.prototype.sign=function(n){return Ro(this._secret,"KeyPair can only verify"),this.eddsa.sign(n,this)};_e.prototype.verify=function(n,s){return this.eddsa.verify(n,s,this)};_e.prototype.getSecret=function(n){return Ro(this._secret,"KeyPair is public only"),nn.encode(this.secret(),n)};_e.prototype.getPublic=function(n){return nn.encode(this.pubBytes(),n)};var $m=_e,Um=Rr,af=ze,Ka=af.assert,hf=af.cachedProperty,Lm=af.parseBytes;function ri(h,n){this.eddsa=h,typeof n!="object"&&(n=Lm(n)),Array.isArray(n)&&(Ka(n.length===h.encodingLength*2,"Signature has invalid size"),n={R:n.slice(0,h.encodingLength),S:n.slice(h.encodingLength)}),Ka(n.R&&n.S,"Signature without R or S"),h.isPoint(n.R)&&(this._R=n.R),n.S instanceof Um&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}hf(ri,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});hf(ri,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});hf(ri,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});hf(ri,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});ri.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};ri.prototype.toHex=function(){return af.encode(this.toBytes(),"hex").toUpperCase()};var Om=ri,zm=rf,Km=ef,pi=ze,Hm=pi.assert,To=pi.parseBytes,Co=$m,Ha=Om;function $e(h){if(Hm(h==="ed25519","only tested with ed25519 so far"),!(this instanceof $e))return new $e(h);h=Km[h].curve,this.curve=h,this.g=h.g,this.g.precompute(h.n.bitLength()+1),this.pointClass=h.point().constructor,this.encodingLength=Math.ceil(h.n.bitLength()/8),this.hash=zm.sha512}var Zm=$e;$e.prototype.sign=function(n,s){n=To(n);var o=this.keyFromSecret(s),m=this.hashInt(o.messagePrefix(),n),f=this.g.mul(m),g=this.encodePoint(f),y=this.hashInt(g,o.pubBytes(),n).mul(o.priv()),S=m.add(y).umod(this.curve.n);return this.makeSignature({R:f,S,Rencoded:g})};$e.prototype.verify=function(n,s,o){if(n=To(n),s=this.makeSignature(s),s.S().gte(s.eddsa.curve.n)||s.S().isNeg())return!1;var m=this.keyFromPublic(o),f=this.hashInt(s.Rencoded(),m.pubBytes(),n),g=this.g.mul(s.S()),y=s.R().add(m.pub().mul(f));return y.eq(g)};$e.prototype.hashInt=function(){for(var n=this.hash(),s=0;s<arguments.length;s++)n.update(arguments[s]);return pi.intFromLE(n.digest()).umod(this.curve.n)};$e.prototype.keyFromPublic=function(n){return Co.fromPublic(this,n)};$e.prototype.keyFromSecret=function(n){return Co.fromSecret(this,n)};$e.prototype.makeSignature=function(n){return n instanceof Ha?n:new Ha(this,n)};$e.prototype.encodePoint=function(n){var s=n.getY().toArray("le",this.encodingLength);return s[this.encodingLength-1]|=n.getX().isOdd()?128:0,s};$e.prototype.decodePoint=function(n){n=pi.parseBytes(n);var s=n.length-1,o=n.slice(0,s).concat(n[s]&-129),m=(n[s]&128)!==0,f=pi.intFromLE(o);return this.curve.pointFromY(f,m)};$e.prototype.encodeInt=function(n){return n.toArray("le",this.encodingLength)};$e.prototype.decodeInt=function(n){return pi.intFromLE(n)};$e.prototype.isPoint=function(n){return n instanceof this.pointClass};var Za;function Z0(){return Za||(Za=1,function(h){var n=h;n.version=Wv.version,n.utils=ze,n.rand=P0(),n.curve=z0,n.curves=ef,n.ec=Nm(),n.eddsa=Zm}(kf)),kf}var rr={},Df={},W0={exports:{}};W0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(W0);var Wm=W0.exports,Nf={},Wa;function Vm(){return Wa||(Wa=1,function(h){var n=fn(),s=Jt,o=h;o.define=function(g,y){return new m(g,y)};function m(f,g){this.name=f,this.body=g,this.decoders={},this.encoders={}}m.prototype._createNamed=function(g){var y;try{y=De.runInThisContext("(function "+this.name+`(entity) {
|
|
12
|
+
*/var Bc=50;mt.TYPED_ARRAY_SUPPORT=Li.TYPED_ARRAY_SUPPORT!==void 0?Li.TYPED_ARRAY_SUPPORT:!0;Sn();function Sn(){return mt.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function xr(h,n){if(Sn()<n)throw new RangeError("Invalid typed array length");return mt.TYPED_ARRAY_SUPPORT?(h=new Uint8Array(n),h.__proto__=mt.prototype):(h===null&&(h=new mt(n)),h.length=n),h}function mt(h,n,s){if(!mt.TYPED_ARRAY_SUPPORT&&!(this instanceof mt))return new mt(h,n,s);if(typeof h=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return E0(this,h)}return ds(this,h,n,s)}mt.poolSize=8192;mt._augment=function(h){return h.__proto__=mt.prototype,h};function ds(h,n,s,o){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&n instanceof ArrayBuffer?Ic(h,n,s,o):typeof n=="string"?kc(h,n,s):Rc(h,n)}mt.from=function(h,n,s){return ds(null,h,n,s)};mt.TYPED_ARRAY_SUPPORT&&(mt.prototype.__proto__=Uint8Array.prototype,mt.__proto__=Uint8Array,typeof Symbol!="undefined"&&Symbol.species&&mt[Symbol.species]);function cs(h){if(typeof h!="number")throw new TypeError('"size" argument must be a number');if(h<0)throw new RangeError('"size" argument must not be negative')}function Ec(h,n,s,o){return cs(n),n<=0?xr(h,n):s!==void 0?typeof o=="string"?xr(h,n).fill(s,o):xr(h,n).fill(s):xr(h,n)}mt.alloc=function(h,n,s){return Ec(null,h,n,s)};function E0(h,n){if(cs(n),h=xr(h,n<0?0:k0(n)|0),!mt.TYPED_ARRAY_SUPPORT)for(var s=0;s<n;++s)h[s]=0;return h}mt.allocUnsafe=function(h){return E0(null,h)};mt.allocUnsafeSlow=function(h){return E0(null,h)};function kc(h,n,s){if((typeof s!="string"||s==="")&&(s="utf8"),!mt.isEncoding(s))throw new TypeError('"encoding" must be a valid string encoding');var o=vs(n,s)|0;h=xr(h,o);var m=h.write(n,s);return m!==o&&(h=h.slice(0,m)),h}function n0(h,n){var s=n.length<0?0:k0(n.length)|0;h=xr(h,s);for(var o=0;o<s;o+=1)h[o]=n[o]&255;return h}function Ic(h,n,s,o){if(n.byteLength,s<0||n.byteLength<s)throw new RangeError("'offset' is out of bounds");if(n.byteLength<s+(o||0))throw new RangeError("'length' is out of bounds");return s===void 0&&o===void 0?n=new Uint8Array(n):o===void 0?n=new Uint8Array(n,s):n=new Uint8Array(n,s,o),mt.TYPED_ARRAY_SUPPORT?(h=n,h.__proto__=mt.prototype):h=n0(h,n),h}function Rc(h,n){if(cr(n)){var s=k0(n.length)|0;return h=xr(h,s),h.length===0||n.copy(h,0,0,s),h}if(n){if(typeof ArrayBuffer!="undefined"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||Jc(n.length)?xr(h,0):n0(h,n);if(n.type==="Buffer"&&ls(n.data))return n0(h,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function k0(h){if(h>=Sn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Sn().toString(16)+" bytes");return h|0}mt.isBuffer=Gc;function cr(h){return!!(h!=null&&h._isBuffer)}mt.compare=function(n,s){if(!cr(n)||!cr(s))throw new TypeError("Arguments must be Buffers");if(n===s)return 0;for(var o=n.length,m=s.length,f=0,g=Math.min(o,m);f<g;++f)if(n[f]!==s[f]){o=n[f],m=s[f];break}return o<m?-1:m<o?1:0};mt.isEncoding=function(n){switch(String(n).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}};mt.concat=function(n,s){if(!ls(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return mt.alloc(0);var o;if(s===void 0)for(s=0,o=0;o<n.length;++o)s+=n[o].length;var m=mt.allocUnsafe(s),f=0;for(o=0;o<n.length;++o){var g=n[o];if(!cr(g))throw new TypeError('"list" argument must be an Array of Buffers');g.copy(m,f),f+=g.length}return m};function vs(h,n){if(cr(h))return h.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(h)||h instanceof ArrayBuffer))return h.byteLength;typeof h!="string"&&(h=""+h);var s=h.length;if(s===0)return 0;for(var o=!1;;)switch(n){case"ascii":case"latin1":case"binary":return s;case"utf8":case"utf-8":case void 0:return An(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s*2;case"hex":return s>>>1;case"base64":return Ms(h).length;default:if(o)return An(h).length;n=(""+n).toLowerCase(),o=!0}}mt.byteLength=vs;function Tc(h,n,s){var o=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((s===void 0||s>this.length)&&(s=this.length),s<=0)||(s>>>=0,n>>>=0,s<=n))return"";for(h||(h="utf8");;)switch(h){case"hex":return Oc(this,n,s);case"utf8":case"utf-8":return gs(this,n,s);case"ascii":return Uc(this,n,s);case"latin1":case"binary":return Lc(this,n,s);case"base64":return Nc(this,n,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zc(this,n,s);default:if(o)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),o=!0}}mt.prototype._isBuffer=!0;function Yr(h,n,s){var o=h[n];h[n]=h[s],h[s]=o}mt.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var s=0;s<n;s+=2)Yr(this,s,s+1);return this};mt.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var s=0;s<n;s+=4)Yr(this,s,s+3),Yr(this,s+1,s+2);return this};mt.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var s=0;s<n;s+=8)Yr(this,s,s+7),Yr(this,s+1,s+6),Yr(this,s+2,s+5),Yr(this,s+3,s+4);return this};mt.prototype.toString=function(){var n=this.length|0;return n===0?"":arguments.length===0?gs(this,0,n):Tc.apply(this,arguments)};mt.prototype.equals=function(n){if(!cr(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:mt.compare(this,n)===0};mt.prototype.inspect=function(){var n="",s=Bc;return this.length>0&&(n=this.toString("hex",0,s).match(/.{2}/g).join(" "),this.length>s&&(n+=" ... ")),"<Buffer "+n+">"};mt.prototype.compare=function(n,s,o,m,f){if(!cr(n))throw new TypeError("Argument must be a Buffer");if(s===void 0&&(s=0),o===void 0&&(o=n?n.length:0),m===void 0&&(m=0),f===void 0&&(f=this.length),s<0||o>n.length||m<0||f>this.length)throw new RangeError("out of range index");if(m>=f&&s>=o)return 0;if(m>=f)return-1;if(s>=o)return 1;if(s>>>=0,o>>>=0,m>>>=0,f>>>=0,this===n)return 0;for(var g=f-m,y=o-s,S=Math.min(g,y),B=this.slice(m,f),M=n.slice(s,o),x=0;x<S;++x)if(B[x]!==M[x]){g=B[x],y=M[x];break}return g<y?-1:y<g?1:0};function ps(h,n,s,o,m){if(h.length===0)return-1;if(typeof s=="string"?(o=s,s=0):s>2147483647?s=2147483647:s<-2147483648&&(s=-2147483648),s=+s,isNaN(s)&&(s=m?0:h.length-1),s<0&&(s=h.length+s),s>=h.length){if(m)return-1;s=h.length-1}else if(s<0)if(m)s=0;else return-1;if(typeof n=="string"&&(n=mt.from(n,o)),cr(n))return n.length===0?-1:wa(h,n,s,o,m);if(typeof n=="number")return n=n&255,mt.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?m?Uint8Array.prototype.indexOf.call(h,n,s):Uint8Array.prototype.lastIndexOf.call(h,n,s):wa(h,[n],s,o,m);throw new TypeError("val must be string, number or Buffer")}function wa(h,n,s,o,m){var f=1,g=h.length,y=n.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(h.length<2||n.length<2)return-1;f=2,g/=2,y/=2,s/=2}function S(k,D){return f===1?k[D]:k.readUInt16BE(D*f)}var B;if(m){var M=-1;for(B=s;B<g;B++)if(S(h,B)===S(n,M===-1?0:B-M)){if(M===-1&&(M=B),B-M+1===y)return M*f}else M!==-1&&(B-=B-M),M=-1}else for(s+y>g&&(s=g-y),B=s;B>=0;B--){for(var x=!0,I=0;I<y;I++)if(S(h,B+I)!==S(n,I)){x=!1;break}if(x)return B}return-1}mt.prototype.includes=function(n,s,o){return this.indexOf(n,s,o)!==-1};mt.prototype.indexOf=function(n,s,o){return ps(this,n,s,o,!0)};mt.prototype.lastIndexOf=function(n,s,o){return ps(this,n,s,o,!1)};function Cc(h,n,s,o){s=Number(s)||0;var m=h.length-s;o?(o=Number(o),o>m&&(o=m)):o=m;var f=n.length;if(f%2!==0)throw new TypeError("Invalid hex string");o>f/2&&(o=f/2);for(var g=0;g<o;++g){var y=parseInt(n.substr(g*2,2),16);if(isNaN(y))return g;h[s+g]=y}return g}function Fc(h,n,s,o){return Hn(An(n,h.length-s),h,s,o)}function ms(h,n,s,o){return Hn(Vc(n),h,s,o)}function qc(h,n,s,o){return ms(h,n,s,o)}function Pc(h,n,s,o){return Hn(Ms(n),h,s,o)}function Dc(h,n,s,o){return Hn(Yc(n,h.length-s),h,s,o)}mt.prototype.write=function(n,s,o,m){if(s===void 0)m="utf8",o=this.length,s=0;else if(o===void 0&&typeof s=="string")m=s,o=this.length,s=0;else if(isFinite(s))s=s|0,isFinite(o)?(o=o|0,m===void 0&&(m="utf8")):(m=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-s;if((o===void 0||o>f)&&(o=f),n.length>0&&(o<0||s<0)||s>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");for(var g=!1;;)switch(m){case"hex":return Cc(this,n,s,o);case"utf8":case"utf-8":return Fc(this,n,s,o);case"ascii":return ms(this,n,s,o);case"latin1":case"binary":return qc(this,n,s,o);case"base64":return Pc(this,n,s,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dc(this,n,s,o);default:if(g)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),g=!0}};mt.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nc(h,n,s){return n===0&&s===h.length?ya(h):ya(h.slice(n,s))}function gs(h,n,s){s=Math.min(h.length,s);for(var o=[],m=n;m<s;){var f=h[m],g=null,y=f>239?4:f>223?3:f>191?2:1;if(m+y<=s){var S,B,M,x;switch(y){case 1:f<128&&(g=f);break;case 2:S=h[m+1],(S&192)===128&&(x=(f&31)<<6|S&63,x>127&&(g=x));break;case 3:S=h[m+1],B=h[m+2],(S&192)===128&&(B&192)===128&&(x=(f&15)<<12|(S&63)<<6|B&63,x>2047&&(x<55296||x>57343)&&(g=x));break;case 4:S=h[m+1],B=h[m+2],M=h[m+3],(S&192)===128&&(B&192)===128&&(M&192)===128&&(x=(f&15)<<18|(S&63)<<12|(B&63)<<6|M&63,x>65535&&x<1114112&&(g=x))}}g===null?(g=65533,y=1):g>65535&&(g-=65536,o.push(g>>>10&1023|55296),g=56320|g&1023),o.push(g),m+=y}return $c(o)}var Ma=4096;function $c(h){var n=h.length;if(n<=Ma)return String.fromCharCode.apply(String,h);for(var s="",o=0;o<n;)s+=String.fromCharCode.apply(String,h.slice(o,o+=Ma));return s}function Uc(h,n,s){var o="";s=Math.min(h.length,s);for(var m=n;m<s;++m)o+=String.fromCharCode(h[m]&127);return o}function Lc(h,n,s){var o="";s=Math.min(h.length,s);for(var m=n;m<s;++m)o+=String.fromCharCode(h[m]);return o}function Oc(h,n,s){var o=h.length;(!n||n<0)&&(n=0),(!s||s<0||s>o)&&(s=o);for(var m="",f=n;f<s;++f)m+=Wc(h[f]);return m}function zc(h,n,s){for(var o=h.slice(n,s),m="",f=0;f<o.length;f+=2)m+=String.fromCharCode(o[f]+o[f+1]*256);return m}mt.prototype.slice=function(n,s){var o=this.length;n=~~n,s=s===void 0?o:~~s,n<0?(n+=o,n<0&&(n=0)):n>o&&(n=o),s<0?(s+=o,s<0&&(s=0)):s>o&&(s=o),s<n&&(s=n);var m;if(mt.TYPED_ARRAY_SUPPORT)m=this.subarray(n,s),m.__proto__=mt.prototype;else{var f=s-n;m=new mt(f,void 0);for(var g=0;g<f;++g)m[g]=this[g+n]}return m};function Ae(h,n,s){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+n>s)throw new RangeError("Trying to access beyond buffer length")}mt.prototype.readUIntLE=function(n,s,o){n=n|0,s=s|0,o||Ae(n,s,this.length);for(var m=this[n],f=1,g=0;++g<s&&(f*=256);)m+=this[n+g]*f;return m};mt.prototype.readUIntBE=function(n,s,o){n=n|0,s=s|0,o||Ae(n,s,this.length);for(var m=this[n+--s],f=1;s>0&&(f*=256);)m+=this[n+--s]*f;return m};mt.prototype.readUInt8=function(n,s){return s||Ae(n,1,this.length),this[n]};mt.prototype.readUInt16LE=function(n,s){return s||Ae(n,2,this.length),this[n]|this[n+1]<<8};mt.prototype.readUInt16BE=function(n,s){return s||Ae(n,2,this.length),this[n]<<8|this[n+1]};mt.prototype.readUInt32LE=function(n,s){return s||Ae(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216};mt.prototype.readUInt32BE=function(n,s){return s||Ae(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])};mt.prototype.readIntLE=function(n,s,o){n=n|0,s=s|0,o||Ae(n,s,this.length);for(var m=this[n],f=1,g=0;++g<s&&(f*=256);)m+=this[n+g]*f;return f*=128,m>=f&&(m-=Math.pow(2,8*s)),m};mt.prototype.readIntBE=function(n,s,o){n=n|0,s=s|0,o||Ae(n,s,this.length);for(var m=s,f=1,g=this[n+--m];m>0&&(f*=256);)g+=this[n+--m]*f;return f*=128,g>=f&&(g-=Math.pow(2,8*s)),g};mt.prototype.readInt8=function(n,s){return s||Ae(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]};mt.prototype.readInt16LE=function(n,s){s||Ae(n,2,this.length);var o=this[n]|this[n+1]<<8;return o&32768?o|4294901760:o};mt.prototype.readInt16BE=function(n,s){s||Ae(n,2,this.length);var o=this[n+1]|this[n]<<8;return o&32768?o|4294901760:o};mt.prototype.readInt32LE=function(n,s){return s||Ae(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24};mt.prototype.readInt32BE=function(n,s){return s||Ae(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]};mt.prototype.readFloatLE=function(n,s){return s||Ae(n,4,this.length),On(this,n,!0,23,4)};mt.prototype.readFloatBE=function(n,s){return s||Ae(n,4,this.length),On(this,n,!1,23,4)};mt.prototype.readDoubleLE=function(n,s){return s||Ae(n,8,this.length),On(this,n,!0,52,8)};mt.prototype.readDoubleBE=function(n,s){return s||Ae(n,8,this.length),On(this,n,!1,52,8)};function Ue(h,n,s,o,m,f){if(!cr(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>m||n<f)throw new RangeError('"value" argument is out of bounds');if(s+o>h.length)throw new RangeError("Index out of range")}mt.prototype.writeUIntLE=function(n,s,o,m){if(n=+n,s=s|0,o=o|0,!m){var f=Math.pow(2,8*o)-1;Ue(this,n,s,o,f,0)}var g=1,y=0;for(this[s]=n&255;++y<o&&(g*=256);)this[s+y]=n/g&255;return s+o};mt.prototype.writeUIntBE=function(n,s,o,m){if(n=+n,s=s|0,o=o|0,!m){var f=Math.pow(2,8*o)-1;Ue(this,n,s,o,f,0)}var g=o-1,y=1;for(this[s+g]=n&255;--g>=0&&(y*=256);)this[s+g]=n/y&255;return s+o};mt.prototype.writeUInt8=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,1,255,0),mt.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[s]=n&255,s+1};function zn(h,n,s,o){n<0&&(n=65535+n+1);for(var m=0,f=Math.min(h.length-s,2);m<f;++m)h[s+m]=(n&255<<8*(o?m:1-m))>>>(o?m:1-m)*8}mt.prototype.writeUInt16LE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,2,65535,0),mt.TYPED_ARRAY_SUPPORT?(this[s]=n&255,this[s+1]=n>>>8):zn(this,n,s,!0),s+2};mt.prototype.writeUInt16BE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,2,65535,0),mt.TYPED_ARRAY_SUPPORT?(this[s]=n>>>8,this[s+1]=n&255):zn(this,n,s,!1),s+2};function Kn(h,n,s,o){n<0&&(n=4294967295+n+1);for(var m=0,f=Math.min(h.length-s,4);m<f;++m)h[s+m]=n>>>(o?m:3-m)*8&255}mt.prototype.writeUInt32LE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,4,4294967295,0),mt.TYPED_ARRAY_SUPPORT?(this[s+3]=n>>>24,this[s+2]=n>>>16,this[s+1]=n>>>8,this[s]=n&255):Kn(this,n,s,!0),s+4};mt.prototype.writeUInt32BE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,4,4294967295,0),mt.TYPED_ARRAY_SUPPORT?(this[s]=n>>>24,this[s+1]=n>>>16,this[s+2]=n>>>8,this[s+3]=n&255):Kn(this,n,s,!1),s+4};mt.prototype.writeIntLE=function(n,s,o,m){if(n=+n,s=s|0,!m){var f=Math.pow(2,8*o-1);Ue(this,n,s,o,f-1,-f)}var g=0,y=1,S=0;for(this[s]=n&255;++g<o&&(y*=256);)n<0&&S===0&&this[s+g-1]!==0&&(S=1),this[s+g]=(n/y>>0)-S&255;return s+o};mt.prototype.writeIntBE=function(n,s,o,m){if(n=+n,s=s|0,!m){var f=Math.pow(2,8*o-1);Ue(this,n,s,o,f-1,-f)}var g=o-1,y=1,S=0;for(this[s+g]=n&255;--g>=0&&(y*=256);)n<0&&S===0&&this[s+g+1]!==0&&(S=1),this[s+g]=(n/y>>0)-S&255;return s+o};mt.prototype.writeInt8=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,1,127,-128),mt.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[s]=n&255,s+1};mt.prototype.writeInt16LE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,2,32767,-32768),mt.TYPED_ARRAY_SUPPORT?(this[s]=n&255,this[s+1]=n>>>8):zn(this,n,s,!0),s+2};mt.prototype.writeInt16BE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,2,32767,-32768),mt.TYPED_ARRAY_SUPPORT?(this[s]=n>>>8,this[s+1]=n&255):zn(this,n,s,!1),s+2};mt.prototype.writeInt32LE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,4,2147483647,-2147483648),mt.TYPED_ARRAY_SUPPORT?(this[s]=n&255,this[s+1]=n>>>8,this[s+2]=n>>>16,this[s+3]=n>>>24):Kn(this,n,s,!0),s+4};mt.prototype.writeInt32BE=function(n,s,o){return n=+n,s=s|0,o||Ue(this,n,s,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),mt.TYPED_ARRAY_SUPPORT?(this[s]=n>>>24,this[s+1]=n>>>16,this[s+2]=n>>>8,this[s+3]=n&255):Kn(this,n,s,!1),s+4};function bs(h,n,s,o,m,f){if(s+o>h.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("Index out of range")}function ys(h,n,s,o,m){return m||bs(h,n,s,4),us(h,n,s,o,23,4),s+4}mt.prototype.writeFloatLE=function(n,s,o){return ys(this,n,s,!0,o)};mt.prototype.writeFloatBE=function(n,s,o){return ys(this,n,s,!1,o)};function ws(h,n,s,o,m){return m||bs(h,n,s,8),us(h,n,s,o,52,8),s+8}mt.prototype.writeDoubleLE=function(n,s,o){return ws(this,n,s,!0,o)};mt.prototype.writeDoubleBE=function(n,s,o){return ws(this,n,s,!1,o)};mt.prototype.copy=function(n,s,o,m){if(o||(o=0),!m&&m!==0&&(m=this.length),s>=n.length&&(s=n.length),s||(s=0),m>0&&m<o&&(m=o),m===o||n.length===0||this.length===0)return 0;if(s<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("sourceStart out of bounds");if(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),n.length-s<m-o&&(m=n.length-s+o);var f=m-o,g;if(this===n&&o<s&&s<m)for(g=f-1;g>=0;--g)n[g+s]=this[g+o];else if(f<1e3||!mt.TYPED_ARRAY_SUPPORT)for(g=0;g<f;++g)n[g+s]=this[g+o];else Uint8Array.prototype.set.call(n,this.subarray(o,o+f),s);return f};mt.prototype.fill=function(n,s,o,m){if(typeof n=="string"){if(typeof s=="string"?(m=s,s=0,o=this.length):typeof o=="string"&&(m=o,o=this.length),n.length===1){var f=n.charCodeAt(0);f<256&&(n=f)}if(m!==void 0&&typeof m!="string")throw new TypeError("encoding must be a string");if(typeof m=="string"&&!mt.isEncoding(m))throw new TypeError("Unknown encoding: "+m)}else typeof n=="number"&&(n=n&255);if(s<0||this.length<s||this.length<o)throw new RangeError("Out of range index");if(o<=s)return this;s=s>>>0,o=o===void 0?this.length:o>>>0,n||(n=0);var g;if(typeof n=="number")for(g=s;g<o;++g)this[g]=n;else{var y=cr(n)?n:An(new mt(n,m).toString()),S=y.length;for(g=0;g<o-s;++g)this[g+s]=y[g%S]}return this};var Kc=/[^+\/0-9A-Za-z-_]/g;function Hc(h){if(h=Zc(h).replace(Kc,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Zc(h){return h.trim?h.trim():h.replace(/^\s+|\s+$/g,"")}function Wc(h){return h<16?"0"+h.toString(16):h.toString(16)}function An(h,n){n=n||1/0;for(var s,o=h.length,m=null,f=[],g=0;g<o;++g){if(s=h.charCodeAt(g),s>55295&&s<57344){if(!m){if(s>56319){(n-=3)>-1&&f.push(239,191,189);continue}else if(g+1===o){(n-=3)>-1&&f.push(239,191,189);continue}m=s;continue}if(s<56320){(n-=3)>-1&&f.push(239,191,189),m=s;continue}s=(m-55296<<10|s-56320)+65536}else m&&(n-=3)>-1&&f.push(239,191,189);if(m=null,s<128){if((n-=1)<0)break;f.push(s)}else if(s<2048){if((n-=2)<0)break;f.push(s>>6|192,s&63|128)}else if(s<65536){if((n-=3)<0)break;f.push(s>>12|224,s>>6&63|128,s&63|128)}else if(s<1114112){if((n-=4)<0)break;f.push(s>>18|240,s>>12&63|128,s>>6&63|128,s&63|128)}else throw new Error("Invalid code point")}return f}function Vc(h){for(var n=[],s=0;s<h.length;++s)n.push(h.charCodeAt(s)&255);return n}function Yc(h,n){for(var s,o,m,f=[],g=0;g<h.length&&!((n-=2)<0);++g)s=h.charCodeAt(g),o=s>>8,m=s%256,f.push(m),f.push(o);return f}function Ms(h){return xc(Hc(h))}function Hn(h,n,s,o){for(var m=0;m<o&&!(m+s>=n.length||m>=h.length);++m)n[m+s]=h[m];return m}function Jc(h){return h!==h}function Gc(h){return h!=null&&(!!h._isBuffer||xs(h)||Xc(h))}function xs(h){return!!h.constructor&&typeof h.constructor.isBuffer=="function"&&h.constructor.isBuffer(h)}function Xc(h){return typeof h.readFloatLE=="function"&&typeof h.slice=="function"&&xs(h.slice(0,0))}var Xi=function(n,s){for(var o=Math.min(n.length,s.length),m=new mt(o),f=0;f<o;++f)m[f]=n[f]^s[f];return m},_s=Xi;A0.encrypt=function(h,n){var s=_s(n,h._prev);return h._prev=h._cipher.encryptBlock(s),h._prev};A0.decrypt=function(h,n){var s=h._prev;h._prev=n;var o=h._cipher.decryptBlock(n);return _s(o,s)};var Ss={},Di=Ot.Buffer,jc=Xi;function xa(h,n,s){var o=n.length,m=jc(n,h._cache);return h._cache=h._cache.slice(o),h._prev=Di.concat([h._prev,s?n:m]),m}Ss.encrypt=function(h,n,s){for(var o=Di.allocUnsafe(0),m;n.length;)if(h._cache.length===0&&(h._cache=h._cipher.encryptBlock(h._prev),h._prev=Di.allocUnsafe(0)),h._cache.length<=n.length)m=h._cache.length,o=Di.concat([o,xa(h,n.slice(0,m),s)]),n=n.slice(m);else{o=Di.concat([o,xa(h,n,s)]);break}return o};var As={},f0=Ot.Buffer;function Qc(h,n,s){var o=h._cipher.encryptBlock(h._prev),m=o[0]^n;return h._prev=f0.concat([h._prev.slice(1),f0.from([s?n:m])]),m}As.encrypt=function(h,n,s){for(var o=n.length,m=f0.allocUnsafe(o),f=-1;++f<o;)m[f]=Qc(h,n[f],s);return m};var Bs={},yn=Ot.Buffer;function t1(h,n,s){for(var o,m=-1,f=8,g=0,y,S;++m<f;)o=h._cipher.encryptBlock(h._prev),y=n&1<<7-m?128:0,S=o[0]^y,g+=(S&128)>>m%8,h._prev=e1(h._prev,s?y:S);return g}function e1(h,n){var s=h.length,o=-1,m=yn.allocUnsafe(h.length);for(h=yn.concat([h,yn.from([n])]);++o<s;)m[o]=h[o]<<1|h[o+1]>>7;return m}Bs.encrypt=function(h,n,s){for(var o=n.length,m=yn.allocUnsafe(o),f=-1;++f<o;)m[f]=t1(h,n[f],s);return m};var Es={},r1=Xi;function i1(h){return h._prev=h._cipher.encryptBlock(h._prev),h._prev}Es.encrypt=function(h,n){for(;h._cache.length<n.length;)h._cache=mt.concat([h._cache,i1(h)]);var s=h._cache.slice(0,n.length);return h._cache=h._cache.slice(n.length),r1(n,s)};var a0={};function n1(h){for(var n=h.length,s;n--;)if(s=h.readUInt8(n),s===255)h.writeUInt8(0,n);else{s++,h.writeUInt8(s,n);break}}var ks=n1,f1=Xi,_a=Ot.Buffer,a1=ks;function h1(h){var n=h._cipher.encryptBlockRaw(h._prev);return a1(h._prev),n}var gf=16;a0.encrypt=function(h,n){var s=Math.ceil(n.length/gf),o=h._cache.length;h._cache=_a.concat([h._cache,_a.allocUnsafe(s*gf)]);for(var m=0;m<s;m++){var f=h1(h),g=o+m*gf;h._cache.writeUInt32BE(f[0],g+0),h._cache.writeUInt32BE(f[1],g+4),h._cache.writeUInt32BE(f[2],g+8),h._cache.writeUInt32BE(f[3],g+12)}var y=h._cache.slice(0,n.length);return h._cache=h._cache.slice(n.length),f1(n,y)};const s1={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},o1={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},u1={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},Is={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:s1,aes192:o1,aes256:u1,"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}};var l1={ECB:S0,CBC:A0,CFB:Ss,CFB8:As,CFB1:Bs,OFB:Es,CTR:a0,GCM:a0},wn=Is;for(var Sa in wn)wn[Sa].module=l1[wn[Sa].mode];var I0=wn,ji={},Bn=Ot.Buffer;function R0(h){Bn.isBuffer(h)||(h=Bn.from(h));for(var n=h.length/4|0,s=new Array(n),o=0;o<n;o++)s[o]=h.readUInt32BE(o*4);return s}function bf(h){for(var n=0;n<h.length;h++)h[n]=0}function Rs(h,n,s,o,m){for(var f=s[0],g=s[1],y=s[2],S=s[3],B=h[0]^n[0],M=h[1]^n[1],x=h[2]^n[2],I=h[3]^n[3],k,D,L,W,z=4,$=1;$<m;$++)k=f[B>>>24]^g[M>>>16&255]^y[x>>>8&255]^S[I&255]^n[z++],D=f[M>>>24]^g[x>>>16&255]^y[I>>>8&255]^S[B&255]^n[z++],L=f[x>>>24]^g[I>>>16&255]^y[B>>>8&255]^S[M&255]^n[z++],W=f[I>>>24]^g[B>>>16&255]^y[M>>>8&255]^S[x&255]^n[z++],B=k,M=D,x=L,I=W;return k=(o[B>>>24]<<24|o[M>>>16&255]<<16|o[x>>>8&255]<<8|o[I&255])^n[z++],D=(o[M>>>24]<<24|o[x>>>16&255]<<16|o[I>>>8&255]<<8|o[B&255])^n[z++],L=(o[x>>>24]<<24|o[I>>>16&255]<<16|o[B>>>8&255]<<8|o[M&255])^n[z++],W=(o[I>>>24]<<24|o[B>>>16&255]<<16|o[M>>>8&255]<<8|o[x&255])^n[z++],k=k>>>0,D=D>>>0,L=L>>>0,W=W>>>0,[k,D,L,W]}var d1=[0,1,2,4,8,16,32,64,128,27,54],be=function(){for(var h=new Array(256),n=0;n<256;n++)n<128?h[n]=n<<1:h[n]=n<<1^283;for(var s=[],o=[],m=[[],[],[],[]],f=[[],[],[],[]],g=0,y=0,S=0;S<256;++S){var B=y^y<<1^y<<2^y<<3^y<<4;B=B>>>8^B&255^99,s[g]=B,o[B]=g;var M=h[g],x=h[M],I=h[x],k=h[B]*257^B*16843008;m[0][g]=k<<24|k>>>8,m[1][g]=k<<16|k>>>16,m[2][g]=k<<8|k>>>24,m[3][g]=k,k=I*16843009^x*65537^M*257^g*16843008,f[0][B]=k<<24|k>>>8,f[1][B]=k<<16|k>>>16,f[2][B]=k<<8|k>>>24,f[3][B]=k,g===0?g=y=1:(g=M^h[h[h[I^M]]],y^=h[h[y]])}return{SBOX:s,INV_SBOX:o,SUB_MIX:m,INV_SUB_MIX:f}}();function Ze(h){this._key=R0(h),this._reset()}Ze.blockSize=4*4;Ze.keySize=256/8;Ze.prototype.blockSize=Ze.blockSize;Ze.prototype.keySize=Ze.keySize;Ze.prototype._reset=function(){for(var h=this._key,n=h.length,s=n+6,o=(s+1)*4,m=[],f=0;f<n;f++)m[f]=h[f];for(f=n;f<o;f++){var g=m[f-1];f%n===0?(g=g<<8|g>>>24,g=be.SBOX[g>>>24]<<24|be.SBOX[g>>>16&255]<<16|be.SBOX[g>>>8&255]<<8|be.SBOX[g&255],g^=d1[f/n|0]<<24):n>6&&f%n===4&&(g=be.SBOX[g>>>24]<<24|be.SBOX[g>>>16&255]<<16|be.SBOX[g>>>8&255]<<8|be.SBOX[g&255]),m[f]=m[f-n]^g}for(var y=[],S=0;S<o;S++){var B=o-S,M=m[B-(S%4?0:4)];S<4||B<=4?y[S]=M:y[S]=be.INV_SUB_MIX[0][be.SBOX[M>>>24]]^be.INV_SUB_MIX[1][be.SBOX[M>>>16&255]]^be.INV_SUB_MIX[2][be.SBOX[M>>>8&255]]^be.INV_SUB_MIX[3][be.SBOX[M&255]]}this._nRounds=s,this._keySchedule=m,this._invKeySchedule=y};Ze.prototype.encryptBlockRaw=function(h){return h=R0(h),Rs(h,this._keySchedule,be.SUB_MIX,be.SBOX,this._nRounds)};Ze.prototype.encryptBlock=function(h){var n=this.encryptBlockRaw(h),s=Bn.allocUnsafe(16);return s.writeUInt32BE(n[0],0),s.writeUInt32BE(n[1],4),s.writeUInt32BE(n[2],8),s.writeUInt32BE(n[3],12),s};Ze.prototype.decryptBlock=function(h){h=R0(h);var n=h[1];h[1]=h[3],h[3]=n;var s=Rs(h,this._invKeySchedule,be.INV_SUB_MIX,be.INV_SBOX,this._nRounds),o=Bn.allocUnsafe(16);return o.writeUInt32BE(s[0],0),o.writeUInt32BE(s[3],4),o.writeUInt32BE(s[2],8),o.writeUInt32BE(s[1],12),o};Ze.prototype.scrub=function(){bf(this._keySchedule),bf(this._invKeySchedule),bf(this._key)};ji.AES=Ze;var oi=Ot.Buffer,c1=oi.alloc(16,0);function v1(h){return[h.readUInt32BE(0),h.readUInt32BE(4),h.readUInt32BE(8),h.readUInt32BE(12)]}function Ts(h){var n=oi.allocUnsafe(16);return n.writeUInt32BE(h[0]>>>0,0),n.writeUInt32BE(h[1]>>>0,4),n.writeUInt32BE(h[2]>>>0,8),n.writeUInt32BE(h[3]>>>0,12),n}function Qi(h){this.h=h,this.state=oi.alloc(16,0),this.cache=oi.allocUnsafe(0)}Qi.prototype.ghash=function(h){for(var n=-1;++n<h.length;)this.state[n]^=h[n];this._multiply()};Qi.prototype._multiply=function(){for(var h=v1(this.h),n=[0,0,0,0],s,o,m,f=-1;++f<128;){for(o=(this.state[~~(f/8)]&1<<7-f%8)!==0,o&&(n[0]^=h[0],n[1]^=h[1],n[2]^=h[2],n[3]^=h[3]),m=(h[3]&1)!==0,s=3;s>0;s--)h[s]=h[s]>>>1|(h[s-1]&1)<<31;h[0]=h[0]>>>1,m&&(h[0]=h[0]^225<<24)}this.state=Ts(n)};Qi.prototype.update=function(h){this.cache=oi.concat([this.cache,h]);for(var n;this.cache.length>=16;)n=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(n)};Qi.prototype.final=function(h,n){return this.cache.length&&this.ghash(oi.concat([this.cache,c1],16)),this.ghash(Ts([0,h,0,n])),this.state};var p1=Qi,m1=ji,Pe=Ot.Buffer,Cs=$r,g1=Jt,Fs=p1,b1=Xi,y1=ks;function w1(h,n){var s=0;h.length!==n.length&&s++;for(var o=Math.min(h.length,n.length),m=0;m<o;++m)s+=h[m]^n[m];return s}function M1(h,n,s){if(n.length===12)return h._finID=Pe.concat([n,Pe.from([0,0,0,1])]),Pe.concat([n,Pe.from([0,0,0,2])]);var o=new Fs(s),m=n.length,f=m%16;o.update(n),f&&(f=16-f,o.update(Pe.alloc(f,0))),o.update(Pe.alloc(8,0));var g=m*8,y=Pe.alloc(8);y.writeUIntBE(g,0,8),o.update(y),h._finID=o.state;var S=Pe.from(h._finID);return y1(S),S}function ei(h,n,s,o){Cs.call(this);var m=Pe.alloc(4,0);this._cipher=new m1.AES(n);var f=this._cipher.encryptBlock(m);this._ghash=new Fs(f),s=M1(this,s,f),this._prev=Pe.from(s),this._cache=Pe.allocUnsafe(0),this._secCache=Pe.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=h,this._authTag=null,this._called=!1}g1(ei,Cs);ei.prototype._update=function(h){if(!this._called&&this._alen){var n=16-this._alen%16;n<16&&(n=Pe.alloc(n,0),this._ghash.update(n))}this._called=!0;var s=this._mode.encrypt(this,h);return this._decrypt?this._ghash.update(h):this._ghash.update(s),this._len+=h.length,s};ei.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var h=b1(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&w1(h,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=h,this._cipher.scrub()};ei.prototype.getAuthTag=function(){if(this._decrypt||!Pe.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag};ei.prototype.setAuthTag=function(n){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=n};ei.prototype.setAAD=function(n){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(n),this._alen+=n.length};var qs=ei,x1=ji,yf=Ot.Buffer,Ps=$r,_1=Jt;function Zn(h,n,s,o){Ps.call(this),this._cipher=new x1.AES(n),this._prev=yf.from(s),this._cache=yf.allocUnsafe(0),this._secCache=yf.allocUnsafe(0),this._decrypt=o,this._mode=h}_1(Zn,Ps);Zn.prototype._update=function(h){return this._mode.encrypt(this,h,this._decrypt)};Zn.prototype._final=function(){this._cipher.scrub()};var Ds=Zn,Or=Ot.Buffer,S1=b0;function A1(h,n,s,o){if(Or.isBuffer(h)||(h=Or.from(h,"binary")),n&&(Or.isBuffer(n)||(n=Or.from(n,"binary")),n.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var m=s/8,f=Or.alloc(m),g=Or.alloc(o||0),y=Or.alloc(0);m>0||o>0;){var S=new S1;S.update(y),S.update(h),n&&S.update(n),y=S.digest();var B=0;if(m>0){var M=f.length-m;B=Math.min(m,y.length),y.copy(f,M,0,B),m-=B}if(B<y.length&&o>0){var x=g.length-o,I=Math.min(o,y.length-B);y.copy(g,x,B,B+I),o-=I}}return y.fill(0),{key:f,iv:g}}var Wn=A1,Ns=I0,B1=qs,Ar=Ot.Buffer,E1=Ds,$s=$r,k1=ji,I1=Wn,R1=Jt;function tn(h,n,s){$s.call(this),this._cache=new Vn,this._cipher=new k1.AES(n),this._prev=Ar.from(s),this._mode=h,this._autopadding=!0}R1(tn,$s);tn.prototype._update=function(h){this._cache.add(h);for(var n,s,o=[];n=this._cache.get();)s=this._mode.encrypt(this,n),o.push(s);return Ar.concat(o)};var T1=Ar.alloc(16,16);tn.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return h=this._mode.encrypt(this,h),this._cipher.scrub(),h;if(!h.equals(T1))throw this._cipher.scrub(),new Error("data not multiple of block length")};tn.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function Vn(){this.cache=Ar.allocUnsafe(0)}Vn.prototype.add=function(h){this.cache=Ar.concat([this.cache,h])};Vn.prototype.get=function(){if(this.cache.length>15){var h=this.cache.slice(0,16);return this.cache=this.cache.slice(16),h}return null};Vn.prototype.flush=function(){for(var h=16-this.cache.length,n=Ar.allocUnsafe(h),s=-1;++s<h;)n.writeUInt8(h,s);return Ar.concat([this.cache,n])};function Us(h,n,s){var o=Ns[h.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if(typeof n=="string"&&(n=Ar.from(n)),n.length!==o.key/8)throw new TypeError("invalid key length "+n.length);if(typeof s=="string"&&(s=Ar.from(s)),o.mode!=="GCM"&&s.length!==o.iv)throw new TypeError("invalid iv length "+s.length);return o.type==="stream"?new E1(o.module,n,s):o.type==="auth"?new B1(o.module,n,s):new tn(o.module,n,s)}function C1(h,n){var s=Ns[h.toLowerCase()];if(!s)throw new TypeError("invalid suite type");var o=I1(n,!1,s.key,s.iv);return Us(h,o.key,o.iv)}_0.createCipheriv=Us;_0.createCipher=C1;var T0={},F1=qs,ui=Ot.Buffer,Ls=I0,q1=Ds,Os=$r,P1=ji,D1=Wn,N1=Jt;function en(h,n,s){Os.call(this),this._cache=new Yn,this._last=void 0,this._cipher=new P1.AES(n),this._prev=ui.from(s),this._mode=h,this._autopadding=!0}N1(en,Os);en.prototype._update=function(h){this._cache.add(h);for(var n,s,o=[];n=this._cache.get(this._autopadding);)s=this._mode.decrypt(this,n),o.push(s);return ui.concat(o)};en.prototype._final=function(){var h=this._cache.flush();if(this._autopadding)return $1(this._mode.decrypt(this,h));if(h)throw new Error("data not multiple of block length")};en.prototype.setAutoPadding=function(h){return this._autopadding=!!h,this};function Yn(){this.cache=ui.allocUnsafe(0)}Yn.prototype.add=function(h){this.cache=ui.concat([this.cache,h])};Yn.prototype.get=function(h){var n;if(h){if(this.cache.length>16)return n=this.cache.slice(0,16),this.cache=this.cache.slice(16),n}else if(this.cache.length>=16)return n=this.cache.slice(0,16),this.cache=this.cache.slice(16),n;return null};Yn.prototype.flush=function(){if(this.cache.length)return this.cache};function $1(h){var n=h[15];if(n<1||n>16)throw new Error("unable to decrypt data");for(var s=-1;++s<n;)if(h[s+(16-n)]!==n)throw new Error("unable to decrypt data");if(n!==16)return h.slice(0,16-n)}function zs(h,n,s){var o=Ls[h.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if(typeof s=="string"&&(s=ui.from(s)),o.mode!=="GCM"&&s.length!==o.iv)throw new TypeError("invalid iv length "+s.length);if(typeof n=="string"&&(n=ui.from(n)),n.length!==o.key/8)throw new TypeError("invalid key length "+n.length);return o.type==="stream"?new q1(o.module,n,s,!0):o.type==="auth"?new F1(o.module,n,s,!0):new en(o.module,n,s)}function U1(h,n){var s=Ls[h.toLowerCase()];if(!s)throw new TypeError("invalid suite type");var o=D1(n,!1,s.key,s.iv);return zs(h,o.key,o.iv)}T0.createDecipher=U1;T0.createDecipheriv=zs;var Ks=_0,Hs=T0,L1=Is;function O1(){return Object.keys(L1)}Le.createCipher=Le.Cipher=Ks.createCipher;Le.createCipheriv=Le.Cipheriv=Ks.createCipheriv;Le.createDecipher=Le.Decipher=Hs.createDecipher;Le.createDecipheriv=Le.Decipheriv=Hs.createDecipheriv;Le.listCiphers=Le.getCiphers=O1;var Zs={};(function(h){h["des-ecb"]={key:8,iv:0},h["des-cbc"]=h.des={key:8,iv:8},h["des-ede3-cbc"]=h.des3={key:24,iv:8},h["des-ede3"]={key:24,iv:0},h["des-ede-cbc"]={key:16,iv:8},h["des-ede"]={key:16,iv:0}})(Zs);var Ws=wc,C0=Le,Pr=I0,Sr=Zs,Vs=Wn;function z1(h,n){h=h.toLowerCase();var s,o;if(Pr[h])s=Pr[h].key,o=Pr[h].iv;else if(Sr[h])s=Sr[h].key*8,o=Sr[h].iv;else throw new TypeError("invalid suite type");var m=Vs(n,!1,s,o);return Ys(h,m.key,m.iv)}function K1(h,n){h=h.toLowerCase();var s,o;if(Pr[h])s=Pr[h].key,o=Pr[h].iv;else if(Sr[h])s=Sr[h].key*8,o=Sr[h].iv;else throw new TypeError("invalid suite type");var m=Vs(n,!1,s,o);return Js(h,m.key,m.iv)}function Ys(h,n,s){if(h=h.toLowerCase(),Pr[h])return C0.createCipheriv(h,n,s);if(Sr[h])return new Ws({key:n,iv:s,mode:h});throw new TypeError("invalid suite type")}function Js(h,n,s){if(h=h.toLowerCase(),Pr[h])return C0.createDecipheriv(h,n,s);if(Sr[h])return new Ws({key:n,iv:s,mode:h,decrypt:!0});throw new TypeError("invalid suite type")}function H1(){return Object.keys(Sr).concat(C0.getCiphers())}Qe.createCipher=Qe.Cipher=z1;Qe.createCipheriv=Qe.Cipheriv=Ys;Qe.createDecipher=Qe.Decipher=K1;Qe.createDecipheriv=Qe.Decipheriv=Js;Qe.listCiphers=Qe.getCiphers=H1;var zr={},F0={exports:{}};F0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(F0);var Gs=F0.exports,q0={exports:{}};q0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(q0);var Z1=q0.exports,un={exports:{}},Aa;function P0(){if(Aa)return un.exports;Aa=1;var h;un.exports=function(m){return h||(h=new n(null)),h.generate(m)};function n(o){this.rand=o}if(un.exports.Rand=n,n.prototype.generate=function(m){return this._rand(m)},n.prototype._rand=function(m){if(this.rand.getBytes)return this.rand.getBytes(m);for(var f=new Uint8Array(m),g=0;g<f.length;g++)f[g]=this.rand.getByte();return f},typeof self=="object")self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(m){var f=new Uint8Array(m);return self.crypto.getRandomValues(f),f}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(m){var f=new Uint8Array(m);return self.msCrypto.getRandomValues(f),f}:typeof window=="object"&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=Xo();if(typeof s.randomBytes!="function")throw new Error("Not supported");n.prototype._rand=function(m){return s.randomBytes(m)}}catch(o){}return un.exports}var wf,Ba;function Xs(){if(Ba)return wf;Ba=1;var h=Z1,n=P0();function s(o){this.rand=o||new n.Rand}return wf=s,s.create=function(m){return new s(m)},s.prototype._randbelow=function(m){var f=m.bitLength(),g=Math.ceil(f/8);do var y=new h(this.rand.generate(g));while(y.cmp(m)>=0);return y},s.prototype._randrange=function(m,f){var g=f.sub(m);return m.add(this._randbelow(g))},s.prototype.test=function(m,f,g){var y=m.bitLength(),S=h.mont(m),B=new h(1).toRed(S);f||(f=Math.max(1,y/48|0));for(var M=m.subn(1),x=0;!M.testn(x);x++);for(var I=m.shrn(x),k=M.toRed(S),D=!0;f>0;f--){var L=this._randrange(new h(2),M);g&&g(L);var W=L.toRed(S).redPow(I);if(!(W.cmp(B)===0||W.cmp(k)===0)){for(var z=1;z<x;z++){if(W=W.redSqr(),W.cmp(B)===0)return!1;if(W.cmp(k)===0)break}if(z===x)return!1}}return D},s.prototype.getDivisor=function(m,f){var g=m.bitLength(),y=h.mont(m),S=new h(1).toRed(y);f||(f=Math.max(1,g/48|0));for(var B=m.subn(1),M=0;!B.testn(M);M++);for(var x=m.shrn(M),I=B.toRed(y);f>0;f--){var k=this._randrange(new h(2),B),D=m.gcd(k);if(D.cmpn(1)!==0)return D;var L=k.toRed(y).redPow(x);if(!(L.cmp(S)===0||L.cmp(I)===0)){for(var W=1;W<M;W++){if(L=L.redSqr(),L.cmp(S)===0)return L.fromRed().subn(1).gcd(m);if(L.cmp(I)===0)break}if(W===M)return L=L.redSqr(),L.fromRed().subn(1).gcd(m)}}return!1},wf}var Mf,Ea;function js(){if(Ea)return Mf;Ea=1;var h=gi;Mf=W,W.simpleSieve=D,W.fermatTest=L;var n=Gs,s=new n(24),o=Xs(),m=new o,f=new n(1),g=new n(2),y=new n(5);new n(16),new n(8);var S=new n(10),B=new n(3);new n(7);var M=new n(11),x=new n(4);new n(12);var I=null;function k(){if(I!==null)return I;var z=1048576,$=[];$[0]=2;for(var lt=1,H=3;H<z;H+=2){for(var At=Math.ceil(Math.sqrt(H)),Bt=0;Bt<lt&&$[Bt]<=At&&H%$[Bt]!==0;Bt++);lt!==Bt&&$[Bt]<=At||($[lt++]=H)}return I=$,$}function D(z){for(var $=k(),lt=0;lt<$.length;lt++)if(z.modn($[lt])===0)return z.cmpn($[lt])===0;return!0}function L(z){var $=n.mont(z);return g.toRed($).redPow(z.subn(1)).fromRed().cmpn(1)===0}function W(z,$){if(z<16)return $===2||$===5?new n([140,123]):new n([140,39]);$=new n($);for(var lt,H;;){for(lt=new n(h(Math.ceil(z/8)));lt.bitLength()>z;)lt.ishrn(1);if(lt.isEven()&<.iadd(f),lt.testn(1)||lt.iadd(g),$.cmp(g)){if(!$.cmp(y))for(;lt.mod(S).cmp(B);)lt.iadd(x)}else for(;lt.mod(s).cmp(M);)lt.iadd(x);if(H=lt.shrn(1),D(H)&&D(lt)&&L(H)&&L(lt)&&m.test(H)&&m.test(lt))return lt}}return Mf}const W1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},V1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},Y1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},J1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},G1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},X1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},j1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},Q1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},tv={modp1:W1,modp2:V1,modp5:Y1,modp14:J1,modp15:G1,modp16:X1,modp17:j1,modp18:Q1};var xf,ka;function ev(){if(ka)return xf;ka=1;var h=Gs,n=Xs(),s=new n,o=new h(24),m=new h(11),f=new h(10),g=new h(3),y=new h(7),S=js(),B=gi;xf=D;function M(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this._pub=new h(W),this}function x(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this._priv=new h(W),this}var I={};function k(W,z){var $=z.toString("hex"),lt=[$,W.toString(16)].join("_");if(lt in I)return I[lt];var H=0;if(W.isEven()||!S.simpleSieve||!S.fermatTest(W)||!s.test(W))return H+=1,$==="02"||$==="05"?H+=8:H+=4,I[lt]=H,H;s.test(W.shrn(1))||(H+=2);var At;switch($){case"02":W.mod(o).cmp(m)&&(H+=8);break;case"05":At=W.mod(f),At.cmp(g)&&At.cmp(y)&&(H+=8);break;default:H+=4}return I[lt]=H,H}function D(W,z,$){this.setGenerator(z),this.__prime=new h(W),this._prime=h.mont(this.__prime),this._primeLen=W.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,$?(this.setPublicKey=M,this.setPrivateKey=x):this._primeCode=8}Object.defineProperty(D.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=k(this.__prime,this.__gen)),this._primeCode}}),D.prototype.generateKeys=function(){return this._priv||(this._priv=new h(B(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},D.prototype.computeSecret=function(W){W=new h(W),W=W.toRed(this._prime);var z=W.redPow(this._priv).fromRed(),$=new mt(z.toArray()),lt=this.getPrime();if($.length<lt.length){var H=new mt(lt.length-$.length);H.fill(0),$=mt.concat([H,$])}return $},D.prototype.getPublicKey=function(z){return L(this._pub,z)},D.prototype.getPrivateKey=function(z){return L(this._priv,z)},D.prototype.getPrime=function(W){return L(this.__prime,W)},D.prototype.getGenerator=function(W){return L(this._gen,W)},D.prototype.setGenerator=function(W,z){return z=z||"utf8",mt.isBuffer(W)||(W=new mt(W,z)),this.__gen=W,this._gen=new h(W),this};function L(W,z){var $=new mt(W.toArray());return z?$.toString(z):$}return xf}var Ia;function rv(){if(Ia)return zr;Ia=1;var h=js(),n=tv,s=ev();function o(g){var y=new mt(n[g].prime,"hex"),S=new mt(n[g].gen,"hex");return new s(y,S)}var m={binary:!0,hex:!0,base64:!0};function f(g,y,S,B){return mt.isBuffer(y)||m[y]===void 0?f(g,"binary",y,S):(y=y||"binary",B=B||"binary",S=S||new mt([2]),mt.isBuffer(S)||(S=new mt(S,B)),typeof g=="number"?new s(h(g,S),S,!0):(mt.isBuffer(g)||(g=new mt(g,y)),new s(g,S,!0)))}return zr.DiffieHellmanGroup=zr.createDiffieHellmanGroup=zr.getDiffieHellman=o,zr.createDiffieHellman=zr.DiffieHellman=f,zr}var h0={exports:{}},s0={exports:{}};typeof ye=="undefined"||!ye.version||ye.version.indexOf("v0.")===0||ye.version.indexOf("v1.")===0&&ye.version.indexOf("v1.8.")!==0?s0.exports={nextTick:iv}:s0.exports=ye;function iv(h,n,s,o){if(typeof h!="function")throw new TypeError('"callback" argument must be a function');var m=arguments.length,f,g;switch(m){case 0:case 1:return ye.nextTick(h);case 2:return ye.nextTick(function(){h.call(null,n)});case 3:return ye.nextTick(function(){h.call(null,n,s)});case 4:return ye.nextTick(function(){h.call(null,n,s,o)});default:for(f=new Array(m-1),g=0;g<f.length;)f[g++]=arguments[g];return ye.nextTick(function(){h.apply(null,f)})}}var Jn=s0.exports,nv={}.toString,fv=Array.isArray||function(h){return nv.call(h)=="[object Array]"},Qs=De.EventEmitter,o0={exports:{}};(function(h,n){var s=gr,o=s.Buffer;function m(g,y){for(var S in g)y[S]=g[S]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?h.exports=s:(m(s,n),n.Buffer=f);function f(g,y,S){return o(g,y,S)}m(o,f),f.from=function(g,y,S){if(typeof g=="number")throw new TypeError("Argument must not be a number");return o(g,y,S)},f.alloc=function(g,y,S){if(typeof g!="number")throw new TypeError("Argument must be a number");var B=o(g);return y!==void 0?typeof S=="string"?B.fill(y,S):B.fill(y):B.fill(0),B},f.allocUnsafe=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return o(g)},f.allocUnsafeSlow=function(g){if(typeof g!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(g)}})(o0,o0.exports);var D0=o0.exports,we={};function av(h){return Array.isArray?Array.isArray(h):Gn(h)==="[object Array]"}we.isArray=av;function hv(h){return typeof h=="boolean"}we.isBoolean=hv;function sv(h){return h===null}we.isNull=sv;function ov(h){return h==null}we.isNullOrUndefined=ov;function uv(h){return typeof h=="number"}we.isNumber=uv;function lv(h){return typeof h=="string"}we.isString=lv;function dv(h){return typeof h=="symbol"}we.isSymbol=dv;function cv(h){return h===void 0}we.isUndefined=cv;function vv(h){return Gn(h)==="[object RegExp]"}we.isRegExp=vv;function pv(h){return typeof h=="object"&&h!==null}we.isObject=pv;function mv(h){return Gn(h)==="[object Date]"}we.isDate=mv;function gv(h){return Gn(h)==="[object Error]"||h instanceof Error}we.isError=gv;function bv(h){return typeof h=="function"}we.isFunction=bv;function yv(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h=="undefined"}we.isPrimitive=yv;we.isBuffer=gr.Buffer.isBuffer;function Gn(h){return Object.prototype.toString.call(h)}var _f={exports:{}},Ra;function wv(){return Ra||(Ra=1,function(h){function n(f,g){if(!(f instanceof g))throw new TypeError("Cannot call a class as a function")}var s=D0.Buffer,o=De;function m(f,g,y){f.copy(g,y)}h.exports=function(){function f(){n(this,f),this.head=null,this.tail=null,this.length=0}return f.prototype.push=function(y){var S={data:y,next:null};this.length>0?this.tail.next=S:this.head=S,this.tail=S,++this.length},f.prototype.unshift=function(y){var S={data:y,next:this.head};this.length===0&&(this.tail=S),this.head=S,++this.length},f.prototype.shift=function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}},f.prototype.clear=function(){this.head=this.tail=null,this.length=0},f.prototype.join=function(y){if(this.length===0)return"";for(var S=this.head,B=""+S.data;S=S.next;)B+=y+S.data;return B},f.prototype.concat=function(y){if(this.length===0)return s.alloc(0);for(var S=s.allocUnsafe(y>>>0),B=this.head,M=0;B;)m(B.data,S,M),M+=B.data.length,B=B.next;return S},f}(),o&&o.inspect&&o.inspect.custom&&(h.exports.prototype[o.inspect.custom]=function(){var f=o.inspect({length:this.length});return this.constructor.name+" "+f})}(_f)),_f.exports}var ln=Jn;function Mv(h,n){var s=this,o=this._readableState&&this._readableState.destroyed,m=this._writableState&&this._writableState.destroyed;return o||m?(n?n(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ln.nextTick(dn,this,h)):ln.nextTick(dn,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(f){!n&&f?s._writableState?s._writableState.errorEmitted||(s._writableState.errorEmitted=!0,ln.nextTick(dn,s,f)):ln.nextTick(dn,s,f):n&&n(f)}),this)}function xv(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function dn(h,n){h.emit("error",n)}var to={destroy:Mv,undestroy:xv},_v=Sv;function Sv(h,n){if(Sf("noDeprecation"))return h;var s=!1;function o(){if(!s){if(Sf("throwDeprecation"))throw new Error(n);Sf("traceDeprecation")?console.trace(n):console.warn(n),s=!0}return h.apply(this,arguments)}return o}function Sf(h){try{if(!Gt.localStorage)return!1}catch(s){return!1}var n=Gt.localStorage[h];return n==null?!1:String(n).toLowerCase()==="true"}var Af,Ta;function eo(){if(Ta)return Af;Ta=1;var h=Jn;Af=L;function n(c){var v=this;this.next=null,this.entry=null,this.finish=function(){d(v,c)}}var s=!ye.browser&&["v0.10","v0.9."].indexOf(ye.version.slice(0,5))>-1?setImmediate:h.nextTick,o;L.WritableState=k;var m=Object.create(we);m.inherits=Jt;var f={deprecate:_v},g=Qs,y=D0.Buffer,S=(typeof Gt!="undefined"?Gt:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function B(c){return y.from(c)}function M(c){return y.isBuffer(c)||c instanceof S}var x=to;m.inherits(L,g);function I(){}function k(c,v){o=o||li(),c=c||{};var u=v instanceof o;this.objectMode=!!c.objectMode,u&&(this.objectMode=this.objectMode||!!c.writableObjectMode);var e=c.highWaterMark,l=c.writableHighWaterMark,b=this.objectMode?16:16*1024;e||e===0?this.highWaterMark=e:u&&(l||l===0)?this.highWaterMark=l:this.highWaterMark=b,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var _=c.decodeStrings===!1;this.decodeStrings=!_,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(C){Ct(v,C)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}k.prototype.getBuffer=function(){for(var v=this.bufferedRequest,u=[];v;)u.push(v),v=v.next;return u},function(){try{Object.defineProperty(k.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(c){}}();var D;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(D=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(c){return D.call(this,c)?!0:this!==L?!1:c&&c._writableState instanceof k}})):D=function(c){return c instanceof this};function L(c){if(o=o||li(),!D.call(L,this)&&!(this instanceof o))return new L(c);this._writableState=new k(c,this),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),g.call(this)}L.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function W(c,v){var u=new Error("write after end");c.emit("error",u),h.nextTick(v,u)}function z(c,v,u,e){var l=!0,b=!1;return u===null?b=new TypeError("May not write null values to stream"):typeof u!="string"&&u!==void 0&&!v.objectMode&&(b=new TypeError("Invalid non-string/buffer chunk")),b&&(c.emit("error",b),h.nextTick(e,b),l=!1),l}L.prototype.write=function(c,v,u){var e=this._writableState,l=!1,b=!e.objectMode&&M(c);return b&&!y.isBuffer(c)&&(c=B(c)),typeof v=="function"&&(u=v,v=null),b?v="buffer":v||(v=e.defaultEncoding),typeof u!="function"&&(u=I),e.ended?W(this,u):(b||z(this,e,c,u))&&(e.pendingcb++,l=lt(this,e,b,c,v,u)),l},L.prototype.cork=function(){var c=this._writableState;c.corked++},L.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&It(this,c))},L.prototype.setDefaultEncoding=function(v){if(typeof v=="string"&&(v=v.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((v+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+v);return this._writableState.defaultEncoding=v,this};function $(c,v,u){return!c.objectMode&&c.decodeStrings!==!1&&typeof v=="string"&&(v=y.from(v,u)),v}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function lt(c,v,u,e,l,b){if(!u){var _=$(v,e,l);e!==_&&(u=!0,l="buffer",e=_)}var C=v.objectMode?1:e.length;v.length+=C;var q=v.length<v.highWaterMark;if(q||(v.needDrain=!0),v.writing||v.corked){var O=v.lastBufferedRequest;v.lastBufferedRequest={chunk:e,encoding:l,isBuf:u,callback:b,next:null},O?O.next=v.lastBufferedRequest:v.bufferedRequest=v.lastBufferedRequest,v.bufferedRequestCount+=1}else H(c,v,!1,C,e,l,b);return q}function H(c,v,u,e,l,b,_){v.writelen=e,v.writecb=_,v.writing=!0,v.sync=!0,u?c._writev(l,v.onwrite):c._write(l,b,v.onwrite),v.sync=!1}function At(c,v,u,e,l){--v.pendingcb,u?(h.nextTick(l,e),h.nextTick(i,c,v),c._writableState.errorEmitted=!0,c.emit("error",e)):(l(e),c._writableState.errorEmitted=!0,c.emit("error",e),i(c,v))}function Bt(c){c.writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0}function Ct(c,v){var u=c._writableState,e=u.sync,l=u.writecb;if(Bt(u),v)At(c,u,e,v,l);else{var b=p(u);!b&&!u.corked&&!u.bufferProcessing&&u.bufferedRequest&&It(c,u),e?s(Et,c,u,b,l):Et(c,u,b,l)}}function Et(c,v,u,e){u||Y(c,v),v.pendingcb--,e(),i(c,v)}function Y(c,v){v.length===0&&v.needDrain&&(v.needDrain=!1,c.emit("drain"))}function It(c,v){v.bufferProcessing=!0;var u=v.bufferedRequest;if(c._writev&&u&&u.next){var e=v.bufferedRequestCount,l=new Array(e),b=v.corkedRequestsFree;b.entry=u;for(var _=0,C=!0;u;)l[_]=u,u.isBuf||(C=!1),u=u.next,_+=1;l.allBuffers=C,H(c,v,!0,v.length,l,"",b.finish),v.pendingcb++,v.lastBufferedRequest=null,b.next?(v.corkedRequestsFree=b.next,b.next=null):v.corkedRequestsFree=new n(v),v.bufferedRequestCount=0}else{for(;u;){var q=u.chunk,O=u.encoding,R=u.callback,P=v.objectMode?1:q.length;if(H(c,v,!1,P,q,O,R),u=u.next,v.bufferedRequestCount--,v.writing)break}u===null&&(v.lastBufferedRequest=null)}v.bufferedRequest=u,v.bufferProcessing=!1}L.prototype._write=function(c,v,u){u(new Error("_write() is not implemented"))},L.prototype._writev=null,L.prototype.end=function(c,v,u){var e=this._writableState;typeof c=="function"?(u=c,c=null,v=null):typeof v=="function"&&(u=v,v=null),c!=null&&this.write(c,v),e.corked&&(e.corked=1,this.uncork()),e.ending||a(this,e,u)};function p(c){return c.ending&&c.length===0&&c.bufferedRequest===null&&!c.finished&&!c.writing}function t(c,v){c._final(function(u){v.pendingcb--,u&&c.emit("error",u),v.prefinished=!0,c.emit("prefinish"),i(c,v)})}function r(c,v){!v.prefinished&&!v.finalCalled&&(typeof c._final=="function"?(v.pendingcb++,v.finalCalled=!0,h.nextTick(t,c,v)):(v.prefinished=!0,c.emit("prefinish")))}function i(c,v){var u=p(v);return u&&(r(c,v),v.pendingcb===0&&(v.finished=!0,c.emit("finish"))),u}function a(c,v,u){v.ending=!0,i(c,v),u&&(v.finished?h.nextTick(u):c.once("finish",u)),v.ended=!0,c.writable=!1}function d(c,v,u){var e=c.entry;for(c.entry=null;e;){var l=e.callback;v.pendingcb--,l(u),e=e.next}v.corkedRequestsFree.next=c}return Object.defineProperty(L.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(c){this._writableState&&(this._writableState.destroyed=c)}}),L.prototype.destroy=x.destroy,L.prototype._undestroy=x.undestroy,L.prototype._destroy=function(c,v){this.end(),v(c)},Af}var Bf,Ca;function li(){if(Ca)return Bf;Ca=1;var h=Jn,n=Object.keys||function(x){var I=[];for(var k in x)I.push(k);return I};Bf=S;var s=Object.create(we);s.inherits=Jt;var o=ro(),m=eo();s.inherits(S,o);for(var f=n(m.prototype),g=0;g<f.length;g++){var y=f[g];S.prototype[y]||(S.prototype[y]=m.prototype[y])}function S(x){if(!(this instanceof S))return new S(x);o.call(this,x),m.call(this,x),x&&x.readable===!1&&(this.readable=!1),x&&x.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,x&&x.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",B)}Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function B(){this.allowHalfOpen||this._writableState.ended||h.nextTick(M,this)}function M(x){x.end()}return Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(x){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=x,this._writableState.destroyed=x)}}),S.prototype._destroy=function(x,I){this.push(null),this.end(),h.nextTick(I,x)},Bf}var Ef,Fa;function ro(){if(Fa)return Ef;Fa=1;var h=Jn;Ef=$;var n=fv,s;$.ReadableState=z,De.EventEmitter;var o=function(R,P){return R.listeners(P).length},m=Qs,f=D0.Buffer,g=(typeof Gt!="undefined"?Gt:typeof window!="undefined"?window:typeof self!="undefined"?self:{}).Uint8Array||function(){};function y(R){return f.from(R)}function S(R){return f.isBuffer(R)||R instanceof g}var B=Object.create(we);B.inherits=Jt;var M=De,x=void 0;M&&M.debuglog?x=M.debuglog("stream"):x=function(){};var I=wv(),k=to,D;B.inherits($,m);var L=["error","close","destroy","pause","resume"];function W(R,P,N){if(typeof R.prependListener=="function")return R.prependListener(P,N);!R._events||!R._events[P]?R.on(P,N):n(R._events[P])?R._events[P].unshift(N):R._events[P]=[N,R._events[P]]}function z(R,P){s=s||li(),R=R||{};var N=P instanceof s;this.objectMode=!!R.objectMode,N&&(this.objectMode=this.objectMode||!!R.readableObjectMode);var K=R.highWaterMark,kt=R.readableHighWaterMark,Z=this.objectMode?16:16*1024;K||K===0?this.highWaterMark=K:N&&(kt||kt===0)?this.highWaterMark=kt:this.highWaterMark=Z,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new I,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(D||(D=xn.StringDecoder),this.decoder=new D(R.encoding),this.encoding=R.encoding)}function $(R){if(s=s||li(),!(this instanceof $))return new $(R);this._readableState=new z(R,this),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),m.call(this)}Object.defineProperty($.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),$.prototype.destroy=k.destroy,$.prototype._undestroy=k.undestroy,$.prototype._destroy=function(R,P){this.push(null),P(R)},$.prototype.push=function(R,P){var N=this._readableState,K;return N.objectMode?K=!0:typeof R=="string"&&(P=P||N.defaultEncoding,P!==N.encoding&&(R=f.from(R,P),P=""),K=!0),lt(this,R,P,!1,K)},$.prototype.unshift=function(R){return lt(this,R,null,!0,!1)};function lt(R,P,N,K,kt){var Z=R._readableState;if(P===null)Z.reading=!1,It(R,Z);else{var J;kt||(J=At(Z,P)),J?R.emit("error",J):Z.objectMode||P&&P.length>0?(typeof P!="string"&&!Z.objectMode&&Object.getPrototypeOf(P)!==f.prototype&&(P=y(P)),K?Z.endEmitted?R.emit("error",new Error("stream.unshift() after end event")):H(R,Z,P,!0):Z.ended?R.emit("error",new Error("stream.push() after EOF")):(Z.reading=!1,Z.decoder&&!N?(P=Z.decoder.write(P),Z.objectMode||P.length!==0?H(R,Z,P,!1):r(R,Z)):H(R,Z,P,!1))):K||(Z.reading=!1)}return Bt(Z)}function H(R,P,N,K){P.flowing&&P.length===0&&!P.sync?(R.emit("data",N),R.read(0)):(P.length+=P.objectMode?1:N.length,K?P.buffer.unshift(N):P.buffer.push(N),P.needReadable&&p(R)),r(R,P)}function At(R,P){var N;return!S(P)&&typeof P!="string"&&P!==void 0&&!R.objectMode&&(N=new TypeError("Invalid non-string/buffer chunk")),N}function Bt(R){return!R.ended&&(R.needReadable||R.length<R.highWaterMark||R.length===0)}$.prototype.isPaused=function(){return this._readableState.flowing===!1},$.prototype.setEncoding=function(R){return D||(D=xn.StringDecoder),this._readableState.decoder=new D(R),this._readableState.encoding=R,this};var Ct=8388608;function Et(R){return R>=Ct?R=Ct:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function Y(R,P){return R<=0||P.length===0&&P.ended?0:P.objectMode?1:R!==R?P.flowing&&P.length?P.buffer.head.data.length:P.length:(R>P.highWaterMark&&(P.highWaterMark=Et(R)),R<=P.length?R:P.ended?P.length:(P.needReadable=!0,0))}$.prototype.read=function(R){x("read",R),R=parseInt(R,10);var P=this._readableState,N=R;if(R!==0&&(P.emittedReadable=!1),R===0&&P.needReadable&&(P.length>=P.highWaterMark||P.ended))return x("read: emitReadable",P.length,P.ended),P.length===0&&P.ended?C(this):p(this),null;if(R=Y(R,P),R===0&&P.ended)return P.length===0&&C(this),null;var K=P.needReadable;x("need readable",K),(P.length===0||P.length-R<P.highWaterMark)&&(K=!0,x("length less than watermark",K)),P.ended||P.reading?(K=!1,x("reading or ended",K)):K&&(x("do read"),P.reading=!0,P.sync=!0,P.length===0&&(P.needReadable=!0),this._read(P.highWaterMark),P.sync=!1,P.reading||(R=Y(N,P)));var kt;return R>0?kt=e(R,P):kt=null,kt===null?(P.needReadable=!0,R=0):P.length-=R,P.length===0&&(P.ended||(P.needReadable=!0),N!==R&&P.ended&&C(this)),kt!==null&&this.emit("data",kt),kt};function It(R,P){if(!P.ended){if(P.decoder){var N=P.decoder.end();N&&N.length&&(P.buffer.push(N),P.length+=P.objectMode?1:N.length)}P.ended=!0,p(R)}}function p(R){var P=R._readableState;P.needReadable=!1,P.emittedReadable||(x("emitReadable",P.flowing),P.emittedReadable=!0,P.sync?h.nextTick(t,R):t(R))}function t(R){x("emit readable"),R.emit("readable"),u(R)}function r(R,P){P.readingMore||(P.readingMore=!0,h.nextTick(i,R,P))}function i(R,P){for(var N=P.length;!P.reading&&!P.flowing&&!P.ended&&P.length<P.highWaterMark&&(x("maybeReadMore read 0"),R.read(0),N!==P.length);)N=P.length;P.readingMore=!1}$.prototype._read=function(R){this.emit("error",new Error("_read() is not implemented"))},$.prototype.pipe=function(R,P){var N=this,K=this._readableState;switch(K.pipesCount){case 0:K.pipes=R;break;case 1:K.pipes=[K.pipes,R];break;default:K.pipes.push(R);break}K.pipesCount+=1,x("pipe count=%d opts=%j",K.pipesCount,P);var kt=(!P||P.end!==!1)&&R!==ye.stdout&&R!==ye.stderr,Z=kt?Ft:qt;K.endEmitted?h.nextTick(Z):N.once("end",Z),R.on("unpipe",J);function J(Q,ct){x("onunpipe"),Q===N&&ct&&ct.hasUnpiped===!1&&(ct.hasUnpiped=!0,Dt())}function Ft(){x("onend"),R.end()}var tt=a(N);R.on("drain",tt);var vt=!1;function Dt(){x("cleanup"),R.removeListener("close",j),R.removeListener("finish",dt),R.removeListener("drain",tt),R.removeListener("error",Pt),R.removeListener("unpipe",J),N.removeListener("end",Ft),N.removeListener("end",qt),N.removeListener("data",pt),vt=!0,K.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&tt()}var et=!1;N.on("data",pt);function pt(Q){x("ondata"),et=!1;var ct=R.write(Q);ct===!1&&!et&&((K.pipesCount===1&&K.pipes===R||K.pipesCount>1&&O(K.pipes,R)!==-1)&&!vt&&(x("false write response, pause",K.awaitDrain),K.awaitDrain++,et=!0),N.pause())}function Pt(Q){x("onerror",Q),qt(),R.removeListener("error",Pt),o(R,"error")===0&&R.emit("error",Q)}W(R,"error",Pt);function j(){R.removeListener("finish",dt),qt()}R.once("close",j);function dt(){x("onfinish"),R.removeListener("close",j),qt()}R.once("finish",dt);function qt(){x("unpipe"),N.unpipe(R)}return R.emit("pipe",N),K.flowing||(x("pipe resume"),N.resume()),R};function a(R){return function(){var P=R._readableState;x("pipeOnDrain",P.awaitDrain),P.awaitDrain&&P.awaitDrain--,P.awaitDrain===0&&o(R,"data")&&(P.flowing=!0,u(R))}}$.prototype.unpipe=function(R){var P=this._readableState,N={hasUnpiped:!1};if(P.pipesCount===0)return this;if(P.pipesCount===1)return R&&R!==P.pipes?this:(R||(R=P.pipes),P.pipes=null,P.pipesCount=0,P.flowing=!1,R&&R.emit("unpipe",this,N),this);if(!R){var K=P.pipes,kt=P.pipesCount;P.pipes=null,P.pipesCount=0,P.flowing=!1;for(var Z=0;Z<kt;Z++)K[Z].emit("unpipe",this,{hasUnpiped:!1});return this}var J=O(P.pipes,R);return J===-1?this:(P.pipes.splice(J,1),P.pipesCount-=1,P.pipesCount===1&&(P.pipes=P.pipes[0]),R.emit("unpipe",this,N),this)},$.prototype.on=function(R,P){var N=m.prototype.on.call(this,R,P);if(R==="data")this._readableState.flowing!==!1&&this.resume();else if(R==="readable"){var K=this._readableState;!K.endEmitted&&!K.readableListening&&(K.readableListening=K.needReadable=!0,K.emittedReadable=!1,K.reading?K.length&&p(this):h.nextTick(d,this))}return N},$.prototype.addListener=$.prototype.on;function d(R){x("readable nexttick read 0"),R.read(0)}$.prototype.resume=function(){var R=this._readableState;return R.flowing||(x("resume"),R.flowing=!0,c(this,R)),this};function c(R,P){P.resumeScheduled||(P.resumeScheduled=!0,h.nextTick(v,R,P))}function v(R,P){P.reading||(x("resume read 0"),R.read(0)),P.resumeScheduled=!1,P.awaitDrain=0,R.emit("resume"),u(R),P.flowing&&!P.reading&&R.read(0)}$.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function u(R){var P=R._readableState;for(x("flow",P.flowing);P.flowing&&R.read()!==null;);}$.prototype.wrap=function(R){var P=this,N=this._readableState,K=!1;R.on("end",function(){if(x("wrapped end"),N.decoder&&!N.ended){var J=N.decoder.end();J&&J.length&&P.push(J)}P.push(null)}),R.on("data",function(J){if(x("wrapped data"),N.decoder&&(J=N.decoder.write(J)),!(N.objectMode&&J==null)&&!(!N.objectMode&&(!J||!J.length))){var Ft=P.push(J);Ft||(K=!0,R.pause())}});for(var kt in R)this[kt]===void 0&&typeof R[kt]=="function"&&(this[kt]=function(J){return function(){return R[J].apply(R,arguments)}}(kt));for(var Z=0;Z<L.length;Z++)R.on(L[Z],this.emit.bind(this,L[Z]));return this._read=function(J){x("wrapped _read",J),K&&(K=!1,R.resume())},this},Object.defineProperty($.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),$._fromList=e;function e(R,P){if(P.length===0)return null;var N;return P.objectMode?N=P.buffer.shift():!R||R>=P.length?(P.decoder?N=P.buffer.join(""):P.buffer.length===1?N=P.buffer.head.data:N=P.buffer.concat(P.length),P.buffer.clear()):N=l(R,P.buffer,P.decoder),N}function l(R,P,N){var K;return R<P.head.data.length?(K=P.head.data.slice(0,R),P.head.data=P.head.data.slice(R)):R===P.head.data.length?K=P.shift():K=N?b(R,P):_(R,P),K}function b(R,P){var N=P.head,K=1,kt=N.data;for(R-=kt.length;N=N.next;){var Z=N.data,J=R>Z.length?Z.length:R;if(J===Z.length?kt+=Z:kt+=Z.slice(0,R),R-=J,R===0){J===Z.length?(++K,N.next?P.head=N.next:P.head=P.tail=null):(P.head=N,N.data=Z.slice(J));break}++K}return P.length-=K,kt}function _(R,P){var N=f.allocUnsafe(R),K=P.head,kt=1;for(K.data.copy(N),R-=K.data.length;K=K.next;){var Z=K.data,J=R>Z.length?Z.length:R;if(Z.copy(N,N.length-R,0,J),R-=J,R===0){J===Z.length?(++kt,K.next?P.head=K.next:P.head=P.tail=null):(P.head=K,K.data=Z.slice(J));break}++kt}return P.length-=kt,N}function C(R){var P=R._readableState;if(P.length>0)throw new Error('"endReadable()" called on non-empty stream');P.endEmitted||(P.ended=!0,h.nextTick(q,P,R))}function q(R,P){!R.endEmitted&&R.length===0&&(R.endEmitted=!0,P.readable=!1,P.emit("end"))}function O(R,P){for(var N=0,K=R.length;N<K;N++)if(R[N]===P)return N;return-1}return Ef}var io=Br,Xn=li(),no=Object.create(we);no.inherits=Jt;no.inherits(Br,Xn);function Av(h,n){var s=this._transformState;s.transforming=!1;var o=s.writecb;if(!o)return this.emit("error",new Error("write callback called multiple times"));s.writechunk=null,s.writecb=null,n!=null&&this.push(n),o(h);var m=this._readableState;m.reading=!1,(m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}function Br(h){if(!(this instanceof Br))return new Br(h);Xn.call(this,h),this._transformState={afterTransform:Av.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",Bv)}function Bv(){var h=this;typeof this._flush=="function"?this._flush(function(n,s){qa(h,n,s)}):qa(this,null,null)}Br.prototype.push=function(h,n){return this._transformState.needTransform=!1,Xn.prototype.push.call(this,h,n)};Br.prototype._transform=function(h,n,s){throw new Error("_transform() is not implemented")};Br.prototype._write=function(h,n,s){var o=this._transformState;if(o.writecb=s,o.writechunk=h,o.writeencoding=n,!o.transforming){var m=this._readableState;(o.needTransform||m.needReadable||m.length<m.highWaterMark)&&this._read(m.highWaterMark)}};Br.prototype._read=function(h){var n=this._transformState;n.writechunk!==null&&n.writecb&&!n.transforming?(n.transforming=!0,this._transform(n.writechunk,n.writeencoding,n.afterTransform)):n.needTransform=!0};Br.prototype._destroy=function(h,n){var s=this;Xn.prototype._destroy.call(this,h,function(o){n(o),s.emit("close")})};function qa(h,n,s){if(n)return h.emit("error",n);if(s!=null&&h.push(s),h._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(h._transformState.transforming)throw new Error("Calling transform done when still transforming");return h.push(null)}var Ev=Ki,fo=io,ao=Object.create(we);ao.inherits=Jt;ao.inherits(Ki,fo);function Ki(h){if(!(this instanceof Ki))return new Ki(h);fo.call(this,h)}Ki.prototype._transform=function(h,n,s){s(null,h)};(function(h,n){n=h.exports=ro(),n.Stream=n,n.Readable=n,n.Writable=eo(),n.Duplex=li(),n.Transform=io,n.PassThrough=Ev})(h0,h0.exports);var kv=h0.exports,Ci={exports:{}},N0={exports:{}};N0.exports;(function(h){(function(n,s){function o(r,i){if(!r)throw new Error(i||"Assertion failed")}function m(r,i){r.super_=i;var a=function(){};a.prototype=i.prototype,r.prototype=new a,r.prototype.constructor=r}function f(r,i,a){if(f.isBN(r))return r;this.negative=0,this.words=null,this.length=0,this.red=null,r!==null&&((i==="le"||i==="be")&&(a=i,i=10),this._init(r||0,i||10,a||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(r){}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,a){return i.cmp(a)>0?i:a},f.min=function(i,a){return i.cmp(a)<0?i:a},f.prototype._init=function(i,a,d){if(typeof i=="number")return this._initNumber(i,a,d);if(typeof i=="object")return this._initArray(i,a,d);a==="hex"&&(a=16),o(a===(a|0)&&a>=2&&a<=36),i=i.toString().replace(/\s+/g,"");var c=0;i[0]==="-"&&(c++,this.negative=1),c<i.length&&(a===16?this._parseHex(i,c,d):(this._parseBase(i,a,c),d==="le"&&this._initArray(this.toArray(),a,d)))},f.prototype._initNumber=function(i,a,d){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(o(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),a,d)},f.prototype._initArray=function(i,a,d){if(o(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var v,u,e=0;if(d==="be")for(c=i.length-1,v=0;c>=0;c-=3)u=i[c]|i[c-1]<<8|i[c-2]<<16,this.words[v]|=u<<e&67108863,this.words[v+1]=u>>>26-e&67108863,e+=24,e>=26&&(e-=26,v++);else if(d==="le")for(c=0,v=0;c<i.length;c+=3)u=i[c]|i[c+1]<<8|i[c+2]<<16,this.words[v]|=u<<e&67108863,this.words[v+1]=u>>>26-e&67108863,e+=24,e>=26&&(e-=26,v++);return this._strip()};function y(r,i){var a=r.charCodeAt(i);if(a>=48&&a<=57)return a-48;if(a>=65&&a<=70)return a-55;if(a>=97&&a<=102)return a-87;o(!1,"Invalid character in "+r)}function S(r,i,a){var d=y(r,a);return a-1>=i&&(d|=y(r,a-1)<<4),d}f.prototype._parseHex=function(i,a,d){this.length=Math.ceil((i.length-a)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var v=0,u=0,e;if(d==="be")for(c=i.length-1;c>=a;c-=2)e=S(i,a,c)<<v,this.words[u]|=e&67108863,v>=18?(v-=18,u+=1,this.words[u]|=e>>>26):v+=8;else{var l=i.length-a;for(c=l%2===0?a+1:a;c<i.length;c+=2)e=S(i,a,c)<<v,this.words[u]|=e&67108863,v>=18?(v-=18,u+=1,this.words[u]|=e>>>26):v+=8}this._strip()};function B(r,i,a,d){for(var c=0,v=0,u=Math.min(r.length,a),e=i;e<u;e++){var l=r.charCodeAt(e)-48;c*=d,l>=49?v=l-49+10:l>=17?v=l-17+10:v=l,o(l>=0&&v<d,"Invalid character"),c+=v}return c}f.prototype._parseBase=function(i,a,d){this.words=[0],this.length=1;for(var c=0,v=1;v<=67108863;v*=a)c++;c--,v=v/a|0;for(var u=i.length-d,e=u%c,l=Math.min(u,u-e)+d,b=0,_=d;_<l;_+=c)b=B(i,_,_+c,a),this.imuln(v),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(e!==0){var C=1;for(b=B(i,_,i.length,a),_=0;_<e;_++)C*=a;this.imuln(C),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var a=0;a<this.length;a++)i.words[a]=this.words[a];i.length=this.length,i.negative=this.negative,i.red=this.red};function M(r,i){r.words=i.words,r.length=i.length,r.negative=i.negative,r.red=i.red}if(f.prototype._move=function(i){M(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=x}catch(r){f.prototype.inspect=x}else f.prototype.inspect=x;function x(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var I=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],k=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],D=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(i,a){i=i||10,a=a|0||1;var d;if(i===16||i==="hex"){d="";for(var c=0,v=0,u=0;u<this.length;u++){var e=this.words[u],l=((e<<c|v)&16777215).toString(16);v=e>>>24-c&16777215,c+=2,c>=26&&(c-=26,u--),v!==0||u!==this.length-1?d=I[6-l.length]+l+d:d=l+d}for(v!==0&&(d=v.toString(16)+d);d.length%a!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(i===(i|0)&&i>=2&&i<=36){var b=k[i],_=D[i];d="";var C=this.clone();for(C.negative=0;!C.isZero();){var q=C.modrn(_).toString(i);C=C.idivn(_),C.isZero()?d=q+d:d=I[b-q.length]+q+d}for(this.isZero()&&(d="0"+d);d.length%a!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},g&&(f.prototype.toBuffer=function(i,a){return this.toArrayLike(g,i,a)}),f.prototype.toArray=function(i,a){return this.toArrayLike(Array,i,a)};var L=function(i,a){return i.allocUnsafe?i.allocUnsafe(a):new i(a)};f.prototype.toArrayLike=function(i,a,d){this._strip();var c=this.byteLength(),v=d||Math.max(1,c);o(c<=v,"byte array longer than desired length"),o(v>0,"Requested array length <= 0");var u=L(i,v),e=a==="le"?"LE":"BE";return this["_toArrayLike"+e](u,c),u},f.prototype._toArrayLikeLE=function(i,a){for(var d=0,c=0,v=0,u=0;v<this.length;v++){var e=this.words[v]<<u|c;i[d++]=e&255,d<i.length&&(i[d++]=e>>8&255),d<i.length&&(i[d++]=e>>16&255),u===6?(d<i.length&&(i[d++]=e>>24&255),c=0,u=0):(c=e>>>24,u+=2)}if(d<i.length)for(i[d++]=c;d<i.length;)i[d++]=0},f.prototype._toArrayLikeBE=function(i,a){for(var d=i.length-1,c=0,v=0,u=0;v<this.length;v++){var e=this.words[v]<<u|c;i[d--]=e&255,d>=0&&(i[d--]=e>>8&255),d>=0&&(i[d--]=e>>16&255),u===6?(d>=0&&(i[d--]=e>>24&255),c=0,u=0):(c=e>>>24,u+=2)}if(d>=0)for(i[d--]=c;d>=0;)i[d--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var a=i,d=0;return a>=4096&&(d+=13,a>>>=13),a>=64&&(d+=7,a>>>=7),a>=8&&(d+=4,a>>>=4),a>=2&&(d+=2,a>>>=2),d+a},f.prototype._zeroBits=function(i){if(i===0)return 26;var a=i,d=0;return a&8191||(d+=13,a>>>=13),a&127||(d+=7,a>>>=7),a&15||(d+=4,a>>>=4),a&3||(d+=2,a>>>=2),a&1||d++,d},f.prototype.bitLength=function(){var i=this.words[this.length-1],a=this._countBits(i);return(this.length-1)*26+a};function W(r){for(var i=new Array(r.bitLength()),a=0;a<i.length;a++){var d=a/26|0,c=a%26;i[a]=r.words[d]>>>c&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,a=0;a<this.length;a++){var d=this._zeroBits(this.words[a]);if(i+=d,d!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var a=0;a<i.length;a++)this.words[a]=this.words[a]|i.words[a];return this._strip()},f.prototype.ior=function(i){return o((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var a;this.length>i.length?a=i:a=this;for(var d=0;d<a.length;d++)this.words[d]=this.words[d]&i.words[d];return this.length=a.length,this._strip()},f.prototype.iand=function(i){return o((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var a,d;this.length>i.length?(a=this,d=i):(a=i,d=this);for(var c=0;c<d.length;c++)this.words[c]=a.words[c]^d.words[c];if(this!==a)for(;c<a.length;c++)this.words[c]=a.words[c];return this.length=a.length,this._strip()},f.prototype.ixor=function(i){return o((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){o(typeof i=="number"&&i>=0);var a=Math.ceil(i/26)|0,d=i%26;this._expand(a),d>0&&a--;for(var c=0;c<a;c++)this.words[c]=~this.words[c]&67108863;return d>0&&(this.words[c]=~this.words[c]&67108863>>26-d),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,a){o(typeof i=="number"&&i>=0);var d=i/26|0,c=i%26;return this._expand(d+1),a?this.words[d]=this.words[d]|1<<c:this.words[d]=this.words[d]&~(1<<c),this._strip()},f.prototype.iadd=function(i){var a;if(this.negative!==0&&i.negative===0)return this.negative=0,a=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,a=this.isub(i),i.negative=1,a._normSign();var d,c;this.length>i.length?(d=this,c=i):(d=i,c=this);for(var v=0,u=0;u<c.length;u++)a=(d.words[u]|0)+(c.words[u]|0)+v,this.words[u]=a&67108863,v=a>>>26;for(;v!==0&&u<d.length;u++)a=(d.words[u]|0)+v,this.words[u]=a&67108863,v=a>>>26;if(this.length=d.length,v!==0)this.words[this.length]=v,this.length++;else if(d!==this)for(;u<d.length;u++)this.words[u]=d.words[u];return this},f.prototype.add=function(i){var a;return i.negative!==0&&this.negative===0?(i.negative=0,a=this.sub(i),i.negative^=1,a):i.negative===0&&this.negative!==0?(this.negative=0,a=i.sub(this),this.negative=1,a):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var a=this.iadd(i);return i.negative=1,a._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var d=this.cmp(i);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var c,v;d>0?(c=this,v=i):(c=i,v=this);for(var u=0,e=0;e<v.length;e++)a=(c.words[e]|0)-(v.words[e]|0)+u,u=a>>26,this.words[e]=a&67108863;for(;u!==0&&e<c.length;e++)a=(c.words[e]|0)+u,u=a>>26,this.words[e]=a&67108863;if(u===0&&e<c.length&&c!==this)for(;e<c.length;e++)this.words[e]=c.words[e];return this.length=Math.max(this.length,e),c!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function z(r,i,a){a.negative=i.negative^r.negative;var d=r.length+i.length|0;a.length=d,d=d-1|0;var c=r.words[0]|0,v=i.words[0]|0,u=c*v,e=u&67108863,l=u/67108864|0;a.words[0]=e;for(var b=1;b<d;b++){for(var _=l>>>26,C=l&67108863,q=Math.min(b,i.length-1),O=Math.max(0,b-r.length+1);O<=q;O++){var R=b-O|0;c=r.words[R]|0,v=i.words[O]|0,u=c*v+C,_+=u/67108864|0,C=u&67108863}a.words[b]=C|0,l=_|0}return l!==0?a.words[b]=l|0:a.length--,a._strip()}var $=function(i,a,d){var c=i.words,v=a.words,u=d.words,e=0,l,b,_,C=c[0]|0,q=C&8191,O=C>>>13,R=c[1]|0,P=R&8191,N=R>>>13,K=c[2]|0,kt=K&8191,Z=K>>>13,J=c[3]|0,Ft=J&8191,tt=J>>>13,vt=c[4]|0,Dt=vt&8191,et=vt>>>13,pt=c[5]|0,Pt=pt&8191,j=pt>>>13,dt=c[6]|0,qt=dt&8191,Q=dt>>>13,ct=c[7]|0,Lt=ct&8191,E=ct>>>13,w=c[8]|0,A=w&8191,T=w>>>13,F=c[9]|0,V=F&8191,U=F>>>13,X=v[0]|0,Tt=X&8191,G=X>>>13,rt=v[1]|0,Rt=rt&8191,it=rt>>>13,gt=v[2]|0,zt=gt&8191,nt=gt>>>13,bt=v[3]|0,Kt=bt&8191,ft=bt>>>13,yt=v[4]|0,Ht=yt&8191,at=yt>>>13,wt=v[5]|0,Zt=wt&8191,ht=wt>>>13,Mt=v[6]|0,Wt=Mt&8191,st=Mt>>>13,xt=v[7]|0,Vt=xt&8191,ot=xt>>>13,_t=v[8]|0,Yt=_t&8191,ut=_t>>>13,St=v[9]|0,Nt=St&8191,$t=St>>>13;d.negative=i.negative^a.negative,d.length=19,l=Math.imul(q,Tt),b=Math.imul(q,G),b=b+Math.imul(O,Tt)|0,_=Math.imul(O,G);var jt=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(jt>>>26)|0,jt&=67108863,l=Math.imul(P,Tt),b=Math.imul(P,G),b=b+Math.imul(N,Tt)|0,_=Math.imul(N,G),l=l+Math.imul(q,Rt)|0,b=b+Math.imul(q,it)|0,b=b+Math.imul(O,Rt)|0,_=_+Math.imul(O,it)|0;var Qt=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(kt,Tt),b=Math.imul(kt,G),b=b+Math.imul(Z,Tt)|0,_=Math.imul(Z,G),l=l+Math.imul(P,Rt)|0,b=b+Math.imul(P,it)|0,b=b+Math.imul(N,Rt)|0,_=_+Math.imul(N,it)|0,l=l+Math.imul(q,zt)|0,b=b+Math.imul(q,nt)|0,b=b+Math.imul(O,zt)|0,_=_+Math.imul(O,nt)|0;var te=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(Ft,Tt),b=Math.imul(Ft,G),b=b+Math.imul(tt,Tt)|0,_=Math.imul(tt,G),l=l+Math.imul(kt,Rt)|0,b=b+Math.imul(kt,it)|0,b=b+Math.imul(Z,Rt)|0,_=_+Math.imul(Z,it)|0,l=l+Math.imul(P,zt)|0,b=b+Math.imul(P,nt)|0,b=b+Math.imul(N,zt)|0,_=_+Math.imul(N,nt)|0,l=l+Math.imul(q,Kt)|0,b=b+Math.imul(q,ft)|0,b=b+Math.imul(O,Kt)|0,_=_+Math.imul(O,ft)|0;var ee=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(Dt,Tt),b=Math.imul(Dt,G),b=b+Math.imul(et,Tt)|0,_=Math.imul(et,G),l=l+Math.imul(Ft,Rt)|0,b=b+Math.imul(Ft,it)|0,b=b+Math.imul(tt,Rt)|0,_=_+Math.imul(tt,it)|0,l=l+Math.imul(kt,zt)|0,b=b+Math.imul(kt,nt)|0,b=b+Math.imul(Z,zt)|0,_=_+Math.imul(Z,nt)|0,l=l+Math.imul(P,Kt)|0,b=b+Math.imul(P,ft)|0,b=b+Math.imul(N,Kt)|0,_=_+Math.imul(N,ft)|0,l=l+Math.imul(q,Ht)|0,b=b+Math.imul(q,at)|0,b=b+Math.imul(O,Ht)|0,_=_+Math.imul(O,at)|0;var re=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(Pt,Tt),b=Math.imul(Pt,G),b=b+Math.imul(j,Tt)|0,_=Math.imul(j,G),l=l+Math.imul(Dt,Rt)|0,b=b+Math.imul(Dt,it)|0,b=b+Math.imul(et,Rt)|0,_=_+Math.imul(et,it)|0,l=l+Math.imul(Ft,zt)|0,b=b+Math.imul(Ft,nt)|0,b=b+Math.imul(tt,zt)|0,_=_+Math.imul(tt,nt)|0,l=l+Math.imul(kt,Kt)|0,b=b+Math.imul(kt,ft)|0,b=b+Math.imul(Z,Kt)|0,_=_+Math.imul(Z,ft)|0,l=l+Math.imul(P,Ht)|0,b=b+Math.imul(P,at)|0,b=b+Math.imul(N,Ht)|0,_=_+Math.imul(N,at)|0,l=l+Math.imul(q,Zt)|0,b=b+Math.imul(q,ht)|0,b=b+Math.imul(O,Zt)|0,_=_+Math.imul(O,ht)|0;var ie=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ie>>>26)|0,ie&=67108863,l=Math.imul(qt,Tt),b=Math.imul(qt,G),b=b+Math.imul(Q,Tt)|0,_=Math.imul(Q,G),l=l+Math.imul(Pt,Rt)|0,b=b+Math.imul(Pt,it)|0,b=b+Math.imul(j,Rt)|0,_=_+Math.imul(j,it)|0,l=l+Math.imul(Dt,zt)|0,b=b+Math.imul(Dt,nt)|0,b=b+Math.imul(et,zt)|0,_=_+Math.imul(et,nt)|0,l=l+Math.imul(Ft,Kt)|0,b=b+Math.imul(Ft,ft)|0,b=b+Math.imul(tt,Kt)|0,_=_+Math.imul(tt,ft)|0,l=l+Math.imul(kt,Ht)|0,b=b+Math.imul(kt,at)|0,b=b+Math.imul(Z,Ht)|0,_=_+Math.imul(Z,at)|0,l=l+Math.imul(P,Zt)|0,b=b+Math.imul(P,ht)|0,b=b+Math.imul(N,Zt)|0,_=_+Math.imul(N,ht)|0,l=l+Math.imul(q,Wt)|0,b=b+Math.imul(q,st)|0,b=b+Math.imul(O,Wt)|0,_=_+Math.imul(O,st)|0;var ne=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ne>>>26)|0,ne&=67108863,l=Math.imul(Lt,Tt),b=Math.imul(Lt,G),b=b+Math.imul(E,Tt)|0,_=Math.imul(E,G),l=l+Math.imul(qt,Rt)|0,b=b+Math.imul(qt,it)|0,b=b+Math.imul(Q,Rt)|0,_=_+Math.imul(Q,it)|0,l=l+Math.imul(Pt,zt)|0,b=b+Math.imul(Pt,nt)|0,b=b+Math.imul(j,zt)|0,_=_+Math.imul(j,nt)|0,l=l+Math.imul(Dt,Kt)|0,b=b+Math.imul(Dt,ft)|0,b=b+Math.imul(et,Kt)|0,_=_+Math.imul(et,ft)|0,l=l+Math.imul(Ft,Ht)|0,b=b+Math.imul(Ft,at)|0,b=b+Math.imul(tt,Ht)|0,_=_+Math.imul(tt,at)|0,l=l+Math.imul(kt,Zt)|0,b=b+Math.imul(kt,ht)|0,b=b+Math.imul(Z,Zt)|0,_=_+Math.imul(Z,ht)|0,l=l+Math.imul(P,Wt)|0,b=b+Math.imul(P,st)|0,b=b+Math.imul(N,Wt)|0,_=_+Math.imul(N,st)|0,l=l+Math.imul(q,Vt)|0,b=b+Math.imul(q,ot)|0,b=b+Math.imul(O,Vt)|0,_=_+Math.imul(O,ot)|0;var fe=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(fe>>>26)|0,fe&=67108863,l=Math.imul(A,Tt),b=Math.imul(A,G),b=b+Math.imul(T,Tt)|0,_=Math.imul(T,G),l=l+Math.imul(Lt,Rt)|0,b=b+Math.imul(Lt,it)|0,b=b+Math.imul(E,Rt)|0,_=_+Math.imul(E,it)|0,l=l+Math.imul(qt,zt)|0,b=b+Math.imul(qt,nt)|0,b=b+Math.imul(Q,zt)|0,_=_+Math.imul(Q,nt)|0,l=l+Math.imul(Pt,Kt)|0,b=b+Math.imul(Pt,ft)|0,b=b+Math.imul(j,Kt)|0,_=_+Math.imul(j,ft)|0,l=l+Math.imul(Dt,Ht)|0,b=b+Math.imul(Dt,at)|0,b=b+Math.imul(et,Ht)|0,_=_+Math.imul(et,at)|0,l=l+Math.imul(Ft,Zt)|0,b=b+Math.imul(Ft,ht)|0,b=b+Math.imul(tt,Zt)|0,_=_+Math.imul(tt,ht)|0,l=l+Math.imul(kt,Wt)|0,b=b+Math.imul(kt,st)|0,b=b+Math.imul(Z,Wt)|0,_=_+Math.imul(Z,st)|0,l=l+Math.imul(P,Vt)|0,b=b+Math.imul(P,ot)|0,b=b+Math.imul(N,Vt)|0,_=_+Math.imul(N,ot)|0,l=l+Math.imul(q,Yt)|0,b=b+Math.imul(q,ut)|0,b=b+Math.imul(O,Yt)|0,_=_+Math.imul(O,ut)|0;var ae=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ae>>>26)|0,ae&=67108863,l=Math.imul(V,Tt),b=Math.imul(V,G),b=b+Math.imul(U,Tt)|0,_=Math.imul(U,G),l=l+Math.imul(A,Rt)|0,b=b+Math.imul(A,it)|0,b=b+Math.imul(T,Rt)|0,_=_+Math.imul(T,it)|0,l=l+Math.imul(Lt,zt)|0,b=b+Math.imul(Lt,nt)|0,b=b+Math.imul(E,zt)|0,_=_+Math.imul(E,nt)|0,l=l+Math.imul(qt,Kt)|0,b=b+Math.imul(qt,ft)|0,b=b+Math.imul(Q,Kt)|0,_=_+Math.imul(Q,ft)|0,l=l+Math.imul(Pt,Ht)|0,b=b+Math.imul(Pt,at)|0,b=b+Math.imul(j,Ht)|0,_=_+Math.imul(j,at)|0,l=l+Math.imul(Dt,Zt)|0,b=b+Math.imul(Dt,ht)|0,b=b+Math.imul(et,Zt)|0,_=_+Math.imul(et,ht)|0,l=l+Math.imul(Ft,Wt)|0,b=b+Math.imul(Ft,st)|0,b=b+Math.imul(tt,Wt)|0,_=_+Math.imul(tt,st)|0,l=l+Math.imul(kt,Vt)|0,b=b+Math.imul(kt,ot)|0,b=b+Math.imul(Z,Vt)|0,_=_+Math.imul(Z,ot)|0,l=l+Math.imul(P,Yt)|0,b=b+Math.imul(P,ut)|0,b=b+Math.imul(N,Yt)|0,_=_+Math.imul(N,ut)|0,l=l+Math.imul(q,Nt)|0,b=b+Math.imul(q,$t)|0,b=b+Math.imul(O,Nt)|0,_=_+Math.imul(O,$t)|0;var he=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(he>>>26)|0,he&=67108863,l=Math.imul(V,Rt),b=Math.imul(V,it),b=b+Math.imul(U,Rt)|0,_=Math.imul(U,it),l=l+Math.imul(A,zt)|0,b=b+Math.imul(A,nt)|0,b=b+Math.imul(T,zt)|0,_=_+Math.imul(T,nt)|0,l=l+Math.imul(Lt,Kt)|0,b=b+Math.imul(Lt,ft)|0,b=b+Math.imul(E,Kt)|0,_=_+Math.imul(E,ft)|0,l=l+Math.imul(qt,Ht)|0,b=b+Math.imul(qt,at)|0,b=b+Math.imul(Q,Ht)|0,_=_+Math.imul(Q,at)|0,l=l+Math.imul(Pt,Zt)|0,b=b+Math.imul(Pt,ht)|0,b=b+Math.imul(j,Zt)|0,_=_+Math.imul(j,ht)|0,l=l+Math.imul(Dt,Wt)|0,b=b+Math.imul(Dt,st)|0,b=b+Math.imul(et,Wt)|0,_=_+Math.imul(et,st)|0,l=l+Math.imul(Ft,Vt)|0,b=b+Math.imul(Ft,ot)|0,b=b+Math.imul(tt,Vt)|0,_=_+Math.imul(tt,ot)|0,l=l+Math.imul(kt,Yt)|0,b=b+Math.imul(kt,ut)|0,b=b+Math.imul(Z,Yt)|0,_=_+Math.imul(Z,ut)|0,l=l+Math.imul(P,Nt)|0,b=b+Math.imul(P,$t)|0,b=b+Math.imul(N,Nt)|0,_=_+Math.imul(N,$t)|0;var se=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(se>>>26)|0,se&=67108863,l=Math.imul(V,zt),b=Math.imul(V,nt),b=b+Math.imul(U,zt)|0,_=Math.imul(U,nt),l=l+Math.imul(A,Kt)|0,b=b+Math.imul(A,ft)|0,b=b+Math.imul(T,Kt)|0,_=_+Math.imul(T,ft)|0,l=l+Math.imul(Lt,Ht)|0,b=b+Math.imul(Lt,at)|0,b=b+Math.imul(E,Ht)|0,_=_+Math.imul(E,at)|0,l=l+Math.imul(qt,Zt)|0,b=b+Math.imul(qt,ht)|0,b=b+Math.imul(Q,Zt)|0,_=_+Math.imul(Q,ht)|0,l=l+Math.imul(Pt,Wt)|0,b=b+Math.imul(Pt,st)|0,b=b+Math.imul(j,Wt)|0,_=_+Math.imul(j,st)|0,l=l+Math.imul(Dt,Vt)|0,b=b+Math.imul(Dt,ot)|0,b=b+Math.imul(et,Vt)|0,_=_+Math.imul(et,ot)|0,l=l+Math.imul(Ft,Yt)|0,b=b+Math.imul(Ft,ut)|0,b=b+Math.imul(tt,Yt)|0,_=_+Math.imul(tt,ut)|0,l=l+Math.imul(kt,Nt)|0,b=b+Math.imul(kt,$t)|0,b=b+Math.imul(Z,Nt)|0,_=_+Math.imul(Z,$t)|0;var oe=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(oe>>>26)|0,oe&=67108863,l=Math.imul(V,Kt),b=Math.imul(V,ft),b=b+Math.imul(U,Kt)|0,_=Math.imul(U,ft),l=l+Math.imul(A,Ht)|0,b=b+Math.imul(A,at)|0,b=b+Math.imul(T,Ht)|0,_=_+Math.imul(T,at)|0,l=l+Math.imul(Lt,Zt)|0,b=b+Math.imul(Lt,ht)|0,b=b+Math.imul(E,Zt)|0,_=_+Math.imul(E,ht)|0,l=l+Math.imul(qt,Wt)|0,b=b+Math.imul(qt,st)|0,b=b+Math.imul(Q,Wt)|0,_=_+Math.imul(Q,st)|0,l=l+Math.imul(Pt,Vt)|0,b=b+Math.imul(Pt,ot)|0,b=b+Math.imul(j,Vt)|0,_=_+Math.imul(j,ot)|0,l=l+Math.imul(Dt,Yt)|0,b=b+Math.imul(Dt,ut)|0,b=b+Math.imul(et,Yt)|0,_=_+Math.imul(et,ut)|0,l=l+Math.imul(Ft,Nt)|0,b=b+Math.imul(Ft,$t)|0,b=b+Math.imul(tt,Nt)|0,_=_+Math.imul(tt,$t)|0;var ue=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ue>>>26)|0,ue&=67108863,l=Math.imul(V,Ht),b=Math.imul(V,at),b=b+Math.imul(U,Ht)|0,_=Math.imul(U,at),l=l+Math.imul(A,Zt)|0,b=b+Math.imul(A,ht)|0,b=b+Math.imul(T,Zt)|0,_=_+Math.imul(T,ht)|0,l=l+Math.imul(Lt,Wt)|0,b=b+Math.imul(Lt,st)|0,b=b+Math.imul(E,Wt)|0,_=_+Math.imul(E,st)|0,l=l+Math.imul(qt,Vt)|0,b=b+Math.imul(qt,ot)|0,b=b+Math.imul(Q,Vt)|0,_=_+Math.imul(Q,ot)|0,l=l+Math.imul(Pt,Yt)|0,b=b+Math.imul(Pt,ut)|0,b=b+Math.imul(j,Yt)|0,_=_+Math.imul(j,ut)|0,l=l+Math.imul(Dt,Nt)|0,b=b+Math.imul(Dt,$t)|0,b=b+Math.imul(et,Nt)|0,_=_+Math.imul(et,$t)|0;var le=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(le>>>26)|0,le&=67108863,l=Math.imul(V,Zt),b=Math.imul(V,ht),b=b+Math.imul(U,Zt)|0,_=Math.imul(U,ht),l=l+Math.imul(A,Wt)|0,b=b+Math.imul(A,st)|0,b=b+Math.imul(T,Wt)|0,_=_+Math.imul(T,st)|0,l=l+Math.imul(Lt,Vt)|0,b=b+Math.imul(Lt,ot)|0,b=b+Math.imul(E,Vt)|0,_=_+Math.imul(E,ot)|0,l=l+Math.imul(qt,Yt)|0,b=b+Math.imul(qt,ut)|0,b=b+Math.imul(Q,Yt)|0,_=_+Math.imul(Q,ut)|0,l=l+Math.imul(Pt,Nt)|0,b=b+Math.imul(Pt,$t)|0,b=b+Math.imul(j,Nt)|0,_=_+Math.imul(j,$t)|0;var de=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(de>>>26)|0,de&=67108863,l=Math.imul(V,Wt),b=Math.imul(V,st),b=b+Math.imul(U,Wt)|0,_=Math.imul(U,st),l=l+Math.imul(A,Vt)|0,b=b+Math.imul(A,ot)|0,b=b+Math.imul(T,Vt)|0,_=_+Math.imul(T,ot)|0,l=l+Math.imul(Lt,Yt)|0,b=b+Math.imul(Lt,ut)|0,b=b+Math.imul(E,Yt)|0,_=_+Math.imul(E,ut)|0,l=l+Math.imul(qt,Nt)|0,b=b+Math.imul(qt,$t)|0,b=b+Math.imul(Q,Nt)|0,_=_+Math.imul(Q,$t)|0;var ce=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ce>>>26)|0,ce&=67108863,l=Math.imul(V,Vt),b=Math.imul(V,ot),b=b+Math.imul(U,Vt)|0,_=Math.imul(U,ot),l=l+Math.imul(A,Yt)|0,b=b+Math.imul(A,ut)|0,b=b+Math.imul(T,Yt)|0,_=_+Math.imul(T,ut)|0,l=l+Math.imul(Lt,Nt)|0,b=b+Math.imul(Lt,$t)|0,b=b+Math.imul(E,Nt)|0,_=_+Math.imul(E,$t)|0;var ve=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(ve>>>26)|0,ve&=67108863,l=Math.imul(V,Yt),b=Math.imul(V,ut),b=b+Math.imul(U,Yt)|0,_=Math.imul(U,ut),l=l+Math.imul(A,Nt)|0,b=b+Math.imul(A,$t)|0,b=b+Math.imul(T,Nt)|0,_=_+Math.imul(T,$t)|0;var of=(e+l|0)+((b&8191)<<13)|0;e=(_+(b>>>13)|0)+(of>>>26)|0,of&=67108863,l=Math.imul(V,Nt),b=Math.imul(V,$t),b=b+Math.imul(U,Nt)|0,_=Math.imul(U,$t);var uf=(e+l|0)+((b&8191)<<13)|0;return e=(_+(b>>>13)|0)+(uf>>>26)|0,uf&=67108863,u[0]=jt,u[1]=Qt,u[2]=te,u[3]=ee,u[4]=re,u[5]=ie,u[6]=ne,u[7]=fe,u[8]=ae,u[9]=he,u[10]=se,u[11]=oe,u[12]=ue,u[13]=le,u[14]=de,u[15]=ce,u[16]=ve,u[17]=of,u[18]=uf,e!==0&&(u[19]=e,d.length++),d};Math.imul||($=z);function lt(r,i,a){a.negative=i.negative^r.negative,a.length=r.length+i.length;for(var d=0,c=0,v=0;v<a.length-1;v++){var u=c;c=0;for(var e=d&67108863,l=Math.min(v,i.length-1),b=Math.max(0,v-r.length+1);b<=l;b++){var _=v-b,C=r.words[_]|0,q=i.words[b]|0,O=C*q,R=O&67108863;u=u+(O/67108864|0)|0,R=R+e|0,e=R&67108863,u=u+(R>>>26)|0,c+=u>>>26,u&=67108863}a.words[v]=e,d=u,u=c}return d!==0?a.words[v]=d:a.length--,a._strip()}function H(r,i,a){return lt(r,i,a)}f.prototype.mulTo=function(i,a){var d,c=this.length+i.length;return this.length===10&&i.length===10?d=$(this,i,a):c<63?d=z(this,i,a):c<1024?d=lt(this,i,a):d=H(this,i,a),d},f.prototype.mul=function(i){var a=new f(null);return a.words=new Array(this.length+i.length),this.mulTo(i,a)},f.prototype.mulf=function(i){var a=new f(null);return a.words=new Array(this.length+i.length),H(this,i,a)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var a=i<0;a&&(i=-i),o(typeof i=="number"),o(i<67108864);for(var d=0,c=0;c<this.length;c++){var v=(this.words[c]|0)*i,u=(v&67108863)+(d&67108863);d>>=26,d+=v/67108864|0,d+=u>>>26,this.words[c]=u&67108863}return d!==0&&(this.words[c]=d,this.length++),this.length=i===0?1:this.length,a?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var a=W(i);if(a.length===0)return new f(1);for(var d=this,c=0;c<a.length&&a[c]===0;c++,d=d.sqr());if(++c<a.length)for(var v=d.sqr();c<a.length;c++,v=v.sqr())a[c]!==0&&(d=d.mul(v));return d},f.prototype.iushln=function(i){o(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26,c=67108863>>>26-a<<26-a,v;if(a!==0){var u=0;for(v=0;v<this.length;v++){var e=this.words[v]&c,l=(this.words[v]|0)-e<<a;this.words[v]=l|u,u=e>>>26-a}u&&(this.words[v]=u,this.length++)}if(d!==0){for(v=this.length-1;v>=0;v--)this.words[v+d]=this.words[v];for(v=0;v<d;v++)this.words[v]=0;this.length+=d}return this._strip()},f.prototype.ishln=function(i){return o(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,a,d){o(typeof i=="number"&&i>=0);var c;a?c=(a-a%26)/26:c=0;var v=i%26,u=Math.min((i-v)/26,this.length),e=67108863^67108863>>>v<<v,l=d;if(c-=u,c=Math.max(0,c),l){for(var b=0;b<u;b++)l.words[b]=this.words[b];l.length=u}if(u!==0)if(this.length>u)for(this.length-=u,b=0;b<this.length;b++)this.words[b]=this.words[b+u];else this.words[0]=0,this.length=1;var _=0;for(b=this.length-1;b>=0&&(_!==0||b>=c);b--){var C=this.words[b]|0;this.words[b]=_<<26-v|C>>>v,_=C&e}return l&&_!==0&&(l.words[l.length++]=_),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,a,d){return o(this.negative===0),this.iushrn(i,a,d)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){o(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26,c=1<<a;if(this.length<=d)return!1;var v=this.words[d];return!!(v&c)},f.prototype.imaskn=function(i){o(typeof i=="number"&&i>=0);var a=i%26,d=(i-a)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(a!==0&&d++,this.length=Math.min(d,this.length),a!==0){var c=67108863^67108863>>>a<<a;this.words[this.length-1]&=c}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return o(typeof i=="number"),o(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var a=0;a<this.length&&this.words[a]>=67108864;a++)this.words[a]-=67108864,a===this.length-1?this.words[a+1]=1:this.words[a+1]++;return this.length=Math.max(this.length,a+1),this},f.prototype.isubn=function(i){if(o(typeof i=="number"),o(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var a=0;a<this.length&&this.words[a]<0;a++)this.words[a]+=67108864,this.words[a+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,a,d){var c=i.length+d,v;this._expand(c);var u,e=0;for(v=0;v<i.length;v++){u=(this.words[v+d]|0)+e;var l=(i.words[v]|0)*a;u-=l&67108863,e=(u>>26)-(l/67108864|0),this.words[v+d]=u&67108863}for(;v<this.length-d;v++)u=(this.words[v+d]|0)+e,e=u>>26,this.words[v+d]=u&67108863;if(e===0)return this._strip();for(o(e===-1),e=0,v=0;v<this.length;v++)u=-(this.words[v]|0)+e,e=u>>26,this.words[v]=u&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,a){var d=this.length-i.length,c=this.clone(),v=i,u=v.words[v.length-1]|0,e=this._countBits(u);d=26-e,d!==0&&(v=v.ushln(d),c.iushln(d),u=v.words[v.length-1]|0);var l=c.length-v.length,b;if(a!=="mod"){b=new f(null),b.length=l+1,b.words=new Array(b.length);for(var _=0;_<b.length;_++)b.words[_]=0}var C=c.clone()._ishlnsubmul(v,1,l);C.negative===0&&(c=C,b&&(b.words[l]=1));for(var q=l-1;q>=0;q--){var O=(c.words[v.length+q]|0)*67108864+(c.words[v.length+q-1]|0);for(O=Math.min(O/u|0,67108863),c._ishlnsubmul(v,O,q);c.negative!==0;)O--,c.negative=0,c._ishlnsubmul(v,1,q),c.isZero()||(c.negative^=1);b&&(b.words[q]=O)}return b&&b._strip(),c._strip(),a!=="div"&&d!==0&&c.iushrn(d),{div:b||null,mod:c}},f.prototype.divmod=function(i,a,d){if(o(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var c,v,u;return this.negative!==0&&i.negative===0?(u=this.neg().divmod(i,a),a!=="mod"&&(c=u.div.neg()),a!=="div"&&(v=u.mod.neg(),d&&v.negative!==0&&v.iadd(i)),{div:c,mod:v}):this.negative===0&&i.negative!==0?(u=this.divmod(i.neg(),a),a!=="mod"&&(c=u.div.neg()),{div:c,mod:u.mod}):this.negative&i.negative?(u=this.neg().divmod(i.neg(),a),a!=="div"&&(v=u.mod.neg(),d&&v.negative!==0&&v.isub(i)),{div:u.div,mod:v}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?a==="div"?{div:this.divn(i.words[0]),mod:null}:a==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,a)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var a=this.divmod(i);if(a.mod.isZero())return a.div;var d=a.div.negative!==0?a.mod.isub(i):a.mod,c=i.ushrn(1),v=i.andln(1),u=d.cmp(c);return u<0||v===1&&u===0?a.div:a.div.negative!==0?a.div.isubn(1):a.div.iaddn(1)},f.prototype.modrn=function(i){var a=i<0;a&&(i=-i),o(i<=67108863);for(var d=(1<<26)%i,c=0,v=this.length-1;v>=0;v--)c=(d*c+(this.words[v]|0))%i;return a?-c:c},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var a=i<0;a&&(i=-i),o(i<=67108863);for(var d=0,c=this.length-1;c>=0;c--){var v=(this.words[c]|0)+d*67108864;this.words[c]=v/i|0,d=v%i}return this._strip(),a?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){o(i.negative===0),o(!i.isZero());var a=this,d=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new f(1),v=new f(0),u=new f(0),e=new f(1),l=0;a.isEven()&&d.isEven();)a.iushrn(1),d.iushrn(1),++l;for(var b=d.clone(),_=a.clone();!a.isZero();){for(var C=0,q=1;!(a.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(a.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(b),v.isub(_)),c.iushrn(1),v.iushrn(1);for(var O=0,R=1;!(d.words[0]&R)&&O<26;++O,R<<=1);if(O>0)for(d.iushrn(O);O-- >0;)(u.isOdd()||e.isOdd())&&(u.iadd(b),e.isub(_)),u.iushrn(1),e.iushrn(1);a.cmp(d)>=0?(a.isub(d),c.isub(u),v.isub(e)):(d.isub(a),u.isub(c),e.isub(v))}return{a:u,b:e,gcd:d.iushln(l)}},f.prototype._invmp=function(i){o(i.negative===0),o(!i.isZero());var a=this,d=i.clone();a.negative!==0?a=a.umod(i):a=a.clone();for(var c=new f(1),v=new f(0),u=d.clone();a.cmpn(1)>0&&d.cmpn(1)>0;){for(var e=0,l=1;!(a.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(a.iushrn(e);e-- >0;)c.isOdd()&&c.iadd(u),c.iushrn(1);for(var b=0,_=1;!(d.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(d.iushrn(b);b-- >0;)v.isOdd()&&v.iadd(u),v.iushrn(1);a.cmp(d)>=0?(a.isub(d),c.isub(v)):(d.isub(a),v.isub(c))}var C;return a.cmpn(1)===0?C=c:C=v,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var a=this.clone(),d=i.clone();a.negative=0,d.negative=0;for(var c=0;a.isEven()&&d.isEven();c++)a.iushrn(1),d.iushrn(1);do{for(;a.isEven();)a.iushrn(1);for(;d.isEven();)d.iushrn(1);var v=a.cmp(d);if(v<0){var u=a;a=d,d=u}else if(v===0||d.cmpn(1)===0)break;a.isub(d)}while(!0);return d.iushln(c)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){o(typeof i=="number");var a=i%26,d=(i-a)/26,c=1<<a;if(this.length<=d)return this._expand(d+1),this.words[d]|=c,this;for(var v=c,u=d;v!==0&&u<this.length;u++){var e=this.words[u]|0;e+=v,v=e>>>26,e&=67108863,this.words[u]=e}return v!==0&&(this.words[u]=v,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var a=i<0;if(this.negative!==0&&!a)return-1;if(this.negative===0&&a)return 1;this._strip();var d;if(this.length>1)d=1;else{a&&(i=-i),o(i<=67108863,"Number is too big");var c=this.words[0]|0;d=c===i?0:c<i?-1:1}return this.negative!==0?-d|0:d},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var a=this.ucmp(i);return this.negative!==0?-a|0:a},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var a=0,d=this.length-1;d>=0;d--){var c=this.words[d]|0,v=i.words[d]|0;if(c!==v){c<v?a=-1:c>v&&(a=1);break}}return a},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new p(i)},f.prototype.toRed=function(i){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return o(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return o(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var At={k256:null,p224:null,p192:null,p25519:null};function Bt(r,i){this.name=r,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Bt.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Bt.prototype.ireduce=function(i){var a=i,d;do this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),d=a.bitLength();while(d>this.n);var c=d<this.n?-1:a.ucmp(this.p);return c===0?(a.words[0]=0,a.length=1):c>0?a.isub(this.p):a.strip!==void 0?a.strip():a._strip(),a},Bt.prototype.split=function(i,a){i.iushrn(this.n,0,a)},Bt.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Bt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(Ct,Bt),Ct.prototype.split=function(i,a){for(var d=4194303,c=Math.min(i.length,9),v=0;v<c;v++)a.words[v]=i.words[v];if(a.length=c,i.length<=9){i.words[0]=0,i.length=1;return}var u=i.words[9];for(a.words[a.length++]=u&d,v=10;v<i.length;v++){var e=i.words[v]|0;i.words[v-10]=(e&d)<<4|u>>>22,u=e}u>>>=22,i.words[v-10]=u,u===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var a=0,d=0;d<i.length;d++){var c=i.words[d]|0;a+=c*977,i.words[d]=a&67108863,a=c*64+(a/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Et(){Bt.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Et,Bt);function Y(){Bt.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Y,Bt);function It(){Bt.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(It,Bt),It.prototype.imulK=function(i){for(var a=0,d=0;d<i.length;d++){var c=(i.words[d]|0)*19+a,v=c&67108863;c>>>=26,i.words[d]=v,a=c}return a!==0&&(i.words[i.length++]=a),i},f._prime=function(i){if(At[i])return At[i];var a;if(i==="k256")a=new Ct;else if(i==="p224")a=new Et;else if(i==="p192")a=new Y;else if(i==="p25519")a=new It;else throw new Error("Unknown prime "+i);return At[i]=a,a};function p(r){if(typeof r=="string"){var i=f._prime(r);this.m=i.p,this.prime=i}else o(r.gtn(1),"modulus must be greater than 1"),this.m=r,this.prime=null}p.prototype._verify1=function(i){o(i.negative===0,"red works only with positives"),o(i.red,"red works only with red numbers")},p.prototype._verify2=function(i,a){o((i.negative|a.negative)===0,"red works only with positives"),o(i.red&&i.red===a.red,"red works only with red numbers")},p.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(M(i,i.umod(this.m)._forceRed(this)),i)},p.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},p.prototype.add=function(i,a){this._verify2(i,a);var d=i.add(a);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},p.prototype.iadd=function(i,a){this._verify2(i,a);var d=i.iadd(a);return d.cmp(this.m)>=0&&d.isub(this.m),d},p.prototype.sub=function(i,a){this._verify2(i,a);var d=i.sub(a);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},p.prototype.isub=function(i,a){this._verify2(i,a);var d=i.isub(a);return d.cmpn(0)<0&&d.iadd(this.m),d},p.prototype.shl=function(i,a){return this._verify1(i),this.imod(i.ushln(a))},p.prototype.imul=function(i,a){return this._verify2(i,a),this.imod(i.imul(a))},p.prototype.mul=function(i,a){return this._verify2(i,a),this.imod(i.mul(a))},p.prototype.isqr=function(i){return this.imul(i,i.clone())},p.prototype.sqr=function(i){return this.mul(i,i)},p.prototype.sqrt=function(i){if(i.isZero())return i.clone();var a=this.m.andln(3);if(o(a%2===1),a===3){var d=this.m.add(new f(1)).iushrn(2);return this.pow(i,d)}for(var c=this.m.subn(1),v=0;!c.isZero()&&c.andln(1)===0;)v++,c.iushrn(1);o(!c.isZero());var u=new f(1).toRed(this),e=u.redNeg(),l=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new f(2*b*b).toRed(this);this.pow(b,l).cmp(e)!==0;)b.redIAdd(e);for(var _=this.pow(b,c),C=this.pow(i,c.addn(1).iushrn(1)),q=this.pow(i,c),O=v;q.cmp(u)!==0;){for(var R=q,P=0;R.cmp(u)!==0;P++)R=R.redSqr();o(P<O);var N=this.pow(_,new f(1).iushln(O-P-1));C=C.redMul(N),_=N.redSqr(),q=q.redMul(_),O=P}return C},p.prototype.invm=function(i){var a=i._invmp(this.m);return a.negative!==0?(a.negative=0,this.imod(a).redNeg()):this.imod(a)},p.prototype.pow=function(i,a){if(a.isZero())return new f(1).toRed(this);if(a.cmpn(1)===0)return i.clone();var d=4,c=new Array(1<<d);c[0]=new f(1).toRed(this),c[1]=i;for(var v=2;v<c.length;v++)c[v]=this.mul(c[v-1],i);var u=c[0],e=0,l=0,b=a.bitLength()%26;for(b===0&&(b=26),v=a.length-1;v>=0;v--){for(var _=a.words[v],C=b-1;C>=0;C--){var q=_>>C&1;if(u!==c[0]&&(u=this.sqr(u)),q===0&&e===0){l=0;continue}e<<=1,e|=q,l++,!(l!==d&&(v!==0||C!==0))&&(u=this.mul(u,c[e]),l=0,e=0)}b=26}return u},p.prototype.convertTo=function(i){var a=i.umod(this.m);return a===i?a.clone():a},p.prototype.convertFrom=function(i){var a=i.clone();return a.red=null,a},f.mont=function(i){return new t(i)};function t(r){p.call(this,r),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(t,p),t.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},t.prototype.convertFrom=function(i){var a=this.imod(i.mul(this.rinv));return a.red=null,a},t.prototype.imul=function(i,a){if(i.isZero()||a.isZero())return i.words[0]=0,i.length=1,i;var d=i.imul(a),c=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(c).iushrn(this.shift),u=v;return v.cmp(this.m)>=0?u=v.isub(this.m):v.cmpn(0)<0&&(u=v.iadd(this.m)),u._forceRed(this)},t.prototype.mul=function(i,a){if(i.isZero()||a.isZero())return new f(0)._forceRed(this);var d=i.mul(a),c=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=d.isub(c).iushrn(this.shift),u=v;return v.cmp(this.m)>=0?u=v.isub(this.m):v.cmpn(0)<0&&(u=v.iadd(this.m)),u._forceRed(this)},t.prototype.invm=function(i){var a=this.imod(i._invmp(this.m).mul(this.r2));return a._forceRed(this)}})(h,Gt)})(N0);var $0=N0.exports,si=$0,Iv=gi,Rv=Ot.Buffer;function ho(h){var n=h.modulus.byteLength(),s;do s=new si(Iv(n));while(s.cmp(h.modulus)>=0||!s.umod(h.prime1)||!s.umod(h.prime2));return s}function Tv(h){var n=ho(h),s=n.toRed(si.mont(h.modulus)).redPow(new si(h.publicExponent)).fromRed();return{blinder:s,unblinder:n.invm(h.modulus)}}function so(h,n){var s=Tv(n),o=n.modulus.byteLength(),m=new si(h).mul(s.blinder).umod(n.modulus),f=m.toRed(si.mont(n.prime1)),g=m.toRed(si.mont(n.prime2)),y=n.coefficient,S=n.prime1,B=n.prime2,M=f.redPow(n.exponent1).fromRed(),x=g.redPow(n.exponent2).fromRed(),I=M.isub(x).imul(y).umod(S).imul(B);return x.iadd(I).imul(s.unblinder).umod(n.modulus).toArrayLike(Rv,"be",o)}so.getr=ho;var U0=so,kf={};const Cv="elliptic",Fv="6.6.1",qv="EC cryptography",Pv="lib/elliptic.js",Dv=["lib"],Nv={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},$v={type:"git",url:"git@github.com:indutny/elliptic"},Uv=["EC","Elliptic","curve","Cryptography"],Lv="Fedor Indutny <fedor@indutny.com>",Ov="MIT",zv={url:"https://github.com/indutny/elliptic/issues"},Kv="https://github.com/indutny/elliptic",Hv={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},Zv={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},Wv={name:Cv,version:Fv,description:qv,main:Pv,files:Dv,scripts:Nv,repository:$v,keywords:Uv,author:Lv,license:Ov,bugs:zv,homepage:Kv,devDependencies:Hv,dependencies:Zv};var ze={},L0={exports:{}};L0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(L0);var Rr=L0.exports,O0={};(function(h){var n=h;function s(f,g){if(Array.isArray(f))return f.slice();if(!f)return[];var y=[];if(typeof f!="string"){for(var S=0;S<f.length;S++)y[S]=f[S]|0;return y}if(g==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var S=0;S<f.length;S+=2)y.push(parseInt(f[S]+f[S+1],16))}else for(var S=0;S<f.length;S++){var B=f.charCodeAt(S),M=B>>8,x=B&255;M?y.push(M,x):y.push(x)}return y}n.toArray=s;function o(f){return f.length===1?"0"+f:f}n.zero2=o;function m(f){for(var g="",y=0;y<f.length;y++)g+=o(f[y].toString(16));return g}n.toHex=m,n.encode=function(g,y){return y==="hex"?m(g):g}})(O0);(function(h){var n=h,s=Rr,o=We,m=O0;n.assert=o,n.toArray=m.toArray,n.zero2=m.zero2,n.toHex=m.toHex,n.encode=m.encode;function f(M,x,I){var k=new Array(Math.max(M.bitLength(),I)+1),D;for(D=0;D<k.length;D+=1)k[D]=0;var L=1<<x+1,W=M.clone();for(D=0;D<k.length;D++){var z,$=W.andln(L-1);W.isOdd()?($>(L>>1)-1?z=(L>>1)-$:z=$,W.isubn(z)):z=0,k[D]=z,W.iushrn(1)}return k}n.getNAF=f;function g(M,x){var I=[[],[]];M=M.clone(),x=x.clone();for(var k=0,D=0,L;M.cmpn(-k)>0||x.cmpn(-D)>0;){var W=M.andln(3)+k&3,z=x.andln(3)+D&3;W===3&&(W=-1),z===3&&(z=-1);var $;W&1?(L=M.andln(7)+k&7,(L===3||L===5)&&z===2?$=-W:$=W):$=0,I[0].push($);var lt;z&1?(L=x.andln(7)+D&7,(L===3||L===5)&&W===2?lt=-z:lt=z):lt=0,I[1].push(lt),2*k===$+1&&(k=1-k),2*D===lt+1&&(D=1-D),M.iushrn(1),x.iushrn(1)}return I}n.getJSF=g;function y(M,x,I){var k="_"+x;M.prototype[x]=function(){return this[k]!==void 0?this[k]:this[k]=I.call(this)}}n.cachedProperty=y;function S(M){return typeof M=="string"?n.toArray(M,"hex"):M}n.parseBytes=S;function B(M){return new s(M,"hex","le")}n.intFromLE=B})(ze);var z0={},Kr=Rr,rn=ze,En=rn.getNAF,Vv=rn.getJSF,kn=rn.assert;function Ur(h,n){this.type=h,this.p=new Kr(n.p,16),this.red=n.prime?Kr.red(n.prime):Kr.mont(this.p),this.zero=new Kr(0).toRed(this.red),this.one=new Kr(1).toRed(this.red),this.two=new Kr(2).toRed(this.red),this.n=n.n&&new Kr(n.n,16),this.g=n.g&&this.pointFromJSON(n.g,n.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var s=this.n&&this.p.div(this.n);!s||s.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var jn=Ur;Ur.prototype.point=function(){throw new Error("Not implemented")};Ur.prototype.validate=function(){throw new Error("Not implemented")};Ur.prototype._fixedNafMul=function(n,s){kn(n.precomputed);var o=n._getDoubles(),m=En(s,1,this._bitLength),f=(1<<o.step+1)-(o.step%2===0?2:1);f/=3;var g=[],y,S;for(y=0;y<m.length;y+=o.step){S=0;for(var B=y+o.step-1;B>=y;B--)S=(S<<1)+m[B];g.push(S)}for(var M=this.jpoint(null,null,null),x=this.jpoint(null,null,null),I=f;I>0;I--){for(y=0;y<g.length;y++)S=g[y],S===I?x=x.mixedAdd(o.points[y]):S===-I&&(x=x.mixedAdd(o.points[y].neg()));M=M.add(x)}return M.toP()};Ur.prototype._wnafMul=function(n,s){var o=4,m=n._getNAFPoints(o);o=m.wnd;for(var f=m.points,g=En(s,o,this._bitLength),y=this.jpoint(null,null,null),S=g.length-1;S>=0;S--){for(var B=0;S>=0&&g[S]===0;S--)B++;if(S>=0&&B++,y=y.dblp(B),S<0)break;var M=g[S];kn(M!==0),n.type==="affine"?M>0?y=y.mixedAdd(f[M-1>>1]):y=y.mixedAdd(f[-M-1>>1].neg()):M>0?y=y.add(f[M-1>>1]):y=y.add(f[-M-1>>1].neg())}return n.type==="affine"?y.toP():y};Ur.prototype._wnafMulAdd=function(n,s,o,m,f){var g=this._wnafT1,y=this._wnafT2,S=this._wnafT3,B=0,M,x,I;for(M=0;M<m;M++){I=s[M];var k=I._getNAFPoints(n);g[M]=k.wnd,y[M]=k.points}for(M=m-1;M>=1;M-=2){var D=M-1,L=M;if(g[D]!==1||g[L]!==1){S[D]=En(o[D],g[D],this._bitLength),S[L]=En(o[L],g[L],this._bitLength),B=Math.max(S[D].length,B),B=Math.max(S[L].length,B);continue}var W=[s[D],null,null,s[L]];s[D].y.cmp(s[L].y)===0?(W[1]=s[D].add(s[L]),W[2]=s[D].toJ().mixedAdd(s[L].neg())):s[D].y.cmp(s[L].y.redNeg())===0?(W[1]=s[D].toJ().mixedAdd(s[L]),W[2]=s[D].add(s[L].neg())):(W[1]=s[D].toJ().mixedAdd(s[L]),W[2]=s[D].toJ().mixedAdd(s[L].neg()));var z=[-3,-1,-5,-7,0,7,5,1,3],$=Vv(o[D],o[L]);for(B=Math.max($[0].length,B),S[D]=new Array(B),S[L]=new Array(B),x=0;x<B;x++){var lt=$[0][x]|0,H=$[1][x]|0;S[D][x]=z[(lt+1)*3+(H+1)],S[L][x]=0,y[D]=W}}var At=this.jpoint(null,null,null),Bt=this._wnafT4;for(M=B;M>=0;M--){for(var Ct=0;M>=0;){var Et=!0;for(x=0;x<m;x++)Bt[x]=S[x][M]|0,Bt[x]!==0&&(Et=!1);if(!Et)break;Ct++,M--}if(M>=0&&Ct++,At=At.dblp(Ct),M<0)break;for(x=0;x<m;x++){var Y=Bt[x];Y!==0&&(Y>0?I=y[x][Y-1>>1]:Y<0&&(I=y[x][-Y-1>>1].neg()),I.type==="affine"?At=At.mixedAdd(I):At=At.add(I))}}for(M=0;M<m;M++)y[M]=null;return f?At:At.toP()};function Ye(h,n){this.curve=h,this.type=n,this.precomputed=null}Ur.BasePoint=Ye;Ye.prototype.eq=function(){throw new Error("Not implemented")};Ye.prototype.validate=function(){return this.curve.validate(this)};Ur.prototype.decodePoint=function(n,s){n=rn.toArray(n,s);var o=this.p.byteLength();if((n[0]===4||n[0]===6||n[0]===7)&&n.length-1===2*o){n[0]===6?kn(n[n.length-1]%2===0):n[0]===7&&kn(n[n.length-1]%2===1);var m=this.point(n.slice(1,1+o),n.slice(1+o,1+2*o));return m}else if((n[0]===2||n[0]===3)&&n.length-1===o)return this.pointFromX(n.slice(1,1+o),n[0]===3);throw new Error("Unknown point format")};Ye.prototype.encodeCompressed=function(n){return this.encode(n,!0)};Ye.prototype._encode=function(n){var s=this.curve.p.byteLength(),o=this.getX().toArray("be",s);return n?[this.getY().isEven()?2:3].concat(o):[4].concat(o,this.getY().toArray("be",s))};Ye.prototype.encode=function(n,s){return rn.encode(this._encode(s),n)};Ye.prototype.precompute=function(n){if(this.precomputed)return this;var s={doubles:null,naf:null,beta:null};return s.naf=this._getNAFPoints(8),s.doubles=this._getDoubles(4,n),s.beta=this._getBeta(),this.precomputed=s,this};Ye.prototype._hasDoubles=function(n){if(!this.precomputed)return!1;var s=this.precomputed.doubles;return s?s.points.length>=Math.ceil((n.bitLength()+1)/s.step):!1};Ye.prototype._getDoubles=function(n,s){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var o=[this],m=this,f=0;f<s;f+=n){for(var g=0;g<n;g++)m=m.dbl();o.push(m)}return{step:n,points:o}};Ye.prototype._getNAFPoints=function(n){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var s=[this],o=(1<<n)-1,m=o===1?null:this.dbl(),f=1;f<o;f++)s[f]=s[f-1].add(m);return{wnd:n,points:s}};Ye.prototype._getBeta=function(){return null};Ye.prototype.dblp=function(n){for(var s=this,o=0;o<n;o++)s=s.dbl();return s};var Yv=ze,ge=Rr,K0=Jt,wi=jn,Jv=Yv.assert;function Je(h){wi.call(this,"short",h),this.a=new ge(h.a,16).toRed(this.red),this.b=new ge(h.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(h),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}K0(Je,wi);var Gv=Je;Je.prototype._getEndomorphism=function(n){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var s,o;if(n.beta)s=new ge(n.beta,16).toRed(this.red);else{var m=this._getEndoRoots(this.p);s=m[0].cmp(m[1])<0?m[0]:m[1],s=s.toRed(this.red)}if(n.lambda)o=new ge(n.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(s))===0?o=f[0]:(o=f[1],Jv(this.g.mul(o).x.cmp(this.g.x.redMul(s))===0))}var g;return n.basis?g=n.basis.map(function(y){return{a:new ge(y.a,16),b:new ge(y.b,16)}}):g=this._getEndoBasis(o),{beta:s,lambda:o,basis:g}}};Je.prototype._getEndoRoots=function(n){var s=n===this.p?this.red:ge.mont(n),o=new ge(2).toRed(s).redInvm(),m=o.redNeg(),f=new ge(3).toRed(s).redNeg().redSqrt().redMul(o),g=m.redAdd(f).fromRed(),y=m.redSub(f).fromRed();return[g,y]};Je.prototype._getEndoBasis=function(n){for(var s=this.n.ushrn(Math.floor(this.n.bitLength()/2)),o=n,m=this.n.clone(),f=new ge(1),g=new ge(0),y=new ge(0),S=new ge(1),B,M,x,I,k,D,L,W=0,z,$;o.cmpn(0)!==0;){var lt=m.div(o);z=m.sub(lt.mul(o)),$=y.sub(lt.mul(f));var H=S.sub(lt.mul(g));if(!x&&z.cmp(s)<0)B=L.neg(),M=f,x=z.neg(),I=$;else if(x&&++W===2)break;L=z,m=o,o=z,y=f,f=$,S=g,g=H}k=z.neg(),D=$;var At=x.sqr().add(I.sqr()),Bt=k.sqr().add(D.sqr());return Bt.cmp(At)>=0&&(k=B,D=M),x.negative&&(x=x.neg(),I=I.neg()),k.negative&&(k=k.neg(),D=D.neg()),[{a:x,b:I},{a:k,b:D}]};Je.prototype._endoSplit=function(n){var s=this.endo.basis,o=s[0],m=s[1],f=m.b.mul(n).divRound(this.n),g=o.b.neg().mul(n).divRound(this.n),y=f.mul(o.a),S=g.mul(m.a),B=f.mul(o.b),M=g.mul(m.b),x=n.sub(y).sub(S),I=B.add(M).neg();return{k1:x,k2:I}};Je.prototype.pointFromX=function(n,s){n=new ge(n,16),n.red||(n=n.toRed(this.red));var o=n.redSqr().redMul(n).redIAdd(n.redMul(this.a)).redIAdd(this.b),m=o.redSqrt();if(m.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var f=m.fromRed().isOdd();return(s&&!f||!s&&f)&&(m=m.redNeg()),this.point(n,m)};Je.prototype.validate=function(n){if(n.inf)return!0;var s=n.x,o=n.y,m=this.a.redMul(s),f=s.redSqr().redMul(s).redIAdd(m).redIAdd(this.b);return o.redSqr().redISub(f).cmpn(0)===0};Je.prototype._endoWnafMulAdd=function(n,s,o){for(var m=this._endoWnafT1,f=this._endoWnafT2,g=0;g<n.length;g++){var y=this._endoSplit(s[g]),S=n[g],B=S._getBeta();y.k1.negative&&(y.k1.ineg(),S=S.neg(!0)),y.k2.negative&&(y.k2.ineg(),B=B.neg(!0)),m[g*2]=S,m[g*2+1]=B,f[g*2]=y.k1,f[g*2+1]=y.k2}for(var M=this._wnafMulAdd(1,m,f,g*2,o),x=0;x<g*2;x++)m[x]=null,f[x]=null;return M};function Be(h,n,s,o){wi.BasePoint.call(this,h,"affine"),n===null&&s===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ge(n,16),this.y=new ge(s,16),o&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}K0(Be,wi.BasePoint);Je.prototype.point=function(n,s,o){return new Be(this,n,s,o)};Je.prototype.pointFromJSON=function(n,s){return Be.fromJSON(this,n,s)};Be.prototype._getBeta=function(){if(this.curve.endo){var n=this.precomputed;if(n&&n.beta)return n.beta;var s=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(n){var o=this.curve,m=function(f){return o.point(f.x.redMul(o.endo.beta),f.y)};n.beta=s,s.precomputed={beta:null,naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(m)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(m)}}}return s}};Be.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Be.fromJSON=function(n,s,o){typeof s=="string"&&(s=JSON.parse(s));var m=n.point(s[0],s[1],o);if(!s[2])return m;function f(y){return n.point(y[0],y[1],o)}var g=s[2];return m.precomputed={beta:null,doubles:g.doubles&&{step:g.doubles.step,points:[m].concat(g.doubles.points.map(f))},naf:g.naf&&{wnd:g.naf.wnd,points:[m].concat(g.naf.points.map(f))}},m};Be.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Be.prototype.isInfinity=function(){return this.inf};Be.prototype.add=function(n){if(this.inf)return n;if(n.inf)return this;if(this.eq(n))return this.dbl();if(this.neg().eq(n))return this.curve.point(null,null);if(this.x.cmp(n.x)===0)return this.curve.point(null,null);var s=this.y.redSub(n.y);s.cmpn(0)!==0&&(s=s.redMul(this.x.redSub(n.x).redInvm()));var o=s.redSqr().redISub(this.x).redISub(n.x),m=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,m)};Be.prototype.dbl=function(){if(this.inf)return this;var n=this.y.redAdd(this.y);if(n.cmpn(0)===0)return this.curve.point(null,null);var s=this.curve.a,o=this.x.redSqr(),m=n.redInvm(),f=o.redAdd(o).redIAdd(o).redIAdd(s).redMul(m),g=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,y)};Be.prototype.getX=function(){return this.x.fromRed()};Be.prototype.getY=function(){return this.y.fromRed()};Be.prototype.mul=function(n){return n=new ge(n,16),this.isInfinity()?this:this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve.endo?this.curve._endoWnafMulAdd([this],[n]):this.curve._wnafMul(this,n)};Be.prototype.mulAdd=function(n,s,o){var m=[this,s],f=[n,o];return this.curve.endo?this.curve._endoWnafMulAdd(m,f):this.curve._wnafMulAdd(1,m,f,2)};Be.prototype.jmulAdd=function(n,s,o){var m=[this,s],f=[n,o];return this.curve.endo?this.curve._endoWnafMulAdd(m,f,!0):this.curve._wnafMulAdd(1,m,f,2,!0)};Be.prototype.eq=function(n){return this===n||this.inf===n.inf&&(this.inf||this.x.cmp(n.x)===0&&this.y.cmp(n.y)===0)};Be.prototype.neg=function(n){if(this.inf)return this;var s=this.curve.point(this.x,this.y.redNeg());if(n&&this.precomputed){var o=this.precomputed,m=function(f){return f.neg()};s.precomputed={naf:o.naf&&{wnd:o.naf.wnd,points:o.naf.points.map(m)},doubles:o.doubles&&{step:o.doubles.step,points:o.doubles.points.map(m)}}}return s};Be.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var n=this.curve.jpoint(this.x,this.y,this.curve.one);return n};function Ee(h,n,s,o){wi.BasePoint.call(this,h,"jacobian"),n===null&&s===null&&o===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ge(0)):(this.x=new ge(n,16),this.y=new ge(s,16),this.z=new ge(o,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}K0(Ee,wi.BasePoint);Je.prototype.jpoint=function(n,s,o){return new Ee(this,n,s,o)};Ee.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var n=this.z.redInvm(),s=n.redSqr(),o=this.x.redMul(s),m=this.y.redMul(s).redMul(n);return this.curve.point(o,m)};Ee.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Ee.prototype.add=function(n){if(this.isInfinity())return n;if(n.isInfinity())return this;var s=n.z.redSqr(),o=this.z.redSqr(),m=this.x.redMul(s),f=n.x.redMul(o),g=this.y.redMul(s.redMul(n.z)),y=n.y.redMul(o.redMul(this.z)),S=m.redSub(f),B=g.redSub(y);if(S.cmpn(0)===0)return B.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var M=S.redSqr(),x=M.redMul(S),I=m.redMul(M),k=B.redSqr().redIAdd(x).redISub(I).redISub(I),D=B.redMul(I.redISub(k)).redISub(g.redMul(x)),L=this.z.redMul(n.z).redMul(S);return this.curve.jpoint(k,D,L)};Ee.prototype.mixedAdd=function(n){if(this.isInfinity())return n.toJ();if(n.isInfinity())return this;var s=this.z.redSqr(),o=this.x,m=n.x.redMul(s),f=this.y,g=n.y.redMul(s).redMul(this.z),y=o.redSub(m),S=f.redSub(g);if(y.cmpn(0)===0)return S.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var B=y.redSqr(),M=B.redMul(y),x=o.redMul(B),I=S.redSqr().redIAdd(M).redISub(x).redISub(x),k=S.redMul(x.redISub(I)).redISub(f.redMul(M)),D=this.z.redMul(y);return this.curve.jpoint(I,k,D)};Ee.prototype.dblp=function(n){if(n===0)return this;if(this.isInfinity())return this;if(!n)return this.dbl();var s;if(this.curve.zeroA||this.curve.threeA){var o=this;for(s=0;s<n;s++)o=o.dbl();return o}var m=this.curve.a,f=this.curve.tinv,g=this.x,y=this.y,S=this.z,B=S.redSqr().redSqr(),M=y.redAdd(y);for(s=0;s<n;s++){var x=g.redSqr(),I=M.redSqr(),k=I.redSqr(),D=x.redAdd(x).redIAdd(x).redIAdd(m.redMul(B)),L=g.redMul(I),W=D.redSqr().redISub(L.redAdd(L)),z=L.redISub(W),$=D.redMul(z);$=$.redIAdd($).redISub(k);var lt=M.redMul(S);s+1<n&&(B=B.redMul(k)),g=W,S=lt,M=$}return this.curve.jpoint(g,M.redMul(f),S)};Ee.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};Ee.prototype._zeroDbl=function(){var n,s,o;if(this.zOne){var m=this.x.redSqr(),f=this.y.redSqr(),g=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(m).redISub(g);y=y.redIAdd(y);var S=m.redAdd(m).redIAdd(m),B=S.redSqr().redISub(y).redISub(y),M=g.redIAdd(g);M=M.redIAdd(M),M=M.redIAdd(M),n=B,s=S.redMul(y.redISub(B)).redISub(M),o=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),I=this.y.redSqr(),k=I.redSqr(),D=this.x.redAdd(I).redSqr().redISub(x).redISub(k);D=D.redIAdd(D);var L=x.redAdd(x).redIAdd(x),W=L.redSqr(),z=k.redIAdd(k);z=z.redIAdd(z),z=z.redIAdd(z),n=W.redISub(D).redISub(D),s=L.redMul(D.redISub(n)).redISub(z),o=this.y.redMul(this.z),o=o.redIAdd(o)}return this.curve.jpoint(n,s,o)};Ee.prototype._threeDbl=function(){var n,s,o;if(this.zOne){var m=this.x.redSqr(),f=this.y.redSqr(),g=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(m).redISub(g);y=y.redIAdd(y);var S=m.redAdd(m).redIAdd(m).redIAdd(this.curve.a),B=S.redSqr().redISub(y).redISub(y);n=B;var M=g.redIAdd(g);M=M.redIAdd(M),M=M.redIAdd(M),s=S.redMul(y.redISub(B)).redISub(M),o=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),I=this.y.redSqr(),k=this.x.redMul(I),D=this.x.redSub(x).redMul(this.x.redAdd(x));D=D.redAdd(D).redIAdd(D);var L=k.redIAdd(k);L=L.redIAdd(L);var W=L.redAdd(L);n=D.redSqr().redISub(W),o=this.y.redAdd(this.z).redSqr().redISub(I).redISub(x);var z=I.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),s=D.redMul(L.redISub(n)).redISub(z)}return this.curve.jpoint(n,s,o)};Ee.prototype._dbl=function(){var n=this.curve.a,s=this.x,o=this.y,m=this.z,f=m.redSqr().redSqr(),g=s.redSqr(),y=o.redSqr(),S=g.redAdd(g).redIAdd(g).redIAdd(n.redMul(f)),B=s.redAdd(s);B=B.redIAdd(B);var M=B.redMul(y),x=S.redSqr().redISub(M.redAdd(M)),I=M.redISub(x),k=y.redSqr();k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var D=S.redMul(I).redISub(k),L=o.redAdd(o).redMul(m);return this.curve.jpoint(x,D,L)};Ee.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var n=this.x.redSqr(),s=this.y.redSqr(),o=this.z.redSqr(),m=s.redSqr(),f=n.redAdd(n).redIAdd(n),g=f.redSqr(),y=this.x.redAdd(s).redSqr().redISub(n).redISub(m);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(g);var S=y.redSqr(),B=m.redIAdd(m);B=B.redIAdd(B),B=B.redIAdd(B),B=B.redIAdd(B);var M=f.redIAdd(y).redSqr().redISub(g).redISub(S).redISub(B),x=s.redMul(M);x=x.redIAdd(x),x=x.redIAdd(x);var I=this.x.redMul(S).redISub(x);I=I.redIAdd(I),I=I.redIAdd(I);var k=this.y.redMul(M.redMul(B.redISub(M)).redISub(y.redMul(S)));k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var D=this.z.redAdd(y).redSqr().redISub(o).redISub(S);return this.curve.jpoint(I,k,D)};Ee.prototype.mul=function(n,s){return n=new ge(n,s),this.curve._wnafMul(this,n)};Ee.prototype.eq=function(n){if(n.type==="affine")return this.eq(n.toJ());if(this===n)return!0;var s=this.z.redSqr(),o=n.z.redSqr();if(this.x.redMul(o).redISub(n.x.redMul(s)).cmpn(0)!==0)return!1;var m=s.redMul(this.z),f=o.redMul(n.z);return this.y.redMul(f).redISub(n.y.redMul(m)).cmpn(0)===0};Ee.prototype.eqXToP=function(n){var s=this.z.redSqr(),o=n.toRed(this.curve.red).redMul(s);if(this.x.cmp(o)===0)return!0;for(var m=n.clone(),f=this.curve.redN.redMul(s);;){if(m.iadd(this.curve.n),m.cmp(this.curve.p)>=0)return!1;if(o.redIAdd(f),this.x.cmp(o)===0)return!0}};Ee.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};Ee.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var ai=Rr,oo=Jt,Qn=jn,Xv=ze;function Mi(h){Qn.call(this,"mont",h),this.a=new ai(h.a,16).toRed(this.red),this.b=new ai(h.b,16).toRed(this.red),this.i4=new ai(4).toRed(this.red).redInvm(),this.two=new ai(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}oo(Mi,Qn);var jv=Mi;Mi.prototype.validate=function(n){var s=n.normalize().x,o=s.redSqr(),m=o.redMul(s).redAdd(o.redMul(this.a)).redAdd(s),f=m.redSqrt();return f.redSqr().cmp(m)===0};function Se(h,n,s){Qn.BasePoint.call(this,h,"projective"),n===null&&s===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new ai(n,16),this.z=new ai(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}oo(Se,Qn.BasePoint);Mi.prototype.decodePoint=function(n,s){return this.point(Xv.toArray(n,s),1)};Mi.prototype.point=function(n,s){return new Se(this,n,s)};Mi.prototype.pointFromJSON=function(n){return Se.fromJSON(this,n)};Se.prototype.precompute=function(){};Se.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Se.fromJSON=function(n,s){return new Se(n,s[0],s[1]||n.one)};Se.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Se.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Se.prototype.dbl=function(){var n=this.x.redAdd(this.z),s=n.redSqr(),o=this.x.redSub(this.z),m=o.redSqr(),f=s.redSub(m),g=s.redMul(m),y=f.redMul(m.redAdd(this.curve.a24.redMul(f)));return this.curve.point(g,y)};Se.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Se.prototype.diffAdd=function(n,s){var o=this.x.redAdd(this.z),m=this.x.redSub(this.z),f=n.x.redAdd(n.z),g=n.x.redSub(n.z),y=g.redMul(o),S=f.redMul(m),B=s.z.redMul(y.redAdd(S).redSqr()),M=s.x.redMul(y.redISub(S).redSqr());return this.curve.point(B,M)};Se.prototype.mul=function(n){for(var s=n.clone(),o=this,m=this.curve.point(null,null),f=this,g=[];s.cmpn(0)!==0;s.iushrn(1))g.push(s.andln(1));for(var y=g.length-1;y>=0;y--)g[y]===0?(o=o.diffAdd(m,f),m=m.dbl()):(m=o.diffAdd(m,f),o=o.dbl());return m};Se.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Se.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Se.prototype.eq=function(n){return this.getX().cmp(n.getX())===0};Se.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Se.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Qv=ze,_r=Rr,uo=Jt,tf=jn,tp=Qv.assert;function br(h){this.twisted=(h.a|0)!==1,this.mOneA=this.twisted&&(h.a|0)===-1,this.extended=this.mOneA,tf.call(this,"edwards",h),this.a=new _r(h.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new _r(h.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new _r(h.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),tp(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(h.c|0)===1}uo(br,tf);var ep=br;br.prototype._mulA=function(n){return this.mOneA?n.redNeg():this.a.redMul(n)};br.prototype._mulC=function(n){return this.oneC?n:this.c.redMul(n)};br.prototype.jpoint=function(n,s,o,m){return this.point(n,s,o,m)};br.prototype.pointFromX=function(n,s){n=new _r(n,16),n.red||(n=n.toRed(this.red));var o=n.redSqr(),m=this.c2.redSub(this.a.redMul(o)),f=this.one.redSub(this.c2.redMul(this.d).redMul(o)),g=m.redMul(f.redInvm()),y=g.redSqrt();if(y.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");var S=y.fromRed().isOdd();return(s&&!S||!s&&S)&&(y=y.redNeg()),this.point(n,y)};br.prototype.pointFromY=function(n,s){n=new _r(n,16),n.red||(n=n.toRed(this.red));var o=n.redSqr(),m=o.redSub(this.c2),f=o.redMul(this.d).redMul(this.c2).redSub(this.a),g=m.redMul(f.redInvm());if(g.cmp(this.zero)===0){if(s)throw new Error("invalid point");return this.point(this.zero,n)}var y=g.redSqrt();if(y.redSqr().redSub(g).cmp(this.zero)!==0)throw new Error("invalid point");return y.fromRed().isOdd()!==s&&(y=y.redNeg()),this.point(y,n)};br.prototype.validate=function(n){if(n.isInfinity())return!0;n.normalize();var s=n.x.redSqr(),o=n.y.redSqr(),m=s.redMul(this.a).redAdd(o),f=this.c2.redMul(this.one.redAdd(this.d.redMul(s).redMul(o)));return m.cmp(f)===0};function me(h,n,s,o,m){tf.BasePoint.call(this,h,"projective"),n===null&&s===null&&o===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new _r(n,16),this.y=new _r(s,16),this.z=o?new _r(o,16):this.curve.one,this.t=m&&new _r(m,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}uo(me,tf.BasePoint);br.prototype.pointFromJSON=function(n){return me.fromJSON(this,n)};br.prototype.point=function(n,s,o,m){return new me(this,n,s,o,m)};me.fromJSON=function(n,s){return new me(n,s[0],s[1],s[2])};me.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};me.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};me.prototype._extDbl=function(){var n=this.x.redSqr(),s=this.y.redSqr(),o=this.z.redSqr();o=o.redIAdd(o);var m=this.curve._mulA(n),f=this.x.redAdd(this.y).redSqr().redISub(n).redISub(s),g=m.redAdd(s),y=g.redSub(o),S=m.redSub(s),B=f.redMul(y),M=g.redMul(S),x=f.redMul(S),I=y.redMul(g);return this.curve.point(B,M,I,x)};me.prototype._projDbl=function(){var n=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),o=this.y.redSqr(),m,f,g,y,S,B;if(this.curve.twisted){y=this.curve._mulA(s);var M=y.redAdd(o);this.zOne?(m=n.redSub(s).redSub(o).redMul(M.redSub(this.curve.two)),f=M.redMul(y.redSub(o)),g=M.redSqr().redSub(M).redSub(M)):(S=this.z.redSqr(),B=M.redSub(S).redISub(S),m=n.redSub(s).redISub(o).redMul(B),f=M.redMul(y.redSub(o)),g=M.redMul(B))}else y=s.redAdd(o),S=this.curve._mulC(this.z).redSqr(),B=y.redSub(S).redSub(S),m=this.curve._mulC(n.redISub(y)).redMul(B),f=this.curve._mulC(y).redMul(s.redISub(o)),g=y.redMul(B);return this.curve.point(m,f,g)};me.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};me.prototype._extAdd=function(n){var s=this.y.redSub(this.x).redMul(n.y.redSub(n.x)),o=this.y.redAdd(this.x).redMul(n.y.redAdd(n.x)),m=this.t.redMul(this.curve.dd).redMul(n.t),f=this.z.redMul(n.z.redAdd(n.z)),g=o.redSub(s),y=f.redSub(m),S=f.redAdd(m),B=o.redAdd(s),M=g.redMul(y),x=S.redMul(B),I=g.redMul(B),k=y.redMul(S);return this.curve.point(M,x,k,I)};me.prototype._projAdd=function(n){var s=this.z.redMul(n.z),o=s.redSqr(),m=this.x.redMul(n.x),f=this.y.redMul(n.y),g=this.curve.d.redMul(m).redMul(f),y=o.redSub(g),S=o.redAdd(g),B=this.x.redAdd(this.y).redMul(n.x.redAdd(n.y)).redISub(m).redISub(f),M=s.redMul(y).redMul(B),x,I;return this.curve.twisted?(x=s.redMul(S).redMul(f.redSub(this.curve._mulA(m))),I=y.redMul(S)):(x=s.redMul(S).redMul(f.redSub(m)),I=this.curve._mulC(y).redMul(S)),this.curve.point(M,x,I)};me.prototype.add=function(n){return this.isInfinity()?n:n.isInfinity()?this:this.curve.extended?this._extAdd(n):this._projAdd(n)};me.prototype.mul=function(n){return this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve._wnafMul(this,n)};me.prototype.mulAdd=function(n,s,o){return this.curve._wnafMulAdd(1,[this,s],[n,o],2,!1)};me.prototype.jmulAdd=function(n,s,o){return this.curve._wnafMulAdd(1,[this,s],[n,o],2,!0)};me.prototype.normalize=function(){if(this.zOne)return this;var n=this.z.redInvm();return this.x=this.x.redMul(n),this.y=this.y.redMul(n),this.t&&(this.t=this.t.redMul(n)),this.z=this.curve.one,this.zOne=!0,this};me.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};me.prototype.getX=function(){return this.normalize(),this.x.fromRed()};me.prototype.getY=function(){return this.normalize(),this.y.fromRed()};me.prototype.eq=function(n){return this===n||this.getX().cmp(n.getX())===0&&this.getY().cmp(n.getY())===0};me.prototype.eqXToP=function(n){var s=n.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(s)===0)return!0;for(var o=n.clone(),m=this.curve.redN.redMul(this.z);;){if(o.iadd(this.curve.n),o.cmp(this.curve.p)>=0)return!1;if(s.redIAdd(m),this.x.cmp(s)===0)return!0}};me.prototype.toP=me.prototype.normalize;me.prototype.mixedAdd=me.prototype.add;(function(h){var n=h;n.base=jn,n.short=Gv,n.mont=jv,n.edwards=ep})(z0);var ef={},rf={},Xt={},rp=We,ip=Jt;Xt.inherits=ip;function np(h,n){return(h.charCodeAt(n)&64512)!==55296||n<0||n+1>=h.length?!1:(h.charCodeAt(n+1)&64512)===56320}function fp(h,n){if(Array.isArray(h))return h.slice();if(!h)return[];var s=[];if(typeof h=="string")if(n){if(n==="hex")for(h=h.replace(/[^a-z0-9]+/ig,""),h.length%2!==0&&(h="0"+h),m=0;m<h.length;m+=2)s.push(parseInt(h[m]+h[m+1],16))}else for(var o=0,m=0;m<h.length;m++){var f=h.charCodeAt(m);f<128?s[o++]=f:f<2048?(s[o++]=f>>6|192,s[o++]=f&63|128):np(h,m)?(f=65536+((f&1023)<<10)+(h.charCodeAt(++m)&1023),s[o++]=f>>18|240,s[o++]=f>>12&63|128,s[o++]=f>>6&63|128,s[o++]=f&63|128):(s[o++]=f>>12|224,s[o++]=f>>6&63|128,s[o++]=f&63|128)}else for(m=0;m<h.length;m++)s[m]=h[m]|0;return s}Xt.toArray=fp;function ap(h){for(var n="",s=0;s<h.length;s++)n+=co(h[s].toString(16));return n}Xt.toHex=ap;function lo(h){var n=h>>>24|h>>>8&65280|h<<8&16711680|(h&255)<<24;return n>>>0}Xt.htonl=lo;function hp(h,n){for(var s="",o=0;o<h.length;o++){var m=h[o];n==="little"&&(m=lo(m)),s+=vo(m.toString(16))}return s}Xt.toHex32=hp;function co(h){return h.length===1?"0"+h:h}Xt.zero2=co;function vo(h){return h.length===7?"0"+h:h.length===6?"00"+h:h.length===5?"000"+h:h.length===4?"0000"+h:h.length===3?"00000"+h:h.length===2?"000000"+h:h.length===1?"0000000"+h:h}Xt.zero8=vo;function sp(h,n,s,o){var m=s-n;rp(m%4===0);for(var f=new Array(m/4),g=0,y=n;g<f.length;g++,y+=4){var S;o==="big"?S=h[y]<<24|h[y+1]<<16|h[y+2]<<8|h[y+3]:S=h[y+3]<<24|h[y+2]<<16|h[y+1]<<8|h[y],f[g]=S>>>0}return f}Xt.join32=sp;function op(h,n){for(var s=new Array(h.length*4),o=0,m=0;o<h.length;o++,m+=4){var f=h[o];n==="big"?(s[m]=f>>>24,s[m+1]=f>>>16&255,s[m+2]=f>>>8&255,s[m+3]=f&255):(s[m+3]=f>>>24,s[m+2]=f>>>16&255,s[m+1]=f>>>8&255,s[m]=f&255)}return s}Xt.split32=op;function up(h,n){return h>>>n|h<<32-n}Xt.rotr32=up;function lp(h,n){return h<<n|h>>>32-n}Xt.rotl32=lp;function dp(h,n){return h+n>>>0}Xt.sum32=dp;function cp(h,n,s){return h+n+s>>>0}Xt.sum32_3=cp;function vp(h,n,s,o){return h+n+s+o>>>0}Xt.sum32_4=vp;function pp(h,n,s,o,m){return h+n+s+o+m>>>0}Xt.sum32_5=pp;function mp(h,n,s,o){var m=h[n],f=h[n+1],g=o+f>>>0,y=(g<o?1:0)+s+m;h[n]=y>>>0,h[n+1]=g}Xt.sum64=mp;function gp(h,n,s,o){var m=n+o>>>0,f=(m<n?1:0)+h+s;return f>>>0}Xt.sum64_hi=gp;function bp(h,n,s,o){var m=n+o;return m>>>0}Xt.sum64_lo=bp;function yp(h,n,s,o,m,f,g,y){var S=0,B=n;B=B+o>>>0,S+=B<n?1:0,B=B+f>>>0,S+=B<f?1:0,B=B+y>>>0,S+=B<y?1:0;var M=h+s+m+g+S;return M>>>0}Xt.sum64_4_hi=yp;function wp(h,n,s,o,m,f,g,y){var S=n+o+f+y;return S>>>0}Xt.sum64_4_lo=wp;function Mp(h,n,s,o,m,f,g,y,S,B){var M=0,x=n;x=x+o>>>0,M+=x<n?1:0,x=x+f>>>0,M+=x<f?1:0,x=x+y>>>0,M+=x<y?1:0,x=x+B>>>0,M+=x<B?1:0;var I=h+s+m+g+S+M;return I>>>0}Xt.sum64_5_hi=Mp;function xp(h,n,s,o,m,f,g,y,S,B){var M=n+o+f+y+B;return M>>>0}Xt.sum64_5_lo=xp;function _p(h,n,s){var o=n<<32-s|h>>>s;return o>>>0}Xt.rotr64_hi=_p;function Sp(h,n,s){var o=h<<32-s|n>>>s;return o>>>0}Xt.rotr64_lo=Sp;function Ap(h,n,s){return h>>>s}Xt.shr64_hi=Ap;function Bp(h,n,s){var o=h<<32-s|n>>>s;return o>>>0}Xt.shr64_lo=Bp;var xi={},Pa=Xt,Ep=We;function nf(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}xi.BlockHash=nf;nf.prototype.update=function(n,s){if(n=Pa.toArray(n,s),this.pending?this.pending=this.pending.concat(n):this.pending=n,this.pendingTotal+=n.length,this.pending.length>=this._delta8){n=this.pending;var o=n.length%this._delta8;this.pending=n.slice(n.length-o,n.length),this.pending.length===0&&(this.pending=null),n=Pa.join32(n,0,n.length-o,this.endian);for(var m=0;m<n.length;m+=this._delta32)this._update(n,m,m+this._delta32)}return this};nf.prototype.digest=function(n){return this.update(this._pad()),Ep(this.pending===null),this._digest(n)};nf.prototype._pad=function(){var n=this.pendingTotal,s=this._delta8,o=s-(n+this.padLength)%s,m=new Array(o+this.padLength);m[0]=128;for(var f=1;f<o;f++)m[f]=0;if(n<<=3,this.endian==="big"){for(var g=8;g<this.padLength;g++)m[f++]=0;m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=n>>>24&255,m[f++]=n>>>16&255,m[f++]=n>>>8&255,m[f++]=n&255}else for(m[f++]=n&255,m[f++]=n>>>8&255,m[f++]=n>>>16&255,m[f++]=n>>>24&255,m[f++]=0,m[f++]=0,m[f++]=0,m[f++]=0,g=8;g<this.padLength;g++)m[f++]=0;return m};var _i={},yr={},kp=Xt,or=kp.rotr32;function Ip(h,n,s,o){if(h===0)return po(n,s,o);if(h===1||h===3)return go(n,s,o);if(h===2)return mo(n,s,o)}yr.ft_1=Ip;function po(h,n,s){return h&n^~h&s}yr.ch32=po;function mo(h,n,s){return h&n^h&s^n&s}yr.maj32=mo;function go(h,n,s){return h^n^s}yr.p32=go;function Rp(h){return or(h,2)^or(h,13)^or(h,22)}yr.s0_256=Rp;function Tp(h){return or(h,6)^or(h,11)^or(h,25)}yr.s1_256=Tp;function Cp(h){return or(h,7)^or(h,18)^h>>>3}yr.g0_256=Cp;function Fp(h){return or(h,17)^or(h,19)^h>>>10}yr.g1_256=Fp;var di=Xt,qp=xi,Pp=yr,If=di.rotl32,Fi=di.sum32,Dp=di.sum32_5,Np=Pp.ft_1,bo=qp.BlockHash,$p=[1518500249,1859775393,2400959708,3395469782];function vr(){if(!(this instanceof vr))return new vr;bo.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}di.inherits(vr,bo);var Up=vr;vr.blockSize=512;vr.outSize=160;vr.hmacStrength=80;vr.padLength=64;vr.prototype._update=function(n,s){for(var o=this.W,m=0;m<16;m++)o[m]=n[s+m];for(;m<o.length;m++)o[m]=If(o[m-3]^o[m-8]^o[m-14]^o[m-16],1);var f=this.h[0],g=this.h[1],y=this.h[2],S=this.h[3],B=this.h[4];for(m=0;m<o.length;m++){var M=~~(m/20),x=Dp(If(f,5),Np(M,g,y,S),B,o[m],$p[M]);B=S,S=y,y=If(g,30),g=f,f=x}this.h[0]=Fi(this.h[0],f),this.h[1]=Fi(this.h[1],g),this.h[2]=Fi(this.h[2],y),this.h[3]=Fi(this.h[3],S),this.h[4]=Fi(this.h[4],B)};vr.prototype._digest=function(n){return n==="hex"?di.toHex32(this.h,"big"):di.split32(this.h,"big")};var ci=Xt,Lp=xi,Si=yr,Op=We,Xe=ci.sum32,zp=ci.sum32_4,Kp=ci.sum32_5,Hp=Si.ch32,Zp=Si.maj32,Wp=Si.s0_256,Vp=Si.s1_256,Yp=Si.g0_256,Jp=Si.g1_256,yo=Lp.BlockHash,Gp=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function pr(){if(!(this instanceof pr))return new pr;yo.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Gp,this.W=new Array(64)}ci.inherits(pr,yo);var wo=pr;pr.blockSize=512;pr.outSize=256;pr.hmacStrength=192;pr.padLength=64;pr.prototype._update=function(n,s){for(var o=this.W,m=0;m<16;m++)o[m]=n[s+m];for(;m<o.length;m++)o[m]=zp(Jp(o[m-2]),o[m-7],Yp(o[m-15]),o[m-16]);var f=this.h[0],g=this.h[1],y=this.h[2],S=this.h[3],B=this.h[4],M=this.h[5],x=this.h[6],I=this.h[7];for(Op(this.k.length===o.length),m=0;m<o.length;m++){var k=Kp(I,Vp(B),Hp(B,M,x),this.k[m],o[m]),D=Xe(Wp(f),Zp(f,g,y));I=x,x=M,M=B,B=Xe(S,k),S=y,y=g,g=f,f=Xe(k,D)}this.h[0]=Xe(this.h[0],f),this.h[1]=Xe(this.h[1],g),this.h[2]=Xe(this.h[2],y),this.h[3]=Xe(this.h[3],S),this.h[4]=Xe(this.h[4],B),this.h[5]=Xe(this.h[5],M),this.h[6]=Xe(this.h[6],x),this.h[7]=Xe(this.h[7],I)};pr.prototype._digest=function(n){return n==="hex"?ci.toHex32(this.h,"big"):ci.split32(this.h,"big")};var u0=Xt,Mo=wo;function Er(){if(!(this instanceof Er))return new Er;Mo.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}u0.inherits(Er,Mo);var Xp=Er;Er.blockSize=512;Er.outSize=224;Er.hmacStrength=192;Er.padLength=64;Er.prototype._digest=function(n){return n==="hex"?u0.toHex32(this.h.slice(0,7),"big"):u0.split32(this.h.slice(0,7),"big")};var Ne=Xt,jp=xi,Qp=We,ur=Ne.rotr64_hi,lr=Ne.rotr64_lo,xo=Ne.shr64_hi,_o=Ne.shr64_lo,Tr=Ne.sum64,Rf=Ne.sum64_hi,Tf=Ne.sum64_lo,t2=Ne.sum64_4_hi,e2=Ne.sum64_4_lo,r2=Ne.sum64_5_hi,i2=Ne.sum64_5_lo,So=jp.BlockHash,n2=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function tr(){if(!(this instanceof tr))return new tr;So.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=n2,this.W=new Array(160)}Ne.inherits(tr,So);var Ao=tr;tr.blockSize=1024;tr.outSize=512;tr.hmacStrength=192;tr.padLength=128;tr.prototype._prepareBlock=function(n,s){for(var o=this.W,m=0;m<32;m++)o[m]=n[s+m];for(;m<o.length;m+=2){var f=p2(o[m-4],o[m-3]),g=m2(o[m-4],o[m-3]),y=o[m-14],S=o[m-13],B=c2(o[m-30],o[m-29]),M=v2(o[m-30],o[m-29]),x=o[m-32],I=o[m-31];o[m]=t2(f,g,y,S,B,M,x,I),o[m+1]=e2(f,g,y,S,B,M,x,I)}};tr.prototype._update=function(n,s){this._prepareBlock(n,s);var o=this.W,m=this.h[0],f=this.h[1],g=this.h[2],y=this.h[3],S=this.h[4],B=this.h[5],M=this.h[6],x=this.h[7],I=this.h[8],k=this.h[9],D=this.h[10],L=this.h[11],W=this.h[12],z=this.h[13],$=this.h[14],lt=this.h[15];Qp(this.k.length===o.length);for(var H=0;H<o.length;H+=2){var At=$,Bt=lt,Ct=l2(I,k),Et=d2(I,k),Y=f2(I,k,D,L,W),It=a2(I,k,D,L,W,z),p=this.k[H],t=this.k[H+1],r=o[H],i=o[H+1],a=r2(At,Bt,Ct,Et,Y,It,p,t,r,i),d=i2(At,Bt,Ct,Et,Y,It,p,t,r,i);At=o2(m,f),Bt=u2(m,f),Ct=h2(m,f,g,y,S),Et=s2(m,f,g,y,S,B);var c=Rf(At,Bt,Ct,Et),v=Tf(At,Bt,Ct,Et);$=W,lt=z,W=D,z=L,D=I,L=k,I=Rf(M,x,a,d),k=Tf(x,x,a,d),M=S,x=B,S=g,B=y,g=m,y=f,m=Rf(a,d,c,v),f=Tf(a,d,c,v)}Tr(this.h,0,m,f),Tr(this.h,2,g,y),Tr(this.h,4,S,B),Tr(this.h,6,M,x),Tr(this.h,8,I,k),Tr(this.h,10,D,L),Tr(this.h,12,W,z),Tr(this.h,14,$,lt)};tr.prototype._digest=function(n){return n==="hex"?Ne.toHex32(this.h,"big"):Ne.split32(this.h,"big")};function f2(h,n,s,o,m){var f=h&s^~h&m;return f<0&&(f+=4294967296),f}function a2(h,n,s,o,m,f){var g=n&o^~n&f;return g<0&&(g+=4294967296),g}function h2(h,n,s,o,m){var f=h&s^h&m^s&m;return f<0&&(f+=4294967296),f}function s2(h,n,s,o,m,f){var g=n&o^n&f^o&f;return g<0&&(g+=4294967296),g}function o2(h,n){var s=ur(h,n,28),o=ur(n,h,2),m=ur(n,h,7),f=s^o^m;return f<0&&(f+=4294967296),f}function u2(h,n){var s=lr(h,n,28),o=lr(n,h,2),m=lr(n,h,7),f=s^o^m;return f<0&&(f+=4294967296),f}function l2(h,n){var s=ur(h,n,14),o=ur(h,n,18),m=ur(n,h,9),f=s^o^m;return f<0&&(f+=4294967296),f}function d2(h,n){var s=lr(h,n,14),o=lr(h,n,18),m=lr(n,h,9),f=s^o^m;return f<0&&(f+=4294967296),f}function c2(h,n){var s=ur(h,n,1),o=ur(h,n,8),m=xo(h,n,7),f=s^o^m;return f<0&&(f+=4294967296),f}function v2(h,n){var s=lr(h,n,1),o=lr(h,n,8),m=_o(h,n,7),f=s^o^m;return f<0&&(f+=4294967296),f}function p2(h,n){var s=ur(h,n,19),o=ur(n,h,29),m=xo(h,n,6),f=s^o^m;return f<0&&(f+=4294967296),f}function m2(h,n){var s=lr(h,n,19),o=lr(n,h,29),m=_o(h,n,6),f=s^o^m;return f<0&&(f+=4294967296),f}var l0=Xt,Bo=Ao;function kr(){if(!(this instanceof kr))return new kr;Bo.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}l0.inherits(kr,Bo);var g2=kr;kr.blockSize=1024;kr.outSize=384;kr.hmacStrength=192;kr.padLength=128;kr.prototype._digest=function(n){return n==="hex"?l0.toHex32(this.h.slice(0,12),"big"):l0.split32(this.h.slice(0,12),"big")};_i.sha1=Up;_i.sha224=Xp;_i.sha256=wo;_i.sha384=g2;_i.sha512=Ao;var Eo={},jr=Xt,b2=xi,cn=jr.rotl32,Da=jr.sum32,qi=jr.sum32_3,Na=jr.sum32_4,ko=b2.BlockHash;function mr(){if(!(this instanceof mr))return new mr;ko.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}jr.inherits(mr,ko);Eo.ripemd160=mr;mr.blockSize=512;mr.outSize=160;mr.hmacStrength=192;mr.padLength=64;mr.prototype._update=function(n,s){for(var o=this.h[0],m=this.h[1],f=this.h[2],g=this.h[3],y=this.h[4],S=o,B=m,M=f,x=g,I=y,k=0;k<80;k++){var D=Da(cn(Na(o,$a(k,m,f,g),n[M2[k]+s],y2(k)),_2[k]),y);o=y,y=g,g=cn(f,10),f=m,m=D,D=Da(cn(Na(S,$a(79-k,B,M,x),n[x2[k]+s],w2(k)),S2[k]),I),S=I,I=x,x=cn(M,10),M=B,B=D}D=qi(this.h[1],f,x),this.h[1]=qi(this.h[2],g,I),this.h[2]=qi(this.h[3],y,S),this.h[3]=qi(this.h[4],o,B),this.h[4]=qi(this.h[0],m,M),this.h[0]=D};mr.prototype._digest=function(n){return n==="hex"?jr.toHex32(this.h,"little"):jr.split32(this.h,"little")};function $a(h,n,s,o){return h<=15?n^s^o:h<=31?n&s|~n&o:h<=47?(n|~s)^o:h<=63?n&o|s&~o:n^(s|~o)}function y2(h){return h<=15?0:h<=31?1518500249:h<=47?1859775393:h<=63?2400959708:2840853838}function w2(h){return h<=15?1352829926:h<=31?1548603684:h<=47?1836072691:h<=63?2053994217:0}var M2=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],x2=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],_2=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],S2=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],A2=Xt,B2=We;function vi(h,n,s){if(!(this instanceof vi))return new vi(h,n,s);this.Hash=h,this.blockSize=h.blockSize/8,this.outSize=h.outSize/8,this.inner=null,this.outer=null,this._init(A2.toArray(n,s))}var E2=vi;vi.prototype._init=function(n){n.length>this.blockSize&&(n=new this.Hash().update(n).digest()),B2(n.length<=this.blockSize);for(var s=n.length;s<this.blockSize;s++)n.push(0);for(s=0;s<n.length;s++)n[s]^=54;for(this.inner=new this.Hash().update(n),s=0;s<n.length;s++)n[s]^=106;this.outer=new this.Hash().update(n)};vi.prototype.update=function(n,s){return this.inner.update(n,s),this};vi.prototype.digest=function(n){return this.outer.update(this.inner.digest()),this.outer.digest(n)};(function(h){var n=h;n.utils=Xt,n.common=xi,n.sha=_i,n.ripemd=Eo,n.hmac=E2,n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160})(rf);var Cf,Ua;function k2(){return Ua||(Ua=1,Cf={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),Cf}(function(h){var n=h,s=rf,o=z0,m=ze,f=m.assert;function g(B){B.type==="short"?this.curve=new o.short(B):B.type==="edwards"?this.curve=new o.edwards(B):this.curve=new o.mont(B),this.g=this.curve.g,this.n=this.curve.n,this.hash=B.hash,f(this.g.validate(),"Invalid curve"),f(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}n.PresetCurve=g;function y(B,M){Object.defineProperty(n,B,{configurable:!0,enumerable:!0,get:function(){var x=new g(M);return Object.defineProperty(n,B,{configurable:!0,enumerable:!0,value:x}),x}})}y("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),y("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),y("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),y("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),y("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),y("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),y("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var S;try{S=k2()}catch(B){S=void 0}y("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",S]})})(ef);var I2=rf,Jr=O0,Io=We;function Dr(h){if(!(this instanceof Dr))return new Dr(h);this.hash=h.hash,this.predResist=!!h.predResist,this.outLen=this.hash.outSize,this.minEntropy=h.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var n=Jr.toArray(h.entropy,h.entropyEnc||"hex"),s=Jr.toArray(h.nonce,h.nonceEnc||"hex"),o=Jr.toArray(h.pers,h.persEnc||"hex");Io(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(n,s,o)}var R2=Dr;Dr.prototype._init=function(n,s,o){var m=n.concat(s).concat(o);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(m),this._reseed=1,this.reseedInterval=281474976710656};Dr.prototype._hmac=function(){return new I2.hmac(this.hash,this.K)};Dr.prototype._update=function(n){var s=this._hmac().update(this.V).update([0]);n&&(s=s.update(n)),this.K=s.digest(),this.V=this._hmac().update(this.V).digest(),n&&(this.K=this._hmac().update(this.V).update([1]).update(n).digest(),this.V=this._hmac().update(this.V).digest())};Dr.prototype.reseed=function(n,s,o,m){typeof s!="string"&&(m=o,o=s,s=null),n=Jr.toArray(n,s),o=Jr.toArray(o,m),Io(n.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(n.concat(o||[])),this._reseed=1};Dr.prototype.generate=function(n,s,o,m){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof s!="string"&&(m=o,o=s,s=null),o&&(o=Jr.toArray(o,m||"hex"),this._update(o));for(var f=[];f.length<n;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var g=f.slice(0,n);return this._update(o),this._reseed++,Jr.encode(g,s)};var T2=Rr,C2=ze,d0=C2.assert;function Fe(h,n){this.ec=h,this.priv=null,this.pub=null,n.priv&&this._importPrivate(n.priv,n.privEnc),n.pub&&this._importPublic(n.pub,n.pubEnc)}var F2=Fe;Fe.fromPublic=function(n,s,o){return s instanceof Fe?s:new Fe(n,{pub:s,pubEnc:o})};Fe.fromPrivate=function(n,s,o){return s instanceof Fe?s:new Fe(n,{priv:s,privEnc:o})};Fe.prototype.validate=function(){var n=this.getPublic();return n.isInfinity()?{result:!1,reason:"Invalid public key"}:n.validate()?n.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Fe.prototype.getPublic=function(n,s){return typeof n=="string"&&(s=n,n=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),s?this.pub.encode(s,n):this.pub};Fe.prototype.getPrivate=function(n){return n==="hex"?this.priv.toString(16,2):this.priv};Fe.prototype._importPrivate=function(n,s){this.priv=new T2(n,s||16),this.priv=this.priv.umod(this.ec.curve.n)};Fe.prototype._importPublic=function(n,s){if(n.x||n.y){this.ec.curve.type==="mont"?d0(n.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&d0(n.x&&n.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(n.x,n.y);return}this.pub=this.ec.curve.decodePoint(n,s)};Fe.prototype.derive=function(n){return n.validate()||d0(n.validate(),"public point not validated"),n.mul(this.priv).getX()};Fe.prototype.sign=function(n,s,o){return this.ec.sign(n,this,s,o)};Fe.prototype.verify=function(n,s,o){return this.ec.verify(n,s,this,void 0,o)};Fe.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var In=Rr,H0=ze,q2=H0.assert;function ff(h,n){if(h instanceof ff)return h;this._importDER(h,n)||(q2(h.r&&h.s,"Signature without r or s"),this.r=new In(h.r,16),this.s=new In(h.s,16),h.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=h.recoveryParam)}var P2=ff;function D2(){this.place=0}function Ff(h,n){var s=h[n.place++];if(!(s&128))return s;var o=s&15;if(o===0||o>4||h[n.place]===0)return!1;for(var m=0,f=0,g=n.place;f<o;f++,g++)m<<=8,m|=h[g],m>>>=0;return m<=127?!1:(n.place=g,m)}function La(h){for(var n=0,s=h.length-1;!h[n]&&!(h[n+1]&128)&&n<s;)n++;return n===0?h:h.slice(n)}ff.prototype._importDER=function(n,s){n=H0.toArray(n,s);var o=new D2;if(n[o.place++]!==48)return!1;var m=Ff(n,o);if(m===!1||m+o.place!==n.length||n[o.place++]!==2)return!1;var f=Ff(n,o);if(f===!1||n[o.place]&128)return!1;var g=n.slice(o.place,f+o.place);if(o.place+=f,n[o.place++]!==2)return!1;var y=Ff(n,o);if(y===!1||n.length!==y+o.place||n[o.place]&128)return!1;var S=n.slice(o.place,y+o.place);if(g[0]===0)if(g[1]&128)g=g.slice(1);else return!1;if(S[0]===0)if(S[1]&128)S=S.slice(1);else return!1;return this.r=new In(g),this.s=new In(S),this.recoveryParam=null,!0};function qf(h,n){if(n<128){h.push(n);return}var s=1+(Math.log(n)/Math.LN2>>>3);for(h.push(s|128);--s;)h.push(n>>>(s<<3)&255);h.push(n)}ff.prototype.toDER=function(n){var s=this.r.toArray(),o=this.s.toArray();for(s[0]&128&&(s=[0].concat(s)),o[0]&128&&(o=[0].concat(o)),s=La(s),o=La(o);!o[0]&&!(o[1]&128);)o=o.slice(1);var m=[2];qf(m,s.length),m=m.concat(s),m.push(2),qf(m,o.length);var f=m.concat(o),g=[48];return qf(g,f.length),g=g.concat(f),H0.encode(g,n)};var Pf,Oa;function N2(){if(Oa)return Pf;Oa=1;var h=Rr,n=R2,s=ze,o=ef,m=P0(),f=s.assert,g=F2,y=P2;function S(B){if(!(this instanceof S))return new S(B);typeof B=="string"&&(f(Object.prototype.hasOwnProperty.call(o,B),"Unknown curve "+B),B=o[B]),B instanceof o.PresetCurve&&(B={curve:B}),this.curve=B.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=B.curve.g,this.g.precompute(B.curve.n.bitLength()+1),this.hash=B.hash||B.curve.hash}return Pf=S,S.prototype.keyPair=function(M){return new g(this,M)},S.prototype.keyFromPrivate=function(M,x){return g.fromPrivate(this,M,x)},S.prototype.keyFromPublic=function(M,x){return g.fromPublic(this,M,x)},S.prototype.genKeyPair=function(M){M||(M={});for(var x=new n({hash:this.hash,pers:M.pers,persEnc:M.persEnc||"utf8",entropy:M.entropy||m(this.hash.hmacStrength),entropyEnc:M.entropy&&M.entropyEnc||"utf8",nonce:this.n.toArray()}),I=this.n.byteLength(),k=this.n.sub(new h(2));;){var D=new h(x.generate(I));if(!(D.cmp(k)>0))return D.iaddn(1),this.keyFromPrivate(D)}},S.prototype._truncateToN=function(M,x,I){var k;if(h.isBN(M)||typeof M=="number")M=new h(M,16),k=M.byteLength();else if(typeof M=="object")k=M.length,M=new h(M,16);else{var D=M.toString();k=D.length+1>>>1,M=new h(D,16)}typeof I!="number"&&(I=k*8);var L=I-this.n.bitLength();return L>0&&(M=M.ushrn(L)),!x&&M.cmp(this.n)>=0?M.sub(this.n):M},S.prototype.sign=function(M,x,I,k){if(typeof I=="object"&&(k=I,I=null),k||(k={}),typeof M!="string"&&typeof M!="number"&&!h.isBN(M)){f(typeof M=="object"&&M&&typeof M.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),f(M.length>>>0===M.length);for(var D=0;D<M.length;D++)f((M[D]&255)===M[D])}x=this.keyFromPrivate(x,I),M=this._truncateToN(M,!1,k.msgBitLength),f(!M.isNeg(),"Can not sign a negative message");var L=this.n.byteLength(),W=x.getPrivate().toArray("be",L),z=M.toArray("be",L);f(new h(z).eq(M),"Can not sign message");for(var $=new n({hash:this.hash,entropy:W,nonce:z,pers:k.pers,persEnc:k.persEnc||"utf8"}),lt=this.n.sub(new h(1)),H=0;;H++){var At=k.k?k.k(H):new h($.generate(this.n.byteLength()));if(At=this._truncateToN(At,!0),!(At.cmpn(1)<=0||At.cmp(lt)>=0)){var Bt=this.g.mul(At);if(!Bt.isInfinity()){var Ct=Bt.getX(),Et=Ct.umod(this.n);if(Et.cmpn(0)!==0){var Y=At.invm(this.n).mul(Et.mul(x.getPrivate()).iadd(M));if(Y=Y.umod(this.n),Y.cmpn(0)!==0){var It=(Bt.getY().isOdd()?1:0)|(Ct.cmp(Et)!==0?2:0);return k.canonical&&Y.cmp(this.nh)>0&&(Y=this.n.sub(Y),It^=1),new y({r:Et,s:Y,recoveryParam:It})}}}}}},S.prototype.verify=function(M,x,I,k,D){D||(D={}),M=this._truncateToN(M,!1,D.msgBitLength),I=this.keyFromPublic(I,k),x=new y(x,"hex");var L=x.r,W=x.s;if(L.cmpn(1)<0||L.cmp(this.n)>=0||W.cmpn(1)<0||W.cmp(this.n)>=0)return!1;var z=W.invm(this.n),$=z.mul(M).umod(this.n),lt=z.mul(L).umod(this.n),H;return this.curve._maxwellTrick?(H=this.g.jmulAdd($,I.getPublic(),lt),H.isInfinity()?!1:H.eqXToP(L)):(H=this.g.mulAdd($,I.getPublic(),lt),H.isInfinity()?!1:H.getX().umod(this.n).cmp(L)===0)},S.prototype.recoverPubKey=function(B,M,x,I){f((3&x)===x,"The recovery param is more than two bits"),M=new y(M,I);var k=this.n,D=new h(B),L=M.r,W=M.s,z=x&1,$=x>>1;if(L.cmp(this.curve.p.umod(this.curve.n))>=0&&$)throw new Error("Unable to find sencond key candinate");$?L=this.curve.pointFromX(L.add(this.curve.n),z):L=this.curve.pointFromX(L,z);var lt=M.r.invm(k),H=k.sub(D).mul(lt).umod(k),At=W.mul(lt).umod(k);return this.g.mulAdd(H,L,At)},S.prototype.getKeyRecoveryParam=function(B,M,x,I){if(M=new y(M,I),M.recoveryParam!==null)return M.recoveryParam;for(var k=0;k<4;k++){var D;try{D=this.recoverPubKey(B,M,k)}catch(L){continue}if(D.eq(x))return k}throw new Error("Unable to find valid recovery factor")},Pf}var nn=ze,Ro=nn.assert,za=nn.parseBytes,Ai=nn.cachedProperty;function _e(h,n){this.eddsa=h,this._secret=za(n.secret),h.isPoint(n.pub)?this._pub=n.pub:this._pubBytes=za(n.pub)}_e.fromPublic=function(n,s){return s instanceof _e?s:new _e(n,{pub:s})};_e.fromSecret=function(n,s){return s instanceof _e?s:new _e(n,{secret:s})};_e.prototype.secret=function(){return this._secret};Ai(_e,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Ai(_e,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Ai(_e,"privBytes",function(){var n=this.eddsa,s=this.hash(),o=n.encodingLength-1,m=s.slice(0,n.encodingLength);return m[0]&=248,m[o]&=127,m[o]|=64,m});Ai(_e,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Ai(_e,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Ai(_e,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});_e.prototype.sign=function(n){return Ro(this._secret,"KeyPair can only verify"),this.eddsa.sign(n,this)};_e.prototype.verify=function(n,s){return this.eddsa.verify(n,s,this)};_e.prototype.getSecret=function(n){return Ro(this._secret,"KeyPair is public only"),nn.encode(this.secret(),n)};_e.prototype.getPublic=function(n){return nn.encode(this.pubBytes(),n)};var $2=_e,U2=Rr,af=ze,Ka=af.assert,hf=af.cachedProperty,L2=af.parseBytes;function ri(h,n){this.eddsa=h,typeof n!="object"&&(n=L2(n)),Array.isArray(n)&&(Ka(n.length===h.encodingLength*2,"Signature has invalid size"),n={R:n.slice(0,h.encodingLength),S:n.slice(h.encodingLength)}),Ka(n.R&&n.S,"Signature without R or S"),h.isPoint(n.R)&&(this._R=n.R),n.S instanceof U2&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}hf(ri,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});hf(ri,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});hf(ri,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});hf(ri,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});ri.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};ri.prototype.toHex=function(){return af.encode(this.toBytes(),"hex").toUpperCase()};var O2=ri,z2=rf,K2=ef,pi=ze,H2=pi.assert,To=pi.parseBytes,Co=$2,Ha=O2;function $e(h){if(H2(h==="ed25519","only tested with ed25519 so far"),!(this instanceof $e))return new $e(h);h=K2[h].curve,this.curve=h,this.g=h.g,this.g.precompute(h.n.bitLength()+1),this.pointClass=h.point().constructor,this.encodingLength=Math.ceil(h.n.bitLength()/8),this.hash=z2.sha512}var Z2=$e;$e.prototype.sign=function(n,s){n=To(n);var o=this.keyFromSecret(s),m=this.hashInt(o.messagePrefix(),n),f=this.g.mul(m),g=this.encodePoint(f),y=this.hashInt(g,o.pubBytes(),n).mul(o.priv()),S=m.add(y).umod(this.curve.n);return this.makeSignature({R:f,S,Rencoded:g})};$e.prototype.verify=function(n,s,o){if(n=To(n),s=this.makeSignature(s),s.S().gte(s.eddsa.curve.n)||s.S().isNeg())return!1;var m=this.keyFromPublic(o),f=this.hashInt(s.Rencoded(),m.pubBytes(),n),g=this.g.mul(s.S()),y=s.R().add(m.pub().mul(f));return y.eq(g)};$e.prototype.hashInt=function(){for(var n=this.hash(),s=0;s<arguments.length;s++)n.update(arguments[s]);return pi.intFromLE(n.digest()).umod(this.curve.n)};$e.prototype.keyFromPublic=function(n){return Co.fromPublic(this,n)};$e.prototype.keyFromSecret=function(n){return Co.fromSecret(this,n)};$e.prototype.makeSignature=function(n){return n instanceof Ha?n:new Ha(this,n)};$e.prototype.encodePoint=function(n){var s=n.getY().toArray("le",this.encodingLength);return s[this.encodingLength-1]|=n.getX().isOdd()?128:0,s};$e.prototype.decodePoint=function(n){n=pi.parseBytes(n);var s=n.length-1,o=n.slice(0,s).concat(n[s]&-129),m=(n[s]&128)!==0,f=pi.intFromLE(o);return this.curve.pointFromY(f,m)};$e.prototype.encodeInt=function(n){return n.toArray("le",this.encodingLength)};$e.prototype.decodeInt=function(n){return pi.intFromLE(n)};$e.prototype.isPoint=function(n){return n instanceof this.pointClass};var Za;function Z0(){return Za||(Za=1,function(h){var n=h;n.version=Wv.version,n.utils=ze,n.rand=P0(),n.curve=z0,n.curves=ef,n.ec=N2(),n.eddsa=Z2}(kf)),kf}var rr={},Df={},W0={exports:{}};W0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(W0);var W2=W0.exports,Nf={},Wa;function V2(){return Wa||(Wa=1,function(h){var n=fn(),s=Jt,o=h;o.define=function(g,y){return new m(g,y)};function m(f,g){this.name=f,this.body=g,this.decoders={},this.encoders={}}m.prototype._createNamed=function(g){var y;try{y=De.runInThisContext("(function "+this.name+`(entity) {
|
|
13
13
|
this._initNamed(entity);
|
|
14
|
-
})`)}catch(S){y=function(B){this._initNamed(B)}}return s(y,g),y.prototype._initNamed=function(B){g.call(this,B)},new y(this)},m.prototype._getDecoder=function(g){return g=g||"der",this.decoders.hasOwnProperty(g)||(this.decoders[g]=this._createNamed(n.decoders[g])),this.decoders[g]},m.prototype.decode=function(g,y,S){return this._getDecoder(y).decode(g,S)},m.prototype._getEncoder=function(g){return g=g||"der",this.encoders.hasOwnProperty(g)||(this.encoders[g]=this._createNamed(n.encoders[g])),this.encoders[g]},m.prototype.encode=function(g,y,S){return this._getEncoder(y).encode(g,S)}}(Nf)),Nf}var $f={},Fo={},Ym=Jt;function Ge(h){this._reporterState={obj:null,path:[],options:h||{},errors:[]}}Fo.Reporter=Ge;Ge.prototype.isError=function(n){return n instanceof mi};Ge.prototype.save=function(){var n=this._reporterState;return{obj:n.obj,pathLen:n.path.length}};Ge.prototype.restore=function(n){var s=this._reporterState;s.obj=n.obj,s.path=s.path.slice(0,n.pathLen)};Ge.prototype.enterKey=function(n){return this._reporterState.path.push(n)};Ge.prototype.exitKey=function(n){var s=this._reporterState;s.path=s.path.slice(0,n-1)};Ge.prototype.leaveKey=function(n,s,o){var m=this._reporterState;this.exitKey(n),m.obj!==null&&(m.obj[s]=o)};Ge.prototype.path=function(){return this._reporterState.path.join("/")};Ge.prototype.enterObject=function(){var n=this._reporterState,s=n.obj;return n.obj={},s};Ge.prototype.leaveObject=function(n){var s=this._reporterState,o=s.obj;return s.obj=n,o};Ge.prototype.error=function(n){var s,o=this._reporterState,m=n instanceof mi;if(m?s=n:s=new mi(o.path.map(function(f){return"["+JSON.stringify(f)+"]"}).join(""),n.message||n,n.stack),!o.options.partial)throw s;return m||o.errors.push(s),s};Ge.prototype.wrapResult=function(n){var s=this._reporterState;return s.options.partial?{result:this.isError(n)?null:n,errors:s.errors}:n};function mi(h,n){this.path=h,this.rethrow(n)}Ym(mi,Error);mi.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,mi),!this.stack)try{throw new Error(this.message)}catch(s){this.stack=s.stack}return this};var vn={},Va;function Ya(){if(Va)return vn;Va=1;var h=Jt,n=Ui().Reporter,s=gr.Buffer;function o(f,g){if(n.call(this,g),!s.isBuffer(f)){this.error("Input not Buffer");return}this.base=f,this.offset=0,this.length=f.length}h(o,n),vn.DecoderBuffer=o,o.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},o.prototype.restore=function(g){var y=new o(this.base);return y.offset=g.offset,y.length=this.offset,this.offset=g.offset,n.prototype.restore.call(this,g.reporter),y},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(g){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(g||"DecoderBuffer overrun")},o.prototype.skip=function(g,y){if(!(this.offset+g<=this.length))return this.error(y||"DecoderBuffer overrun");var S=new o(this.base);return S._reporterState=this._reporterState,S.offset=this.offset,S.length=this.offset+g,this.offset+=g,S},o.prototype.raw=function(g){return this.base.slice(g?g.offset:this.offset,this.length)};function m(f,g){if(Array.isArray(f))this.length=0,this.value=f.map(function(y){return y instanceof m||(y=new m(y,g)),this.length+=y.length,y},this);else if(typeof f=="number"){if(!(0<=f&&f<=255))return g.error("non-byte EncoderBuffer value");this.value=f,this.length=1}else if(typeof f=="string")this.value=f,this.length=s.byteLength(f);else if(s.isBuffer(f))this.value=f,this.length=f.length;else return g.error("Unsupported type: "+typeof f)}return vn.EncoderBuffer=m,m.prototype.join=function(g,y){return g||(g=new s(this.length)),y||(y=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(S){S.join(g,y),y+=S.length}):(typeof this.value=="number"?g[y]=this.value:typeof this.value=="string"?g.write(this.value,y):s.isBuffer(this.value)&&this.value.copy(g,y),y+=this.length)),g},vn}var Uf,Ja;function Jm(){if(Ja)return Uf;Ja=1;var h=Ui().Reporter,n=Ui().EncoderBuffer,s=Ui().DecoderBuffer,o=We,m=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],f=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(m),g=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function y(B,M){var x={};this._baseState=x,x.enc=B,x.parent=M||null,x.children=null,x.tag=null,x.args=null,x.reverseArgs=null,x.choice=null,x.optional=!1,x.any=!1,x.obj=!1,x.use=null,x.useDecoder=null,x.key=null,x.default=null,x.explicit=null,x.implicit=null,x.contains=null,x.parent||(x.children=[],this._wrap())}Uf=y;var S=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return y.prototype.clone=function(){var M=this._baseState,x={};S.forEach(function(k){x[k]=M[k]});var I=new this.constructor(x.parent);return I._baseState=x,I},y.prototype._wrap=function(){var M=this._baseState;f.forEach(function(x){this[x]=function(){var k=new this.constructor(this);return M.children.push(k),k[x].apply(k,arguments)}},this)},y.prototype._init=function(M){var x=this._baseState;o(x.parent===null),M.call(this),x.children=x.children.filter(function(I){return I._baseState.parent===this},this),o.equal(x.children.length,1,"Root node can have only one child")},y.prototype._useArgs=function(M){var x=this._baseState,I=M.filter(function(k){return k instanceof this.constructor},this);M=M.filter(function(k){return!(k instanceof this.constructor)},this),I.length!==0&&(o(x.children===null),x.children=I,I.forEach(function(k){k._baseState.parent=this},this)),M.length!==0&&(o(x.args===null),x.args=M,x.reverseArgs=M.map(function(k){if(typeof k!="object"||k.constructor!==Object)return k;var D={};return Object.keys(k).forEach(function(L){L==(L|0)&&(L|=0);var W=k[L];D[W]=L}),D}))},g.forEach(function(B){y.prototype[B]=function(){var x=this._baseState;throw new Error(B+" not implemented for encoding: "+x.enc)}}),m.forEach(function(B){y.prototype[B]=function(){var x=this._baseState,I=Array.prototype.slice.call(arguments);return o(x.tag===null),x.tag=B,this._useArgs(I),this}}),y.prototype.use=function(M){o(M);var x=this._baseState;return o(x.use===null),x.use=M,this},y.prototype.optional=function(){var M=this._baseState;return M.optional=!0,this},y.prototype.def=function(M){var x=this._baseState;return o(x.default===null),x.default=M,x.optional=!0,this},y.prototype.explicit=function(M){var x=this._baseState;return o(x.explicit===null&&x.implicit===null),x.explicit=M,this},y.prototype.implicit=function(M){var x=this._baseState;return o(x.explicit===null&&x.implicit===null),x.implicit=M,this},y.prototype.obj=function(){var M=this._baseState,x=Array.prototype.slice.call(arguments);return M.obj=!0,x.length!==0&&this._useArgs(x),this},y.prototype.key=function(M){var x=this._baseState;return o(x.key===null),x.key=M,this},y.prototype.any=function(){var M=this._baseState;return M.any=!0,this},y.prototype.choice=function(M){var x=this._baseState;return o(x.choice===null),x.choice=M,this._useArgs(Object.keys(M).map(function(I){return M[I]})),this},y.prototype.contains=function(M){var x=this._baseState;return o(x.use===null),x.contains=M,this},y.prototype._decode=function(M,x){var I=this._baseState;if(I.parent===null)return M.wrapResult(I.children[0]._decode(M,x));var k=I.default,D=!0,L=null;if(I.key!==null&&(L=M.enterKey(I.key)),I.optional){var W=null;if(I.explicit!==null?W=I.explicit:I.implicit!==null?W=I.implicit:I.tag!==null&&(W=I.tag),W===null&&!I.any){var z=M.save();try{I.choice===null?this._decodeGeneric(I.tag,M,x):this._decodeChoice(M,x),D=!0}catch(Ct){D=!1}M.restore(z)}else if(D=this._peekTag(M,W,I.any),M.isError(D))return D}var $;if(I.obj&&D&&($=M.enterObject()),D){if(I.explicit!==null){var lt=this._decodeTag(M,I.explicit);if(M.isError(lt))return lt;M=lt}var H=M.offset;if(I.use===null&&I.choice===null){if(I.any)var z=M.save();var At=this._decodeTag(M,I.implicit!==null?I.implicit:I.tag,I.any);if(M.isError(At))return At;I.any?k=M.raw(z):M=At}if(x&&x.track&&I.tag!==null&&x.track(M.path(),H,M.length,"tagged"),x&&x.track&&I.tag!==null&&x.track(M.path(),M.offset,M.length,"content"),I.any?k=k:I.choice===null?k=this._decodeGeneric(I.tag,M,x):k=this._decodeChoice(M,x),M.isError(k))return k;if(!I.any&&I.choice===null&&I.children!==null&&I.children.forEach(function(Et){Et._decode(M,x)}),I.contains&&(I.tag==="octstr"||I.tag==="bitstr")){var Bt=new s(k);k=this._getUse(I.contains,M._reporterState.obj)._decode(Bt,x)}}return I.obj&&D&&(k=M.leaveObject($)),I.key!==null&&(k!==null||D===!0)?M.leaveKey(L,I.key,k):L!==null&&M.exitKey(L),k},y.prototype._decodeGeneric=function(M,x,I){var k=this._baseState;return M==="seq"||M==="set"?null:M==="seqof"||M==="setof"?this._decodeList(x,M,k.args[0],I):/str$/.test(M)?this._decodeStr(x,M,I):M==="objid"&&k.args?this._decodeObjid(x,k.args[0],k.args[1],I):M==="objid"?this._decodeObjid(x,null,null,I):M==="gentime"||M==="utctime"?this._decodeTime(x,M,I):M==="null_"?this._decodeNull(x,I):M==="bool"?this._decodeBool(x,I):M==="objDesc"?this._decodeStr(x,M,I):M==="int"||M==="enum"?this._decodeInt(x,k.args&&k.args[0],I):k.use!==null?this._getUse(k.use,x._reporterState.obj)._decode(x,I):x.error("unknown tag: "+M)},y.prototype._getUse=function(M,x){var I=this._baseState;return I.useDecoder=this._use(M,x),o(I.useDecoder._baseState.parent===null),I.useDecoder=I.useDecoder._baseState.children[0],I.implicit!==I.useDecoder._baseState.implicit&&(I.useDecoder=I.useDecoder.clone(),I.useDecoder._baseState.implicit=I.implicit),I.useDecoder},y.prototype._decodeChoice=function(M,x){var I=this._baseState,k=null,D=!1;return Object.keys(I.choice).some(function(L){var W=M.save(),z=I.choice[L];try{var $=z._decode(M,x);if(M.isError($))return!1;k={type:L,value:$},D=!0}catch(lt){return M.restore(W),!1}return!0},this),D?k:M.error("Choice not matched")},y.prototype._createEncoderBuffer=function(M){return new n(M,this.reporter)},y.prototype._encode=function(M,x,I){var k=this._baseState;if(!(k.default!==null&&k.default===M)){var D=this._encodeValue(M,x,I);if(D!==void 0&&!this._skipDefault(D,x,I))return D}},y.prototype._encodeValue=function(M,x,I){var k=this._baseState;if(k.parent===null)return k.children[0]._encode(M,x||new h);var z=null;if(this.reporter=x,k.optional&&M===void 0)if(k.default!==null)M=k.default;else return;var D=null,L=!1;if(k.any)z=this._createEncoderBuffer(M);else if(k.choice)z=this._encodeChoice(M,x);else if(k.contains)D=this._getUse(k.contains,I)._encode(M,x),L=!0;else if(k.children)D=k.children.map(function(H){if(H._baseState.tag==="null_")return H._encode(null,x,M);if(H._baseState.key===null)return x.error("Child should have a key");var At=x.enterKey(H._baseState.key);if(typeof M!="object")return x.error("Child expected, but input is not object");var Bt=H._encode(M[H._baseState.key],x,M);return x.leaveKey(At),Bt},this).filter(function(H){return H}),D=this._createEncoderBuffer(D);else if(k.tag==="seqof"||k.tag==="setof"){if(!(k.args&&k.args.length===1))return x.error("Too many args for : "+k.tag);if(!Array.isArray(M))return x.error("seqof/setof, but data is not Array");var W=this.clone();W._baseState.implicit=null,D=this._createEncoderBuffer(M.map(function(H){var At=this._baseState;return this._getUse(At.args[0],M)._encode(H,x)},W))}else k.use!==null?z=this._getUse(k.use,I)._encode(M,x):(D=this._encodePrimitive(k.tag,M),L=!0);var z;if(!k.any&&k.choice===null){var $=k.implicit!==null?k.implicit:k.tag,lt=k.implicit===null?"universal":"context";$===null?k.use===null&&x.error("Tag could be omitted only for .use()"):k.use===null&&(z=this._encodeComposite($,L,lt,D))}return k.explicit!==null&&(z=this._encodeComposite(k.explicit,!1,"context",z)),z},y.prototype._encodeChoice=function(M,x){var I=this._baseState,k=I.choice[M.type];return k||o(!1,M.type+" not found in "+JSON.stringify(Object.keys(I.choice))),k._encode(M.value,x)},y.prototype._encodePrimitive=function(M,x){var I=this._baseState;if(/str$/.test(M))return this._encodeStr(x,M);if(M==="objid"&&I.args)return this._encodeObjid(x,I.reverseArgs[0],I.args[1]);if(M==="objid")return this._encodeObjid(x,null,null);if(M==="gentime"||M==="utctime")return this._encodeTime(x,M);if(M==="null_")return this._encodeNull();if(M==="int"||M==="enum")return this._encodeInt(x,I.args&&I.reverseArgs[0]);if(M==="bool")return this._encodeBool(x);if(M==="objDesc")return this._encodeStr(x,M);throw new Error("Unsupported tag: "+M)},y.prototype._isNumstr=function(M){return/^[0-9 ]*$/.test(M)},y.prototype._isPrintstr=function(M){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(M)},Uf}var Ga;function Ui(){return Ga||(Ga=1,function(h){var n=h;n.Reporter=Fo.Reporter,n.DecoderBuffer=Ya().DecoderBuffer,n.EncoderBuffer=Ya().EncoderBuffer,n.Node=Jm()}($f)),$f}var Lf={},Of={},Xa;function Gm(){return Xa||(Xa=1,function(h){var n=qo();h.tagClass={0:"universal",1:"application",2:"context",3:"private"},h.tagClassByName=n._reverse(h.tagClass),h.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},h.tagByName=n._reverse(h.tag)}(Of)),Of}var ja;function qo(){return ja||(ja=1,function(h){var n=h;n._reverse=function(o){var m={};return Object.keys(o).forEach(function(f){(f|0)==f&&(f=f|0);var g=o[f];m[g]=f}),m},n.der=Gm()}(Lf)),Lf}var zf={},Kf,Qa;function Po(){if(Qa)return Kf;Qa=1;var h=Jt,n=fn(),s=n.base,o=n.bignum,m=n.constants.der;function f(B){this.enc="der",this.name=B.name,this.entity=B,this.tree=new g,this.tree._init(B.body)}Kf=f,f.prototype.decode=function(M,x){return M instanceof s.DecoderBuffer||(M=new s.DecoderBuffer(M,x)),this.tree._decode(M,x)};function g(B){s.Node.call(this,"der",B)}h(g,s.Node),g.prototype._peekTag=function(M,x,I){if(M.isEmpty())return!1;var k=M.save(),D=y(M,'Failed to peek tag: "'+x+'"');return M.isError(D)?D:(M.restore(k),D.tag===x||D.tagStr===x||D.tagStr+"of"===x||I)},g.prototype._decodeTag=function(M,x,I){var k=y(M,'Failed to decode tag of "'+x+'"');if(M.isError(k))return k;var D=S(M,k.primitive,'Failed to get length of "'+x+'"');if(M.isError(D))return D;if(!I&&k.tag!==x&&k.tagStr!==x&&k.tagStr+"of"!==x)return M.error('Failed to match tag: "'+x+'"');if(k.primitive||D!==null)return M.skip(D,'Failed to match body of: "'+x+'"');var L=M.save(),W=this._skipUntilEnd(M,'Failed to skip indefinite length body: "'+this.tag+'"');return M.isError(W)?W:(D=M.offset-L.offset,M.restore(L),M.skip(D,'Failed to match body of: "'+x+'"'))},g.prototype._skipUntilEnd=function(M,x){for(;;){var I=y(M,x);if(M.isError(I))return I;var k=S(M,I.primitive,x);if(M.isError(k))return k;var D;if(I.primitive||k!==null?D=M.skip(k):D=this._skipUntilEnd(M,x),M.isError(D))return D;if(I.tagStr==="end")break}},g.prototype._decodeList=function(M,x,I,k){for(var D=[];!M.isEmpty();){var L=this._peekTag(M,"end");if(M.isError(L))return L;var W=I.decode(M,"der",k);if(M.isError(W)&&L)break;D.push(W)}return D},g.prototype._decodeStr=function(M,x){if(x==="bitstr"){var I=M.readUInt8();return M.isError(I)?I:{unused:I,data:M.raw()}}else if(x==="bmpstr"){var k=M.raw();if(k.length%2===1)return M.error("Decoding of string type: bmpstr length mismatch");for(var D="",L=0;L<k.length/2;L++)D+=String.fromCharCode(k.readUInt16BE(L*2));return D}else if(x==="numstr"){var W=M.raw().toString("ascii");return this._isNumstr(W)?W:M.error("Decoding of string type: numstr unsupported characters")}else{if(x==="octstr")return M.raw();if(x==="objDesc")return M.raw();if(x==="printstr"){var z=M.raw().toString("ascii");return this._isPrintstr(z)?z:M.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(x)?M.raw().toString():M.error("Decoding of string type: "+x+" unsupported")}},g.prototype._decodeObjid=function(M,x,I){for(var k,D=[],L=0;!M.isEmpty();){var W=M.readUInt8();L<<=7,L|=W&127,W&128||(D.push(L),L=0)}W&128&&D.push(L);var z=D[0]/40|0,$=D[0]%40;if(I?k=D:k=[z,$].concat(D.slice(1)),x){var lt=x[k.join(" ")];lt===void 0&&(lt=x[k.join(".")]),lt!==void 0&&(k=lt)}return k},g.prototype._decodeTime=function(M,x){var I=M.raw().toString();if(x==="gentime")var k=I.slice(0,4)|0,D=I.slice(4,6)|0,L=I.slice(6,8)|0,W=I.slice(8,10)|0,z=I.slice(10,12)|0,$=I.slice(12,14)|0;else if(x==="utctime"){var k=I.slice(0,2)|0,D=I.slice(2,4)|0,L=I.slice(4,6)|0,W=I.slice(6,8)|0,z=I.slice(8,10)|0,$=I.slice(10,12)|0;k<70?k=2e3+k:k=1900+k}else return M.error("Decoding "+x+" time is not supported yet");return Date.UTC(k,D-1,L,W,z,$,0)},g.prototype._decodeNull=function(M){return null},g.prototype._decodeBool=function(M){var x=M.readUInt8();return M.isError(x)?x:x!==0},g.prototype._decodeInt=function(M,x){var I=M.raw(),k=new o(I);return x&&(k=x[k.toString(10)]||k),k},g.prototype._use=function(M,x){return typeof M=="function"&&(M=M(x)),M._getDecoder("der").tree};function y(B,M){var x=B.readUInt8(M);if(B.isError(x))return x;var I=m.tagClass[x>>6],k=(x&32)===0;if((x&31)===31){var D=x;for(x=0;(D&128)===128;){if(D=B.readUInt8(M),B.isError(D))return D;x<<=7,x|=D&127}}else x&=31;var L=m.tag[x];return{cls:I,primitive:k,tag:x,tagStr:L}}function S(B,M,x){var I=B.readUInt8(x);if(B.isError(I))return I;if(!M&&I===128)return null;if(!(I&128))return I;var k=I&127;if(k>4)return B.error("length octect is too long");I=0;for(var D=0;D<k;D++){I<<=8;var L=B.readUInt8(x);if(B.isError(L))return L;I|=L}return I}return Kf}var Hf,th;function Xm(){if(th)return Hf;th=1;var h=Jt,n=gr.Buffer,s=Po();function o(m){s.call(this,m),this.enc="pem"}return h(o,s),Hf=o,o.prototype.decode=function(f,g){for(var y=f.toString().split(/[\r\n]+/g),S=g.label.toUpperCase(),B=/^-----(BEGIN|END) ([^-]+)-----$/,M=-1,x=-1,I=0;I<y.length;I++){var k=y[I].match(B);if(k!==null&&k[2]===S)if(M===-1){if(k[1]!=="BEGIN")break;M=I}else{if(k[1]!=="END")break;x=I;break}}if(M===-1||x===-1)throw new Error("PEM section not found for: "+S);var D=y.slice(M+1,x).join("");D.replace(/[^a-z0-9\+\/=]+/gi,"");var L=new n(D,"base64");return s.prototype.decode.call(this,L,g)},Hf}var eh;function jm(){return eh||(eh=1,function(h){var n=h;n.der=Po(),n.pem=Xm()}(zf)),zf}var Zf={},Wf,rh;function Do(){if(rh)return Wf;rh=1;var h=Jt,n=gr.Buffer,s=fn(),o=s.base,m=s.constants.der;function f(B){this.enc="der",this.name=B.name,this.entity=B,this.tree=new g,this.tree._init(B.body)}Wf=f,f.prototype.encode=function(M,x){return this.tree._encode(M,x).join()};function g(B){o.Node.call(this,"der",B)}h(g,o.Node),g.prototype._encodeComposite=function(M,x,I,k){var D=S(M,x,I,this.reporter);if(k.length<128){var z=new n(2);return z[0]=D,z[1]=k.length,this._createEncoderBuffer([z,k])}for(var L=1,W=k.length;W>=256;W>>=8)L++;var z=new n(1+1+L);z[0]=D,z[1]=128|L;for(var W=1+L,$=k.length;$>0;W--,$>>=8)z[W]=$&255;return this._createEncoderBuffer([z,k])},g.prototype._encodeStr=function(M,x){if(x==="bitstr")return this._createEncoderBuffer([M.unused|0,M.data]);if(x==="bmpstr"){for(var I=new n(M.length*2),k=0;k<M.length;k++)I.writeUInt16BE(M.charCodeAt(k),k*2);return this._createEncoderBuffer(I)}else return x==="numstr"?this._isNumstr(M)?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: numstr supports only digits and space"):x==="printstr"?this._isPrintstr(M)?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(x)?this._createEncoderBuffer(M):x==="objDesc"?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: "+x+" unsupported")},g.prototype._encodeObjid=function(M,x,I){if(typeof M=="string"){if(!x)return this.reporter.error("string objid given, but no values map found");if(!x.hasOwnProperty(M))return this.reporter.error("objid not found in values map");M=x[M].split(/[\s\.]+/g);for(var k=0;k<M.length;k++)M[k]|=0}else if(Array.isArray(M)){M=M.slice();for(var k=0;k<M.length;k++)M[k]|=0}if(!Array.isArray(M))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(M));if(!I){if(M[1]>=40)return this.reporter.error("Second objid identifier OOB");M.splice(0,2,M[0]*40+M[1])}for(var D=0,k=0;k<M.length;k++){var L=M[k];for(D++;L>=128;L>>=7)D++}for(var W=new n(D),z=W.length-1,k=M.length-1;k>=0;k--){var L=M[k];for(W[z--]=L&127;(L>>=7)>0;)W[z--]=128|L&127}return this._createEncoderBuffer(W)};function y(B){return B<10?"0"+B:B}g.prototype._encodeTime=function(M,x){var I,k=new Date(M);return x==="gentime"?I=[y(k.getFullYear()),y(k.getUTCMonth()+1),y(k.getUTCDate()),y(k.getUTCHours()),y(k.getUTCMinutes()),y(k.getUTCSeconds()),"Z"].join(""):x==="utctime"?I=[y(k.getFullYear()%100),y(k.getUTCMonth()+1),y(k.getUTCDate()),y(k.getUTCHours()),y(k.getUTCMinutes()),y(k.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+x+" time is not supported yet"),this._encodeStr(I,"octstr")},g.prototype._encodeNull=function(){return this._createEncoderBuffer("")},g.prototype._encodeInt=function(M,x){if(typeof M=="string"){if(!x)return this.reporter.error("String int or enum given, but no values map");if(!x.hasOwnProperty(M))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(M));M=x[M]}if(typeof M!="number"&&!n.isBuffer(M)){var I=M.toArray();!M.sign&&I[0]&128&&I.unshift(0),M=new n(I)}if(n.isBuffer(M)){var k=M.length;M.length===0&&k++;var L=new n(k);return M.copy(L),M.length===0&&(L[0]=0),this._createEncoderBuffer(L)}if(M<128)return this._createEncoderBuffer(M);if(M<256)return this._createEncoderBuffer([0,M]);for(var k=1,D=M;D>=256;D>>=8)k++;for(var L=new Array(k),D=L.length-1;D>=0;D--)L[D]=M&255,M>>=8;return L[0]&128&&L.unshift(0),this._createEncoderBuffer(new n(L))},g.prototype._encodeBool=function(M){return this._createEncoderBuffer(M?255:0)},g.prototype._use=function(M,x){return typeof M=="function"&&(M=M(x)),M._getEncoder("der").tree},g.prototype._skipDefault=function(M,x,I){var k=this._baseState,D;if(k.default===null)return!1;var L=M.join();if(k.defaultBuffer===void 0&&(k.defaultBuffer=this._encodeValue(k.default,x,I).join()),L.length!==k.defaultBuffer.length)return!1;for(D=0;D<L.length;D++)if(L[D]!==k.defaultBuffer[D])return!1;return!0};function S(B,M,x,I){var k;if(B==="seqof"?B="seq":B==="setof"&&(B="set"),m.tagByName.hasOwnProperty(B))k=m.tagByName[B];else if(typeof B=="number"&&(B|0)===B)k=B;else return I.error("Unknown tag: "+B);return k>=31?I.error("Multi-octet tag encoding unsupported"):(M||(k|=32),k|=m.tagClassByName[x||"universal"]<<6,k)}return Wf}var Vf,ih;function Qm(){if(ih)return Vf;ih=1;var h=Jt,n=Do();function s(o){n.call(this,o),this.enc="pem"}return h(s,n),Vf=s,s.prototype.encode=function(m,f){for(var g=n.prototype.encode.call(this,m),y=g.toString("base64"),S=["-----BEGIN "+f.label+"-----"],B=0;B<y.length;B+=64)S.push(y.slice(B,B+64));return S.push("-----END "+f.label+"-----"),S.join(`
|
|
15
|
-
`)},Vf}var nh;function t2(){return nh||(nh=1,function(h){var n=h;n.der=Do(),n.pem=Qm()}(Zf)),Zf}var fh;function fn(){return fh||(fh=1,function(h){var n=h;n.bignum=Wm,n.define=Vm().define,n.base=Ui(),n.constants=qo(),n.decoders=jm(),n.encoders=t2()}(Df)),Df}var ir=fn(),ah=ir.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),e2=ir.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),V0=ir.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),r2=ir.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(V0),this.key("subjectPublicKey").bitstr())}),i2=ir.define("RelativeDistinguishedName",function(){this.setof(e2)}),n2=ir.define("RDNSequence",function(){this.seqof(i2)}),hh=ir.define("Name",function(){this.choice({rdnSequence:this.use(n2)})}),f2=ir.define("Validity",function(){this.seq().obj(this.key("notBefore").use(ah),this.key("notAfter").use(ah))}),a2=ir.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),h2=ir.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(V0),this.key("issuer").use(hh),this.key("validity").use(f2),this.key("subject").use(hh),this.key("subjectPublicKeyInfo").use(r2),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(a2).optional())}),s2=ir.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(h2),this.key("signatureAlgorithm").use(V0),this.key("signatureValue").bitstr())}),o2=s2,nr=fn();rr.certificate=o2;var u2=nr.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});rr.RSAPrivateKey=u2;var l2=nr.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});rr.RSAPublicKey=l2;var No=nr.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),d2=nr.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(No),this.key("subjectPublicKey").bitstr())});rr.PublicKey=d2;var c2=nr.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(No),this.key("subjectPrivateKey").octstr())});rr.PrivateKey=c2;var v2=nr.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});rr.EncryptedPrivateKey=v2;var p2=nr.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});rr.DSAPrivateKey=p2;rr.DSAparam=nr.define("DSAparam",function(){this.int()});var m2=nr.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),g2=nr.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(m2),this.key("publicKey").optional().explicit(1).bitstr())});rr.ECPrivateKey=g2;rr.signature=nr.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())});const b2={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var y2=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,w2=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,M2=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,x2=Wn,_2=Le,pn=Ot.Buffer,S2=function(h,n){var s=h.toString(),o=s.match(y2),m;if(o){var g="aes"+o[1],y=pn.from(o[2],"hex"),S=pn.from(o[3].replace(/[\r\n]/g,""),"base64"),B=x2(n,y.slice(0,8),parseInt(o[1],10)).key,M=[],x=_2.createDecipheriv(g,B,y);M.push(x.update(S)),M.push(x.final()),m=pn.concat(M)}else{var f=s.match(M2);m=pn.from(f[2].replace(/[\r\n]/g,""),"base64")}var I=s.match(w2)[1];return{tag:I,data:m}},qe=rr,A2=b2,B2=S2,E2=Le,k2=Un,c0=Ot.Buffer;function I2(h,n){var s=h.algorithm.decrypt.kde.kdeparams.salt,o=parseInt(h.algorithm.decrypt.kde.kdeparams.iters.toString(),10),m=A2[h.algorithm.decrypt.cipher.algo.join(".")],f=h.algorithm.decrypt.cipher.iv,g=h.subjectPrivateKey,y=parseInt(m.split("-")[1],10)/8,S=k2.pbkdf2Sync(n,s,o,y,"sha1"),B=E2.createDecipheriv(m,S,f),M=[];return M.push(B.update(g)),M.push(B.final()),c0.concat(M)}function $o(h){var n;typeof h=="object"&&!c0.isBuffer(h)&&(n=h.passphrase,h=h.key),typeof h=="string"&&(h=c0.from(h));var s=B2(h,n),o=s.tag,m=s.data,f,g;switch(o){case"CERTIFICATE":g=qe.certificate.decode(m,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(g||(g=qe.PublicKey.decode(m,"der")),f=g.algorithm.algorithm.join("."),f){case"1.2.840.113549.1.1.1":return qe.RSAPublicKey.decode(g.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return g.subjectPrivateKey=g.subjectPublicKey,{type:"ec",data:g};case"1.2.840.10040.4.1":return g.algorithm.params.pub_key=qe.DSAparam.decode(g.subjectPublicKey.data,"der"),{type:"dsa",data:g.algorithm.params};default:throw new Error("unknown key id "+f)}case"ENCRYPTED PRIVATE KEY":m=qe.EncryptedPrivateKey.decode(m,"der"),m=I2(m,n);case"PRIVATE KEY":switch(g=qe.PrivateKey.decode(m,"der"),f=g.algorithm.algorithm.join("."),f){case"1.2.840.113549.1.1.1":return qe.RSAPrivateKey.decode(g.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:g.algorithm.curve,privateKey:qe.ECPrivateKey.decode(g.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return g.algorithm.params.priv_key=qe.DSAparam.decode(g.subjectPrivateKey,"der"),{type:"dsa",params:g.algorithm.params};default:throw new Error("unknown key id "+f)}case"RSA PUBLIC KEY":return qe.RSAPublicKey.decode(m,"der");case"RSA PRIVATE KEY":return qe.RSAPrivateKey.decode(m,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:qe.DSAPrivateKey.decode(m,"der")};case"EC PRIVATE KEY":return m=qe.ECPrivateKey.decode(m,"der"),{curve:m.parameters.value,privateKey:m.privateKey};default:throw new Error("unknown key type "+o)}}$o.signature=qe.signature;var sf=$o;const Uo={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var sh;function R2(){if(sh)return Ci.exports;sh=1;var h=Ot.Buffer,n=Vh,s=U0,o=Z0().ec,m=$0,f=sf,g=Uo,y=1;function S(z,$,lt,H,At){var Bt=f($);if(Bt.curve){if(H!=="ecdsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");return B(z,Bt)}else if(Bt.type==="dsa"){if(H!=="dsa")throw new Error("wrong private key type");return M(z,Bt,lt)}if(H!=="rsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");if($.padding!==void 0&&$.padding!==y)throw new Error("illegal or unsupported padding mode");z=h.concat([At,z]);for(var Ct=Bt.modulus.byteLength(),Et=[0,1];z.length+Et.length+1<Ct;)Et.push(255);Et.push(0);for(var Y=-1;++Y<z.length;)Et.push(z[Y]);var It=s(Et,Bt);return It}function B(z,$){var lt=g[$.curve.join(".")];if(!lt)throw new Error("unknown curve "+$.curve.join("."));var H=new o(lt),At=H.keyFromPrivate($.privateKey),Bt=At.sign(z);return h.from(Bt.toDER())}function M(z,$,lt){for(var H=$.params.priv_key,At=$.params.p,Bt=$.params.q,Ct=$.params.g,Et=new m(0),Y,It=k(z,Bt).mod(Bt),p=!1,t=I(H,Bt,z,lt);p===!1;)Y=L(Bt,t,lt),Et=W(Ct,Y,At,Bt),p=Y.invm(Bt).imul(It.add(H.mul(Et))).mod(Bt),p.cmpn(0)===0&&(p=!1,Et=new m(0));return x(Et,p)}function x(z,$){z=z.toArray(),$=$.toArray(),z[0]&128&&(z=[0].concat(z)),$[0]&128&&($=[0].concat($));var lt=z.length+$.length+4,H=[48,lt,2,z.length];return H=H.concat(z,[2,$.length],$),h.from(H)}function I(z,$,lt,H){if(z=h.from(z.toArray()),z.length<$.byteLength()){var At=h.alloc($.byteLength()-z.length);z=h.concat([At,z])}var Bt=lt.length,Ct=D(lt,$),Et=h.alloc(Bt);Et.fill(1);var Y=h.alloc(Bt);return Y=n(H,Y).update(Et).update(h.from([0])).update(z).update(Ct).digest(),Et=n(H,Y).update(Et).digest(),Y=n(H,Y).update(Et).update(h.from([1])).update(z).update(Ct).digest(),Et=n(H,Y).update(Et).digest(),{k:Y,v:Et}}function k(z,$){var lt=new m(z),H=(z.length<<3)-$.bitLength();return H>0&<.ishrn(H),lt}function D(z,$){z=k(z,$),z=z.mod($);var lt=h.from(z.toArray());if(lt.length<$.byteLength()){var H=h.alloc($.byteLength()-lt.length);lt=h.concat([H,lt])}return lt}function L(z,$,lt){var H,At;do{for(H=h.alloc(0);H.length*8<z.bitLength();)$.v=n(lt,$.k).update($.v).digest(),H=h.concat([H,$.v]);At=k(H,z),$.k=n(lt,$.k).update($.v).update(h.from([0])).digest(),$.v=n(lt,$.k).update($.v).digest()}while(At.cmp(z)!==-1);return At}function W(z,$,lt,H){return z.toRed(m.mont(lt)).redPow($).fromRed().mod(H)}return Ci.exports=S,Ci.exports.getKey=I,Ci.exports.makeKey=L,Ci.exports}var Yf,oh;function T2(){if(oh)return Yf;oh=1;var h=Ot.Buffer,n=$0,s=Z0().ec,o=sf,m=Uo;function f(B,M,x,I,k){var D=o(x);if(D.type==="ec"){if(I!=="ecdsa"&&I!=="ecdsa/rsa")throw new Error("wrong public key type");return g(B,M,D)}else if(D.type==="dsa"){if(I!=="dsa")throw new Error("wrong public key type");return y(B,M,D)}if(I!=="rsa"&&I!=="ecdsa/rsa")throw new Error("wrong public key type");M=h.concat([k,M]);for(var L=D.modulus.byteLength(),W=[1],z=0;M.length+W.length+2<L;)W.push(255),z+=1;W.push(0);for(var $=-1;++$<M.length;)W.push(M[$]);W=h.from(W);var lt=n.mont(D.modulus);B=new n(B).toRed(lt),B=B.redPow(new n(D.publicExponent)),B=h.from(B.fromRed().toArray());var H=z<8?1:0;for(L=Math.min(B.length,W.length),B.length!==W.length&&(H=1),$=-1;++$<L;)H|=B[$]^W[$];return H===0}function g(B,M,x){var I=m[x.data.algorithm.curve.join(".")];if(!I)throw new Error("unknown curve "+x.data.algorithm.curve.join("."));var k=new s(I),D=x.data.subjectPrivateKey.data;return k.verify(M,B,D)}function y(B,M,x){var I=x.data.p,k=x.data.q,D=x.data.g,L=x.data.pub_key,W=o.signature.decode(B,"der"),z=W.s,$=W.r;S(z,k),S($,k);var lt=n.mont(I),H=z.invm(k),At=D.toRed(lt).redPow(new n(M).mul(H).mod(k)).fromRed().mul(L.toRed(lt).redPow($.mul(H).mod(k)).fromRed()).mod(I).mod(k);return At.cmp($)===0}function S(B,M){if(B.cmpn(0)<=0)throw new Error("invalid sig");if(B.cmp(M)>=0)throw new Error("invalid sig")}return Yf=f,Yf}var Jf,uh;function C2(){if(uh)return Jf;uh=1;var h=Ot.Buffer,n=Gi,s=kv,o=Jt,m=R2(),f=T2(),g=Yh;Object.keys(g).forEach(function(x){g[x].id=h.from(g[x].id,"hex"),g[x.toLowerCase()]=g[x]});function y(x){s.Writable.call(this);var I=g[x];if(!I)throw new Error("Unknown message digest");this._hashType=I.hash,this._hash=n(I.hash),this._tag=I.id,this._signType=I.sign}o(y,s.Writable),y.prototype._write=function(I,k,D){this._hash.update(I),D()},y.prototype.update=function(I,k){return this._hash.update(typeof I=="string"?h.from(I,k):I),this},y.prototype.sign=function(I,k){this.end();var D=this._hash.digest(),L=m(D,I,this._hashType,this._signType,this._tag);return k?L.toString(k):L};function S(x){s.Writable.call(this);var I=g[x];if(!I)throw new Error("Unknown message digest");this._hash=n(I.hash),this._tag=I.id,this._signType=I.sign}o(S,s.Writable),S.prototype._write=function(I,k,D){this._hash.update(I),D()},S.prototype.update=function(I,k){return this._hash.update(typeof I=="string"?h.from(I,k):I),this},S.prototype.verify=function(I,k,D){var L=typeof k=="string"?h.from(k,D):k;this.end();var W=this._hash.digest();return f(L,W,I,this._signType,this._tag)};function B(x){return new y(x)}function M(x){return new S(x)}return Jf={Sign:B,Verify:M,createSign:B,createVerify:M},Jf}var Y0={exports:{}};Y0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(Y0);var F2=Y0.exports,Gf,lh;function q2(){if(lh)return Gf;lh=1;var h=Z0(),n=F2;Gf=function(g){return new o(g)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1;function o(f){this.curveType=s[f],this.curveType||(this.curveType={name:f}),this.curve=new h.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(f,g){return this.keys=this.curve.genKeyPair(),this.getPublicKey(f,g)},o.prototype.computeSecret=function(f,g,y){g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g));var S=this.curve.keyFromPublic(f).getPublic(),B=S.mul(this.keys.getPrivate()).getX();return m(B,y,this.curveType.byteLength)},o.prototype.getPublicKey=function(f,g){var y=this.keys.getPublic(g==="compressed",!0);return g==="hybrid"&&(y[y.length-1]%2?y[0]=7:y[0]=6),m(y,f)},o.prototype.getPrivateKey=function(f){return m(this.keys.getPrivate(),f)},o.prototype.setPublicKey=function(f,g){return g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g)),this.keys._importPublic(f),this},o.prototype.setPrivateKey=function(f,g){g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g));var y=new n(f);return y=y.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(y),this};function m(f,g,y){Array.isArray(f)||(f=f.toArray());var S=new mt(f);if(y&&S.length<y){var B=new mt(y-S.length);B.fill(0),S=mt.concat([B,S])}return g?S.toString(g):S}return Gf}var Lo={},P2=Gi,v0=Ot.Buffer,Oo=function(h,n){for(var s=v0.alloc(0),o=0,m;s.length<n;)m=D2(o++),s=v0.concat([s,P2("sha1").update(h).update(m).digest()]);return s.slice(0,n)};function D2(h){var n=v0.allocUnsafe(4);return n.writeUInt32BE(h,0),n}var zo=function(n,s){for(var o=n.length,m=-1;++m<o;)n[m]^=s[m];return n},J0={exports:{}};J0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(J0);var G0=J0.exports,dh=G0,N2=Ot.Buffer;function $2(h,n){return N2.from(h.toRed(dh.mont(n.modulus)).redPow(new dh(n.publicExponent)).fromRed().toArray())}var Ko=$2,U2=sf,p0=gi,L2=Gi,ch=Oo,vh=zo,X0=G0,O2=Ko,z2=U0,je=Ot.Buffer,K2=function(n,s,o){var m;n.padding?m=n.padding:o?m=1:m=4;var f=U2(n),g;if(m===4)g=H2(f,s);else if(m===1)g=Z2(f,s,o);else if(m===3){if(g=new X0(s),g.cmp(f.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return o?z2(g,f):O2(g,f)};function H2(h,n){var s=h.modulus.byteLength(),o=n.length,m=L2("sha1").update(je.alloc(0)).digest(),f=m.length,g=2*f;if(o>s-g-2)throw new Error("message too long");var y=je.alloc(s-o-g-2),S=s-f-1,B=p0(f),M=vh(je.concat([m,y,je.alloc(1,1),n],S),ch(B,S)),x=vh(B,ch(M,f));return new X0(je.concat([je.alloc(1),x,M],s))}function Z2(h,n,s){var o=n.length,m=h.modulus.byteLength();if(o>m-11)throw new Error("message too long");var f;return s?f=je.alloc(m-o-3,255):f=W2(m-o-3),new X0(je.concat([je.from([0,s?1:2]),f,je.alloc(1),n],m))}function W2(h){for(var n=je.allocUnsafe(h),s=0,o=p0(h*2),m=0,f;s<h;)m===o.length&&(o=p0(h*2),m=0),f=o[m++],f&&(n[s++]=f);return n}var V2=sf,ph=Oo,mh=zo,gh=G0,Y2=U0,J2=Gi,G2=Ko,Hi=Ot.Buffer,X2=function(n,s,o){var m;n.padding?m=n.padding:o?m=1:m=4;var f=V2(n),g=f.modulus.byteLength();if(s.length>g||new gh(s).cmp(f.modulus)>=0)throw new Error("decryption error");var y;o?y=G2(new gh(s),f):y=Y2(s,f);var S=Hi.alloc(g-y.length);if(y=Hi.concat([S,y],g),m===4)return j2(f,y);if(m===1)return Q2(f,y,o);if(m===3)return y;throw new Error("unknown padding")};function j2(h,n){var s=h.modulus.byteLength(),o=J2("sha1").update(Hi.alloc(0)).digest(),m=o.length;if(n[0]!==0)throw new Error("decryption error");var f=n.slice(1,m+1),g=n.slice(m+1),y=mh(f,ph(g,m)),S=mh(g,ph(y,s-m-1));if(tg(o,S.slice(0,m)))throw new Error("decryption error");for(var B=m;S[B]===0;)B++;if(S[B++]!==1)throw new Error("decryption error");return S.slice(B)}function Q2(h,n,s){for(var o=n.slice(0,2),m=2,f=0;n[m++]!==0;)if(m>=n.length){f++;break}var g=n.slice(2,m-1);if((o.toString("hex")!=="0002"&&!s||o.toString("hex")!=="0001"&&s)&&f++,g.length<8&&f++,f)throw new Error("decryption error");return n.slice(m)}function tg(h,n){h=Hi.from(h),n=Hi.from(n);var s=0,o=h.length;h.length!==n.length&&(s++,o=Math.min(h.length,n.length));for(var m=-1;++m<o;)s+=h[m]^n[m];return s}(function(h){h.publicEncrypt=K2,h.privateDecrypt=X2,h.privateEncrypt=function(s,o){return h.publicEncrypt(s,o,!0)},h.publicDecrypt=function(s,o){return h.privateDecrypt(s,o,!0)}})(Lo);var Ni={};function bh(){throw new Error(`secure random number generation not supported by this browser
|
|
16
|
-
use chrome, FireFox or Internet Explorer 11`)}var Ho=Ot,yh=gi,Zo=Ho.Buffer,Wo=Ho.kMaxLength,m0=Gt.crypto||Gt.msCrypto,Vo=Math.pow(2,32)-1;function Yo(h,n){if(typeof h!="number"||h!==h)throw new TypeError("offset must be a number");if(h>Vo||h<0)throw new TypeError("offset must be a uint32");if(h>Wo||h>n)throw new RangeError("offset out of range")}function Jo(h,n,s){if(typeof h!="number"||h!==h)throw new TypeError("size must be a number");if(h>Vo||h<0)throw new TypeError("size must be a uint32");if(h+n>s||h>Wo)throw new RangeError("buffer too small")}m0&&m0.getRandomValues||!ye.browser?(Ni.randomFill=eg,Ni.randomFillSync=rg):(Ni.randomFill=bh,Ni.randomFillSync=bh);function eg(h,n,s,o){if(!Zo.isBuffer(h)&&!(h instanceof Gt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof n=="function")o=n,n=0,s=h.length;else if(typeof s=="function")o=s,s=h.length-n;else if(typeof o!="function")throw new TypeError('"cb" argument must be a function');return Yo(n,h.length),Jo(s,n,h.length),Go(h,n,s,o)}function Go(h,n,s,o){if(ye.browser){var m=h.buffer,f=new Uint8Array(m,n,s);if(m0.getRandomValues(f),o){ye.nextTick(function(){o(null,h)});return}return h}if(o){yh(s,function(y,S){if(y)return o(y);S.copy(h,n),o(null,h)});return}var g=yh(s);return g.copy(h,n),h}function rg(h,n,s){if(typeof n=="undefined"&&(n=0),!Zo.isBuffer(h)&&!(h instanceof Gt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return Yo(n,h.length),s===void 0&&(s=h.length-n),Jo(s,n,h.length),Go(h,n,s)}var wh;function Xo(){if(wh)return Ut;wh=1,Ut.randomBytes=Ut.rng=Ut.pseudoRandomBytes=Ut.prng=gi,Ut.createHash=Ut.Hash=Gi,Ut.createHmac=Ut.Hmac=Vh;var h=Wd,n=Object.keys(h),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);Ut.getHashes=function(){return s};var o=Un;Ut.pbkdf2=o.pbkdf2,Ut.pbkdf2Sync=o.pbkdf2Sync;var m=Qe;Ut.Cipher=m.Cipher,Ut.createCipher=m.createCipher,Ut.Cipheriv=m.Cipheriv,Ut.createCipheriv=m.createCipheriv,Ut.Decipher=m.Decipher,Ut.createDecipher=m.createDecipher,Ut.Decipheriv=m.Decipheriv,Ut.createDecipheriv=m.createDecipheriv,Ut.getCiphers=m.getCiphers,Ut.listCiphers=m.listCiphers;var f=rv();Ut.DiffieHellmanGroup=f.DiffieHellmanGroup,Ut.createDiffieHellmanGroup=f.createDiffieHellmanGroup,Ut.getDiffieHellman=f.getDiffieHellman,Ut.createDiffieHellman=f.createDiffieHellman,Ut.DiffieHellman=f.DiffieHellman;var g=
|
|
14
|
+
})`)}catch(S){y=function(B){this._initNamed(B)}}return s(y,g),y.prototype._initNamed=function(B){g.call(this,B)},new y(this)},m.prototype._getDecoder=function(g){return g=g||"der",this.decoders.hasOwnProperty(g)||(this.decoders[g]=this._createNamed(n.decoders[g])),this.decoders[g]},m.prototype.decode=function(g,y,S){return this._getDecoder(y).decode(g,S)},m.prototype._getEncoder=function(g){return g=g||"der",this.encoders.hasOwnProperty(g)||(this.encoders[g]=this._createNamed(n.encoders[g])),this.encoders[g]},m.prototype.encode=function(g,y,S){return this._getEncoder(y).encode(g,S)}}(Nf)),Nf}var $f={},Fo={},Y2=Jt;function Ge(h){this._reporterState={obj:null,path:[],options:h||{},errors:[]}}Fo.Reporter=Ge;Ge.prototype.isError=function(n){return n instanceof mi};Ge.prototype.save=function(){var n=this._reporterState;return{obj:n.obj,pathLen:n.path.length}};Ge.prototype.restore=function(n){var s=this._reporterState;s.obj=n.obj,s.path=s.path.slice(0,n.pathLen)};Ge.prototype.enterKey=function(n){return this._reporterState.path.push(n)};Ge.prototype.exitKey=function(n){var s=this._reporterState;s.path=s.path.slice(0,n-1)};Ge.prototype.leaveKey=function(n,s,o){var m=this._reporterState;this.exitKey(n),m.obj!==null&&(m.obj[s]=o)};Ge.prototype.path=function(){return this._reporterState.path.join("/")};Ge.prototype.enterObject=function(){var n=this._reporterState,s=n.obj;return n.obj={},s};Ge.prototype.leaveObject=function(n){var s=this._reporterState,o=s.obj;return s.obj=n,o};Ge.prototype.error=function(n){var s,o=this._reporterState,m=n instanceof mi;if(m?s=n:s=new mi(o.path.map(function(f){return"["+JSON.stringify(f)+"]"}).join(""),n.message||n,n.stack),!o.options.partial)throw s;return m||o.errors.push(s),s};Ge.prototype.wrapResult=function(n){var s=this._reporterState;return s.options.partial?{result:this.isError(n)?null:n,errors:s.errors}:n};function mi(h,n){this.path=h,this.rethrow(n)}Y2(mi,Error);mi.prototype.rethrow=function(n){if(this.message=n+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,mi),!this.stack)try{throw new Error(this.message)}catch(s){this.stack=s.stack}return this};var vn={},Va;function Ya(){if(Va)return vn;Va=1;var h=Jt,n=Ui().Reporter,s=gr.Buffer;function o(f,g){if(n.call(this,g),!s.isBuffer(f)){this.error("Input not Buffer");return}this.base=f,this.offset=0,this.length=f.length}h(o,n),vn.DecoderBuffer=o,o.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},o.prototype.restore=function(g){var y=new o(this.base);return y.offset=g.offset,y.length=this.offset,this.offset=g.offset,n.prototype.restore.call(this,g.reporter),y},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(g){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(g||"DecoderBuffer overrun")},o.prototype.skip=function(g,y){if(!(this.offset+g<=this.length))return this.error(y||"DecoderBuffer overrun");var S=new o(this.base);return S._reporterState=this._reporterState,S.offset=this.offset,S.length=this.offset+g,this.offset+=g,S},o.prototype.raw=function(g){return this.base.slice(g?g.offset:this.offset,this.length)};function m(f,g){if(Array.isArray(f))this.length=0,this.value=f.map(function(y){return y instanceof m||(y=new m(y,g)),this.length+=y.length,y},this);else if(typeof f=="number"){if(!(0<=f&&f<=255))return g.error("non-byte EncoderBuffer value");this.value=f,this.length=1}else if(typeof f=="string")this.value=f,this.length=s.byteLength(f);else if(s.isBuffer(f))this.value=f,this.length=f.length;else return g.error("Unsupported type: "+typeof f)}return vn.EncoderBuffer=m,m.prototype.join=function(g,y){return g||(g=new s(this.length)),y||(y=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(S){S.join(g,y),y+=S.length}):(typeof this.value=="number"?g[y]=this.value:typeof this.value=="string"?g.write(this.value,y):s.isBuffer(this.value)&&this.value.copy(g,y),y+=this.length)),g},vn}var Uf,Ja;function J2(){if(Ja)return Uf;Ja=1;var h=Ui().Reporter,n=Ui().EncoderBuffer,s=Ui().DecoderBuffer,o=We,m=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],f=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(m),g=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function y(B,M){var x={};this._baseState=x,x.enc=B,x.parent=M||null,x.children=null,x.tag=null,x.args=null,x.reverseArgs=null,x.choice=null,x.optional=!1,x.any=!1,x.obj=!1,x.use=null,x.useDecoder=null,x.key=null,x.default=null,x.explicit=null,x.implicit=null,x.contains=null,x.parent||(x.children=[],this._wrap())}Uf=y;var S=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return y.prototype.clone=function(){var M=this._baseState,x={};S.forEach(function(k){x[k]=M[k]});var I=new this.constructor(x.parent);return I._baseState=x,I},y.prototype._wrap=function(){var M=this._baseState;f.forEach(function(x){this[x]=function(){var k=new this.constructor(this);return M.children.push(k),k[x].apply(k,arguments)}},this)},y.prototype._init=function(M){var x=this._baseState;o(x.parent===null),M.call(this),x.children=x.children.filter(function(I){return I._baseState.parent===this},this),o.equal(x.children.length,1,"Root node can have only one child")},y.prototype._useArgs=function(M){var x=this._baseState,I=M.filter(function(k){return k instanceof this.constructor},this);M=M.filter(function(k){return!(k instanceof this.constructor)},this),I.length!==0&&(o(x.children===null),x.children=I,I.forEach(function(k){k._baseState.parent=this},this)),M.length!==0&&(o(x.args===null),x.args=M,x.reverseArgs=M.map(function(k){if(typeof k!="object"||k.constructor!==Object)return k;var D={};return Object.keys(k).forEach(function(L){L==(L|0)&&(L|=0);var W=k[L];D[W]=L}),D}))},g.forEach(function(B){y.prototype[B]=function(){var x=this._baseState;throw new Error(B+" not implemented for encoding: "+x.enc)}}),m.forEach(function(B){y.prototype[B]=function(){var x=this._baseState,I=Array.prototype.slice.call(arguments);return o(x.tag===null),x.tag=B,this._useArgs(I),this}}),y.prototype.use=function(M){o(M);var x=this._baseState;return o(x.use===null),x.use=M,this},y.prototype.optional=function(){var M=this._baseState;return M.optional=!0,this},y.prototype.def=function(M){var x=this._baseState;return o(x.default===null),x.default=M,x.optional=!0,this},y.prototype.explicit=function(M){var x=this._baseState;return o(x.explicit===null&&x.implicit===null),x.explicit=M,this},y.prototype.implicit=function(M){var x=this._baseState;return o(x.explicit===null&&x.implicit===null),x.implicit=M,this},y.prototype.obj=function(){var M=this._baseState,x=Array.prototype.slice.call(arguments);return M.obj=!0,x.length!==0&&this._useArgs(x),this},y.prototype.key=function(M){var x=this._baseState;return o(x.key===null),x.key=M,this},y.prototype.any=function(){var M=this._baseState;return M.any=!0,this},y.prototype.choice=function(M){var x=this._baseState;return o(x.choice===null),x.choice=M,this._useArgs(Object.keys(M).map(function(I){return M[I]})),this},y.prototype.contains=function(M){var x=this._baseState;return o(x.use===null),x.contains=M,this},y.prototype._decode=function(M,x){var I=this._baseState;if(I.parent===null)return M.wrapResult(I.children[0]._decode(M,x));var k=I.default,D=!0,L=null;if(I.key!==null&&(L=M.enterKey(I.key)),I.optional){var W=null;if(I.explicit!==null?W=I.explicit:I.implicit!==null?W=I.implicit:I.tag!==null&&(W=I.tag),W===null&&!I.any){var z=M.save();try{I.choice===null?this._decodeGeneric(I.tag,M,x):this._decodeChoice(M,x),D=!0}catch(Ct){D=!1}M.restore(z)}else if(D=this._peekTag(M,W,I.any),M.isError(D))return D}var $;if(I.obj&&D&&($=M.enterObject()),D){if(I.explicit!==null){var lt=this._decodeTag(M,I.explicit);if(M.isError(lt))return lt;M=lt}var H=M.offset;if(I.use===null&&I.choice===null){if(I.any)var z=M.save();var At=this._decodeTag(M,I.implicit!==null?I.implicit:I.tag,I.any);if(M.isError(At))return At;I.any?k=M.raw(z):M=At}if(x&&x.track&&I.tag!==null&&x.track(M.path(),H,M.length,"tagged"),x&&x.track&&I.tag!==null&&x.track(M.path(),M.offset,M.length,"content"),I.any?k=k:I.choice===null?k=this._decodeGeneric(I.tag,M,x):k=this._decodeChoice(M,x),M.isError(k))return k;if(!I.any&&I.choice===null&&I.children!==null&&I.children.forEach(function(Et){Et._decode(M,x)}),I.contains&&(I.tag==="octstr"||I.tag==="bitstr")){var Bt=new s(k);k=this._getUse(I.contains,M._reporterState.obj)._decode(Bt,x)}}return I.obj&&D&&(k=M.leaveObject($)),I.key!==null&&(k!==null||D===!0)?M.leaveKey(L,I.key,k):L!==null&&M.exitKey(L),k},y.prototype._decodeGeneric=function(M,x,I){var k=this._baseState;return M==="seq"||M==="set"?null:M==="seqof"||M==="setof"?this._decodeList(x,M,k.args[0],I):/str$/.test(M)?this._decodeStr(x,M,I):M==="objid"&&k.args?this._decodeObjid(x,k.args[0],k.args[1],I):M==="objid"?this._decodeObjid(x,null,null,I):M==="gentime"||M==="utctime"?this._decodeTime(x,M,I):M==="null_"?this._decodeNull(x,I):M==="bool"?this._decodeBool(x,I):M==="objDesc"?this._decodeStr(x,M,I):M==="int"||M==="enum"?this._decodeInt(x,k.args&&k.args[0],I):k.use!==null?this._getUse(k.use,x._reporterState.obj)._decode(x,I):x.error("unknown tag: "+M)},y.prototype._getUse=function(M,x){var I=this._baseState;return I.useDecoder=this._use(M,x),o(I.useDecoder._baseState.parent===null),I.useDecoder=I.useDecoder._baseState.children[0],I.implicit!==I.useDecoder._baseState.implicit&&(I.useDecoder=I.useDecoder.clone(),I.useDecoder._baseState.implicit=I.implicit),I.useDecoder},y.prototype._decodeChoice=function(M,x){var I=this._baseState,k=null,D=!1;return Object.keys(I.choice).some(function(L){var W=M.save(),z=I.choice[L];try{var $=z._decode(M,x);if(M.isError($))return!1;k={type:L,value:$},D=!0}catch(lt){return M.restore(W),!1}return!0},this),D?k:M.error("Choice not matched")},y.prototype._createEncoderBuffer=function(M){return new n(M,this.reporter)},y.prototype._encode=function(M,x,I){var k=this._baseState;if(!(k.default!==null&&k.default===M)){var D=this._encodeValue(M,x,I);if(D!==void 0&&!this._skipDefault(D,x,I))return D}},y.prototype._encodeValue=function(M,x,I){var k=this._baseState;if(k.parent===null)return k.children[0]._encode(M,x||new h);var z=null;if(this.reporter=x,k.optional&&M===void 0)if(k.default!==null)M=k.default;else return;var D=null,L=!1;if(k.any)z=this._createEncoderBuffer(M);else if(k.choice)z=this._encodeChoice(M,x);else if(k.contains)D=this._getUse(k.contains,I)._encode(M,x),L=!0;else if(k.children)D=k.children.map(function(H){if(H._baseState.tag==="null_")return H._encode(null,x,M);if(H._baseState.key===null)return x.error("Child should have a key");var At=x.enterKey(H._baseState.key);if(typeof M!="object")return x.error("Child expected, but input is not object");var Bt=H._encode(M[H._baseState.key],x,M);return x.leaveKey(At),Bt},this).filter(function(H){return H}),D=this._createEncoderBuffer(D);else if(k.tag==="seqof"||k.tag==="setof"){if(!(k.args&&k.args.length===1))return x.error("Too many args for : "+k.tag);if(!Array.isArray(M))return x.error("seqof/setof, but data is not Array");var W=this.clone();W._baseState.implicit=null,D=this._createEncoderBuffer(M.map(function(H){var At=this._baseState;return this._getUse(At.args[0],M)._encode(H,x)},W))}else k.use!==null?z=this._getUse(k.use,I)._encode(M,x):(D=this._encodePrimitive(k.tag,M),L=!0);var z;if(!k.any&&k.choice===null){var $=k.implicit!==null?k.implicit:k.tag,lt=k.implicit===null?"universal":"context";$===null?k.use===null&&x.error("Tag could be omitted only for .use()"):k.use===null&&(z=this._encodeComposite($,L,lt,D))}return k.explicit!==null&&(z=this._encodeComposite(k.explicit,!1,"context",z)),z},y.prototype._encodeChoice=function(M,x){var I=this._baseState,k=I.choice[M.type];return k||o(!1,M.type+" not found in "+JSON.stringify(Object.keys(I.choice))),k._encode(M.value,x)},y.prototype._encodePrimitive=function(M,x){var I=this._baseState;if(/str$/.test(M))return this._encodeStr(x,M);if(M==="objid"&&I.args)return this._encodeObjid(x,I.reverseArgs[0],I.args[1]);if(M==="objid")return this._encodeObjid(x,null,null);if(M==="gentime"||M==="utctime")return this._encodeTime(x,M);if(M==="null_")return this._encodeNull();if(M==="int"||M==="enum")return this._encodeInt(x,I.args&&I.reverseArgs[0]);if(M==="bool")return this._encodeBool(x);if(M==="objDesc")return this._encodeStr(x,M);throw new Error("Unsupported tag: "+M)},y.prototype._isNumstr=function(M){return/^[0-9 ]*$/.test(M)},y.prototype._isPrintstr=function(M){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(M)},Uf}var Ga;function Ui(){return Ga||(Ga=1,function(h){var n=h;n.Reporter=Fo.Reporter,n.DecoderBuffer=Ya().DecoderBuffer,n.EncoderBuffer=Ya().EncoderBuffer,n.Node=J2()}($f)),$f}var Lf={},Of={},Xa;function G2(){return Xa||(Xa=1,function(h){var n=qo();h.tagClass={0:"universal",1:"application",2:"context",3:"private"},h.tagClassByName=n._reverse(h.tagClass),h.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},h.tagByName=n._reverse(h.tag)}(Of)),Of}var ja;function qo(){return ja||(ja=1,function(h){var n=h;n._reverse=function(o){var m={};return Object.keys(o).forEach(function(f){(f|0)==f&&(f=f|0);var g=o[f];m[g]=f}),m},n.der=G2()}(Lf)),Lf}var zf={},Kf,Qa;function Po(){if(Qa)return Kf;Qa=1;var h=Jt,n=fn(),s=n.base,o=n.bignum,m=n.constants.der;function f(B){this.enc="der",this.name=B.name,this.entity=B,this.tree=new g,this.tree._init(B.body)}Kf=f,f.prototype.decode=function(M,x){return M instanceof s.DecoderBuffer||(M=new s.DecoderBuffer(M,x)),this.tree._decode(M,x)};function g(B){s.Node.call(this,"der",B)}h(g,s.Node),g.prototype._peekTag=function(M,x,I){if(M.isEmpty())return!1;var k=M.save(),D=y(M,'Failed to peek tag: "'+x+'"');return M.isError(D)?D:(M.restore(k),D.tag===x||D.tagStr===x||D.tagStr+"of"===x||I)},g.prototype._decodeTag=function(M,x,I){var k=y(M,'Failed to decode tag of "'+x+'"');if(M.isError(k))return k;var D=S(M,k.primitive,'Failed to get length of "'+x+'"');if(M.isError(D))return D;if(!I&&k.tag!==x&&k.tagStr!==x&&k.tagStr+"of"!==x)return M.error('Failed to match tag: "'+x+'"');if(k.primitive||D!==null)return M.skip(D,'Failed to match body of: "'+x+'"');var L=M.save(),W=this._skipUntilEnd(M,'Failed to skip indefinite length body: "'+this.tag+'"');return M.isError(W)?W:(D=M.offset-L.offset,M.restore(L),M.skip(D,'Failed to match body of: "'+x+'"'))},g.prototype._skipUntilEnd=function(M,x){for(;;){var I=y(M,x);if(M.isError(I))return I;var k=S(M,I.primitive,x);if(M.isError(k))return k;var D;if(I.primitive||k!==null?D=M.skip(k):D=this._skipUntilEnd(M,x),M.isError(D))return D;if(I.tagStr==="end")break}},g.prototype._decodeList=function(M,x,I,k){for(var D=[];!M.isEmpty();){var L=this._peekTag(M,"end");if(M.isError(L))return L;var W=I.decode(M,"der",k);if(M.isError(W)&&L)break;D.push(W)}return D},g.prototype._decodeStr=function(M,x){if(x==="bitstr"){var I=M.readUInt8();return M.isError(I)?I:{unused:I,data:M.raw()}}else if(x==="bmpstr"){var k=M.raw();if(k.length%2===1)return M.error("Decoding of string type: bmpstr length mismatch");for(var D="",L=0;L<k.length/2;L++)D+=String.fromCharCode(k.readUInt16BE(L*2));return D}else if(x==="numstr"){var W=M.raw().toString("ascii");return this._isNumstr(W)?W:M.error("Decoding of string type: numstr unsupported characters")}else{if(x==="octstr")return M.raw();if(x==="objDesc")return M.raw();if(x==="printstr"){var z=M.raw().toString("ascii");return this._isPrintstr(z)?z:M.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(x)?M.raw().toString():M.error("Decoding of string type: "+x+" unsupported")}},g.prototype._decodeObjid=function(M,x,I){for(var k,D=[],L=0;!M.isEmpty();){var W=M.readUInt8();L<<=7,L|=W&127,W&128||(D.push(L),L=0)}W&128&&D.push(L);var z=D[0]/40|0,$=D[0]%40;if(I?k=D:k=[z,$].concat(D.slice(1)),x){var lt=x[k.join(" ")];lt===void 0&&(lt=x[k.join(".")]),lt!==void 0&&(k=lt)}return k},g.prototype._decodeTime=function(M,x){var I=M.raw().toString();if(x==="gentime")var k=I.slice(0,4)|0,D=I.slice(4,6)|0,L=I.slice(6,8)|0,W=I.slice(8,10)|0,z=I.slice(10,12)|0,$=I.slice(12,14)|0;else if(x==="utctime"){var k=I.slice(0,2)|0,D=I.slice(2,4)|0,L=I.slice(4,6)|0,W=I.slice(6,8)|0,z=I.slice(8,10)|0,$=I.slice(10,12)|0;k<70?k=2e3+k:k=1900+k}else return M.error("Decoding "+x+" time is not supported yet");return Date.UTC(k,D-1,L,W,z,$,0)},g.prototype._decodeNull=function(M){return null},g.prototype._decodeBool=function(M){var x=M.readUInt8();return M.isError(x)?x:x!==0},g.prototype._decodeInt=function(M,x){var I=M.raw(),k=new o(I);return x&&(k=x[k.toString(10)]||k),k},g.prototype._use=function(M,x){return typeof M=="function"&&(M=M(x)),M._getDecoder("der").tree};function y(B,M){var x=B.readUInt8(M);if(B.isError(x))return x;var I=m.tagClass[x>>6],k=(x&32)===0;if((x&31)===31){var D=x;for(x=0;(D&128)===128;){if(D=B.readUInt8(M),B.isError(D))return D;x<<=7,x|=D&127}}else x&=31;var L=m.tag[x];return{cls:I,primitive:k,tag:x,tagStr:L}}function S(B,M,x){var I=B.readUInt8(x);if(B.isError(I))return I;if(!M&&I===128)return null;if(!(I&128))return I;var k=I&127;if(k>4)return B.error("length octect is too long");I=0;for(var D=0;D<k;D++){I<<=8;var L=B.readUInt8(x);if(B.isError(L))return L;I|=L}return I}return Kf}var Hf,th;function X2(){if(th)return Hf;th=1;var h=Jt,n=gr.Buffer,s=Po();function o(m){s.call(this,m),this.enc="pem"}return h(o,s),Hf=o,o.prototype.decode=function(f,g){for(var y=f.toString().split(/[\r\n]+/g),S=g.label.toUpperCase(),B=/^-----(BEGIN|END) ([^-]+)-----$/,M=-1,x=-1,I=0;I<y.length;I++){var k=y[I].match(B);if(k!==null&&k[2]===S)if(M===-1){if(k[1]!=="BEGIN")break;M=I}else{if(k[1]!=="END")break;x=I;break}}if(M===-1||x===-1)throw new Error("PEM section not found for: "+S);var D=y.slice(M+1,x).join("");D.replace(/[^a-z0-9\+\/=]+/gi,"");var L=new n(D,"base64");return s.prototype.decode.call(this,L,g)},Hf}var eh;function j2(){return eh||(eh=1,function(h){var n=h;n.der=Po(),n.pem=X2()}(zf)),zf}var Zf={},Wf,rh;function Do(){if(rh)return Wf;rh=1;var h=Jt,n=gr.Buffer,s=fn(),o=s.base,m=s.constants.der;function f(B){this.enc="der",this.name=B.name,this.entity=B,this.tree=new g,this.tree._init(B.body)}Wf=f,f.prototype.encode=function(M,x){return this.tree._encode(M,x).join()};function g(B){o.Node.call(this,"der",B)}h(g,o.Node),g.prototype._encodeComposite=function(M,x,I,k){var D=S(M,x,I,this.reporter);if(k.length<128){var z=new n(2);return z[0]=D,z[1]=k.length,this._createEncoderBuffer([z,k])}for(var L=1,W=k.length;W>=256;W>>=8)L++;var z=new n(1+1+L);z[0]=D,z[1]=128|L;for(var W=1+L,$=k.length;$>0;W--,$>>=8)z[W]=$&255;return this._createEncoderBuffer([z,k])},g.prototype._encodeStr=function(M,x){if(x==="bitstr")return this._createEncoderBuffer([M.unused|0,M.data]);if(x==="bmpstr"){for(var I=new n(M.length*2),k=0;k<M.length;k++)I.writeUInt16BE(M.charCodeAt(k),k*2);return this._createEncoderBuffer(I)}else return x==="numstr"?this._isNumstr(M)?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: numstr supports only digits and space"):x==="printstr"?this._isPrintstr(M)?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(x)?this._createEncoderBuffer(M):x==="objDesc"?this._createEncoderBuffer(M):this.reporter.error("Encoding of string type: "+x+" unsupported")},g.prototype._encodeObjid=function(M,x,I){if(typeof M=="string"){if(!x)return this.reporter.error("string objid given, but no values map found");if(!x.hasOwnProperty(M))return this.reporter.error("objid not found in values map");M=x[M].split(/[\s\.]+/g);for(var k=0;k<M.length;k++)M[k]|=0}else if(Array.isArray(M)){M=M.slice();for(var k=0;k<M.length;k++)M[k]|=0}if(!Array.isArray(M))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(M));if(!I){if(M[1]>=40)return this.reporter.error("Second objid identifier OOB");M.splice(0,2,M[0]*40+M[1])}for(var D=0,k=0;k<M.length;k++){var L=M[k];for(D++;L>=128;L>>=7)D++}for(var W=new n(D),z=W.length-1,k=M.length-1;k>=0;k--){var L=M[k];for(W[z--]=L&127;(L>>=7)>0;)W[z--]=128|L&127}return this._createEncoderBuffer(W)};function y(B){return B<10?"0"+B:B}g.prototype._encodeTime=function(M,x){var I,k=new Date(M);return x==="gentime"?I=[y(k.getFullYear()),y(k.getUTCMonth()+1),y(k.getUTCDate()),y(k.getUTCHours()),y(k.getUTCMinutes()),y(k.getUTCSeconds()),"Z"].join(""):x==="utctime"?I=[y(k.getFullYear()%100),y(k.getUTCMonth()+1),y(k.getUTCDate()),y(k.getUTCHours()),y(k.getUTCMinutes()),y(k.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+x+" time is not supported yet"),this._encodeStr(I,"octstr")},g.prototype._encodeNull=function(){return this._createEncoderBuffer("")},g.prototype._encodeInt=function(M,x){if(typeof M=="string"){if(!x)return this.reporter.error("String int or enum given, but no values map");if(!x.hasOwnProperty(M))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(M));M=x[M]}if(typeof M!="number"&&!n.isBuffer(M)){var I=M.toArray();!M.sign&&I[0]&128&&I.unshift(0),M=new n(I)}if(n.isBuffer(M)){var k=M.length;M.length===0&&k++;var L=new n(k);return M.copy(L),M.length===0&&(L[0]=0),this._createEncoderBuffer(L)}if(M<128)return this._createEncoderBuffer(M);if(M<256)return this._createEncoderBuffer([0,M]);for(var k=1,D=M;D>=256;D>>=8)k++;for(var L=new Array(k),D=L.length-1;D>=0;D--)L[D]=M&255,M>>=8;return L[0]&128&&L.unshift(0),this._createEncoderBuffer(new n(L))},g.prototype._encodeBool=function(M){return this._createEncoderBuffer(M?255:0)},g.prototype._use=function(M,x){return typeof M=="function"&&(M=M(x)),M._getEncoder("der").tree},g.prototype._skipDefault=function(M,x,I){var k=this._baseState,D;if(k.default===null)return!1;var L=M.join();if(k.defaultBuffer===void 0&&(k.defaultBuffer=this._encodeValue(k.default,x,I).join()),L.length!==k.defaultBuffer.length)return!1;for(D=0;D<L.length;D++)if(L[D]!==k.defaultBuffer[D])return!1;return!0};function S(B,M,x,I){var k;if(B==="seqof"?B="seq":B==="setof"&&(B="set"),m.tagByName.hasOwnProperty(B))k=m.tagByName[B];else if(typeof B=="number"&&(B|0)===B)k=B;else return I.error("Unknown tag: "+B);return k>=31?I.error("Multi-octet tag encoding unsupported"):(M||(k|=32),k|=m.tagClassByName[x||"universal"]<<6,k)}return Wf}var Vf,ih;function Q2(){if(ih)return Vf;ih=1;var h=Jt,n=Do();function s(o){n.call(this,o),this.enc="pem"}return h(s,n),Vf=s,s.prototype.encode=function(m,f){for(var g=n.prototype.encode.call(this,m),y=g.toString("base64"),S=["-----BEGIN "+f.label+"-----"],B=0;B<y.length;B+=64)S.push(y.slice(B,B+64));return S.push("-----END "+f.label+"-----"),S.join(`
|
|
15
|
+
`)},Vf}var nh;function tm(){return nh||(nh=1,function(h){var n=h;n.der=Do(),n.pem=Q2()}(Zf)),Zf}var fh;function fn(){return fh||(fh=1,function(h){var n=h;n.bignum=W2,n.define=V2().define,n.base=Ui(),n.constants=qo(),n.decoders=j2(),n.encoders=tm()}(Df)),Df}var ir=fn(),ah=ir.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),em=ir.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),V0=ir.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),rm=ir.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(V0),this.key("subjectPublicKey").bitstr())}),im=ir.define("RelativeDistinguishedName",function(){this.setof(em)}),nm=ir.define("RDNSequence",function(){this.seqof(im)}),hh=ir.define("Name",function(){this.choice({rdnSequence:this.use(nm)})}),fm=ir.define("Validity",function(){this.seq().obj(this.key("notBefore").use(ah),this.key("notAfter").use(ah))}),am=ir.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),hm=ir.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(V0),this.key("issuer").use(hh),this.key("validity").use(fm),this.key("subject").use(hh),this.key("subjectPublicKeyInfo").use(rm),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(am).optional())}),sm=ir.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(hm),this.key("signatureAlgorithm").use(V0),this.key("signatureValue").bitstr())}),om=sm,nr=fn();rr.certificate=om;var um=nr.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});rr.RSAPrivateKey=um;var lm=nr.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});rr.RSAPublicKey=lm;var No=nr.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),dm=nr.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(No),this.key("subjectPublicKey").bitstr())});rr.PublicKey=dm;var cm=nr.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(No),this.key("subjectPrivateKey").octstr())});rr.PrivateKey=cm;var vm=nr.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});rr.EncryptedPrivateKey=vm;var pm=nr.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});rr.DSAPrivateKey=pm;rr.DSAparam=nr.define("DSAparam",function(){this.int()});var mm=nr.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),gm=nr.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(mm),this.key("publicKey").optional().explicit(1).bitstr())});rr.ECPrivateKey=gm;rr.signature=nr.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())});const bm={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"};var ym=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,wm=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,Mm=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,xm=Wn,_m=Le,pn=Ot.Buffer,Sm=function(h,n){var s=h.toString(),o=s.match(ym),m;if(o){var g="aes"+o[1],y=pn.from(o[2],"hex"),S=pn.from(o[3].replace(/[\r\n]/g,""),"base64"),B=xm(n,y.slice(0,8),parseInt(o[1],10)).key,M=[],x=_m.createDecipheriv(g,B,y);M.push(x.update(S)),M.push(x.final()),m=pn.concat(M)}else{var f=s.match(Mm);m=pn.from(f[2].replace(/[\r\n]/g,""),"base64")}var I=s.match(wm)[1];return{tag:I,data:m}},qe=rr,Am=bm,Bm=Sm,Em=Le,km=Un,c0=Ot.Buffer;function Im(h,n){var s=h.algorithm.decrypt.kde.kdeparams.salt,o=parseInt(h.algorithm.decrypt.kde.kdeparams.iters.toString(),10),m=Am[h.algorithm.decrypt.cipher.algo.join(".")],f=h.algorithm.decrypt.cipher.iv,g=h.subjectPrivateKey,y=parseInt(m.split("-")[1],10)/8,S=km.pbkdf2Sync(n,s,o,y,"sha1"),B=Em.createDecipheriv(m,S,f),M=[];return M.push(B.update(g)),M.push(B.final()),c0.concat(M)}function $o(h){var n;typeof h=="object"&&!c0.isBuffer(h)&&(n=h.passphrase,h=h.key),typeof h=="string"&&(h=c0.from(h));var s=Bm(h,n),o=s.tag,m=s.data,f,g;switch(o){case"CERTIFICATE":g=qe.certificate.decode(m,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(g||(g=qe.PublicKey.decode(m,"der")),f=g.algorithm.algorithm.join("."),f){case"1.2.840.113549.1.1.1":return qe.RSAPublicKey.decode(g.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return g.subjectPrivateKey=g.subjectPublicKey,{type:"ec",data:g};case"1.2.840.10040.4.1":return g.algorithm.params.pub_key=qe.DSAparam.decode(g.subjectPublicKey.data,"der"),{type:"dsa",data:g.algorithm.params};default:throw new Error("unknown key id "+f)}case"ENCRYPTED PRIVATE KEY":m=qe.EncryptedPrivateKey.decode(m,"der"),m=Im(m,n);case"PRIVATE KEY":switch(g=qe.PrivateKey.decode(m,"der"),f=g.algorithm.algorithm.join("."),f){case"1.2.840.113549.1.1.1":return qe.RSAPrivateKey.decode(g.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:g.algorithm.curve,privateKey:qe.ECPrivateKey.decode(g.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return g.algorithm.params.priv_key=qe.DSAparam.decode(g.subjectPrivateKey,"der"),{type:"dsa",params:g.algorithm.params};default:throw new Error("unknown key id "+f)}case"RSA PUBLIC KEY":return qe.RSAPublicKey.decode(m,"der");case"RSA PRIVATE KEY":return qe.RSAPrivateKey.decode(m,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:qe.DSAPrivateKey.decode(m,"der")};case"EC PRIVATE KEY":return m=qe.ECPrivateKey.decode(m,"der"),{curve:m.parameters.value,privateKey:m.privateKey};default:throw new Error("unknown key type "+o)}}$o.signature=qe.signature;var sf=$o;const Uo={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"};var sh;function Rm(){if(sh)return Ci.exports;sh=1;var h=Ot.Buffer,n=Vh,s=U0,o=Z0().ec,m=$0,f=sf,g=Uo,y=1;function S(z,$,lt,H,At){var Bt=f($);if(Bt.curve){if(H!=="ecdsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");return B(z,Bt)}else if(Bt.type==="dsa"){if(H!=="dsa")throw new Error("wrong private key type");return M(z,Bt,lt)}if(H!=="rsa"&&H!=="ecdsa/rsa")throw new Error("wrong private key type");if($.padding!==void 0&&$.padding!==y)throw new Error("illegal or unsupported padding mode");z=h.concat([At,z]);for(var Ct=Bt.modulus.byteLength(),Et=[0,1];z.length+Et.length+1<Ct;)Et.push(255);Et.push(0);for(var Y=-1;++Y<z.length;)Et.push(z[Y]);var It=s(Et,Bt);return It}function B(z,$){var lt=g[$.curve.join(".")];if(!lt)throw new Error("unknown curve "+$.curve.join("."));var H=new o(lt),At=H.keyFromPrivate($.privateKey),Bt=At.sign(z);return h.from(Bt.toDER())}function M(z,$,lt){for(var H=$.params.priv_key,At=$.params.p,Bt=$.params.q,Ct=$.params.g,Et=new m(0),Y,It=k(z,Bt).mod(Bt),p=!1,t=I(H,Bt,z,lt);p===!1;)Y=L(Bt,t,lt),Et=W(Ct,Y,At,Bt),p=Y.invm(Bt).imul(It.add(H.mul(Et))).mod(Bt),p.cmpn(0)===0&&(p=!1,Et=new m(0));return x(Et,p)}function x(z,$){z=z.toArray(),$=$.toArray(),z[0]&128&&(z=[0].concat(z)),$[0]&128&&($=[0].concat($));var lt=z.length+$.length+4,H=[48,lt,2,z.length];return H=H.concat(z,[2,$.length],$),h.from(H)}function I(z,$,lt,H){if(z=h.from(z.toArray()),z.length<$.byteLength()){var At=h.alloc($.byteLength()-z.length);z=h.concat([At,z])}var Bt=lt.length,Ct=D(lt,$),Et=h.alloc(Bt);Et.fill(1);var Y=h.alloc(Bt);return Y=n(H,Y).update(Et).update(h.from([0])).update(z).update(Ct).digest(),Et=n(H,Y).update(Et).digest(),Y=n(H,Y).update(Et).update(h.from([1])).update(z).update(Ct).digest(),Et=n(H,Y).update(Et).digest(),{k:Y,v:Et}}function k(z,$){var lt=new m(z),H=(z.length<<3)-$.bitLength();return H>0&<.ishrn(H),lt}function D(z,$){z=k(z,$),z=z.mod($);var lt=h.from(z.toArray());if(lt.length<$.byteLength()){var H=h.alloc($.byteLength()-lt.length);lt=h.concat([H,lt])}return lt}function L(z,$,lt){var H,At;do{for(H=h.alloc(0);H.length*8<z.bitLength();)$.v=n(lt,$.k).update($.v).digest(),H=h.concat([H,$.v]);At=k(H,z),$.k=n(lt,$.k).update($.v).update(h.from([0])).digest(),$.v=n(lt,$.k).update($.v).digest()}while(At.cmp(z)!==-1);return At}function W(z,$,lt,H){return z.toRed(m.mont(lt)).redPow($).fromRed().mod(H)}return Ci.exports=S,Ci.exports.getKey=I,Ci.exports.makeKey=L,Ci.exports}var Yf,oh;function Tm(){if(oh)return Yf;oh=1;var h=Ot.Buffer,n=$0,s=Z0().ec,o=sf,m=Uo;function f(B,M,x,I,k){var D=o(x);if(D.type==="ec"){if(I!=="ecdsa"&&I!=="ecdsa/rsa")throw new Error("wrong public key type");return g(B,M,D)}else if(D.type==="dsa"){if(I!=="dsa")throw new Error("wrong public key type");return y(B,M,D)}if(I!=="rsa"&&I!=="ecdsa/rsa")throw new Error("wrong public key type");M=h.concat([k,M]);for(var L=D.modulus.byteLength(),W=[1],z=0;M.length+W.length+2<L;)W.push(255),z+=1;W.push(0);for(var $=-1;++$<M.length;)W.push(M[$]);W=h.from(W);var lt=n.mont(D.modulus);B=new n(B).toRed(lt),B=B.redPow(new n(D.publicExponent)),B=h.from(B.fromRed().toArray());var H=z<8?1:0;for(L=Math.min(B.length,W.length),B.length!==W.length&&(H=1),$=-1;++$<L;)H|=B[$]^W[$];return H===0}function g(B,M,x){var I=m[x.data.algorithm.curve.join(".")];if(!I)throw new Error("unknown curve "+x.data.algorithm.curve.join("."));var k=new s(I),D=x.data.subjectPrivateKey.data;return k.verify(M,B,D)}function y(B,M,x){var I=x.data.p,k=x.data.q,D=x.data.g,L=x.data.pub_key,W=o.signature.decode(B,"der"),z=W.s,$=W.r;S(z,k),S($,k);var lt=n.mont(I),H=z.invm(k),At=D.toRed(lt).redPow(new n(M).mul(H).mod(k)).fromRed().mul(L.toRed(lt).redPow($.mul(H).mod(k)).fromRed()).mod(I).mod(k);return At.cmp($)===0}function S(B,M){if(B.cmpn(0)<=0)throw new Error("invalid sig");if(B.cmp(M)>=0)throw new Error("invalid sig")}return Yf=f,Yf}var Jf,uh;function Cm(){if(uh)return Jf;uh=1;var h=Ot.Buffer,n=Gi,s=kv,o=Jt,m=Rm(),f=Tm(),g=Yh;Object.keys(g).forEach(function(x){g[x].id=h.from(g[x].id,"hex"),g[x.toLowerCase()]=g[x]});function y(x){s.Writable.call(this);var I=g[x];if(!I)throw new Error("Unknown message digest");this._hashType=I.hash,this._hash=n(I.hash),this._tag=I.id,this._signType=I.sign}o(y,s.Writable),y.prototype._write=function(I,k,D){this._hash.update(I),D()},y.prototype.update=function(I,k){return this._hash.update(typeof I=="string"?h.from(I,k):I),this},y.prototype.sign=function(I,k){this.end();var D=this._hash.digest(),L=m(D,I,this._hashType,this._signType,this._tag);return k?L.toString(k):L};function S(x){s.Writable.call(this);var I=g[x];if(!I)throw new Error("Unknown message digest");this._hash=n(I.hash),this._tag=I.id,this._signType=I.sign}o(S,s.Writable),S.prototype._write=function(I,k,D){this._hash.update(I),D()},S.prototype.update=function(I,k){return this._hash.update(typeof I=="string"?h.from(I,k):I),this},S.prototype.verify=function(I,k,D){var L=typeof k=="string"?h.from(k,D):k;this.end();var W=this._hash.digest();return f(L,W,I,this._signType,this._tag)};function B(x){return new y(x)}function M(x){return new S(x)}return Jf={Sign:B,Verify:M,createSign:B,createVerify:M},Jf}var Y0={exports:{}};Y0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(Y0);var Fm=Y0.exports,Gf,lh;function qm(){if(lh)return Gf;lh=1;var h=Z0(),n=Fm;Gf=function(g){return new o(g)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1;function o(f){this.curveType=s[f],this.curveType||(this.curveType={name:f}),this.curve=new h.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(f,g){return this.keys=this.curve.genKeyPair(),this.getPublicKey(f,g)},o.prototype.computeSecret=function(f,g,y){g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g));var S=this.curve.keyFromPublic(f).getPublic(),B=S.mul(this.keys.getPrivate()).getX();return m(B,y,this.curveType.byteLength)},o.prototype.getPublicKey=function(f,g){var y=this.keys.getPublic(g==="compressed",!0);return g==="hybrid"&&(y[y.length-1]%2?y[0]=7:y[0]=6),m(y,f)},o.prototype.getPrivateKey=function(f){return m(this.keys.getPrivate(),f)},o.prototype.setPublicKey=function(f,g){return g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g)),this.keys._importPublic(f),this},o.prototype.setPrivateKey=function(f,g){g=g||"utf8",mt.isBuffer(f)||(f=new mt(f,g));var y=new n(f);return y=y.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(y),this};function m(f,g,y){Array.isArray(f)||(f=f.toArray());var S=new mt(f);if(y&&S.length<y){var B=new mt(y-S.length);B.fill(0),S=mt.concat([B,S])}return g?S.toString(g):S}return Gf}var Lo={},Pm=Gi,v0=Ot.Buffer,Oo=function(h,n){for(var s=v0.alloc(0),o=0,m;s.length<n;)m=Dm(o++),s=v0.concat([s,Pm("sha1").update(h).update(m).digest()]);return s.slice(0,n)};function Dm(h){var n=v0.allocUnsafe(4);return n.writeUInt32BE(h,0),n}var zo=function(n,s){for(var o=n.length,m=-1;++m<o;)n[m]^=s[m];return n},J0={exports:{}};J0.exports;(function(h){(function(n,s){function o(p,t){if(!p)throw new Error(t||"Assertion failed")}function m(p,t){p.super_=t;var r=function(){};r.prototype=t.prototype,p.prototype=new r,p.prototype.constructor=p}function f(p,t,r){if(f.isBN(p))return p;this.negative=0,this.words=null,this.length=0,this.red=null,p!==null&&((t==="le"||t==="be")&&(r=t,t=10),this._init(p||0,t||10,r||"be"))}typeof n=="object"?n.exports=f:s.BN=f,f.BN=f,f.wordSize=26;var g;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?g=window.Buffer:g=De.Buffer}catch(p){}f.isBN=function(t){return t instanceof f?!0:t!==null&&typeof t=="object"&&t.constructor.wordSize===f.wordSize&&Array.isArray(t.words)},f.max=function(t,r){return t.cmp(r)>0?t:r},f.min=function(t,r){return t.cmp(r)<0?t:r},f.prototype._init=function(t,r,i){if(typeof t=="number")return this._initNumber(t,r,i);if(typeof t=="object")return this._initArray(t,r,i);r==="hex"&&(r=16),o(r===(r|0)&&r>=2&&r<=36),t=t.toString().replace(/\s+/g,"");var a=0;t[0]==="-"&&(a++,this.negative=1),a<t.length&&(r===16?this._parseHex(t,a,i):(this._parseBase(t,r,a),i==="le"&&this._initArray(this.toArray(),r,i)))},f.prototype._initNumber=function(t,r,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[t&67108863],this.length=1):t<4503599627370496?(this.words=[t&67108863,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[t&67108863,t/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),r,i)},f.prototype._initArray=function(t,r,i){if(o(typeof t.length=="number"),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d,c,v=0;if(i==="be")for(a=t.length-1,d=0;a>=0;a-=3)c=t[a]|t[a-1]<<8|t[a-2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);else if(i==="le")for(a=0,d=0;a<t.length;a+=3)c=t[a]|t[a+1]<<8|t[a+2]<<16,this.words[d]|=c<<v&67108863,this.words[d+1]=c>>>26-v&67108863,v+=24,v>=26&&(v-=26,d++);return this.strip()};function y(p,t){var r=p.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function S(p,t,r){var i=y(p,r);return r-1>=t&&(i|=y(p,r-1)<<4),i}f.prototype._parseHex=function(t,r,i){this.length=Math.ceil((t.length-r)/6),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var d=0,c=0,v;if(i==="be")for(a=t.length-1;a>=r;a-=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8;else{var u=t.length-r;for(a=u%2===0?r+1:r;a<t.length;a+=2)v=S(t,r,a)<<d,this.words[c]|=v&67108863,d>=18?(d-=18,c+=1,this.words[c]|=v>>>26):d+=8}this.strip()};function B(p,t,r,i){for(var a=0,d=Math.min(p.length,r),c=t;c<d;c++){var v=p.charCodeAt(c)-48;a*=i,v>=49?a+=v-49+10:v>=17?a+=v-17+10:a+=v}return a}f.prototype._parseBase=function(t,r,i){this.words=[0],this.length=1;for(var a=0,d=1;d<=67108863;d*=r)a++;a--,d=d/r|0;for(var c=t.length-i,v=c%a,u=Math.min(c,c-v)+i,e=0,l=i;l<u;l+=a)e=B(t,l,l+a,r),this.imuln(d),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e);if(v!==0){var b=1;for(e=B(t,l,t.length,r),l=0;l<v;l++)b*=r;this.imuln(b),this.words[0]+e<67108864?this.words[0]+=e:this._iaddn(e)}this.strip()},f.prototype.copy=function(t){t.words=new Array(this.length);for(var r=0;r<this.length;r++)t.words[r]=this.words[r];t.length=this.length,t.negative=this.negative,t.red=this.red},f.prototype.clone=function(){var t=new f(null);return this.copy(t),t},f.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];f.prototype.toString=function(t,r){t=t||10,r=r|0||1;var i;if(t===16||t==="hex"){i="";for(var a=0,d=0,c=0;c<this.length;c++){var v=this.words[c],u=((v<<a|d)&16777215).toString(16);d=v>>>24-a&16777215,a+=2,a>=26&&(a-=26,c--),d!==0||c!==this.length-1?i=M[6-u.length]+u+i:i=u+i}for(d!==0&&(i=d.toString(16)+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(t===(t|0)&&t>=2&&t<=36){var e=x[t],l=I[t];i="";var b=this.clone();for(b.negative=0;!b.isZero();){var _=b.modn(l).toString(t);b=b.idivn(l),b.isZero()?i=_+i:i=M[e-_.length]+_+i}for(this.isZero()&&(i="0"+i);i.length%r!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}o(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var t=this.words[0];return this.length===2?t+=this.words[1]*67108864:this.length===3&&this.words[2]===1?t+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-t:t},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(t,r){return o(typeof g!="undefined"),this.toArrayLike(g,t,r)},f.prototype.toArray=function(t,r){return this.toArrayLike(Array,t,r)},f.prototype.toArrayLike=function(t,r,i){var a=this.byteLength(),d=i||Math.max(1,a);o(a<=d,"byte array longer than desired length"),o(d>0,"Requested array length <= 0"),this.strip();var c=r==="le",v=new t(d),u,e,l=this.clone();if(c){for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[e]=u;for(;e<d;e++)v[e]=0}else{for(e=0;e<d-a;e++)v[e]=0;for(e=0;!l.isZero();e++)u=l.andln(255),l.iushrn(8),v[d-e-1]=u}return v},Math.clz32?f.prototype._countBits=function(t){return 32-Math.clz32(t)}:f.prototype._countBits=function(t){var r=t,i=0;return r>=4096&&(i+=13,r>>>=13),r>=64&&(i+=7,r>>>=7),r>=8&&(i+=4,r>>>=4),r>=2&&(i+=2,r>>>=2),i+r},f.prototype._zeroBits=function(t){if(t===0)return 26;var r=t,i=0;return r&8191||(i+=13,r>>>=13),r&127||(i+=7,r>>>=7),r&15||(i+=4,r>>>=4),r&3||(i+=2,r>>>=2),r&1||i++,i},f.prototype.bitLength=function(){var t=this.words[this.length-1],r=this._countBits(t);return(this.length-1)*26+r};function k(p){for(var t=new Array(p.bitLength()),r=0;r<t.length;r++){var i=r/26|0,a=r%26;t[r]=(p.words[i]&1<<a)>>>a}return t}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,r=0;r<this.length;r++){var i=this._zeroBits(this.words[r]);if(t+=i,i!==26)break}return t},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(t){return this.negative!==0?this.abs().inotn(t).iaddn(1):this.clone()},f.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]|t.words[r];return this.strip()},f.prototype.ior=function(t){return o((this.negative|t.negative)===0),this.iuor(t)},f.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},f.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},f.prototype.iuand=function(t){var r;this.length>t.length?r=t:r=this;for(var i=0;i<r.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=r.length,this.strip()},f.prototype.iand=function(t){return o((this.negative|t.negative)===0),this.iuand(t)},f.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},f.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},f.prototype.iuxor=function(t){var r,i;this.length>t.length?(r=this,i=t):(r=t,i=this);for(var a=0;a<i.length;a++)this.words[a]=r.words[a]^i.words[a];if(this!==r)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=r.length,this.strip()},f.prototype.ixor=function(t){return o((this.negative|t.negative)===0),this.iuxor(t)},f.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},f.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},f.prototype.inotn=function(t){o(typeof t=="number"&&t>=0);var r=Math.ceil(t/26)|0,i=t%26;this._expand(r),i>0&&r--;for(var a=0;a<r;a++)this.words[a]=~this.words[a]&67108863;return i>0&&(this.words[a]=~this.words[a]&67108863>>26-i),this.strip()},f.prototype.notn=function(t){return this.clone().inotn(t)},f.prototype.setn=function(t,r){o(typeof t=="number"&&t>=0);var i=t/26|0,a=t%26;return this._expand(i+1),r?this.words[i]=this.words[i]|1<<a:this.words[i]=this.words[i]&~(1<<a),this.strip()},f.prototype.iadd=function(t){var r;if(this.negative!==0&&t.negative===0)return this.negative=0,r=this.isub(t),this.negative^=1,this._normSign();if(this.negative===0&&t.negative!==0)return t.negative=0,r=this.isub(t),t.negative=1,r._normSign();var i,a;this.length>t.length?(i=this,a=t):(i=t,a=this);for(var d=0,c=0;c<a.length;c++)r=(i.words[c]|0)+(a.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;for(;d!==0&&c<i.length;c++)r=(i.words[c]|0)+d,this.words[c]=r&67108863,d=r>>>26;if(this.length=i.length,d!==0)this.words[this.length]=d,this.length++;else if(i!==this)for(;c<i.length;c++)this.words[c]=i.words[c];return this},f.prototype.add=function(t){var r;return t.negative!==0&&this.negative===0?(t.negative=0,r=this.sub(t),t.negative^=1,r):t.negative===0&&this.negative!==0?(this.negative=0,r=t.sub(this),this.negative=1,r):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},f.prototype.isub=function(t){if(t.negative!==0){t.negative=0;var r=this.iadd(t);return t.negative=1,r._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i=this.cmp(t);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var a,d;i>0?(a=this,d=t):(a=t,d=this);for(var c=0,v=0;v<d.length;v++)r=(a.words[v]|0)-(d.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;for(;c!==0&&v<a.length;v++)r=(a.words[v]|0)+c,c=r>>26,this.words[v]=r&67108863;if(c===0&&v<a.length&&a!==this)for(;v<a.length;v++)this.words[v]=a.words[v];return this.length=Math.max(this.length,v),a!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(t){return this.clone().isub(t)};function D(p,t,r){r.negative=t.negative^p.negative;var i=p.length+t.length|0;r.length=i,i=i-1|0;var a=p.words[0]|0,d=t.words[0]|0,c=a*d,v=c&67108863,u=c/67108864|0;r.words[0]=v;for(var e=1;e<i;e++){for(var l=u>>>26,b=u&67108863,_=Math.min(e,t.length-1),C=Math.max(0,e-p.length+1);C<=_;C++){var q=e-C|0;a=p.words[q]|0,d=t.words[C]|0,c=a*d+b,l+=c/67108864|0,b=c&67108863}r.words[e]=b|0,u=l|0}return u!==0?r.words[e]=u|0:r.length--,r.strip()}var L=function(t,r,i){var a=t.words,d=r.words,c=i.words,v=0,u,e,l,b=a[0]|0,_=b&8191,C=b>>>13,q=a[1]|0,O=q&8191,R=q>>>13,P=a[2]|0,N=P&8191,K=P>>>13,kt=a[3]|0,Z=kt&8191,J=kt>>>13,Ft=a[4]|0,tt=Ft&8191,vt=Ft>>>13,Dt=a[5]|0,et=Dt&8191,pt=Dt>>>13,Pt=a[6]|0,j=Pt&8191,dt=Pt>>>13,qt=a[7]|0,Q=qt&8191,ct=qt>>>13,Lt=a[8]|0,E=Lt&8191,w=Lt>>>13,A=a[9]|0,T=A&8191,F=A>>>13,V=d[0]|0,U=V&8191,X=V>>>13,Tt=d[1]|0,G=Tt&8191,rt=Tt>>>13,Rt=d[2]|0,it=Rt&8191,gt=Rt>>>13,zt=d[3]|0,nt=zt&8191,bt=zt>>>13,Kt=d[4]|0,ft=Kt&8191,yt=Kt>>>13,Ht=d[5]|0,at=Ht&8191,wt=Ht>>>13,Zt=d[6]|0,ht=Zt&8191,Mt=Zt>>>13,Wt=d[7]|0,st=Wt&8191,xt=Wt>>>13,Vt=d[8]|0,ot=Vt&8191,_t=Vt>>>13,Yt=d[9]|0,ut=Yt&8191,St=Yt>>>13;i.negative=t.negative^r.negative,i.length=19,u=Math.imul(_,U),e=Math.imul(_,X),e=e+Math.imul(C,U)|0,l=Math.imul(C,X);var Nt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u=Math.imul(O,U),e=Math.imul(O,X),e=e+Math.imul(R,U)|0,l=Math.imul(R,X),u=u+Math.imul(_,G)|0,e=e+Math.imul(_,rt)|0,e=e+Math.imul(C,G)|0,l=l+Math.imul(C,rt)|0;var $t=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+($t>>>26)|0,$t&=67108863,u=Math.imul(N,U),e=Math.imul(N,X),e=e+Math.imul(K,U)|0,l=Math.imul(K,X),u=u+Math.imul(O,G)|0,e=e+Math.imul(O,rt)|0,e=e+Math.imul(R,G)|0,l=l+Math.imul(R,rt)|0,u=u+Math.imul(_,it)|0,e=e+Math.imul(_,gt)|0,e=e+Math.imul(C,it)|0,l=l+Math.imul(C,gt)|0;var jt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(jt>>>26)|0,jt&=67108863,u=Math.imul(Z,U),e=Math.imul(Z,X),e=e+Math.imul(J,U)|0,l=Math.imul(J,X),u=u+Math.imul(N,G)|0,e=e+Math.imul(N,rt)|0,e=e+Math.imul(K,G)|0,l=l+Math.imul(K,rt)|0,u=u+Math.imul(O,it)|0,e=e+Math.imul(O,gt)|0,e=e+Math.imul(R,it)|0,l=l+Math.imul(R,gt)|0,u=u+Math.imul(_,nt)|0,e=e+Math.imul(_,bt)|0,e=e+Math.imul(C,nt)|0,l=l+Math.imul(C,bt)|0;var Qt=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,u=Math.imul(tt,U),e=Math.imul(tt,X),e=e+Math.imul(vt,U)|0,l=Math.imul(vt,X),u=u+Math.imul(Z,G)|0,e=e+Math.imul(Z,rt)|0,e=e+Math.imul(J,G)|0,l=l+Math.imul(J,rt)|0,u=u+Math.imul(N,it)|0,e=e+Math.imul(N,gt)|0,e=e+Math.imul(K,it)|0,l=l+Math.imul(K,gt)|0,u=u+Math.imul(O,nt)|0,e=e+Math.imul(O,bt)|0,e=e+Math.imul(R,nt)|0,l=l+Math.imul(R,bt)|0,u=u+Math.imul(_,ft)|0,e=e+Math.imul(_,yt)|0,e=e+Math.imul(C,ft)|0,l=l+Math.imul(C,yt)|0;var te=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(te>>>26)|0,te&=67108863,u=Math.imul(et,U),e=Math.imul(et,X),e=e+Math.imul(pt,U)|0,l=Math.imul(pt,X),u=u+Math.imul(tt,G)|0,e=e+Math.imul(tt,rt)|0,e=e+Math.imul(vt,G)|0,l=l+Math.imul(vt,rt)|0,u=u+Math.imul(Z,it)|0,e=e+Math.imul(Z,gt)|0,e=e+Math.imul(J,it)|0,l=l+Math.imul(J,gt)|0,u=u+Math.imul(N,nt)|0,e=e+Math.imul(N,bt)|0,e=e+Math.imul(K,nt)|0,l=l+Math.imul(K,bt)|0,u=u+Math.imul(O,ft)|0,e=e+Math.imul(O,yt)|0,e=e+Math.imul(R,ft)|0,l=l+Math.imul(R,yt)|0,u=u+Math.imul(_,at)|0,e=e+Math.imul(_,wt)|0,e=e+Math.imul(C,at)|0,l=l+Math.imul(C,wt)|0;var ee=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ee>>>26)|0,ee&=67108863,u=Math.imul(j,U),e=Math.imul(j,X),e=e+Math.imul(dt,U)|0,l=Math.imul(dt,X),u=u+Math.imul(et,G)|0,e=e+Math.imul(et,rt)|0,e=e+Math.imul(pt,G)|0,l=l+Math.imul(pt,rt)|0,u=u+Math.imul(tt,it)|0,e=e+Math.imul(tt,gt)|0,e=e+Math.imul(vt,it)|0,l=l+Math.imul(vt,gt)|0,u=u+Math.imul(Z,nt)|0,e=e+Math.imul(Z,bt)|0,e=e+Math.imul(J,nt)|0,l=l+Math.imul(J,bt)|0,u=u+Math.imul(N,ft)|0,e=e+Math.imul(N,yt)|0,e=e+Math.imul(K,ft)|0,l=l+Math.imul(K,yt)|0,u=u+Math.imul(O,at)|0,e=e+Math.imul(O,wt)|0,e=e+Math.imul(R,at)|0,l=l+Math.imul(R,wt)|0,u=u+Math.imul(_,ht)|0,e=e+Math.imul(_,Mt)|0,e=e+Math.imul(C,ht)|0,l=l+Math.imul(C,Mt)|0;var re=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(re>>>26)|0,re&=67108863,u=Math.imul(Q,U),e=Math.imul(Q,X),e=e+Math.imul(ct,U)|0,l=Math.imul(ct,X),u=u+Math.imul(j,G)|0,e=e+Math.imul(j,rt)|0,e=e+Math.imul(dt,G)|0,l=l+Math.imul(dt,rt)|0,u=u+Math.imul(et,it)|0,e=e+Math.imul(et,gt)|0,e=e+Math.imul(pt,it)|0,l=l+Math.imul(pt,gt)|0,u=u+Math.imul(tt,nt)|0,e=e+Math.imul(tt,bt)|0,e=e+Math.imul(vt,nt)|0,l=l+Math.imul(vt,bt)|0,u=u+Math.imul(Z,ft)|0,e=e+Math.imul(Z,yt)|0,e=e+Math.imul(J,ft)|0,l=l+Math.imul(J,yt)|0,u=u+Math.imul(N,at)|0,e=e+Math.imul(N,wt)|0,e=e+Math.imul(K,at)|0,l=l+Math.imul(K,wt)|0,u=u+Math.imul(O,ht)|0,e=e+Math.imul(O,Mt)|0,e=e+Math.imul(R,ht)|0,l=l+Math.imul(R,Mt)|0,u=u+Math.imul(_,st)|0,e=e+Math.imul(_,xt)|0,e=e+Math.imul(C,st)|0,l=l+Math.imul(C,xt)|0;var ie=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ie>>>26)|0,ie&=67108863,u=Math.imul(E,U),e=Math.imul(E,X),e=e+Math.imul(w,U)|0,l=Math.imul(w,X),u=u+Math.imul(Q,G)|0,e=e+Math.imul(Q,rt)|0,e=e+Math.imul(ct,G)|0,l=l+Math.imul(ct,rt)|0,u=u+Math.imul(j,it)|0,e=e+Math.imul(j,gt)|0,e=e+Math.imul(dt,it)|0,l=l+Math.imul(dt,gt)|0,u=u+Math.imul(et,nt)|0,e=e+Math.imul(et,bt)|0,e=e+Math.imul(pt,nt)|0,l=l+Math.imul(pt,bt)|0,u=u+Math.imul(tt,ft)|0,e=e+Math.imul(tt,yt)|0,e=e+Math.imul(vt,ft)|0,l=l+Math.imul(vt,yt)|0,u=u+Math.imul(Z,at)|0,e=e+Math.imul(Z,wt)|0,e=e+Math.imul(J,at)|0,l=l+Math.imul(J,wt)|0,u=u+Math.imul(N,ht)|0,e=e+Math.imul(N,Mt)|0,e=e+Math.imul(K,ht)|0,l=l+Math.imul(K,Mt)|0,u=u+Math.imul(O,st)|0,e=e+Math.imul(O,xt)|0,e=e+Math.imul(R,st)|0,l=l+Math.imul(R,xt)|0,u=u+Math.imul(_,ot)|0,e=e+Math.imul(_,_t)|0,e=e+Math.imul(C,ot)|0,l=l+Math.imul(C,_t)|0;var ne=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ne>>>26)|0,ne&=67108863,u=Math.imul(T,U),e=Math.imul(T,X),e=e+Math.imul(F,U)|0,l=Math.imul(F,X),u=u+Math.imul(E,G)|0,e=e+Math.imul(E,rt)|0,e=e+Math.imul(w,G)|0,l=l+Math.imul(w,rt)|0,u=u+Math.imul(Q,it)|0,e=e+Math.imul(Q,gt)|0,e=e+Math.imul(ct,it)|0,l=l+Math.imul(ct,gt)|0,u=u+Math.imul(j,nt)|0,e=e+Math.imul(j,bt)|0,e=e+Math.imul(dt,nt)|0,l=l+Math.imul(dt,bt)|0,u=u+Math.imul(et,ft)|0,e=e+Math.imul(et,yt)|0,e=e+Math.imul(pt,ft)|0,l=l+Math.imul(pt,yt)|0,u=u+Math.imul(tt,at)|0,e=e+Math.imul(tt,wt)|0,e=e+Math.imul(vt,at)|0,l=l+Math.imul(vt,wt)|0,u=u+Math.imul(Z,ht)|0,e=e+Math.imul(Z,Mt)|0,e=e+Math.imul(J,ht)|0,l=l+Math.imul(J,Mt)|0,u=u+Math.imul(N,st)|0,e=e+Math.imul(N,xt)|0,e=e+Math.imul(K,st)|0,l=l+Math.imul(K,xt)|0,u=u+Math.imul(O,ot)|0,e=e+Math.imul(O,_t)|0,e=e+Math.imul(R,ot)|0,l=l+Math.imul(R,_t)|0,u=u+Math.imul(_,ut)|0,e=e+Math.imul(_,St)|0,e=e+Math.imul(C,ut)|0,l=l+Math.imul(C,St)|0;var fe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(fe>>>26)|0,fe&=67108863,u=Math.imul(T,G),e=Math.imul(T,rt),e=e+Math.imul(F,G)|0,l=Math.imul(F,rt),u=u+Math.imul(E,it)|0,e=e+Math.imul(E,gt)|0,e=e+Math.imul(w,it)|0,l=l+Math.imul(w,gt)|0,u=u+Math.imul(Q,nt)|0,e=e+Math.imul(Q,bt)|0,e=e+Math.imul(ct,nt)|0,l=l+Math.imul(ct,bt)|0,u=u+Math.imul(j,ft)|0,e=e+Math.imul(j,yt)|0,e=e+Math.imul(dt,ft)|0,l=l+Math.imul(dt,yt)|0,u=u+Math.imul(et,at)|0,e=e+Math.imul(et,wt)|0,e=e+Math.imul(pt,at)|0,l=l+Math.imul(pt,wt)|0,u=u+Math.imul(tt,ht)|0,e=e+Math.imul(tt,Mt)|0,e=e+Math.imul(vt,ht)|0,l=l+Math.imul(vt,Mt)|0,u=u+Math.imul(Z,st)|0,e=e+Math.imul(Z,xt)|0,e=e+Math.imul(J,st)|0,l=l+Math.imul(J,xt)|0,u=u+Math.imul(N,ot)|0,e=e+Math.imul(N,_t)|0,e=e+Math.imul(K,ot)|0,l=l+Math.imul(K,_t)|0,u=u+Math.imul(O,ut)|0,e=e+Math.imul(O,St)|0,e=e+Math.imul(R,ut)|0,l=l+Math.imul(R,St)|0;var ae=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ae>>>26)|0,ae&=67108863,u=Math.imul(T,it),e=Math.imul(T,gt),e=e+Math.imul(F,it)|0,l=Math.imul(F,gt),u=u+Math.imul(E,nt)|0,e=e+Math.imul(E,bt)|0,e=e+Math.imul(w,nt)|0,l=l+Math.imul(w,bt)|0,u=u+Math.imul(Q,ft)|0,e=e+Math.imul(Q,yt)|0,e=e+Math.imul(ct,ft)|0,l=l+Math.imul(ct,yt)|0,u=u+Math.imul(j,at)|0,e=e+Math.imul(j,wt)|0,e=e+Math.imul(dt,at)|0,l=l+Math.imul(dt,wt)|0,u=u+Math.imul(et,ht)|0,e=e+Math.imul(et,Mt)|0,e=e+Math.imul(pt,ht)|0,l=l+Math.imul(pt,Mt)|0,u=u+Math.imul(tt,st)|0,e=e+Math.imul(tt,xt)|0,e=e+Math.imul(vt,st)|0,l=l+Math.imul(vt,xt)|0,u=u+Math.imul(Z,ot)|0,e=e+Math.imul(Z,_t)|0,e=e+Math.imul(J,ot)|0,l=l+Math.imul(J,_t)|0,u=u+Math.imul(N,ut)|0,e=e+Math.imul(N,St)|0,e=e+Math.imul(K,ut)|0,l=l+Math.imul(K,St)|0;var he=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(he>>>26)|0,he&=67108863,u=Math.imul(T,nt),e=Math.imul(T,bt),e=e+Math.imul(F,nt)|0,l=Math.imul(F,bt),u=u+Math.imul(E,ft)|0,e=e+Math.imul(E,yt)|0,e=e+Math.imul(w,ft)|0,l=l+Math.imul(w,yt)|0,u=u+Math.imul(Q,at)|0,e=e+Math.imul(Q,wt)|0,e=e+Math.imul(ct,at)|0,l=l+Math.imul(ct,wt)|0,u=u+Math.imul(j,ht)|0,e=e+Math.imul(j,Mt)|0,e=e+Math.imul(dt,ht)|0,l=l+Math.imul(dt,Mt)|0,u=u+Math.imul(et,st)|0,e=e+Math.imul(et,xt)|0,e=e+Math.imul(pt,st)|0,l=l+Math.imul(pt,xt)|0,u=u+Math.imul(tt,ot)|0,e=e+Math.imul(tt,_t)|0,e=e+Math.imul(vt,ot)|0,l=l+Math.imul(vt,_t)|0,u=u+Math.imul(Z,ut)|0,e=e+Math.imul(Z,St)|0,e=e+Math.imul(J,ut)|0,l=l+Math.imul(J,St)|0;var se=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(se>>>26)|0,se&=67108863,u=Math.imul(T,ft),e=Math.imul(T,yt),e=e+Math.imul(F,ft)|0,l=Math.imul(F,yt),u=u+Math.imul(E,at)|0,e=e+Math.imul(E,wt)|0,e=e+Math.imul(w,at)|0,l=l+Math.imul(w,wt)|0,u=u+Math.imul(Q,ht)|0,e=e+Math.imul(Q,Mt)|0,e=e+Math.imul(ct,ht)|0,l=l+Math.imul(ct,Mt)|0,u=u+Math.imul(j,st)|0,e=e+Math.imul(j,xt)|0,e=e+Math.imul(dt,st)|0,l=l+Math.imul(dt,xt)|0,u=u+Math.imul(et,ot)|0,e=e+Math.imul(et,_t)|0,e=e+Math.imul(pt,ot)|0,l=l+Math.imul(pt,_t)|0,u=u+Math.imul(tt,ut)|0,e=e+Math.imul(tt,St)|0,e=e+Math.imul(vt,ut)|0,l=l+Math.imul(vt,St)|0;var oe=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(oe>>>26)|0,oe&=67108863,u=Math.imul(T,at),e=Math.imul(T,wt),e=e+Math.imul(F,at)|0,l=Math.imul(F,wt),u=u+Math.imul(E,ht)|0,e=e+Math.imul(E,Mt)|0,e=e+Math.imul(w,ht)|0,l=l+Math.imul(w,Mt)|0,u=u+Math.imul(Q,st)|0,e=e+Math.imul(Q,xt)|0,e=e+Math.imul(ct,st)|0,l=l+Math.imul(ct,xt)|0,u=u+Math.imul(j,ot)|0,e=e+Math.imul(j,_t)|0,e=e+Math.imul(dt,ot)|0,l=l+Math.imul(dt,_t)|0,u=u+Math.imul(et,ut)|0,e=e+Math.imul(et,St)|0,e=e+Math.imul(pt,ut)|0,l=l+Math.imul(pt,St)|0;var ue=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ue>>>26)|0,ue&=67108863,u=Math.imul(T,ht),e=Math.imul(T,Mt),e=e+Math.imul(F,ht)|0,l=Math.imul(F,Mt),u=u+Math.imul(E,st)|0,e=e+Math.imul(E,xt)|0,e=e+Math.imul(w,st)|0,l=l+Math.imul(w,xt)|0,u=u+Math.imul(Q,ot)|0,e=e+Math.imul(Q,_t)|0,e=e+Math.imul(ct,ot)|0,l=l+Math.imul(ct,_t)|0,u=u+Math.imul(j,ut)|0,e=e+Math.imul(j,St)|0,e=e+Math.imul(dt,ut)|0,l=l+Math.imul(dt,St)|0;var le=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(le>>>26)|0,le&=67108863,u=Math.imul(T,st),e=Math.imul(T,xt),e=e+Math.imul(F,st)|0,l=Math.imul(F,xt),u=u+Math.imul(E,ot)|0,e=e+Math.imul(E,_t)|0,e=e+Math.imul(w,ot)|0,l=l+Math.imul(w,_t)|0,u=u+Math.imul(Q,ut)|0,e=e+Math.imul(Q,St)|0,e=e+Math.imul(ct,ut)|0,l=l+Math.imul(ct,St)|0;var de=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(de>>>26)|0,de&=67108863,u=Math.imul(T,ot),e=Math.imul(T,_t),e=e+Math.imul(F,ot)|0,l=Math.imul(F,_t),u=u+Math.imul(E,ut)|0,e=e+Math.imul(E,St)|0,e=e+Math.imul(w,ut)|0,l=l+Math.imul(w,St)|0;var ce=(v+u|0)+((e&8191)<<13)|0;v=(l+(e>>>13)|0)+(ce>>>26)|0,ce&=67108863,u=Math.imul(T,ut),e=Math.imul(T,St),e=e+Math.imul(F,ut)|0,l=Math.imul(F,St);var ve=(v+u|0)+((e&8191)<<13)|0;return v=(l+(e>>>13)|0)+(ve>>>26)|0,ve&=67108863,c[0]=Nt,c[1]=$t,c[2]=jt,c[3]=Qt,c[4]=te,c[5]=ee,c[6]=re,c[7]=ie,c[8]=ne,c[9]=fe,c[10]=ae,c[11]=he,c[12]=se,c[13]=oe,c[14]=ue,c[15]=le,c[16]=de,c[17]=ce,c[18]=ve,v!==0&&(c[19]=v,i.length++),i};Math.imul||(L=D);function W(p,t,r){r.negative=t.negative^p.negative,r.length=p.length+t.length;for(var i=0,a=0,d=0;d<r.length-1;d++){var c=a;a=0;for(var v=i&67108863,u=Math.min(d,t.length-1),e=Math.max(0,d-p.length+1);e<=u;e++){var l=d-e,b=p.words[l]|0,_=t.words[e]|0,C=b*_,q=C&67108863;c=c+(C/67108864|0)|0,q=q+v|0,v=q&67108863,c=c+(q>>>26)|0,a+=c>>>26,c&=67108863}r.words[d]=v,i=c,c=a}return i!==0?r.words[d]=i:r.length--,r.strip()}function z(p,t,r){var i=new $;return i.mulp(p,t,r)}f.prototype.mulTo=function(t,r){var i,a=this.length+t.length;return this.length===10&&t.length===10?i=L(this,t,r):a<63?i=D(this,t,r):a<1024?i=W(this,t,r):i=z(this,t,r),i};function $(p,t){this.x=p,this.y=t}$.prototype.makeRBT=function(t){for(var r=new Array(t),i=f.prototype._countBits(t)-1,a=0;a<t;a++)r[a]=this.revBin(a,i,t);return r},$.prototype.revBin=function(t,r,i){if(t===0||t===i-1)return t;for(var a=0,d=0;d<r;d++)a|=(t&1)<<r-d-1,t>>=1;return a},$.prototype.permute=function(t,r,i,a,d,c){for(var v=0;v<c;v++)a[v]=r[t[v]],d[v]=i[t[v]]},$.prototype.transform=function(t,r,i,a,d,c){this.permute(c,t,r,i,a,d);for(var v=1;v<d;v<<=1)for(var u=v<<1,e=Math.cos(2*Math.PI/u),l=Math.sin(2*Math.PI/u),b=0;b<d;b+=u)for(var _=e,C=l,q=0;q<v;q++){var O=i[b+q],R=a[b+q],P=i[b+q+v],N=a[b+q+v],K=_*P-C*N;N=_*N+C*P,P=K,i[b+q]=O+P,a[b+q]=R+N,i[b+q+v]=O-P,a[b+q+v]=R-N,q!==u&&(K=e*_-l*C,C=e*C+l*_,_=K)}},$.prototype.guessLen13b=function(t,r){var i=Math.max(r,t)|1,a=i&1,d=0;for(i=i/2|0;i;i=i>>>1)d++;return 1<<d+1+a},$.prototype.conjugate=function(t,r,i){if(!(i<=1))for(var a=0;a<i/2;a++){var d=t[a];t[a]=t[i-a-1],t[i-a-1]=d,d=r[a],r[a]=-r[i-a-1],r[i-a-1]=-d}},$.prototype.normalize13b=function(t,r){for(var i=0,a=0;a<r/2;a++){var d=Math.round(t[2*a+1]/r)*8192+Math.round(t[2*a]/r)+i;t[a]=d&67108863,d<67108864?i=0:i=d/67108864|0}return t},$.prototype.convert13b=function(t,r,i,a){for(var d=0,c=0;c<r;c++)d=d+(t[c]|0),i[2*c]=d&8191,d=d>>>13,i[2*c+1]=d&8191,d=d>>>13;for(c=2*r;c<a;++c)i[c]=0;o(d===0),o((d&-8192)===0)},$.prototype.stub=function(t){for(var r=new Array(t),i=0;i<t;i++)r[i]=0;return r},$.prototype.mulp=function(t,r,i){var a=2*this.guessLen13b(t.length,r.length),d=this.makeRBT(a),c=this.stub(a),v=new Array(a),u=new Array(a),e=new Array(a),l=new Array(a),b=new Array(a),_=new Array(a),C=i.words;C.length=a,this.convert13b(t.words,t.length,v,a),this.convert13b(r.words,r.length,l,a),this.transform(v,c,u,e,a,d),this.transform(l,c,b,_,a,d);for(var q=0;q<a;q++){var O=u[q]*b[q]-e[q]*_[q];e[q]=u[q]*_[q]+e[q]*b[q],u[q]=O}return this.conjugate(u,e,a),this.transform(u,e,C,c,a,d),this.conjugate(C,c,a),this.normalize13b(C,a),i.negative=t.negative^r.negative,i.length=t.length+r.length,i.strip()},f.prototype.mul=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),this.mulTo(t,r)},f.prototype.mulf=function(t){var r=new f(null);return r.words=new Array(this.length+t.length),z(this,t,r)},f.prototype.imul=function(t){return this.clone().mulTo(t,this)},f.prototype.imuln=function(t){o(typeof t=="number"),o(t<67108864);for(var r=0,i=0;i<this.length;i++){var a=(this.words[i]|0)*t,d=(a&67108863)+(r&67108863);r>>=26,r+=a/67108864|0,r+=d>>>26,this.words[i]=d&67108863}return r!==0&&(this.words[i]=r,this.length++),this.length=t===0?1:this.length,this},f.prototype.muln=function(t){return this.clone().imuln(t)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(t){var r=k(t);if(r.length===0)return new f(1);for(var i=this,a=0;a<r.length&&r[a]===0;a++,i=i.sqr());if(++a<r.length)for(var d=i.sqr();a<r.length;a++,d=d.sqr())r[a]!==0&&(i=i.mul(d));return i},f.prototype.iushln=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r,d;if(r!==0){var c=0;for(d=0;d<this.length;d++){var v=this.words[d]&a,u=(this.words[d]|0)-v<<r;this.words[d]=u|c,c=v>>>26-r}c&&(this.words[d]=c,this.length++)}if(i!==0){for(d=this.length-1;d>=0;d--)this.words[d+i]=this.words[d];for(d=0;d<i;d++)this.words[d]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(t){return o(this.negative===0),this.iushln(t)},f.prototype.iushrn=function(t,r,i){o(typeof t=="number"&&t>=0);var a;r?a=(r-r%26)/26:a=0;var d=t%26,c=Math.min((t-d)/26,this.length),v=67108863^67108863>>>d<<d,u=i;if(a-=c,a=Math.max(0,a),u){for(var e=0;e<c;e++)u.words[e]=this.words[e];u.length=c}if(c!==0)if(this.length>c)for(this.length-=c,e=0;e<this.length;e++)this.words[e]=this.words[e+c];else this.words[0]=0,this.length=1;var l=0;for(e=this.length-1;e>=0&&(l!==0||e>=a);e--){var b=this.words[e]|0;this.words[e]=l<<26-d|b>>>d,l=b&v}return u&&l!==0&&(u.words[u.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(t,r,i){return o(this.negative===0),this.iushrn(t,r,i)},f.prototype.shln=function(t){return this.clone().ishln(t)},f.prototype.ushln=function(t){return this.clone().iushln(t)},f.prototype.shrn=function(t){return this.clone().ishrn(t)},f.prototype.ushrn=function(t){return this.clone().iushrn(t)},f.prototype.testn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return!1;var d=this.words[i];return!!(d&a)},f.prototype.imaskn=function(t){o(typeof t=="number"&&t>=0);var r=t%26,i=(t-r)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(r!==0&&i++,this.length=Math.min(i,this.length),r!==0){var a=67108863^67108863>>>r<<r;this.words[this.length-1]&=a}return this.strip()},f.prototype.maskn=function(t){return this.clone().imaskn(t)},f.prototype.iaddn=function(t){return o(typeof t=="number"),o(t<67108864),t<0?this.isubn(-t):this.negative!==0?this.length===1&&(this.words[0]|0)<t?(this.words[0]=t-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},f.prototype._iaddn=function(t){this.words[0]+=t;for(var r=0;r<this.length&&this.words[r]>=67108864;r++)this.words[r]-=67108864,r===this.length-1?this.words[r+1]=1:this.words[r+1]++;return this.length=Math.max(this.length,r+1),this},f.prototype.isubn=function(t){if(o(typeof t=="number"),o(t<67108864),t<0)return this.iaddn(-t);if(this.negative!==0)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var r=0;r<this.length&&this.words[r]<0;r++)this.words[r]+=67108864,this.words[r+1]-=1;return this.strip()},f.prototype.addn=function(t){return this.clone().iaddn(t)},f.prototype.subn=function(t){return this.clone().isubn(t)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(t,r,i){var a=t.length+i,d;this._expand(a);var c,v=0;for(d=0;d<t.length;d++){c=(this.words[d+i]|0)+v;var u=(t.words[d]|0)*r;c-=u&67108863,v=(c>>26)-(u/67108864|0),this.words[d+i]=c&67108863}for(;d<this.length-i;d++)c=(this.words[d+i]|0)+v,v=c>>26,this.words[d+i]=c&67108863;if(v===0)return this.strip();for(o(v===-1),v=0,d=0;d<this.length;d++)c=-(this.words[d]|0)+v,v=c>>26,this.words[d]=c&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(t,r){var i=this.length-t.length,a=this.clone(),d=t,c=d.words[d.length-1]|0,v=this._countBits(c);i=26-v,i!==0&&(d=d.ushln(i),a.iushln(i),c=d.words[d.length-1]|0);var u=a.length-d.length,e;if(r!=="mod"){e=new f(null),e.length=u+1,e.words=new Array(e.length);for(var l=0;l<e.length;l++)e.words[l]=0}var b=a.clone()._ishlnsubmul(d,1,u);b.negative===0&&(a=b,e&&(e.words[u]=1));for(var _=u-1;_>=0;_--){var C=(a.words[d.length+_]|0)*67108864+(a.words[d.length+_-1]|0);for(C=Math.min(C/c|0,67108863),a._ishlnsubmul(d,C,_);a.negative!==0;)C--,a.negative=0,a._ishlnsubmul(d,1,_),a.isZero()||(a.negative^=1);e&&(e.words[_]=C)}return e&&e.strip(),a.strip(),r!=="div"&&i!==0&&a.iushrn(i),{div:e||null,mod:a}},f.prototype.divmod=function(t,r,i){if(o(!t.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var a,d,c;return this.negative!==0&&t.negative===0?(c=this.neg().divmod(t,r),r!=="mod"&&(a=c.div.neg()),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.iadd(t)),{div:a,mod:d}):this.negative===0&&t.negative!==0?(c=this.divmod(t.neg(),r),r!=="mod"&&(a=c.div.neg()),{div:a,mod:c.mod}):this.negative&t.negative?(c=this.neg().divmod(t.neg(),r),r!=="div"&&(d=c.mod.neg(),i&&d.negative!==0&&d.isub(t)),{div:c.div,mod:d}):t.length>this.length||this.cmp(t)<0?{div:new f(0),mod:this}:t.length===1?r==="div"?{div:this.divn(t.words[0]),mod:null}:r==="mod"?{div:null,mod:new f(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new f(this.modn(t.words[0]))}:this._wordDiv(t,r)},f.prototype.div=function(t){return this.divmod(t,"div",!1).div},f.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},f.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},f.prototype.divRound=function(t){var r=this.divmod(t);if(r.mod.isZero())return r.div;var i=r.div.negative!==0?r.mod.isub(t):r.mod,a=t.ushrn(1),d=t.andln(1),c=i.cmp(a);return c<0||d===1&&c===0?r.div:r.div.negative!==0?r.div.isubn(1):r.div.iaddn(1)},f.prototype.modn=function(t){o(t<=67108863);for(var r=(1<<26)%t,i=0,a=this.length-1;a>=0;a--)i=(r*i+(this.words[a]|0))%t;return i},f.prototype.idivn=function(t){o(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(this.words[i]|0)+r*67108864;this.words[i]=a/t|0,r=a%t}return this.strip()},f.prototype.divn=function(t){return this.clone().idivn(t)},f.prototype.egcd=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=new f(0),v=new f(1),u=0;r.isEven()&&i.isEven();)r.iushrn(1),i.iushrn(1),++u;for(var e=i.clone(),l=r.clone();!r.isZero();){for(var b=0,_=1;!(r.words[0]&_)&&b<26;++b,_<<=1);if(b>0)for(r.iushrn(b);b-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(e),d.isub(l)),a.iushrn(1),d.iushrn(1);for(var C=0,q=1;!(i.words[0]&q)&&C<26;++C,q<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(c.isOdd()||v.isOdd())&&(c.iadd(e),v.isub(l)),c.iushrn(1),v.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(c),d.isub(v)):(i.isub(r),c.isub(a),v.isub(d))}return{a:c,b:v,gcd:i.iushln(u)}},f.prototype._invmp=function(t){o(t.negative===0),o(!t.isZero());var r=this,i=t.clone();r.negative!==0?r=r.umod(t):r=r.clone();for(var a=new f(1),d=new f(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var v=0,u=1;!(r.words[0]&u)&&v<26;++v,u<<=1);if(v>0)for(r.iushrn(v);v-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var e=0,l=1;!(i.words[0]&l)&&e<26;++e,l<<=1);if(e>0)for(i.iushrn(e);e-- >0;)d.isOdd()&&d.iadd(c),d.iushrn(1);r.cmp(i)>=0?(r.isub(i),a.isub(d)):(i.isub(r),d.isub(a))}var b;return r.cmpn(1)===0?b=a:b=d,b.cmpn(0)<0&&b.iadd(t),b},f.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var r=this.clone(),i=t.clone();r.negative=0,i.negative=0;for(var a=0;r.isEven()&&i.isEven();a++)r.iushrn(1),i.iushrn(1);do{for(;r.isEven();)r.iushrn(1);for(;i.isEven();)i.iushrn(1);var d=r.cmp(i);if(d<0){var c=r;r=i,i=c}else if(d===0||i.cmpn(1)===0)break;r.isub(i)}while(!0);return i.iushln(a)},f.prototype.invm=function(t){return this.egcd(t).a.umod(t)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(t){return this.words[0]&t},f.prototype.bincn=function(t){o(typeof t=="number");var r=t%26,i=(t-r)/26,a=1<<r;if(this.length<=i)return this._expand(i+1),this.words[i]|=a,this;for(var d=a,c=i;d!==0&&c<this.length;c++){var v=this.words[c]|0;v+=d,d=v>>>26,v&=67108863,this.words[c]=v}return d!==0&&(this.words[c]=d,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(t){var r=t<0;if(this.negative!==0&&!r)return-1;if(this.negative===0&&r)return 1;this.strip();var i;if(this.length>1)i=1;else{r&&(t=-t),o(t<=67108863,"Number is too big");var a=this.words[0]|0;i=a===t?0:a<t?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(t){if(this.negative!==0&&t.negative===0)return-1;if(this.negative===0&&t.negative!==0)return 1;var r=this.ucmp(t);return this.negative!==0?-r|0:r},f.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var r=0,i=this.length-1;i>=0;i--){var a=this.words[i]|0,d=t.words[i]|0;if(a!==d){a<d?r=-1:a>d&&(r=1);break}}return r},f.prototype.gtn=function(t){return this.cmpn(t)===1},f.prototype.gt=function(t){return this.cmp(t)===1},f.prototype.gten=function(t){return this.cmpn(t)>=0},f.prototype.gte=function(t){return this.cmp(t)>=0},f.prototype.ltn=function(t){return this.cmpn(t)===-1},f.prototype.lt=function(t){return this.cmp(t)===-1},f.prototype.lten=function(t){return this.cmpn(t)<=0},f.prototype.lte=function(t){return this.cmp(t)<=0},f.prototype.eqn=function(t){return this.cmpn(t)===0},f.prototype.eq=function(t){return this.cmp(t)===0},f.red=function(t){return new Y(t)},f.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),t.convertTo(this)._forceRed(t)},f.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(t){return this.red=t,this},f.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},f.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},f.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},f.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},f.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},f.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},f.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},f.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},f.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var lt={k256:null,p224:null,p192:null,p25519:null};function H(p,t){this.name=p,this.p=new f(t,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var t=new f(null);return t.words=new Array(Math.ceil(this.n/13)),t},H.prototype.ireduce=function(t){var r=t,i;do this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),i=r.bitLength();while(i>this.n);var a=i<this.n?-1:r.ucmp(this.p);return a===0?(r.words[0]=0,r.length=1):a>0?r.isub(this.p):r.strip!==void 0?r.strip():r._strip(),r},H.prototype.split=function(t,r){t.iushrn(this.n,0,r)},H.prototype.imulK=function(t){return t.imul(this.k)};function At(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}m(At,H),At.prototype.split=function(t,r){for(var i=4194303,a=Math.min(t.length,9),d=0;d<a;d++)r.words[d]=t.words[d];if(r.length=a,t.length<=9){t.words[0]=0,t.length=1;return}var c=t.words[9];for(r.words[r.length++]=c&i,d=10;d<t.length;d++){var v=t.words[d]|0;t.words[d-10]=(v&i)<<4|c>>>22,c=v}c>>>=22,t.words[d-10]=c,c===0&&t.length>10?t.length-=10:t.length-=9},At.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,i=0;i<t.length;i++){var a=t.words[i]|0;r+=a*977,t.words[i]=r&67108863,r=a*64+(r/67108864|0)}return t.words[t.length-1]===0&&(t.length--,t.words[t.length-1]===0&&t.length--),t};function Bt(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}m(Bt,H);function Ct(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}m(Ct,H);function Et(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}m(Et,H),Et.prototype.imulK=function(t){for(var r=0,i=0;i<t.length;i++){var a=(t.words[i]|0)*19+r,d=a&67108863;a>>>=26,t.words[i]=d,r=a}return r!==0&&(t.words[t.length++]=r),t},f._prime=function(t){if(lt[t])return lt[t];var r;if(t==="k256")r=new At;else if(t==="p224")r=new Bt;else if(t==="p192")r=new Ct;else if(t==="p25519")r=new Et;else throw new Error("Unknown prime "+t);return lt[t]=r,r};function Y(p){if(typeof p=="string"){var t=f._prime(p);this.m=t.p,this.prime=t}else o(p.gtn(1),"modulus must be greater than 1"),this.m=p,this.prime=null}Y.prototype._verify1=function(t){o(t.negative===0,"red works only with positives"),o(t.red,"red works only with red numbers")},Y.prototype._verify2=function(t,r){o((t.negative|r.negative)===0,"red works only with positives"),o(t.red&&t.red===r.red,"red works only with red numbers")},Y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Y.prototype.add=function(t,r){this._verify2(t,r);var i=t.add(r);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Y.prototype.iadd=function(t,r){this._verify2(t,r);var i=t.iadd(r);return i.cmp(this.m)>=0&&i.isub(this.m),i},Y.prototype.sub=function(t,r){this._verify2(t,r);var i=t.sub(r);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Y.prototype.isub=function(t,r){this._verify2(t,r);var i=t.isub(r);return i.cmpn(0)<0&&i.iadd(this.m),i},Y.prototype.shl=function(t,r){return this._verify1(t),this.imod(t.ushln(r))},Y.prototype.imul=function(t,r){return this._verify2(t,r),this.imod(t.imul(r))},Y.prototype.mul=function(t,r){return this._verify2(t,r),this.imod(t.mul(r))},Y.prototype.isqr=function(t){return this.imul(t,t.clone())},Y.prototype.sqr=function(t){return this.mul(t,t)},Y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var r=this.m.andln(3);if(o(r%2===1),r===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(t,i)}for(var a=this.m.subn(1),d=0;!a.isZero()&&a.andln(1)===0;)d++,a.iushrn(1);o(!a.isZero());var c=new f(1).toRed(this),v=c.redNeg(),u=this.m.subn(1).iushrn(1),e=this.m.bitLength();for(e=new f(2*e*e).toRed(this);this.pow(e,u).cmp(v)!==0;)e.redIAdd(v);for(var l=this.pow(e,a),b=this.pow(t,a.addn(1).iushrn(1)),_=this.pow(t,a),C=d;_.cmp(c)!==0;){for(var q=_,O=0;q.cmp(c)!==0;O++)q=q.redSqr();o(O<C);var R=this.pow(l,new f(1).iushln(C-O-1));b=b.redMul(R),l=R.redSqr(),_=_.redMul(l),C=O}return b},Y.prototype.invm=function(t){var r=t._invmp(this.m);return r.negative!==0?(r.negative=0,this.imod(r).redNeg()):this.imod(r)},Y.prototype.pow=function(t,r){if(r.isZero())return new f(1).toRed(this);if(r.cmpn(1)===0)return t.clone();var i=4,a=new Array(1<<i);a[0]=new f(1).toRed(this),a[1]=t;for(var d=2;d<a.length;d++)a[d]=this.mul(a[d-1],t);var c=a[0],v=0,u=0,e=r.bitLength()%26;for(e===0&&(e=26),d=r.length-1;d>=0;d--){for(var l=r.words[d],b=e-1;b>=0;b--){var _=l>>b&1;if(c!==a[0]&&(c=this.sqr(c)),_===0&&v===0){u=0;continue}v<<=1,v|=_,u++,!(u!==i&&(d!==0||b!==0))&&(c=this.mul(c,a[v]),u=0,v=0)}e=26}return c},Y.prototype.convertTo=function(t){var r=t.umod(this.m);return r===t?r.clone():r},Y.prototype.convertFrom=function(t){var r=t.clone();return r.red=null,r},f.mont=function(t){return new It(t)};function It(p){Y.call(this,p),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m(It,Y),It.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},It.prototype.convertFrom=function(t){var r=this.imod(t.mul(this.rinv));return r.red=null,r},It.prototype.imul=function(t,r){if(t.isZero()||r.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.mul=function(t,r){if(t.isZero()||r.isZero())return new f(0)._forceRed(this);var i=t.mul(r),a=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),d=i.isub(a).iushrn(this.shift),c=d;return d.cmp(this.m)>=0?c=d.isub(this.m):d.cmpn(0)<0&&(c=d.iadd(this.m)),c._forceRed(this)},It.prototype.invm=function(t){var r=this.imod(t._invmp(this.m).mul(this.r2));return r._forceRed(this)}})(h,Gt)})(J0);var G0=J0.exports,dh=G0,Nm=Ot.Buffer;function $m(h,n){return Nm.from(h.toRed(dh.mont(n.modulus)).redPow(new dh(n.publicExponent)).fromRed().toArray())}var Ko=$m,Um=sf,p0=gi,Lm=Gi,ch=Oo,vh=zo,X0=G0,Om=Ko,zm=U0,je=Ot.Buffer,Km=function(n,s,o){var m;n.padding?m=n.padding:o?m=1:m=4;var f=Um(n),g;if(m===4)g=Hm(f,s);else if(m===1)g=Zm(f,s,o);else if(m===3){if(g=new X0(s),g.cmp(f.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return o?zm(g,f):Om(g,f)};function Hm(h,n){var s=h.modulus.byteLength(),o=n.length,m=Lm("sha1").update(je.alloc(0)).digest(),f=m.length,g=2*f;if(o>s-g-2)throw new Error("message too long");var y=je.alloc(s-o-g-2),S=s-f-1,B=p0(f),M=vh(je.concat([m,y,je.alloc(1,1),n],S),ch(B,S)),x=vh(B,ch(M,f));return new X0(je.concat([je.alloc(1),x,M],s))}function Zm(h,n,s){var o=n.length,m=h.modulus.byteLength();if(o>m-11)throw new Error("message too long");var f;return s?f=je.alloc(m-o-3,255):f=Wm(m-o-3),new X0(je.concat([je.from([0,s?1:2]),f,je.alloc(1),n],m))}function Wm(h){for(var n=je.allocUnsafe(h),s=0,o=p0(h*2),m=0,f;s<h;)m===o.length&&(o=p0(h*2),m=0),f=o[m++],f&&(n[s++]=f);return n}var Vm=sf,ph=Oo,mh=zo,gh=G0,Ym=U0,Jm=Gi,Gm=Ko,Hi=Ot.Buffer,Xm=function(n,s,o){var m;n.padding?m=n.padding:o?m=1:m=4;var f=Vm(n),g=f.modulus.byteLength();if(s.length>g||new gh(s).cmp(f.modulus)>=0)throw new Error("decryption error");var y;o?y=Gm(new gh(s),f):y=Ym(s,f);var S=Hi.alloc(g-y.length);if(y=Hi.concat([S,y],g),m===4)return jm(f,y);if(m===1)return Qm(f,y,o);if(m===3)return y;throw new Error("unknown padding")};function jm(h,n){var s=h.modulus.byteLength(),o=Jm("sha1").update(Hi.alloc(0)).digest(),m=o.length;if(n[0]!==0)throw new Error("decryption error");var f=n.slice(1,m+1),g=n.slice(m+1),y=mh(f,ph(g,m)),S=mh(g,ph(y,s-m-1));if(tg(o,S.slice(0,m)))throw new Error("decryption error");for(var B=m;S[B]===0;)B++;if(S[B++]!==1)throw new Error("decryption error");return S.slice(B)}function Qm(h,n,s){for(var o=n.slice(0,2),m=2,f=0;n[m++]!==0;)if(m>=n.length){f++;break}var g=n.slice(2,m-1);if((o.toString("hex")!=="0002"&&!s||o.toString("hex")!=="0001"&&s)&&f++,g.length<8&&f++,f)throw new Error("decryption error");return n.slice(m)}function tg(h,n){h=Hi.from(h),n=Hi.from(n);var s=0,o=h.length;h.length!==n.length&&(s++,o=Math.min(h.length,n.length));for(var m=-1;++m<o;)s+=h[m]^n[m];return s}(function(h){h.publicEncrypt=Km,h.privateDecrypt=Xm,h.privateEncrypt=function(s,o){return h.publicEncrypt(s,o,!0)},h.publicDecrypt=function(s,o){return h.privateDecrypt(s,o,!0)}})(Lo);var Ni={};function bh(){throw new Error(`secure random number generation not supported by this browser
|
|
16
|
+
use chrome, FireFox or Internet Explorer 11`)}var Ho=Ot,yh=gi,Zo=Ho.Buffer,Wo=Ho.kMaxLength,m0=Gt.crypto||Gt.msCrypto,Vo=Math.pow(2,32)-1;function Yo(h,n){if(typeof h!="number"||h!==h)throw new TypeError("offset must be a number");if(h>Vo||h<0)throw new TypeError("offset must be a uint32");if(h>Wo||h>n)throw new RangeError("offset out of range")}function Jo(h,n,s){if(typeof h!="number"||h!==h)throw new TypeError("size must be a number");if(h>Vo||h<0)throw new TypeError("size must be a uint32");if(h+n>s||h>Wo)throw new RangeError("buffer too small")}m0&&m0.getRandomValues||!ye.browser?(Ni.randomFill=eg,Ni.randomFillSync=rg):(Ni.randomFill=bh,Ni.randomFillSync=bh);function eg(h,n,s,o){if(!Zo.isBuffer(h)&&!(h instanceof Gt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof n=="function")o=n,n=0,s=h.length;else if(typeof s=="function")o=s,s=h.length-n;else if(typeof o!="function")throw new TypeError('"cb" argument must be a function');return Yo(n,h.length),Jo(s,n,h.length),Go(h,n,s,o)}function Go(h,n,s,o){if(ye.browser){var m=h.buffer,f=new Uint8Array(m,n,s);if(m0.getRandomValues(f),o){ye.nextTick(function(){o(null,h)});return}return h}if(o){yh(s,function(y,S){if(y)return o(y);S.copy(h,n),o(null,h)});return}var g=yh(s);return g.copy(h,n),h}function rg(h,n,s){if(typeof n=="undefined"&&(n=0),!Zo.isBuffer(h)&&!(h instanceof Gt.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return Yo(n,h.length),s===void 0&&(s=h.length-n),Jo(s,n,h.length),Go(h,n,s)}var wh;function Xo(){if(wh)return Ut;wh=1,Ut.randomBytes=Ut.rng=Ut.pseudoRandomBytes=Ut.prng=gi,Ut.createHash=Ut.Hash=Gi,Ut.createHmac=Ut.Hmac=Vh;var h=Wd,n=Object.keys(h),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(n);Ut.getHashes=function(){return s};var o=Un;Ut.pbkdf2=o.pbkdf2,Ut.pbkdf2Sync=o.pbkdf2Sync;var m=Qe;Ut.Cipher=m.Cipher,Ut.createCipher=m.createCipher,Ut.Cipheriv=m.Cipheriv,Ut.createCipheriv=m.createCipheriv,Ut.Decipher=m.Decipher,Ut.createDecipher=m.createDecipher,Ut.Decipheriv=m.Decipheriv,Ut.createDecipheriv=m.createDecipheriv,Ut.getCiphers=m.getCiphers,Ut.listCiphers=m.listCiphers;var f=rv();Ut.DiffieHellmanGroup=f.DiffieHellmanGroup,Ut.createDiffieHellmanGroup=f.createDiffieHellmanGroup,Ut.getDiffieHellman=f.getDiffieHellman,Ut.createDiffieHellman=f.createDiffieHellman,Ut.DiffieHellman=f.DiffieHellman;var g=Cm();Ut.createSign=g.createSign,Ut.Sign=g.Sign,Ut.createVerify=g.createVerify,Ut.Verify=g.Verify,Ut.createECDH=qm();var y=Lo;Ut.publicEncrypt=y.publicEncrypt,Ut.privateEncrypt=y.privateEncrypt,Ut.publicDecrypt=y.publicDecrypt,Ut.privateDecrypt=y.privateDecrypt;var S=Ni;return Ut.randomFill=S.randomFill,Ut.randomFillSync=S.randomFillSync,Ut.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
|
|
17
17
|
we accept pull requests
|
|
18
18
|
https://github.com/browserify/crypto-browserify`)},Ut.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},Ut}var ig=Xo();const ng=cu(ig);function j0(h){const n=ng.createHash("sha256").update(h).digest("hex");return parseInt(n.slice(0,8),16)%1e4/100}function jo(h,n){const s=j0(h);let o=0;for(const m of n.variants)if(o+=m.weight,s<o)return m.value;return null}function Qo(h,n){const s=n.user_id||n.id||n.email;if(!h||typeof h!="object"||!s)return null;switch(h.strategy){case"percentage":{if(!("percentage"in h)||!("salt"in h))return null;const{percentage:o,salt:m}=h;return j0(`${s}.${m}`)<o?!0:null}case"variant":{if(!("variants"in h))return null;const{salt:o,variants:m}=h;return jo(`${s}.${o}`,m)}default:return null}}function tu(h,n){var f;if(!(h.targeting_rules||[]).every(g=>{var y;if(g.type==="segment"){const S=(y=h.segmentsById)==null?void 0:y[g.segment_id];return S?_u(S,n):!1}else return Sh(g,n)}))return null;const m=h.rollout?Qo(h.rollout,n):null;return(f=m!=null?m:h.value)!=null?f:null}let an={getItem:h=>typeof localStorage!="undefined"?localStorage.getItem(h):null,setItem:(h,n)=>{typeof localStorage!="undefined"&&localStorage.setItem(h,n)}};function fg(h){an=h}function eu(h){return`flagmint_${h}_flags`}function ru(h){return`flagmint_${h}_context`}function iu(h,n){try{const s=an.getItem(eu(h));if(!s)return null;const o=JSON.parse(s);return Date.now()-o.ts>n?null:o.data}catch(s){return null}}function nu(h,n){try{an.setItem(eu(h),JSON.stringify({ts:Date.now(),data:n}))}catch(s){}}function fu(h){try{const n=an.getItem(ru(h));return n?JSON.parse(n):null}catch(n){return null}}function au(h,n){try{an.setItem(ru(h),JSON.stringify(n))}catch(s){}}const ag=Object.freeze(Object.defineProperty({__proto__:null,loadCachedContext:fu,loadCachedFlags:iu,saveCachedContext:au,saveCachedFlags:nu,setCacheStorage:fg},Symbol.toStringTag,{value:"Module"})),hg=24*60*60*1e3;function hu(){switch(typeof process!="undefined"?process.env.NEXT_PUBLIC_NODE_ENV||process.env.NODE_ENV:"development"){case"production":return{rest:"https://api.flagmint.com/evaluator/evaluate",ws:"wss://api.flagmint.com/ws"};case"staging":return{rest:"https://staging-api.flagmint.com/evaluator/evaluate",ws:"wss://staging-api.flagmint.com/ws"};case"development":default:return{rest:"http://localhost:3000/evaluator/evaluate",ws:"ws://localhost:3000/ws"}}}const sg=hu().rest,og=hu().ws;class ug{constructor(n){var s,o,m,f,g,y;if(this.flags={},this.refreshIntervalId=null,this.rawFlags={},this.subscribers=new Set,this.apiKey=n.apiKey,this.enableOfflineCache=(s=n.enableOfflineCache)!=null?s:!0,this.persistContext=(o=n.persistContext)!=null?o:!1,this.cacheTTL=hg,this.onError=n.onError,this.restEndpoint=(m=n.restEndpoint)!=null?m:sg,this.wsEndpoint=(f=n.wsEndpoint)!=null?f:og,this.cacheAdapter=(g=n.cacheAdapter)!=null?g:{loadFlags:iu,saveFlags:nu,loadContext:fu,saveContext:au},this.context=n.context||{},this.rawFlags=(y=n.rawFlags)!=null?y:{},this.previewMode=n.previewMode||!1,this.previewMode&&this.rawFlags&&Object.keys(this.rawFlags).length>0){this.flags=this.evaluateLocally(this.rawFlags,this.context),this.readyPromise=Promise.resolve(),this.resolveReady=()=>{},this.rejectReady=()=>{};return}else this.previewMode&&!this.rawFlags&&console.error("[FlagClient] No raw flags provided for preview mode. Defaulting to remote fetch.");this.readyPromise=new Promise((S,B)=>{this.resolveReady=S,this.rejectReady=B}),this.initialize(n)}initialize(n){return ke(this,null,function*(){var s;try{if(this.persistContext){const o=yield Promise.resolve(this.cacheAdapter.loadContext(this.apiKey));o&&(this.context=o)}if(this.enableOfflineCache){const o=yield Promise.resolve(this.cacheAdapter.loadFlags(this.apiKey,this.cacheTTL));o&&(this.flags=o,this.notifySubscribers())}yield this.setupTransport(n),this.resolveReady()}catch(o){this.rejectReady(o),(s=this.onError)==null||s.call(this,o)}})}setupTransport(n){return ke(this,null,function*(){var f;console.log("[FlagClient] setupTransport() started");const s=(f=n.transportMode)!=null?f:"auto",o=()=>ke(this,null,function*(){console.log("[FlagClient] Initializing WebSocket transport...");const g=new _h(this.wsEndpoint,this.apiKey);return yield g.init(),console.log("[FlagClient] WebSocket transport initialized"),g}),m=()=>{const g=new xh(this.restEndpoint,this.apiKey,this.context,{pollIntervalMs:12e5,maxBackoffMs:6e4,backoffMultiplier:2});return g.onFlagsUpdated(y=>{console.log("[FlagClient] Flags updated via long polling:",y),this.updateFlags(y)}),g.init(),g};try{if(s==="websocket")this.transport=yield o();else if(s==="long-polling")this.transport=m();else try{this.transport=yield o()}catch(y){console.warn("[FlagClient] WebSocket failed, falling back to long polling"),this.transport=m()}console.log("[FlagClient] Fetching flags...");const g=yield this.transport.fetchFlags(this.context);console.log("[FlagClient] Initial flags fetched:",g),this.updateFlags(g),typeof this.transport.onFlagsUpdated=="function"&&this.transport.onFlagsUpdated(y=>{console.log("[FlagClient] Flags updated via transport:",y),this.updateFlags(y)}),this.resolveReady()}catch(g){throw console.error("[FlagClient] setupTransport error:",g),this.rejectReady(g),this.onError&&this.onError(g instanceof Error?g:new Error(String(g))),g}})}updateFlags(n){this.flags=n,this.enableOfflineCache&&Promise.resolve(this.cacheAdapter.saveFlags(this.apiKey,n)),this.notifySubscribers()}notifySubscribers(){this.subscribers.forEach(n=>{try{n(this.flags)}catch(s){console.error("[FlagClient] Error in subscriber callback:",s)}})}subscribe(n){return this.subscribers.add(n),n(this.flags),()=>{this.subscribers.delete(n)}}getFlags(){return hn({},this.flags)}getFlag(n,s){var o;return(o=this.flags[n])!=null?o:s}updateContext(n){return ke(this,null,function*(){var s;if(this.context=hn(hn({},this.context),n),this.persistContext&&(yield Promise.resolve(this.cacheAdapter.saveContext(this.apiKey,this.context))),this.transport&&typeof this.transport.fetchFlags=="function")try{const o=yield this.transport.fetchFlags(this.context);this.updateFlags(o)}catch(o){console.error("[FlagClient] Error updating flags after context change:",o),(s=this.onError)==null||s.call(this,o)}})}destroy(){this.refreshIntervalId&&clearInterval(this.refreshIntervalId),this.subscribers.clear(),this.transport&&this.transport.destroy()}ready(){return ke(this,null,function*(){return console.log("[FlagClient] Waiting for client to be ready...",this.readyPromise),this.readyPromise})}evaluateLocally(n,s){const o={};for(const m in n){const f=tu(n[m],s);f!==null&&(o[m]=f)}return o}}function su(h){return`flagmint_${h}_flags`}function ou(h){return`flagmint_${h}_context`}let Ir=null;function lg(h){Ir=h}function dg(h,n){return ke(this,null,function*(){if(!Ir)throw new Error("Async storage not set");try{const s=yield Ir.getItem(su(h));if(!s)return null;const o=JSON.parse(s);return Date.now()-o.ts>n?null:o.data}catch(s){return null}})}function cg(h,n){return ke(this,null,function*(){if(!Ir)throw new Error("Async storage not set");try{yield Ir.setItem(su(h),JSON.stringify({ts:Date.now(),data:n}))}catch(s){}})}function vg(h){return ke(this,null,function*(){if(!Ir)throw new Error("Async storage not set");try{const n=yield Ir.getItem(ou(h));return n?JSON.parse(n):null}catch(n){return null}})}function pg(h,n){return ke(this,null,function*(){if(!Ir)throw new Error("Async storage not set");try{yield Ir.setItem(ou(h),JSON.stringify(n))}catch(s){}})}const mg=Object.freeze(Object.defineProperty({__proto__:null,loadCachedContext:vg,loadCachedFlags:dg,saveCachedContext:pg,saveCachedFlags:cg,setAsyncCacheStorage:lg},Symbol.toStringTag,{value:"Module"}));typeof globalThis.Buffer=="undefined"&&(globalThis.Buffer=gr.Buffer);exports.FlagClient=ug;exports.LongPollingTransport=xh;exports.WebSocketTransport=_h;exports.asyncCache=mg;exports.evaluateFlagValue=tu;exports.evaluateRollout=Qo;exports.hashToPercentage=j0;exports.pickVariant=jo;exports.syncCache=ag;
|