@elizaos/plugin-elizacloud 2.0.0-alpha.7 → 2.0.0-alpha.8

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.
@@ -1,22 +1,22 @@
1
- var zY=Object.create;var{getPrototypeOf:MY,defineProperty:KO,getOwnPropertyNames:CX,getOwnPropertyDescriptor:qY}=Object,LX=Object.prototype.hasOwnProperty;var PY=(Q,$,V)=>{V=Q!=null?zY(MY(Q)):{};let W=$||!Q||!Q.__esModule?KO(V,"default",{value:Q,enumerable:!0}):V;for(let C of CX(Q))if(!LX.call(W,C))KO(W,C,{get:()=>Q[C],enumerable:!0});return W},IX=new WeakMap,h0=(Q)=>{var $=IX.get(Q),V;if($)return $;if($=KO({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function")CX(Q).map((W)=>!LX.call($,W)&&KO($,W,{get:()=>Q[W],enumerable:!(V=qY(Q,W))||V.enumerable}));return IX.set(Q,$),$},kY=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports);var WO=(Q,$)=>{for(var V in $)KO(Q,V,{get:$[V],enumerable:!0,configurable:!0,set:(W)=>$[V]=()=>W})};var HO=(Q,$)=>()=>(Q&&($=Q(Q=0)),$);var _Y=((Q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Q,{get:($,V)=>(typeof require<"u"?require:$)[V]}):Q)(function(Q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+Q+'" is not supported')});var WU={};WO(WU,{transcode:()=>q$,resolveObjectURL:()=>T$,kStringMaxLength:()=>mX,kMaxLength:()=>FO,isUtf8:()=>z$,isAscii:()=>M$,default:()=>P$,constants:()=>rY,btoa:()=>nY,atob:()=>mY,INSPECT_MAX_BYTES:()=>nX,File:()=>tY,Buffer:()=>G0,Blob:()=>sY});function uY(Q){var $=Q.length;if($%4>0)throw Error("Invalid string. Length must be a multiple of 4");var V=Q.indexOf("=");if(V===-1)V=$;var W=V===$?0:4-V%4;return[V,W]}function bY(Q,$){return(Q+$)*3/4-$}function lY(Q){var $,V=uY(Q),W=V[0],C=V[1],D=new Uint8Array(bY(W,C)),A=0,z=C>0?W-4:W,M;for(M=0;M<z;M+=4)$=fU[Q.charCodeAt(M)]<<18|fU[Q.charCodeAt(M+1)]<<12|fU[Q.charCodeAt(M+2)]<<6|fU[Q.charCodeAt(M+3)],D[A++]=$>>16&255,D[A++]=$>>8&255,D[A++]=$&255;if(C===2)$=fU[Q.charCodeAt(M)]<<2|fU[Q.charCodeAt(M+1)]>>4,D[A++]=$&255;if(C===1)$=fU[Q.charCodeAt(M)]<<10|fU[Q.charCodeAt(M+1)]<<4|fU[Q.charCodeAt(M+2)]>>2,D[A++]=$>>8&255,D[A++]=$&255;return D}function dY(Q){return bU[Q>>18&63]+bU[Q>>12&63]+bU[Q>>6&63]+bU[Q&63]}function oY(Q,$,V){var W,C=[];for(var D=$;D<V;D+=3)W=(Q[D]<<16&16711680)+(Q[D+1]<<8&65280)+(Q[D+2]&255),C.push(dY(W));return C.join("")}function hX(Q){var $,V=Q.length,W=V%3,C=[],D=16383;for(var A=0,z=V-W;A<z;A+=D)C.push(oY(Q,A,A+D>z?z:A+D));if(W===1)$=Q[V-1],C.push(bU[$>>2]+bU[$<<4&63]+"==");else if(W===2)$=(Q[V-2]<<8)+Q[V-1],C.push(bU[$>>10]+bU[$>>4&63]+bU[$<<2&63]+"=");return C.join("")}function cO(Q,$,V,W,C){var D,A,z=C*8-W-1,M=(1<<z)-1,F=M>>1,R=-7,K=V?C-1:0,H=V?-1:1,q=Q[$+K];K+=H,D=q&(1<<-R)-1,q>>=-R,R+=z;for(;R>0;D=D*256+Q[$+K],K+=H,R-=8);A=D&(1<<-R)-1,D>>=-R,R+=W;for(;R>0;A=A*256+Q[$+K],K+=H,R-=8);if(D===0)D=1-F;else if(D===M)return A?NaN:(q?-1:1)*(1/0);else A=A+Math.pow(2,W),D=D-F;return(q?-1:1)*A*Math.pow(2,D-W)}function oX(Q,$,V,W,C,D){var A,z,M,F=D*8-C-1,R=(1<<F)-1,K=R>>1,H=C===23?Math.pow(2,-24)-Math.pow(2,-77):0,q=W?0:D-1,P=W?1:-1,_=$<0||$===0&&1/$<0?1:0;if($=Math.abs($),isNaN($)||$===1/0)z=isNaN($)?1:0,A=R;else{if(A=Math.floor(Math.log($)/Math.LN2),$*(M=Math.pow(2,-A))<1)A--,M*=2;if(A+K>=1)$+=H/M;else $+=H*Math.pow(2,1-K);if($*M>=2)A++,M/=2;if(A+K>=R)z=0,A=R;else if(A+K>=1)z=($*M-1)*Math.pow(2,C),A=A+K;else z=$*Math.pow(2,K-1)*Math.pow(2,C),A=0}for(;C>=8;Q[V+q]=z&255,q+=P,z/=256,C-=8);A=A<<C|z,F+=C;for(;F>0;Q[V+q]=A&255,q+=P,A/=256,F-=8);Q[V+q-P]|=_*128}function oU(Q){if(Q>FO)throw RangeError('The value "'+Q+'" is invalid for option "size"');let $=new Uint8Array(Q);return Object.setPrototypeOf($,G0.prototype),$}function RZ(Q,$,V){return class extends V{constructor(){super();Object.defineProperty(this,"message",{value:$.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Q}]`,this.stack,delete this.name}get code(){return Q}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${Q}]: ${this.message}`}}}function G0(Q,$,V){if(typeof Q==="number"){if(typeof $==="string")throw TypeError('The "string" argument must be of type string. Received type number');return TZ(Q)}return tX(Q,$,V)}function tX(Q,$,V){if(typeof Q==="string")return U$(Q,$);if(ArrayBuffer.isView(Q))return O$(Q);if(Q==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(lU(Q,ArrayBuffer)||Q&&lU(Q.buffer,ArrayBuffer))return DZ(Q,$,V);if(typeof SharedArrayBuffer<"u"&&(lU(Q,SharedArrayBuffer)||Q&&lU(Q.buffer,SharedArrayBuffer)))return DZ(Q,$,V);if(typeof Q==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let W=Q.valueOf&&Q.valueOf();if(W!=null&&W!==Q)return G0.from(W,$,V);let C=Z$(Q);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]==="function")return G0.from(Q[Symbol.toPrimitive]("string"),$,V);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}function sX(Q){if(typeof Q!=="number")throw TypeError('"size" argument must be of type number');else if(Q<0)throw RangeError('The value "'+Q+'" is invalid for option "size"')}function iY(Q,$,V){if(sX(Q),Q<=0)return oU(Q);if($!==void 0)return typeof V==="string"?oU(Q).fill($,V):oU(Q).fill($);return oU(Q)}function TZ(Q){return sX(Q),oU(Q<0?0:zZ(Q)|0)}function U$(Q,$){if(typeof $!=="string"||$==="")$="utf8";if(!G0.isEncoding($))throw TypeError("Unknown encoding: "+$);let V=rX(Q,$)|0,W=oU(V),C=W.write(Q,$);if(C!==V)W=W.slice(0,C);return W}function SZ(Q){let $=Q.length<0?0:zZ(Q.length)|0,V=oU($);for(let W=0;W<$;W+=1)V[W]=Q[W]&255;return V}function O$(Q){if(lU(Q,Uint8Array)){let $=new Uint8Array(Q);return DZ($.buffer,$.byteOffset,$.byteLength)}return SZ(Q)}function DZ(Q,$,V){if($<0||Q.byteLength<$)throw RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<$+(V||0))throw RangeError('"length" is outside of buffer bounds');let W;if($===void 0&&V===void 0)W=new Uint8Array(Q);else if(V===void 0)W=new Uint8Array(Q,$);else W=new Uint8Array(Q,$,V);return Object.setPrototypeOf(W,G0.prototype),W}function Z$(Q){if(G0.isBuffer(Q)){let $=zZ(Q.length)|0,V=oU($);if(V.length===0)return V;return Q.copy(V,0,0,$),V}if(Q.length!==void 0){if(typeof Q.length!=="number"||Number.isNaN(Q.length))return oU(0);return SZ(Q)}if(Q.type==="Buffer"&&Array.isArray(Q.data))return SZ(Q.data)}function zZ(Q){if(Q>=FO)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+FO.toString(16)+" bytes");return Q|0}function rX(Q,$){if(G0.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||lU(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);let V=Q.length,W=arguments.length>2&&arguments[2]===!0;if(!W&&V===0)return 0;let C=!1;for(;;)switch($){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":return FZ(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V*2;case"hex":return V>>>1;case"base64":return YQ(Q).length;default:if(C)return W?-1:FZ(Q).length;$=(""+$).toLowerCase(),C=!0}}function X$(Q,$,V){let W=!1;if($===void 0||$<0)$=0;if($>this.length)return"";if(V===void 0||V>this.length)V=this.length;if(V<=0)return"";if(V>>>=0,$>>>=0,V<=$)return"";if(!Q)Q="utf8";while(!0)switch(Q){case"hex":return C$(this,$,V);case"utf8":case"utf-8":return eX(this,$,V);case"ascii":return E$(this,$,V);case"latin1":case"binary":return I$(this,$,V);case"base64":return G$(this,$,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L$(this,$,V);default:if(W)throw TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),W=!0}}function QO(Q,$,V){let W=Q[$];Q[$]=Q[V],Q[V]=W}function aX(Q,$,V,W,C){if(Q.length===0)return-1;if(typeof V==="string")W=V,V=0;else if(V>2147483647)V=2147483647;else if(V<-2147483648)V=-2147483648;if(V=+V,Number.isNaN(V))V=C?0:Q.length-1;if(V<0)V=Q.length+V;if(V>=Q.length)if(C)return-1;else V=Q.length-1;else if(V<0)if(C)V=0;else return-1;if(typeof $==="string")$=G0.from($,W);if(G0.isBuffer($)){if($.length===0)return-1;return bX(Q,$,V,W,C)}else if(typeof $==="number"){if($=$&255,typeof Uint8Array.prototype.indexOf==="function")if(C)return Uint8Array.prototype.indexOf.call(Q,$,V);else return Uint8Array.prototype.lastIndexOf.call(Q,$,V);return bX(Q,[$],V,W,C)}throw TypeError("val must be string, number or Buffer")}function bX(Q,$,V,W,C){let D=1,A=Q.length,z=$.length;if(W!==void 0){if(W=String(W).toLowerCase(),W==="ucs2"||W==="ucs-2"||W==="utf16le"||W==="utf-16le"){if(Q.length<2||$.length<2)return-1;D=2,A/=2,z/=2,V/=2}}function M(R,K){if(D===1)return R[K];else return R.readUInt16BE(K*D)}let F;if(C){let R=-1;for(F=V;F<A;F++)if(M(Q,F)===M($,R===-1?0:F-R)){if(R===-1)R=F;if(F-R+1===z)return R*D}else{if(R!==-1)F-=F-R;R=-1}}else{if(V+z>A)V=A-z;for(F=V;F>=0;F--){let R=!0;for(let K=0;K<z;K++)if(M(Q,F+K)!==M($,K)){R=!1;break}if(R)return F}}return-1}function Q$(Q,$,V,W){V=Number(V)||0;let C=Q.length-V;if(!W)W=C;else if(W=Number(W),W>C)W=C;let D=$.length;if(W>D/2)W=D/2;let A;for(A=0;A<W;++A){let z=parseInt($.substr(A*2,2),16);if(Number.isNaN(z))return A;Q[V+A]=z}return A}function Y$(Q,$,V,W){return pO(FZ($,Q.length-V),Q,V,W)}function $$(Q,$,V,W){return pO(S$($),Q,V,W)}function A$(Q,$,V,W){return pO(YQ($),Q,V,W)}function J$(Q,$,V,W){return pO(D$($,Q.length-V),Q,V,W)}function G$(Q,$,V){if($===0&&V===Q.length)return hX(Q);else return hX(Q.slice($,V))}function eX(Q,$,V){V=Math.min(Q.length,V);let W=[],C=$;while(C<V){let D=Q[C],A=null,z=D>239?4:D>223?3:D>191?2:1;if(C+z<=V){let M,F,R,K;switch(z){case 1:if(D<128)A=D;break;case 2:if(M=Q[C+1],(M&192)===128){if(K=(D&31)<<6|M&63,K>127)A=K}break;case 3:if(M=Q[C+1],F=Q[C+2],(M&192)===128&&(F&192)===128){if(K=(D&15)<<12|(M&63)<<6|F&63,K>2047&&(K<55296||K>57343))A=K}break;case 4:if(M=Q[C+1],F=Q[C+2],R=Q[C+3],(M&192)===128&&(F&192)===128&&(R&192)===128){if(K=(D&15)<<18|(M&63)<<12|(F&63)<<6|R&63,K>65535&&K<1114112)A=K}}}if(A===null)A=65533,z=1;else if(A>65535)A-=65536,W.push(A>>>10&1023|55296),A=56320|A&1023;W.push(A),C+=z}return V$(W)}function V$(Q){let $=Q.length;if($<=lX)return String.fromCharCode.apply(String,Q);let V="",W=0;while(W<$)V+=String.fromCharCode.apply(String,Q.slice(W,W+=lX));return V}function E$(Q,$,V){let W="";V=Math.min(Q.length,V);for(let C=$;C<V;++C)W+=String.fromCharCode(Q[C]&127);return W}function I$(Q,$,V){let W="";V=Math.min(Q.length,V);for(let C=$;C<V;++C)W+=String.fromCharCode(Q[C]);return W}function C$(Q,$,V){let W=Q.length;if(!$||$<0)$=0;if(!V||V<0||V>W)V=W;let C="";for(let D=$;D<V;++D)C+=F$[Q[D]];return C}function L$(Q,$,V){let W=Q.slice($,V),C="";for(let D=0;D<W.length-1;D+=2)C+=String.fromCharCode(W[D]+W[D+1]*256);return C}function KU(Q,$,V){if(Q%1!==0||Q<0)throw RangeError("offset is not uint");if(Q+$>V)throw RangeError("Trying to access beyond buffer length")}function kU(Q,$,V,W,C,D){if(!G0.isBuffer(Q))throw TypeError('"buffer" argument must be a Buffer instance');if($>C||$<D)throw RangeError('"value" argument is out of bounds');if(V+W>Q.length)throw RangeError("Index out of range")}function iX(Q,$,V,W,C){QQ($,W,C,Q,V,7);let D=Number($&BigInt(4294967295));Q[V++]=D,D=D>>8,Q[V++]=D,D=D>>8,Q[V++]=D,D=D>>8,Q[V++]=D;let A=Number($>>BigInt(32)&BigInt(4294967295));return Q[V++]=A,A=A>>8,Q[V++]=A,A=A>>8,Q[V++]=A,A=A>>8,Q[V++]=A,V}function UQ(Q,$,V,W,C){QQ($,W,C,Q,V,7);let D=Number($&BigInt(4294967295));Q[V+7]=D,D=D>>8,Q[V+6]=D,D=D>>8,Q[V+5]=D,D=D>>8,Q[V+4]=D;let A=Number($>>BigInt(32)&BigInt(4294967295));return Q[V+3]=A,A=A>>8,Q[V+2]=A,A=A>>8,Q[V+1]=A,A=A>>8,Q[V]=A,V+8}function OQ(Q,$,V,W,C,D){if(V+W>Q.length)throw RangeError("Index out of range");if(V<0)throw RangeError("Index out of range")}function ZQ(Q,$,V,W,C){if($=+$,V=V>>>0,!C)OQ(Q,$,V,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return oX(Q,$,V,W,23,4),V+4}function XQ(Q,$,V,W,C){if($=+$,V=V>>>0,!C)OQ(Q,$,V,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return oX(Q,$,V,W,52,8),V+8}function dX(Q){let $="",V=Q.length,W=Q[0]==="-"?1:0;for(;V>=W+4;V-=3)$=`_${Q.slice(V-3,V)}${$}`;return`${Q.slice(0,V)}${$}`}function K$(Q,$,V){if(GO($,"offset"),Q[$]===void 0||Q[$+V]===void 0)RO($,Q.length-(V+1))}function QQ(Q,$,V,W,C,D){if(Q>V||Q<$){let A=typeof $==="bigint"?"n":"",z;if(D>3)if($===0||$===BigInt(0))z=`>= 0${A} and < 2${A} ** ${(D+1)*8}${A}`;else z=`>= -(2${A} ** ${(D+1)*8-1}${A}) and < 2 ** ${(D+1)*8-1}${A}`;else z=`>= ${$}${A} and <= ${V}${A}`;throw new HZ("value",z,Q)}K$(W,C,D)}function GO(Q,$){if(typeof Q!=="number")throw new eY($,"number",Q)}function RO(Q,$,V){if(Math.floor(Q)!==Q)throw GO(Q,V),new HZ(V||"offset","an integer",Q);if($<0)throw new aY;throw new HZ(V||"offset",`>= ${V?1:0} and <= ${$}`,Q)}function H$(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(W$,""),Q.length<2)return"";while(Q.length%4!==0)Q=Q+"=";return Q}function FZ(Q,$){$=$||1/0;let V,W=Q.length,C=null,D=[];for(let A=0;A<W;++A){if(V=Q.charCodeAt(A),V>55295&&V<57344){if(!C){if(V>56319){if(($-=3)>-1)D.push(239,191,189);continue}else if(A+1===W){if(($-=3)>-1)D.push(239,191,189);continue}C=V;continue}if(V<56320){if(($-=3)>-1)D.push(239,191,189);C=V;continue}V=(C-55296<<10|V-56320)+65536}else if(C){if(($-=3)>-1)D.push(239,191,189)}if(C=null,V<128){if(($-=1)<0)break;D.push(V)}else if(V<2048){if(($-=2)<0)break;D.push(V>>6|192,V&63|128)}else if(V<65536){if(($-=3)<0)break;D.push(V>>12|224,V>>6&63|128,V&63|128)}else if(V<1114112){if(($-=4)<0)break;D.push(V>>18|240,V>>12&63|128,V>>6&63|128,V&63|128)}else throw Error("Invalid code point")}return D}function S$(Q){let $=[];for(let V=0;V<Q.length;++V)$.push(Q.charCodeAt(V)&255);return $}function D$(Q,$){let V,W,C,D=[];for(let A=0;A<Q.length;++A){if(($-=2)<0)break;V=Q.charCodeAt(A),W=V>>8,C=V%256,D.push(C),D.push(W)}return D}function YQ(Q){return lY(H$(Q))}function pO(Q,$,V,W){let C;for(C=0;C<W;++C){if(C+V>=$.length||C>=Q.length)break;$[C+V]=Q[C]}return C}function lU(Q,$){return Q instanceof $||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===$.name}function eU(Q){return typeof BigInt>"u"?R$:Q}function R$(){throw Error("BigInt not supported")}function MZ(Q){return()=>{throw Error(Q+" is not implemented for node:buffer browser polyfill")}}var bU,fU,WZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",XO,pX,uX,nX=50,FO=2147483647,mX=536870888,nY,mY,tY,sY,rY,aY,eY,HZ,lX=4096,W$,F$,T$,z$,M$=(Q)=>{for(let $ of Q)if($.charCodeAt(0)>127)return!1;return!0},q$,P$;var HU=HO(()=>{bU=[],fU=[];for(XO=0,pX=WZ.length;XO<pX;++XO)bU[XO]=WZ[XO],fU[WZ.charCodeAt(XO)]=XO;fU[45]=62;fU[95]=63;uX=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,nY=globalThis.btoa,mY=globalThis.atob,tY=globalThis.File,sY=globalThis.Blob,rY={MAX_LENGTH:FO,MAX_STRING_LENGTH:mX};aY=RZ("ERR_BUFFER_OUT_OF_BOUNDS",function(Q){if(Q)return`${Q} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),eY=RZ("ERR_INVALID_ARG_TYPE",function(Q,$){return`The "${Q}" argument must be of type number. Received type ${typeof $}`},TypeError),HZ=RZ("ERR_OUT_OF_RANGE",function(Q,$,V){let W=`The value of "${Q}" is out of range.`,C=V;if(Number.isInteger(V)&&Math.abs(V)>4294967296)C=dX(String(V));else if(typeof V==="bigint"){if(C=String(V),V>BigInt(2)**BigInt(32)||V<-(BigInt(2)**BigInt(32)))C=dX(C);C+="n"}return W+=` It must be ${$}. Received ${C}`,W},RangeError);Object.defineProperty(G0.prototype,"parent",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.buffer}});Object.defineProperty(G0.prototype,"offset",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.byteOffset}});G0.poolSize=8192;G0.from=function(Q,$,V){return tX(Q,$,V)};Object.setPrototypeOf(G0.prototype,Uint8Array.prototype);Object.setPrototypeOf(G0,Uint8Array);G0.alloc=function(Q,$,V){return iY(Q,$,V)};G0.allocUnsafe=function(Q){return TZ(Q)};G0.allocUnsafeSlow=function(Q){return TZ(Q)};G0.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==G0.prototype};G0.compare=function(Q,$){if(lU(Q,Uint8Array))Q=G0.from(Q,Q.offset,Q.byteLength);if(lU($,Uint8Array))$=G0.from($,$.offset,$.byteLength);if(!G0.isBuffer(Q)||!G0.isBuffer($))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===$)return 0;let V=Q.length,W=$.length;for(let C=0,D=Math.min(V,W);C<D;++C)if(Q[C]!==$[C]){V=Q[C],W=$[C];break}if(V<W)return-1;if(W<V)return 1;return 0};G0.isEncoding=function(Q){switch(String(Q).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}};G0.concat=function(Q,$){if(!Array.isArray(Q))throw TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return G0.alloc(0);let V;if($===void 0){$=0;for(V=0;V<Q.length;++V)$+=Q[V].length}let W=G0.allocUnsafe($),C=0;for(V=0;V<Q.length;++V){let D=Q[V];if(lU(D,Uint8Array))if(C+D.length>W.length){if(!G0.isBuffer(D))D=G0.from(D);D.copy(W,C)}else Uint8Array.prototype.set.call(W,D,C);else if(!G0.isBuffer(D))throw TypeError('"list" argument must be an Array of Buffers');else D.copy(W,C);C+=D.length}return W};G0.byteLength=rX;G0.prototype._isBuffer=!0;G0.prototype.swap16=function(){let Q=this.length;if(Q%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$<Q;$+=2)QO(this,$,$+1);return this};G0.prototype.swap32=function(){let Q=this.length;if(Q%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let $=0;$<Q;$+=4)QO(this,$,$+3),QO(this,$+1,$+2);return this};G0.prototype.swap64=function(){let Q=this.length;if(Q%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let $=0;$<Q;$+=8)QO(this,$,$+7),QO(this,$+1,$+6),QO(this,$+2,$+5),QO(this,$+3,$+4);return this};G0.prototype.toString=function(){let Q=this.length;if(Q===0)return"";if(arguments.length===0)return eX(this,0,Q);return X$.apply(this,arguments)};G0.prototype.toLocaleString=G0.prototype.toString;G0.prototype.equals=function(Q){if(!G0.isBuffer(Q))throw TypeError("Argument must be a Buffer");if(this===Q)return!0;return G0.compare(this,Q)===0};G0.prototype.inspect=function(){let Q="",$=nX;if(Q=this.toString("hex",0,$).replace(/(.{2})/g,"$1 ").trim(),this.length>$)Q+=" ... ";return"<Buffer "+Q+">"};if(uX)G0.prototype[uX]=G0.prototype.inspect;G0.prototype.compare=function(Q,$,V,W,C){if(lU(Q,Uint8Array))Q=G0.from(Q,Q.offset,Q.byteLength);if(!G0.isBuffer(Q))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if($===void 0)$=0;if(V===void 0)V=Q?Q.length:0;if(W===void 0)W=0;if(C===void 0)C=this.length;if($<0||V>Q.length||W<0||C>this.length)throw RangeError("out of range index");if(W>=C&&$>=V)return 0;if(W>=C)return-1;if($>=V)return 1;if($>>>=0,V>>>=0,W>>>=0,C>>>=0,this===Q)return 0;let D=C-W,A=V-$,z=Math.min(D,A),M=this.slice(W,C),F=Q.slice($,V);for(let R=0;R<z;++R)if(M[R]!==F[R]){D=M[R],A=F[R];break}if(D<A)return-1;if(A<D)return 1;return 0};G0.prototype.includes=function(Q,$,V){return this.indexOf(Q,$,V)!==-1};G0.prototype.indexOf=function(Q,$,V){return aX(this,Q,$,V,!0)};G0.prototype.lastIndexOf=function(Q,$,V){return aX(this,Q,$,V,!1)};G0.prototype.write=function(Q,$,V,W){if($===void 0)W="utf8",V=this.length,$=0;else if(V===void 0&&typeof $==="string")W=$,V=this.length,$=0;else if(isFinite($))if($=$>>>0,isFinite(V)){if(V=V>>>0,W===void 0)W="utf8"}else W=V,V=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let C=this.length-$;if(V===void 0||V>C)V=C;if(Q.length>0&&(V<0||$<0)||$>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!W)W="utf8";let D=!1;for(;;)switch(W){case"hex":return Q$(this,Q,$,V);case"utf8":case"utf-8":return Y$(this,Q,$,V);case"ascii":case"latin1":case"binary":return $$(this,Q,$,V);case"base64":return A$(this,Q,$,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J$(this,Q,$,V);default:if(D)throw TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),D=!0}};G0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};G0.prototype.slice=function(Q,$){let V=this.length;if(Q=~~Q,$=$===void 0?V:~~$,Q<0){if(Q+=V,Q<0)Q=0}else if(Q>V)Q=V;if($<0){if($+=V,$<0)$=0}else if($>V)$=V;if($<Q)$=Q;let W=this.subarray(Q,$);return Object.setPrototypeOf(W,G0.prototype),W};G0.prototype.readUintLE=G0.prototype.readUIntLE=function(Q,$,V){if(Q=Q>>>0,$=$>>>0,!V)KU(Q,$,this.length);let W=this[Q],C=1,D=0;while(++D<$&&(C*=256))W+=this[Q+D]*C;return W};G0.prototype.readUintBE=G0.prototype.readUIntBE=function(Q,$,V){if(Q=Q>>>0,$=$>>>0,!V)KU(Q,$,this.length);let W=this[Q+--$],C=1;while($>0&&(C*=256))W+=this[Q+--$]*C;return W};G0.prototype.readUint8=G0.prototype.readUInt8=function(Q,$){if(Q=Q>>>0,!$)KU(Q,1,this.length);return this[Q]};G0.prototype.readUint16LE=G0.prototype.readUInt16LE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,2,this.length);return this[Q]|this[Q+1]<<8};G0.prototype.readUint16BE=G0.prototype.readUInt16BE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,2,this.length);return this[Q]<<8|this[Q+1]};G0.prototype.readUint32LE=G0.prototype.readUInt32LE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,4,this.length);return(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216};G0.prototype.readUint32BE=G0.prototype.readUInt32BE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,4,this.length);return this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])};G0.prototype.readBigUInt64LE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let $=this[Q],V=this[Q+7];if($===void 0||V===void 0)RO(Q,this.length-8);let W=$+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216,C=this[++Q]+this[++Q]*256+this[++Q]*65536+V*16777216;return BigInt(W)+(BigInt(C)<<BigInt(32))});G0.prototype.readBigUInt64BE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let $=this[Q],V=this[Q+7];if($===void 0||V===void 0)RO(Q,this.length-8);let W=$*16777216+this[++Q]*65536+this[++Q]*256+this[++Q],C=this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+V;return(BigInt(W)<<BigInt(32))+BigInt(C)});G0.prototype.readIntLE=function(Q,$,V){if(Q=Q>>>0,$=$>>>0,!V)KU(Q,$,this.length);let W=this[Q],C=1,D=0;while(++D<$&&(C*=256))W+=this[Q+D]*C;if(C*=128,W>=C)W-=Math.pow(2,8*$);return W};G0.prototype.readIntBE=function(Q,$,V){if(Q=Q>>>0,$=$>>>0,!V)KU(Q,$,this.length);let W=$,C=1,D=this[Q+--W];while(W>0&&(C*=256))D+=this[Q+--W]*C;if(C*=128,D>=C)D-=Math.pow(2,8*$);return D};G0.prototype.readInt8=function(Q,$){if(Q=Q>>>0,!$)KU(Q,1,this.length);if(!(this[Q]&128))return this[Q];return(255-this[Q]+1)*-1};G0.prototype.readInt16LE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,2,this.length);let V=this[Q]|this[Q+1]<<8;return V&32768?V|4294901760:V};G0.prototype.readInt16BE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,2,this.length);let V=this[Q+1]|this[Q]<<8;return V&32768?V|4294901760:V};G0.prototype.readInt32LE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,4,this.length);return this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24};G0.prototype.readInt32BE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,4,this.length);return this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]};G0.prototype.readBigInt64LE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let $=this[Q],V=this[Q+7];if($===void 0||V===void 0)RO(Q,this.length-8);let W=this[Q+4]+this[Q+5]*256+this[Q+6]*65536+(V<<24);return(BigInt(W)<<BigInt(32))+BigInt($+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216)});G0.prototype.readBigInt64BE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let $=this[Q],V=this[Q+7];if($===void 0||V===void 0)RO(Q,this.length-8);let W=($<<24)+this[++Q]*65536+this[++Q]*256+this[++Q];return(BigInt(W)<<BigInt(32))+BigInt(this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+V)});G0.prototype.readFloatLE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,4,this.length);return cO(this,Q,!0,23,4)};G0.prototype.readFloatBE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,4,this.length);return cO(this,Q,!1,23,4)};G0.prototype.readDoubleLE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,8,this.length);return cO(this,Q,!0,52,8)};G0.prototype.readDoubleBE=function(Q,$){if(Q=Q>>>0,!$)KU(Q,8,this.length);return cO(this,Q,!1,52,8)};G0.prototype.writeUintLE=G0.prototype.writeUIntLE=function(Q,$,V,W){if(Q=+Q,$=$>>>0,V=V>>>0,!W){let A=Math.pow(2,8*V)-1;kU(this,Q,$,V,A,0)}let C=1,D=0;this[$]=Q&255;while(++D<V&&(C*=256))this[$+D]=Q/C&255;return $+V};G0.prototype.writeUintBE=G0.prototype.writeUIntBE=function(Q,$,V,W){if(Q=+Q,$=$>>>0,V=V>>>0,!W){let A=Math.pow(2,8*V)-1;kU(this,Q,$,V,A,0)}let C=V-1,D=1;this[$+C]=Q&255;while(--C>=0&&(D*=256))this[$+C]=Q/D&255;return $+V};G0.prototype.writeUint8=G0.prototype.writeUInt8=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,1,255,0);return this[$]=Q&255,$+1};G0.prototype.writeUint16LE=G0.prototype.writeUInt16LE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,2,65535,0);return this[$]=Q&255,this[$+1]=Q>>>8,$+2};G0.prototype.writeUint16BE=G0.prototype.writeUInt16BE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,2,65535,0);return this[$]=Q>>>8,this[$+1]=Q&255,$+2};G0.prototype.writeUint32LE=G0.prototype.writeUInt32LE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,4,4294967295,0);return this[$+3]=Q>>>24,this[$+2]=Q>>>16,this[$+1]=Q>>>8,this[$]=Q&255,$+4};G0.prototype.writeUint32BE=G0.prototype.writeUInt32BE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,4,4294967295,0);return this[$]=Q>>>24,this[$+1]=Q>>>16,this[$+2]=Q>>>8,this[$+3]=Q&255,$+4};G0.prototype.writeBigUInt64LE=eU(function(Q,$=0){return iX(this,Q,$,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeBigUInt64BE=eU(function(Q,$=0){return UQ(this,Q,$,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeIntLE=function(Q,$,V,W){if(Q=+Q,$=$>>>0,!W){let z=Math.pow(2,8*V-1);kU(this,Q,$,V,z-1,-z)}let C=0,D=1,A=0;this[$]=Q&255;while(++C<V&&(D*=256)){if(Q<0&&A===0&&this[$+C-1]!==0)A=1;this[$+C]=(Q/D>>0)-A&255}return $+V};G0.prototype.writeIntBE=function(Q,$,V,W){if(Q=+Q,$=$>>>0,!W){let z=Math.pow(2,8*V-1);kU(this,Q,$,V,z-1,-z)}let C=V-1,D=1,A=0;this[$+C]=Q&255;while(--C>=0&&(D*=256)){if(Q<0&&A===0&&this[$+C+1]!==0)A=1;this[$+C]=(Q/D>>0)-A&255}return $+V};G0.prototype.writeInt8=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,1,127,-128);if(Q<0)Q=255+Q+1;return this[$]=Q&255,$+1};G0.prototype.writeInt16LE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,2,32767,-32768);return this[$]=Q&255,this[$+1]=Q>>>8,$+2};G0.prototype.writeInt16BE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,2,32767,-32768);return this[$]=Q>>>8,this[$+1]=Q&255,$+2};G0.prototype.writeInt32LE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,4,2147483647,-2147483648);return this[$]=Q&255,this[$+1]=Q>>>8,this[$+2]=Q>>>16,this[$+3]=Q>>>24,$+4};G0.prototype.writeInt32BE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,4,2147483647,-2147483648);if(Q<0)Q=4294967295+Q+1;return this[$]=Q>>>24,this[$+1]=Q>>>16,this[$+2]=Q>>>8,this[$+3]=Q&255,$+4};G0.prototype.writeBigInt64LE=eU(function(Q,$=0){return iX(this,Q,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeBigInt64BE=eU(function(Q,$=0){return UQ(this,Q,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeFloatLE=function(Q,$,V){return ZQ(this,Q,$,!0,V)};G0.prototype.writeFloatBE=function(Q,$,V){return ZQ(this,Q,$,!1,V)};G0.prototype.writeDoubleLE=function(Q,$,V){return XQ(this,Q,$,!0,V)};G0.prototype.writeDoubleBE=function(Q,$,V){return XQ(this,Q,$,!1,V)};G0.prototype.copy=function(Q,$,V,W){if(!G0.isBuffer(Q))throw TypeError("argument should be a Buffer");if(!V)V=0;if(!W&&W!==0)W=this.length;if($>=Q.length)$=Q.length;if(!$)$=0;if(W>0&&W<V)W=V;if(W===V)return 0;if(Q.length===0||this.length===0)return 0;if($<0)throw RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw RangeError("Index out of range");if(W<0)throw RangeError("sourceEnd out of bounds");if(W>this.length)W=this.length;if(Q.length-$<W-V)W=Q.length-$+V;let C=W-V;if(this===Q&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin($,V,W);else Uint8Array.prototype.set.call(Q,this.subarray(V,W),$);return C};G0.prototype.fill=function(Q,$,V,W){if(typeof Q==="string"){if(typeof $==="string")W=$,$=0,V=this.length;else if(typeof V==="string")W=V,V=this.length;if(W!==void 0&&typeof W!=="string")throw TypeError("encoding must be a string");if(typeof W==="string"&&!G0.isEncoding(W))throw TypeError("Unknown encoding: "+W);if(Q.length===1){let D=Q.charCodeAt(0);if(W==="utf8"&&D<128||W==="latin1")Q=D}}else if(typeof Q==="number")Q=Q&255;else if(typeof Q==="boolean")Q=Number(Q);if($<0||this.length<$||this.length<V)throw RangeError("Out of range index");if(V<=$)return this;if($=$>>>0,V=V===void 0?this.length:V>>>0,!Q)Q=0;let C;if(typeof Q==="number")for(C=$;C<V;++C)this[C]=Q;else{let D=G0.isBuffer(Q)?Q:G0.from(Q,W),A=D.length;if(A===0)throw TypeError('The value "'+Q+'" is invalid for argument "value"');for(C=0;C<V-$;++C)this[C+$]=D[C%A]}return this};W$=/[^+/0-9A-Za-z-_]/g;F$=function(){let Q=Array(256);for(let $=0;$<16;++$){let V=$*16;for(let W=0;W<16;++W)Q[V+W]="0123456789abcdef"[$]+"0123456789abcdef"[W]}return Q}();T$=MZ("resolveObjectURL"),z$=MZ("isUtf8"),q$=MZ("transcode"),P$=G0});var zO={};WO(zO,{setMaxListeners:()=>WQ,once:()=>LQ,listenerCount:()=>HQ,init:()=>iU,getMaxListeners:()=>DQ,getEventListeners:()=>KQ,default:()=>f$,captureRejectionSymbol:()=>VQ,addAbortListener:()=>FQ,EventEmitter:()=>iU});function EQ(Q,$){var{_events:V}=Q;if($[0]??=Error("Unhandled error."),!V)throw $[0];var W=V[GQ];if(W)for(var C of AQ.call(W))C.apply(Q,$);var D=V.error;if(!D)throw $[0];for(var C of AQ.call(D))C.apply(Q,$);return!0}function v$(Q,$,V,W){$.then(void 0,function(C){queueMicrotask(()=>j$(Q,C,V,W))})}function j$(Q,$,V,W){if(typeof Q[$Q]==="function")Q[$Q]($,V,...W);else try{Q[YO]=!1,Q.emit("error",$)}finally{Q[YO]=!0}}function IQ(Q,$,V){V.warned=!0;let W=Error(`Possible EventEmitter memory leak detected. ${V.length} ${String($)} listeners added to [${Q.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);W.name="MaxListenersExceededWarning",W.emitter=Q,W.type=$,W.count=V.length,console.warn(W)}function CQ(Q,$,...V){this.removeListener(Q,$),$.apply(this,V)}function LQ(Q,$,V){var W=V?.signal;if(SQ(W,"options.signal"),W?.aborted)throw new qZ(void 0,{cause:W?.reason});let{resolve:C,reject:D,promise:A}=$newPromiseCapability(Promise),z=(R)=>{if(Q.removeListener($,M),W!=null)hO(W,"abort",F);D(R)},M=(...R)=>{if(typeof Q.removeListener==="function")Q.removeListener("error",z);if(W!=null)hO(W,"abort",F);C(R)};if(JQ(Q,$,M,{once:!0}),$!=="error"&&typeof Q.once==="function")Q.once("error",z);function F(){hO(Q,$,M),hO(Q,"error",z),D(new qZ(void 0,{cause:W?.reason}))}if(W!=null)JQ(W,"abort",F,{once:!0});return A}function KQ(Q,$){return Q.listeners($)}function WQ(Q,...$){kZ(Q,"setMaxListeners",0);var V;if($&&(V=$.length))for(let W=0;W<V;W++)$[W].setMaxListeners(Q);else $O=Q}function HQ(Q,$){return Q.listenerCount($)}function hO(Q,$,V,W){if(typeof Q.removeListener==="function")Q.removeListener($,V);else Q.removeEventListener($,V,W)}function JQ(Q,$,V,W){if(typeof Q.on==="function")if(W.once)Q.once($,V);else Q.on($,V);else Q.addEventListener($,V,W)}function VO(Q,$,V){let W=TypeError(`The "${Q}" argument must be of type ${$}. Received ${V}`);return W.code="ERR_INVALID_ARG_TYPE",W}function N$(Q,$,V){let W=RangeError(`The "${Q}" argument is out of range. It must be ${$}. Received ${V}`);return W.code="ERR_OUT_OF_RANGE",W}function SQ(Q,$){if(Q!==void 0&&(Q===null||typeof Q!=="object"||!("aborted"in Q)))throw VO($,"AbortSignal",Q)}function kZ(Q,$,V,W){if(typeof Q!=="number")throw VO($,"number",Q);if(V!=null&&Q<V||W!=null&&Q>W||(V!=null||W!=null)&&Number.isNaN(Q))throw N$($,`${V!=null?`>= ${V}`:""}${V!=null&&W!=null?" && ":""}${W!=null?`<= ${W}`:""}`,Q)}function TO(Q){if(typeof Q!=="function")throw TypeError("The listener must be a function")}function g$(Q,$){if(typeof Q!=="boolean")throw VO($,"boolean",Q)}function DQ(Q){return Q?._maxListeners??$O}function FQ(Q,$){if(Q===void 0)throw VO("signal","AbortSignal",Q);if(SQ(Q,"signal"),typeof $!=="function")throw VO("listener","function",$);let V;if(Q.aborted)queueMicrotask(()=>$());else Q.addEventListener("abort",$,{__proto__:null,once:!0}),V=()=>{Q.removeEventListener("abort",$)};return{__proto__:null,[Symbol.dispose](){V?.()}}}var PZ,YO,GQ,k$,_$,$Q,VQ,AQ,$O=10,iU=function(Q){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[YO]=Q?.captureRejections?Boolean(Q?.captureRejections):o0[YO])this.emit=x$},o0,B$=function(Q,...$){if(Q==="error")return EQ(this,$);var{_events:V}=this;if(V===void 0)return!1;var W=V[Q];if(W===void 0)return!1;let C=W.length>1?W.slice():W;for(let D=0,{length:A}=C;D<A;D++){let z=C[D];switch($.length){case 0:z.call(this);break;case 1:z.call(this,$[0]);break;case 2:z.call(this,$[0],$[1]);break;case 3:z.call(this,$[0],$[1],$[2]);break;default:z.apply(this,$);break}}return!0},x$=function(Q,...$){if(Q==="error")return EQ(this,$);var{_events:V}=this;if(V===void 0)return!1;var W=V[Q];if(W===void 0)return!1;let C=W.length>1?W.slice():W;for(let D=0,{length:A}=C;D<A;D++){let z=C[D],M;switch($.length){case 0:M=z.call(this);break;case 1:M=z.call(this,$[0]);break;case 2:M=z.call(this,$[0],$[1]);break;case 3:M=z.call(this,$[0],$[1],$[2]);break;default:M=z.apply(this,$);break}if(M!==void 0&&typeof M?.then==="function"&&M.then===Promise.prototype.then)v$(this,M,Q,$)}return!0},qZ,f$;var MO=HO(()=>{PZ=Symbol.for,YO=Symbol("kCapture"),GQ=PZ("events.errorMonitor"),k$=Symbol("events.maxEventTargetListeners"),_$=Symbol("events.maxEventTargetListenersWarned"),$Q=PZ("nodejs.rejection"),VQ=PZ("nodejs.rejection"),AQ=Array.prototype.slice,o0=iU.prototype={};o0._events=void 0;o0._eventsCount=0;o0._maxListeners=void 0;o0.setMaxListeners=function(Q){return kZ(Q,"setMaxListeners",0),this._maxListeners=Q,this};o0.constructor=iU;o0.getMaxListeners=function(){return this?._maxListeners??$O};o0.emit=B$;o0.addListener=function(Q,$){TO($);var V=this._events;if(!V)V=this._events={__proto__:null},this._eventsCount=0;else if(V.newListener)this.emit("newListener",Q,$.listener??$);var W=V[Q];if(!W)V[Q]=[$],this._eventsCount++;else{W.push($);var C=this._maxListeners??$O;if(C>0&&W.length>C&&!W.warned)IQ(this,Q,W)}return this};o0.on=o0.addListener;o0.prependListener=function(Q,$){TO($);var V=this._events;if(!V)V=this._events={__proto__:null},this._eventsCount=0;else if(V.newListener)this.emit("newListener",Q,$.listener??$);var W=V[Q];if(!W)V[Q]=[$],this._eventsCount++;else{W.unshift($);var C=this._maxListeners??$O;if(C>0&&W.length>C&&!W.warned)IQ(this,Q,W)}return this};o0.once=function(Q,$){TO($);let V=CQ.bind(this,Q,$);return V.listener=$,this.addListener(Q,V),this};o0.prependOnceListener=function(Q,$){TO($);let V=CQ.bind(this,Q,$);return V.listener=$,this.prependListener(Q,V),this};o0.removeListener=function(Q,$){TO($);var{_events:V}=this;if(!V)return this;var W=V[Q];if(!W)return this;var C=W.length;let D=-1;for(let A=C-1;A>=0;A--)if(W[A]===$||W[A].listener===$){D=A;break}if(D<0)return this;if(D===0)W.shift();else W.splice(D,1);if(W.length===0)delete V[Q],this._eventsCount--;return this};o0.off=o0.removeListener;o0.removeAllListeners=function(Q){var{_events:$}=this;if(Q&&$){if($[Q])delete $[Q],this._eventsCount--}else this._events={__proto__:null};return this};o0.listeners=function(Q){var{_events:$}=this;if(!$)return[];var V=$[Q];if(!V)return[];return V.map((W)=>W.listener??W)};o0.rawListeners=function(Q){var{_events:$}=this;if(!$)return[];var V=$[Q];if(!V)return[];return V.slice()};o0.listenerCount=function(Q){var{_events:$}=this;if(!$)return 0;return $[Q]?.length??0};o0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};o0[YO]=!1;qZ=class qZ extends Error{constructor(Q="The operation was aborted",$=void 0){if($!==void 0&&typeof $!=="object")throw VO("options","Object",$);super(Q,$);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(iU,{captureRejections:{get(){return o0[YO]},set(Q){g$(Q,"EventEmitter.captureRejections"),o0[YO]=Q},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return $O},set:(Q)=>{kZ(Q,"defaultMaxListeners",0),$O=Q}},kMaxEventTargetListeners:{value:k$,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:_$,enumerable:!1,configurable:!1,writable:!1}});Object.assign(iU,{once:LQ,getEventListeners:KQ,getMaxListeners:DQ,setMaxListeners:WQ,EventEmitter:iU,usingDomains:!1,captureRejectionSymbol:VQ,errorMonitor:GQ,addAbortListener:FQ,init:iU,listenerCount:HQ});f$=iU});var dO=kY((YE,_Q)=>{var b0=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports),n0=b0((Q,$)=>{class V extends Error{constructor(W){if(!Array.isArray(W))throw TypeError(`Expected input to be an Array, got ${typeof W}`);let C="";for(let D=0;D<W.length;D++)C+=` ${W[D].stack}
2
- `;super(C);this.name="AggregateError",this.errors=W}}$.exports={AggregateError:V,ArrayIsArray(W){return Array.isArray(W)},ArrayPrototypeIncludes(W,C){return W.includes(C)},ArrayPrototypeIndexOf(W,C){return W.indexOf(C)},ArrayPrototypeJoin(W,C){return W.join(C)},ArrayPrototypeMap(W,C){return W.map(C)},ArrayPrototypePop(W,C){return W.pop(C)},ArrayPrototypePush(W,C){return W.push(C)},ArrayPrototypeSlice(W,C,D){return W.slice(C,D)},Error,FunctionPrototypeCall(W,C,...D){return W.call(C,...D)},FunctionPrototypeSymbolHasInstance(W,C){return Function.prototype[Symbol.hasInstance].call(W,C)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(W,C){return Object.defineProperties(W,C)},ObjectDefineProperty(W,C,D){return Object.defineProperty(W,C,D)},ObjectGetOwnPropertyDescriptor(W,C){return Object.getOwnPropertyDescriptor(W,C)},ObjectKeys(W){return Object.keys(W)},ObjectSetPrototypeOf(W,C){return Object.setPrototypeOf(W,C)},Promise,PromisePrototypeCatch(W,C){return W.catch(C)},PromisePrototypeThen(W,C,D){return W.then(C,D)},PromiseReject(W){return Promise.reject(W)},PromiseResolve(W){return Promise.resolve(W)},ReflectApply:Reflect.apply,RegExpPrototypeTest(W,C){return W.test(C)},SafeSet:Set,String,StringPrototypeSlice(W,C,D){return W.slice(C,D)},StringPrototypeToLowerCase(W){return W.toLowerCase()},StringPrototypeToUpperCase(W){return W.toUpperCase()},StringPrototypeTrim(W){return W.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(W,C,D){return W.set(C,D)},Boolean,Uint8Array}}),RQ=b0((Q,$)=>{$.exports={format(V,...W){return V.replace(/%([sdifj])/g,function(...[C,D]){let A=W.shift();if(D==="f")return A.toFixed(6);else if(D==="j")return JSON.stringify(A);else if(D==="s"&&typeof A==="object")return`${A.constructor!==Object?A.constructor.name:""} {}`.trim();else return A.toString()})},inspect(V){switch(typeof V){case"string":if(V.includes("'")){if(!V.includes('"'))return`"${V}"`;else if(!V.includes("`")&&!V.includes("${"))return`\`${V}\``}return`'${V}'`;case"number":if(isNaN(V))return"NaN";else if(Object.is(V,-0))return String(V);return V;case"bigint":return`${String(V)}n`;case"boolean":case"undefined":return String(V);case"object":return"{}"}}}}),zU=b0((Q,$)=>{var{format:V,inspect:W}=RQ(),{AggregateError:C}=n0(),D=globalThis.AggregateError||C,A=Symbol("kIsNodeError"),z=["string","function","number","object","Function","Object","boolean","bigint","symbol"],M=/^([A-Z][a-z0-9]*)+$/,F={};function R(B,j){if(!B)throw new F.ERR_INTERNAL_ASSERTION(j)}function K(B){let j="",x=B.length,f=B[0]==="-"?1:0;for(;x>=f+4;x-=3)j=`_${B.slice(x-3,x)}${j}`;return`${B.slice(0,x)}${j}`}function H(B,j,x){if(typeof j==="function")return R(j.length<=x.length,`Code: ${B}; The provided arguments length (${x.length}) does not match the required ones (${j.length}).`),j(...x);let f=(j.match(/%[dfijoOs]/g)||[]).length;if(R(f===x.length,`Code: ${B}; The provided arguments length (${x.length}) does not match the required ones (${f}).`),x.length===0)return j;return V(j,...x)}function q(B,j,x){if(!x)x=Error;class f extends x{constructor(...w){super(H(B,j,w))}toString(){return`${this.name} [${B}]: ${this.message}`}}Object.defineProperties(f.prototype,{name:{value:x.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${B}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),f.prototype.code=B,f.prototype[A]=!0,F[B]=f}function P(B){let j="__node_internal_"+B.name;return Object.defineProperty(B,"name",{value:j}),B}function _(B,j){if(B&&j&&B!==j){if(Array.isArray(j.errors))return j.errors.push(B),j;let x=new D([j,B],j.message);return x.code=j.code,x}return B||j}class k extends Error{constructor(B="The operation was aborted",j=void 0){if(j!==void 0&&typeof j!=="object")throw new F.ERR_INVALID_ARG_TYPE("options","Object",j);super(B,j);this.code="ABORT_ERR",this.name="AbortError"}}q("ERR_ASSERTION","%s",Error),q("ERR_INVALID_ARG_TYPE",(B,j,x)=>{if(R(typeof B==="string","'name' must be a string"),!Array.isArray(j))j=[j];let f="The ";if(B.endsWith(" argument"))f+=`${B} `;else f+=`"${B}" ${B.includes(".")?"property":"argument"} `;f+="must be ";let w=[],d=[],Y0=[];for(let $0 of j)if(R(typeof $0==="string","All expected entries have to be of type string"),z.includes($0))w.push($0.toLowerCase());else if(M.test($0))d.push($0);else R($0!=="object",'The value "object" should be written as "Object"'),Y0.push($0);if(d.length>0){let $0=w.indexOf("object");if($0!==-1)w.splice(w,$0,1),d.push("Object")}if(w.length>0){switch(w.length){case 1:f+=`of type ${w[0]}`;break;case 2:f+=`one of type ${w[0]} or ${w[1]}`;break;default:{let $0=w.pop();f+=`one of type ${w.join(", ")}, or ${$0}`}}if(d.length>0||Y0.length>0)f+=" or "}if(d.length>0){switch(d.length){case 1:f+=`an instance of ${d[0]}`;break;case 2:f+=`an instance of ${d[0]} or ${d[1]}`;break;default:{let $0=d.pop();f+=`an instance of ${d.join(", ")}, or ${$0}`}}if(Y0.length>0)f+=" or "}switch(Y0.length){case 0:break;case 1:if(Y0[0].toLowerCase()!==Y0[0])f+="an ";f+=`${Y0[0]}`;break;case 2:f+=`one of ${Y0[0]} or ${Y0[1]}`;break;default:{let $0=Y0.pop();f+=`one of ${Y0.join(", ")}, or ${$0}`}}if(x==null)f+=`. Received ${x}`;else if(typeof x==="function"&&x.name)f+=`. Received function ${x.name}`;else if(typeof x==="object"){var J0;if((J0=x.constructor)!==null&&J0!==void 0&&J0.name)f+=`. Received an instance of ${x.constructor.name}`;else{let $0=W(x,{depth:-1});f+=`. Received ${$0}`}}else{let $0=W(x,{colors:!1});if($0.length>25)$0=`${$0.slice(0,25)}...`;f+=`. Received type ${typeof x} (${$0})`}return f},TypeError),q("ERR_INVALID_ARG_VALUE",(B,j,x="is invalid")=>{let f=W(j);if(f.length>128)f=f.slice(0,128)+"...";return`The ${B.includes(".")?"property":"argument"} '${B}' ${x}. Received ${f}`},TypeError),q("ERR_INVALID_RETURN_VALUE",(B,j,x)=>{var f;let w=x!==null&&x!==void 0&&(f=x.constructor)!==null&&f!==void 0&&f.name?`instance of ${x.constructor.name}`:`type ${typeof x}`;return`Expected ${B} to be returned from the "${j}" function but got ${w}.`},TypeError),q("ERR_MISSING_ARGS",(...B)=>{R(B.length>0,"At least one arg needs to be specified");let j,x=B.length;switch(B=(Array.isArray(B)?B:[B]).map((f)=>`"${f}"`).join(" or "),x){case 1:j+=`The ${B[0]} argument`;break;case 2:j+=`The ${B[0]} and ${B[1]} arguments`;break;default:{let f=B.pop();j+=`The ${B.join(", ")}, and ${f} arguments`}break}return`${j} must be specified`},TypeError),q("ERR_OUT_OF_RANGE",(B,j,x)=>{R(j,'Missing "range" argument');let f;if(Number.isInteger(x)&&Math.abs(x)>4294967296)f=K(String(x));else if(typeof x==="bigint"){f=String(x);let w=BigInt(2)**BigInt(32);if(x>w||x<-w)f=K(f);f+="n"}else f=W(x);return`The value of "${B}" is out of range. It must be ${j}. Received ${f}`},RangeError),q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),q("ERR_STREAM_WRITE_AFTER_END","write after end",Error),q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),$.exports={AbortError:k,aggregateTwoErrors:P(_),hideStackFrames:P,codes:F}}),w$=b0((Q,$)=>{Object.defineProperty(Q,"__esModule",{value:!0});var V=new WeakMap,W=new WeakMap;function C(u){let O0=V.get(u);return console.assert(O0!=null,"'this' is expected an Event object, but got",u),O0}function D(u){if(u.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",u.passiveListener);return}if(!u.event.cancelable)return;if(u.canceled=!0,typeof u.event.preventDefault==="function")u.event.preventDefault()}function A(u,O0){V.set(this,{eventTarget:u,event:O0,eventPhase:2,currentTarget:u,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:O0.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let U=Object.keys(O0);for(let X=0;X<U.length;++X){let J=U[X];if(!(J in this))Object.defineProperty(this,J,z(J))}}if(A.prototype={get type(){return C(this).event.type},get target(){return C(this).eventTarget},get currentTarget(){return C(this).currentTarget},composedPath(){let u=C(this).currentTarget;if(u==null)return[];return[u]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return C(this).eventPhase},stopPropagation(){let u=C(this);if(u.stopped=!0,typeof u.event.stopPropagation==="function")u.event.stopPropagation()},stopImmediatePropagation(){let u=C(this);if(u.stopped=!0,u.immediateStopped=!0,typeof u.event.stopImmediatePropagation==="function")u.event.stopImmediatePropagation()},get bubbles(){return Boolean(C(this).event.bubbles)},get cancelable(){return Boolean(C(this).event.cancelable)},preventDefault(){D(C(this))},get defaultPrevented(){return C(this).canceled},get composed(){return Boolean(C(this).event.composed)},get timeStamp(){return C(this).timeStamp},get srcElement(){return C(this).eventTarget},get cancelBubble(){return C(this).stopped},set cancelBubble(u){if(!u)return;let O0=C(this);if(O0.stopped=!0,typeof O0.event.cancelBubble==="boolean")O0.event.cancelBubble=!0},get returnValue(){return!C(this).canceled},set returnValue(u){if(!u)D(C(this))},initEvent(){}},Object.defineProperty(A.prototype,"constructor",{value:A,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(A.prototype,window.Event.prototype),W.set(window.Event.prototype,A);function z(u){return{get(){return C(this).event[u]},set(O0){C(this).event[u]=O0},configurable:!0,enumerable:!0}}function M(u){return{value(){let O0=C(this).event;return O0[u].apply(O0,arguments)},configurable:!0,enumerable:!0}}function F(u,O0){let U=Object.keys(O0);if(U.length===0)return u;function X(J,Z){u.call(this,J,Z)}X.prototype=Object.create(u.prototype,{constructor:{value:X,configurable:!0,writable:!0}});for(let J=0;J<U.length;++J){let Z=U[J];if(!(Z in u.prototype)){let Y=typeof Object.getOwnPropertyDescriptor(O0,Z).value==="function";Object.defineProperty(X.prototype,Z,Y?M(Z):z(Z))}}return X}function R(u){if(u==null||u===Object.prototype)return A;let O0=W.get(u);if(O0==null)O0=F(R(Object.getPrototypeOf(u)),u),W.set(u,O0);return O0}function K(u,O0){return new(R(Object.getPrototypeOf(O0)))(u,O0)}function H(u){return C(u).immediateStopped}function q(u,O0){C(u).eventPhase=O0}function P(u,O0){C(u).currentTarget=O0}function _(u,O0){C(u).passiveListener=O0}var k=new WeakMap,B=1,j=2,x=3;function f(u){return u!==null&&typeof u==="object"}function w(u){let O0=k.get(u);if(O0==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return O0}function d(u){return{get(){let O0=w(this).get(u);while(O0!=null){if(O0.listenerType===x)return O0.listener;O0=O0.next}return null},set(O0){if(typeof O0!=="function"&&!f(O0))O0=null;let U=w(this),X=null,J=U.get(u);while(J!=null){if(J.listenerType===x)if(X!==null)X.next=J.next;else if(J.next!==null)U.set(u,J.next);else U.delete(u);else X=J;J=J.next}if(O0!==null){let Z={listener:O0,listenerType:x,passive:!1,once:!1,next:null};if(X===null)U.set(u,Z);else X.next=Z}},configurable:!0,enumerable:!0}}function Y0(u,O0){Object.defineProperty(u,`on${O0}`,d(O0))}function J0(u){function O0(){$0.call(this)}O0.prototype=Object.create($0.prototype,{constructor:{value:O0,configurable:!0,writable:!0}});for(let U=0;U<u.length;++U)Y0(O0.prototype,u[U]);return O0}function $0(){if(this instanceof $0){k.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return J0(arguments[0]);if(arguments.length>0){let u=Array(arguments.length);for(let O0=0;O0<arguments.length;++O0)u[O0]=arguments[O0];return J0(u)}throw TypeError("Cannot call a class as a function")}if($0.prototype={addEventListener(u,O0,U){if(O0==null)return;if(typeof O0!=="function"&&!f(O0))throw TypeError("'listener' should be a function or an object.");let X=w(this),J=f(U),Z=(J?Boolean(U.capture):Boolean(U))?B:j,Y={listener:O0,listenerType:Z,passive:J&&Boolean(U.passive),once:J&&Boolean(U.once),next:null},I=X.get(u);if(I===void 0){X.set(u,Y);return}let L=null;while(I!=null){if(I.listener===O0&&I.listenerType===Z)return;L=I,I=I.next}L.next=Y},removeEventListener(u,O0,U){if(O0==null)return;let X=w(this),J=(f(U)?Boolean(U.capture):Boolean(U))?B:j,Z=null,Y=X.get(u);while(Y!=null){if(Y.listener===O0&&Y.listenerType===J){if(Z!==null)Z.next=Y.next;else if(Y.next!==null)X.set(u,Y.next);else X.delete(u);return}Z=Y,Y=Y.next}},dispatchEvent(u){if(u==null||typeof u.type!=="string")throw TypeError('"event.type" should be a string.');let O0=w(this),U=u.type,X=O0.get(U);if(X==null)return!0;let J=K(this,u),Z=null;while(X!=null){if(X.once)if(Z!==null)Z.next=X.next;else if(X.next!==null)O0.set(U,X.next);else O0.delete(U);else Z=X;if(_(J,X.passive?X.listener:null),typeof X.listener==="function")try{X.listener.call(this,J)}catch(Y){if(typeof console<"u"&&typeof console.error==="function")console.error(Y)}else if(X.listenerType!==x&&typeof X.listener.handleEvent==="function")X.listener.handleEvent(J);if(H(J))break;X=X.next}return _(J,null),q(J,0),P(J,null),!J.defaultPrevented}},Object.defineProperty($0.prototype,"constructor",{value:$0,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf($0.prototype,window.EventTarget.prototype);Q.defineEventAttribute=Y0,Q.EventTarget=$0,Q.default=$0,$.exports=$0,$.exports.EventTarget=$.exports.default=$0,$.exports.defineEventAttribute=Y0}),qO=b0((Q,$)=>{Object.defineProperty(Q,"__esModule",{value:!0});var V=w$();class W extends V.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let R=A.get(this);if(typeof R!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return R}}V.defineEventAttribute(W.prototype,"abort");function C(){let R=Object.create(W.prototype);return V.EventTarget.call(R),A.set(R,!1),R}function D(R){if(A.get(R)!==!1)return;A.set(R,!0),R.dispatchEvent({type:"abort"})}var A=new WeakMap;if(Object.defineProperties(W.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(W.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class z{constructor(){M.set(this,C())}get signal(){return F(this)}abort(){D(F(this))}}var M=new WeakMap;function F(R){let K=M.get(R);if(K==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${R===null?"null":typeof R}`);return K}if(Object.defineProperties(z.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(z.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Q.AbortController=z,Q.AbortSignal=W,Q.default=z,$.exports=z,$.exports.AbortController=$.exports.default=z,$.exports.AbortSignal=W}),_U=b0((Q,$)=>{var V=(HU(),h0(WU)),{format:W,inspect:C}=RQ(),{codes:{ERR_INVALID_ARG_TYPE:D}}=zU(),{kResistStopPropagation:A,AggregateError:z,SymbolDispose:M}=n0(),F=globalThis.AbortSignal||qO().AbortSignal,R=globalThis.AbortController||qO().AbortController,K=Object.getPrototypeOf(async function(){}).constructor,H=globalThis.Blob||V.Blob,q=typeof H<"u"?function(k){return k instanceof H}:function(k){return!1},P=(k,B)=>{if(k!==void 0&&(k===null||typeof k!=="object"||!("aborted"in k)))throw new D(B,"AbortSignal",k)},_=(k,B)=>{if(typeof k!=="function")throw new D(B,"Function",k)};$.exports={AggregateError:z,kEmptyObject:Object.freeze({}),once(k){let B=!1;return function(...j){if(B)return;B=!0,k.apply(this,j)}},createDeferredPromise:function(){let k,B;return{promise:new Promise((j,x)=>{k=j,B=x}),resolve:k,reject:B}},promisify(k){return new Promise((B,j)=>{k((x,...f)=>{if(x)return j(x);return B(...f)})})},debuglog(){return function(){}},format:W,inspect:C,types:{isAsyncFunction(k){return k instanceof K},isArrayBufferView(k){return ArrayBuffer.isView(k)}},isBlob:q,deprecate(k,B){return k},addAbortListener:(MO(),h0(zO)).addAbortListener||function(k,B){if(k===void 0)throw new D("signal","AbortSignal",k);P(k,"signal"),_(B,"listener");let j;if(k.aborted)queueMicrotask(()=>B());else k.addEventListener("abort",B,{__proto__:null,once:!0,[A]:!0}),j=()=>{k.removeEventListener("abort",B)};return{__proto__:null,[M](){var x;(x=j)===null||x===void 0||x()}}},AbortSignalAny:F.any||function(k){if(k.length===1)return k[0];let B=new R,j=()=>B.abort();return k.forEach((x)=>{P(x,"signals"),x.addEventListener("abort",j,{once:!0})}),B.signal.addEventListener("abort",()=>{k.forEach((x)=>x.removeEventListener("abort",j))},{once:!0}),B.signal}},$.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),PO=b0((Q,$)=>{var{ArrayIsArray:V,ArrayPrototypeIncludes:W,ArrayPrototypeJoin:C,ArrayPrototypeMap:D,NumberIsInteger:A,NumberIsNaN:z,NumberMAX_SAFE_INTEGER:M,NumberMIN_SAFE_INTEGER:F,NumberParseInt:R,ObjectPrototypeHasOwnProperty:K,RegExpPrototypeExec:H,String:q,StringPrototypeToUpperCase:P,StringPrototypeTrim:_}=n0(),{hideStackFrames:k,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:j,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:f,ERR_UNKNOWN_SIGNAL:w}}=zU(),{normalizeEncoding:d}=_U(),{isAsyncFunction:Y0,isArrayBufferView:J0}=_U().types,$0={};function u(c){return c===(c|0)}function O0(c){return c===c>>>0}var U=/^[0-7]+$/,X="must be a 32-bit unsigned integer or an octal string";function J(c,o,N0){if(typeof c>"u")c=N0;if(typeof c==="string"){if(H(U,c)===null)throw new x(o,c,X);c=R(c,8)}return I(c,o),c}var Z=k((c,o,N0=F,t=M)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!A(c))throw new f(o,"an integer",c);if(c<N0||c>t)throw new f(o,`>= ${N0} && <= ${t}`,c)}),Y=k((c,o,N0=-2147483648,t=2147483647)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!A(c))throw new f(o,"an integer",c);if(c<N0||c>t)throw new f(o,`>= ${N0} && <= ${t}`,c)}),I=k((c,o,N0=!1)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!A(c))throw new f(o,"an integer",c);let t=N0?1:0,Z0=4294967295;if(c<t||c>Z0)throw new f(o,`>= ${t} && <= ${Z0}`,c)});function L(c,o){if(typeof c!=="string")throw new j(o,"string",c)}function G(c,o,N0=void 0,t){if(typeof c!=="number")throw new j(o,"number",c);if(N0!=null&&c<N0||t!=null&&c>t||(N0!=null||t!=null)&&z(c))throw new f(o,`${N0!=null?`>= ${N0}`:""}${N0!=null&&t!=null?" && ":""}${t!=null?`<= ${t}`:""}`,c)}var O=k((c,o,N0)=>{if(!W(N0,c)){let t="must be one of: "+C(D(N0,(Z0)=>typeof Z0==="string"?`'${Z0}'`:q(Z0)),", ");throw new x(o,c,t)}});function E(c,o){if(typeof c!=="boolean")throw new j(o,"boolean",c)}function T(c,o,N0){return c==null||!K(c,o)?N0:c[o]}var S=k((c,o,N0=null)=>{let t=T(N0,"allowArray",!1),Z0=T(N0,"allowFunction",!1);if(!T(N0,"nullable",!1)&&c===null||!t&&V(c)||typeof c!=="object"&&(!Z0||typeof c!=="function"))throw new j(o,"Object",c)}),v=k((c,o)=>{if(c!=null&&typeof c!=="object"&&typeof c!=="function")throw new j(o,"a dictionary",c)}),g=k((c,o,N0=0)=>{if(!V(c))throw new j(o,"Array",c);if(c.length<N0){let t=`must be longer than ${N0}`;throw new x(o,c,t)}});function p(c,o){g(c,o);for(let N0=0;N0<c.length;N0++)L(c[N0],`${o}[${N0}]`)}function n(c,o){g(c,o);for(let N0=0;N0<c.length;N0++)E(c[N0],`${o}[${N0}]`)}function V0(c,o){g(c,o);for(let N0=0;N0<c.length;N0++){let t=c[N0],Z0=`${o}[${N0}]`;if(t==null)throw new j(Z0,"AbortSignal",t);i(t,Z0)}}function r(c,o="signal"){if(L(c,o),$0[c]===void 0){if($0[P(c)]!==void 0)throw new w(c+" (signals must use all capital letters)");throw new w(c)}}var l=k((c,o="buffer")=>{if(!J0(c))throw new j(o,["Buffer","TypedArray","DataView"],c)});function X0(c,o){let N0=d(o),t=c.length;if(N0==="hex"&&t%2!==0)throw new x("encoding",o,`is invalid for data of length ${t}`)}function m(c,o="Port",N0=!0){if(typeof c!=="number"&&typeof c!=="string"||typeof c==="string"&&_(c).length===0||+c!==+c>>>0||c>65535||c===0&&!N0)throw new B(o,c,N0);return c|0}var i=k((c,o)=>{if(c!==void 0&&(c===null||typeof c!=="object"||!("aborted"in c)))throw new j(o,"AbortSignal",c)}),g0=k((c,o)=>{if(typeof c!=="function")throw new j(o,"Function",c)}),y=k((c,o)=>{if(typeof c!=="function"||Y0(c))throw new j(o,"Function",c)}),h=k((c,o)=>{if(c!==void 0)throw new j(o,"undefined",c)});function Q0(c,o,N0){if(!W(N0,c))throw new j(o,`('${C(N0,"|")}')`,c)}var s=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function e(c,o){if(typeof c>"u"||!H(s,c))throw new x(o,c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function F0(c){if(typeof c==="string")return e(c,"hints"),c;else if(V(c)){let o=c.length,N0="";if(o===0)return N0;for(let t=0;t<o;t++){let Z0=c[t];if(e(Z0,"hints"),N0+=Z0,t!==o-1)N0+=", "}return N0}throw new x("hints",c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}$.exports={isInt32:u,isUint32:O0,parseFileMode:J,validateArray:g,validateStringArray:p,validateBooleanArray:n,validateAbortSignalArray:V0,validateBoolean:E,validateBuffer:l,validateDictionary:v,validateEncoding:X0,validateFunction:g0,validateInt32:Y,validateInteger:Z,validateNumber:G,validateObject:S,validateOneOf:O,validatePlainFunction:y,validatePort:m,validateSignalName:r,validateString:L,validateUint32:I,validateUndefined:h,validateUnion:Q0,validateAbortSignal:i,validateLinkHeaderValue:F0}}),AO=b0((Q,$)=>{$.exports=globalThis.process}),mU=b0((Q,$)=>{var{SymbolAsyncIterator:V,SymbolIterator:W,SymbolFor:C}=n0(),D=C("nodejs.stream.destroyed"),A=C("nodejs.stream.errored"),z=C("nodejs.stream.readable"),M=C("nodejs.stream.writable"),F=C("nodejs.stream.disturbed"),R=C("nodejs.webstream.isClosedPromise"),K=C("nodejs.webstream.controllerErrorFunction");function H(T,S=!1){var v;return!!(T&&typeof T.pipe==="function"&&typeof T.on==="function"&&(!S||typeof T.pause==="function"&&typeof T.resume==="function")&&(!T._writableState||((v=T._readableState)===null||v===void 0?void 0:v.readable)!==!1)&&(!T._writableState||T._readableState))}function q(T){var S;return!!(T&&typeof T.write==="function"&&typeof T.on==="function"&&(!T._readableState||((S=T._writableState)===null||S===void 0?void 0:S.writable)!==!1))}function P(T){return!!(T&&typeof T.pipe==="function"&&T._readableState&&typeof T.on==="function"&&typeof T.write==="function")}function _(T){return T&&(T._readableState||T._writableState||typeof T.write==="function"&&typeof T.on==="function"||typeof T.pipe==="function"&&typeof T.on==="function")}function k(T){return!!(T&&!_(T)&&typeof T.pipeThrough==="function"&&typeof T.getReader==="function"&&typeof T.cancel==="function")}function B(T){return!!(T&&!_(T)&&typeof T.getWriter==="function"&&typeof T.abort==="function")}function j(T){return!!(T&&!_(T)&&typeof T.readable==="object"&&typeof T.writable==="object")}function x(T){return k(T)||B(T)||j(T)}function f(T,S){if(T==null)return!1;if(S===!0)return typeof T[V]==="function";if(S===!1)return typeof T[W]==="function";return typeof T[V]==="function"||typeof T[W]==="function"}function w(T){if(!_(T))return null;let{_writableState:S,_readableState:v}=T,g=S||v;return!!(T.destroyed||T[D]||g!==null&&g!==void 0&&g.destroyed)}function d(T){if(!q(T))return null;if(T.writableEnded===!0)return!0;let S=T._writableState;if(S!==null&&S!==void 0&&S.errored)return!1;if(typeof(S===null||S===void 0?void 0:S.ended)!=="boolean")return null;return S.ended}function Y0(T,S){if(!q(T))return null;if(T.writableFinished===!0)return!0;let v=T._writableState;if(v!==null&&v!==void 0&&v.errored)return!1;if(typeof(v===null||v===void 0?void 0:v.finished)!=="boolean")return null;return!!(v.finished||S===!1&&v.ended===!0&&v.length===0)}function J0(T){if(!H(T))return null;if(T.readableEnded===!0)return!0;let S=T._readableState;if(!S||S.errored)return!1;if(typeof(S===null||S===void 0?void 0:S.ended)!=="boolean")return null;return S.ended}function $0(T,S){if(!H(T))return null;let v=T._readableState;if(v!==null&&v!==void 0&&v.errored)return!1;if(typeof(v===null||v===void 0?void 0:v.endEmitted)!=="boolean")return null;return!!(v.endEmitted||S===!1&&v.ended===!0&&v.length===0)}function u(T){if(T&&T[z]!=null)return T[z];if(typeof(T===null||T===void 0?void 0:T.readable)!=="boolean")return null;if(w(T))return!1;return H(T)&&T.readable&&!$0(T)}function O0(T){if(T&&T[M]!=null)return T[M];if(typeof(T===null||T===void 0?void 0:T.writable)!=="boolean")return null;if(w(T))return!1;return q(T)&&T.writable&&!d(T)}function U(T,S){if(!_(T))return null;if(w(T))return!0;if((S===null||S===void 0?void 0:S.readable)!==!1&&u(T))return!1;if((S===null||S===void 0?void 0:S.writable)!==!1&&O0(T))return!1;return!0}function X(T){var S,v;if(!_(T))return null;if(T.writableErrored)return T.writableErrored;return(S=(v=T._writableState)===null||v===void 0?void 0:v.errored)!==null&&S!==void 0?S:null}function J(T){var S,v;if(!_(T))return null;if(T.readableErrored)return T.readableErrored;return(S=(v=T._readableState)===null||v===void 0?void 0:v.errored)!==null&&S!==void 0?S:null}function Z(T){if(!_(T))return null;if(typeof T.closed==="boolean")return T.closed;let{_writableState:S,_readableState:v}=T;if(typeof(S===null||S===void 0?void 0:S.closed)==="boolean"||typeof(v===null||v===void 0?void 0:v.closed)==="boolean")return(S===null||S===void 0?void 0:S.closed)||(v===null||v===void 0?void 0:v.closed);if(typeof T._closed==="boolean"&&Y(T))return T._closed;return null}function Y(T){return typeof T._closed==="boolean"&&typeof T._defaultKeepAlive==="boolean"&&typeof T._removedConnection==="boolean"&&typeof T._removedContLen==="boolean"}function I(T){return typeof T._sent100==="boolean"&&Y(T)}function L(T){var S;return typeof T._consuming==="boolean"&&typeof T._dumped==="boolean"&&((S=T.req)===null||S===void 0?void 0:S.upgradeOrConnect)===void 0}function G(T){if(!_(T))return null;let{_writableState:S,_readableState:v}=T,g=S||v;return!g&&I(T)||!!(g&&g.autoDestroy&&g.emitClose&&g.closed===!1)}function O(T){var S;return!!(T&&((S=T[F])!==null&&S!==void 0?S:T.readableDidRead||T.readableAborted))}function E(T){var S,v,g,p,n,V0,r,l,X0,m;return!!(T&&((S=(v=(g=(p=(n=(V0=T[A])!==null&&V0!==void 0?V0:T.readableErrored)!==null&&n!==void 0?n:T.writableErrored)!==null&&p!==void 0?p:(r=T._readableState)===null||r===void 0?void 0:r.errorEmitted)!==null&&g!==void 0?g:(l=T._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&v!==void 0?v:(X0=T._readableState)===null||X0===void 0?void 0:X0.errored)!==null&&S!==void 0?S:(m=T._writableState)===null||m===void 0?void 0:m.errored))}$.exports={isDestroyed:w,kIsDestroyed:D,isDisturbed:O,kIsDisturbed:F,isErrored:E,kIsErrored:A,isReadable:u,kIsReadable:z,kIsClosedPromise:R,kControllerErrorFunction:K,kIsWritable:M,isClosed:Z,isDuplexNodeStream:P,isFinished:U,isIterable:f,isReadableNodeStream:H,isReadableStream:k,isReadableEnded:J0,isReadableFinished:$0,isReadableErrored:J,isNodeStream:_,isWebStream:x,isWritable:O0,isWritableNodeStream:q,isWritableStream:B,isWritableEnded:d,isWritableFinished:Y0,isWritableErrored:X,isServerRequest:L,isServerResponse:I,willEmitClose:G,isTransformStream:j}}),UO=b0((Q,$)=>{var V=AO(),{AbortError:W,codes:C}=zU(),{ERR_INVALID_ARG_TYPE:D,ERR_STREAM_PREMATURE_CLOSE:A}=C,{kEmptyObject:z,once:M}=_U(),{validateAbortSignal:F,validateFunction:R,validateObject:K,validateBoolean:H}=PO(),{Promise:q,PromisePrototypeThen:P,SymbolDispose:_}=n0(),{isClosed:k,isReadable:B,isReadableNodeStream:j,isReadableStream:x,isReadableFinished:f,isReadableErrored:w,isWritable:d,isWritableNodeStream:Y0,isWritableStream:J0,isWritableFinished:$0,isWritableErrored:u,isNodeStream:O0,willEmitClose:U,kIsClosedPromise:X}=mU(),J;function Z(O){return O.setHeader&&typeof O.abort==="function"}var Y=()=>{};function I(O,E,T){var S,v;if(arguments.length===2)T=E,E=z;else if(E==null)E=z;else K(E,"options");if(R(T,"callback"),F(E.signal,"options.signal"),T=M(T),x(O)||J0(O))return L(O,E,T);if(!O0(O))throw new D("stream",["ReadableStream","WritableStream","Stream"],O);let g=(S=E.readable)!==null&&S!==void 0?S:j(O),p=(v=E.writable)!==null&&v!==void 0?v:Y0(O),n=O._writableState,V0=O._readableState,r=()=>{if(!O.writable)m()},l=U(O)&&j(O)===g&&Y0(O)===p,X0=$0(O,!1),m=()=>{if(X0=!0,O.destroyed)l=!1;if(l&&(!O.readable||g))return;if(!g||i)T.call(O)},i=f(O,!1),g0=()=>{if(i=!0,O.destroyed)l=!1;if(l&&(!O.writable||p))return;if(!p||X0)T.call(O)},y=(c)=>{T.call(O,c)},h=k(O),Q0=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return T.call(O,c);if(g&&!i&&j(O,!0)){if(!f(O,!1))return T.call(O,new A)}if(p&&!X0){if(!$0(O,!1))return T.call(O,new A)}T.call(O)},s=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return T.call(O,c);T.call(O)},e=()=>{O.req.on("finish",m)};if(Z(O)){if(O.on("complete",m),!l)O.on("abort",Q0);if(O.req)e();else O.on("request",e)}else if(p&&!n)O.on("end",r),O.on("close",r);if(!l&&typeof O.aborted==="boolean")O.on("aborted",Q0);if(O.on("end",g0),O.on("finish",m),E.error!==!1)O.on("error",y);if(O.on("close",Q0),h)V.nextTick(Q0);else if(n!==null&&n!==void 0&&n.errorEmitted||V0!==null&&V0!==void 0&&V0.errorEmitted){if(!l)V.nextTick(s)}else if(!g&&(!l||B(O))&&(X0||d(O)===!1))V.nextTick(s);else if(!p&&(!l||d(O))&&(i||B(O)===!1))V.nextTick(s);else if(V0&&O.req&&O.aborted)V.nextTick(s);let F0=()=>{if(T=Y,O.removeListener("aborted",Q0),O.removeListener("complete",m),O.removeListener("abort",Q0),O.removeListener("request",e),O.req)O.req.removeListener("finish",m);O.removeListener("end",r),O.removeListener("close",r),O.removeListener("finish",m),O.removeListener("end",g0),O.removeListener("error",y),O.removeListener("close",Q0)};if(E.signal&&!h){let c=()=>{let o=T;F0(),o.call(O,new W(void 0,{cause:E.signal.reason}))};if(E.signal.aborted)V.nextTick(c);else{J=J||_U().addAbortListener;let o=J(E.signal,c),N0=T;T=M((...t)=>{o[_](),N0.apply(O,t)})}}return F0}function L(O,E,T){let S=!1,v=Y;if(E.signal)if(v=()=>{S=!0,T.call(O,new W(void 0,{cause:E.signal.reason}))},E.signal.aborted)V.nextTick(v);else{J=J||_U().addAbortListener;let p=J(E.signal,v),n=T;T=M((...V0)=>{p[_](),n.apply(O,V0)})}let g=(...p)=>{if(!S)V.nextTick(()=>T.apply(O,p))};return P(O[X].promise,g,g),Y}function G(O,E){var T;let S=!1;if(E===null)E=z;if((T=E)!==null&&T!==void 0&&T.cleanup)H(E.cleanup,"cleanup"),S=E.cleanup;return new q((v,g)=>{let p=I(O,E,(n)=>{if(S)p();if(n)g(n);else v()})})}$.exports=I,$.exports.finished=G}),EO=b0((Q,$)=>{var V=AO(),{aggregateTwoErrors:W,codes:{ERR_MULTIPLE_CALLBACK:C},AbortError:D}=zU(),{Symbol:A}=n0(),{kIsDestroyed:z,isDestroyed:M,isFinished:F,isServerRequest:R}=mU(),K=A("kDestroy"),H=A("kConstruct");function q(U,X,J){if(U){if(U.stack,X&&!X.errored)X.errored=U;if(J&&!J.errored)J.errored=U}}function P(U,X){let J=this._readableState,Z=this._writableState,Y=Z||J;if(Z!==null&&Z!==void 0&&Z.destroyed||J!==null&&J!==void 0&&J.destroyed){if(typeof X==="function")X();return this}if(q(U,Z,J),Z)Z.destroyed=!0;if(J)J.destroyed=!0;if(!Y.constructed)this.once(K,function(I){_(this,W(I,U),X)});else _(this,U,X);return this}function _(U,X,J){let Z=!1;function Y(I){if(Z)return;Z=!0;let{_readableState:L,_writableState:G}=U;if(q(I,G,L),G)G.closed=!0;if(L)L.closed=!0;if(typeof J==="function")J(I);if(I)V.nextTick(k,U,I);else V.nextTick(B,U)}try{U._destroy(X||null,Y)}catch(I){Y(I)}}function k(U,X){j(U,X),B(U)}function B(U){let{_readableState:X,_writableState:J}=U;if(J)J.closeEmitted=!0;if(X)X.closeEmitted=!0;if(J!==null&&J!==void 0&&J.emitClose||X!==null&&X!==void 0&&X.emitClose)U.emit("close")}function j(U,X){let{_readableState:J,_writableState:Z}=U;if(Z!==null&&Z!==void 0&&Z.errorEmitted||J!==null&&J!==void 0&&J.errorEmitted)return;if(Z)Z.errorEmitted=!0;if(J)J.errorEmitted=!0;U.emit("error",X)}function x(){let U=this._readableState,X=this._writableState;if(U)U.constructed=!0,U.closed=!1,U.closeEmitted=!1,U.destroyed=!1,U.errored=null,U.errorEmitted=!1,U.reading=!1,U.ended=U.readable===!1,U.endEmitted=U.readable===!1;if(X)X.constructed=!0,X.destroyed=!1,X.closed=!1,X.closeEmitted=!1,X.errored=null,X.errorEmitted=!1,X.finalCalled=!1,X.prefinished=!1,X.ended=X.writable===!1,X.ending=X.writable===!1,X.finished=X.writable===!1}function f(U,X,J){let{_readableState:Z,_writableState:Y}=U;if(Y!==null&&Y!==void 0&&Y.destroyed||Z!==null&&Z!==void 0&&Z.destroyed)return this;if(Z!==null&&Z!==void 0&&Z.autoDestroy||Y!==null&&Y!==void 0&&Y.autoDestroy)U.destroy(X);else if(X){if(X.stack,Y&&!Y.errored)Y.errored=X;if(Z&&!Z.errored)Z.errored=X;if(J)V.nextTick(j,U,X);else j(U,X)}}function w(U,X){if(typeof U._construct!=="function")return;let{_readableState:J,_writableState:Z}=U;if(J)J.constructed=!1;if(Z)Z.constructed=!1;if(U.once(H,X),U.listenerCount(H)>1)return;V.nextTick(d,U)}function d(U){let X=!1;function J(Z){if(X){f(U,Z!==null&&Z!==void 0?Z:new C);return}X=!0;let{_readableState:Y,_writableState:I}=U,L=I||Y;if(Y)Y.constructed=!0;if(I)I.constructed=!0;if(L.destroyed)U.emit(K,Z);else if(Z)f(U,Z,!0);else V.nextTick(Y0,U)}try{U._construct((Z)=>{V.nextTick(J,Z)})}catch(Z){V.nextTick(J,Z)}}function Y0(U){U.emit(H)}function J0(U){return(U===null||U===void 0?void 0:U.setHeader)&&typeof U.abort==="function"}function $0(U){U.emit("close")}function u(U,X){U.emit("error",X),V.nextTick($0,U)}function O0(U,X){if(!U||M(U))return;if(!X&&!F(U))X=new D;if(R(U))U.socket=null,U.destroy(X);else if(J0(U))U.abort();else if(J0(U.req))U.req.abort();else if(typeof U.destroy==="function")U.destroy(X);else if(typeof U.close==="function")U.close();else if(X)V.nextTick(u,U,X);else V.nextTick($0,U);if(!U.destroyed)U[z]=!0}$.exports={construct:w,destroyer:O0,destroy:P,undestroy:x,errorOrDestroy:f}}),_Z=b0((Q,$)=>{var{ArrayIsArray:V,ObjectSetPrototypeOf:W}=n0(),{EventEmitter:C}=(MO(),h0(zO));function D(z){C.call(this,z)}W(D.prototype,C.prototype),W(D,C),D.prototype.pipe=function(z,M){let F=this;function R(B){if(z.writable&&z.write(B)===!1&&F.pause)F.pause()}F.on("data",R);function K(){if(F.readable&&F.resume)F.resume()}if(z.on("drain",K),!z._isStdio&&(!M||M.end!==!1))F.on("end",q),F.on("close",P);let H=!1;function q(){if(H)return;H=!0,z.end()}function P(){if(H)return;if(H=!0,typeof z.destroy==="function")z.destroy()}function _(B){if(k(),C.listenerCount(this,"error")===0)this.emit("error",B)}A(F,"error",_),A(z,"error",_);function k(){F.removeListener("data",R),z.removeListener("drain",K),F.removeListener("end",q),F.removeListener("close",P),F.removeListener("error",_),z.removeListener("error",_),F.removeListener("end",k),F.removeListener("close",k),z.removeListener("close",k)}return F.on("end",k),F.on("close",k),z.on("close",k),z.emit("pipe",F),z};function A(z,M,F){if(typeof z.prependListener==="function")return z.prependListener(M,F);if(!z._events||!z._events[M])z.on(M,F);else if(V(z._events[M]))z._events[M].unshift(F);else z._events[M]=[F,z._events[M]]}$.exports={Stream:D,prependListener:A}}),uO=b0((Q,$)=>{var{SymbolDispose:V}=n0(),{AbortError:W,codes:C}=zU(),{isNodeStream:D,isWebStream:A,kControllerErrorFunction:z}=mU(),M=UO(),{ERR_INVALID_ARG_TYPE:F}=C,R,K=(H,q)=>{if(typeof H!=="object"||!("aborted"in H))throw new F(q,"AbortSignal",H)};$.exports.addAbortSignal=function(H,q){if(K(H,"signal"),!D(q)&&!A(q))throw new F("stream",["ReadableStream","WritableStream","Stream"],q);return $.exports.addAbortSignalNoValidate(H,q)},$.exports.addAbortSignalNoValidate=function(H,q){if(typeof H!=="object"||!("aborted"in H))return q;let P=D(q)?()=>{q.destroy(new W(void 0,{cause:H.reason}))}:()=>{q[z](new W(void 0,{cause:H.reason}))};if(H.aborted)P();else{R=R||_U().addAbortListener;let _=R(H,P);M(q,_[V])}return q}}),y$=b0((Q,$)=>{var{StringPrototypeSlice:V,SymbolIterator:W,TypedArrayPrototypeSet:C,Uint8Array:D}=n0(),{Buffer:A}=(HU(),h0(WU)),{inspect:z}=_U();$.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(M){let F={data:M,next:null};if(this.length>0)this.tail.next=F;else this.head=F;this.tail=F,++this.length}unshift(M){let F={data:M,next:this.head};if(this.length===0)this.tail=F;this.head=F,++this.length}shift(){if(this.length===0)return;let M=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,M}clear(){this.head=this.tail=null,this.length=0}join(M){if(this.length===0)return"";let F=this.head,R=""+F.data;while((F=F.next)!==null)R+=M+F.data;return R}concat(M){if(this.length===0)return A.alloc(0);let F=A.allocUnsafe(M>>>0),R=this.head,K=0;while(R)C(F,R.data,K),K+=R.data.length,R=R.next;return F}consume(M,F){let R=this.head.data;if(M<R.length){let K=R.slice(0,M);return this.head.data=R.slice(M),K}if(M===R.length)return this.shift();return F?this._getString(M):this._getBuffer(M)}first(){return this.head.data}*[W](){for(let M=this.head;M;M=M.next)yield M.data}_getString(M){let F="",R=this.head,K=0;do{let H=R.data;if(M>H.length)F+=H,M-=H.length;else{if(M===H.length)if(F+=H,++K,R.next)this.head=R.next;else this.head=this.tail=null;else F+=V(H,0,M),this.head=R,R.data=V(H,M);break}++K}while((R=R.next)!==null);return this.length-=K,F}_getBuffer(M){let F=A.allocUnsafe(M),R=M,K=this.head,H=0;do{let q=K.data;if(M>q.length)C(F,q,R-M),M-=q.length;else{if(M===q.length)if(C(F,q,R-M),++H,K.next)this.head=K.next;else this.head=this.tail=null;else C(F,new D(q.buffer,q.byteOffset,M),R-M),this.head=K,K.data=q.slice(M);break}++H}while((K=K.next)!==null);return this.length-=H,F}[Symbol.for("nodejs.util.inspect.custom")](M,F){return z(this,{...F,depth:0,customInspect:!1})}}}),bO=b0((Q,$)=>{var{MathFloor:V,NumberIsInteger:W}=n0(),{validateInteger:C}=PO(),{ERR_INVALID_ARG_VALUE:D}=zU().codes,A=16384,z=16;function M(H,q,P){return H.highWaterMark!=null?H.highWaterMark:q?H[P]:null}function F(H){return H?z:A}function R(H,q){if(C(q,"value",0),H)z=q;else A=q}function K(H,q,P,_){let k=M(q,_,P);if(k!=null){if(!W(k)||k<0){let B=_?`options.${P}`:"options.highWaterMark";throw new D(B,k)}return V(k)}return F(H.objectMode)}$.exports={getHighWaterMark:K,getDefaultHighWaterMark:F,setDefaultHighWaterMark:R}}),c$=b0((Q,$)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=(HU(),h0(WU)),W=V.Buffer;function C(A,z){for(var M in A)z[M]=A[M]}if(W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow)$.exports=V;else C(V,Q),Q.Buffer=D;function D(A,z,M){return W(A,z,M)}D.prototype=Object.create(W.prototype),C(W,D),D.from=function(A,z,M){if(typeof A==="number")throw TypeError("Argument must not be a number");return W(A,z,M)},D.alloc=function(A,z,M){if(typeof A!=="number")throw TypeError("Argument must be a number");var F=W(A);if(z!==void 0)if(typeof M==="string")F.fill(z,M);else F.fill(z);else F.fill(0);return F},D.allocUnsafe=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return W(A)},D.allocUnsafeSlow=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return V.SlowBuffer(A)}}),p$=b0((Q)=>{var $=c$().Buffer,V=$.isEncoding||function(j){switch(j=""+j,j&&j.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 W(j){if(!j)return"utf8";var x;while(!0)switch(j){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 j;default:if(x)return;j=(""+j).toLowerCase(),x=!0}}function C(j){var x=W(j);if(typeof x!=="string"&&($.isEncoding===V||!V(j)))throw Error("Unknown encoding: "+j);return x||j}Q.StringDecoder=D;function D(j){this.encoding=C(j);var x;switch(this.encoding){case"utf16le":this.text=H,this.end=q,x=4;break;case"utf8":this.fillLast=F,x=4;break;case"base64":this.text=P,this.end=_,x=3;break;default:this.write=k,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=$.allocUnsafe(x)}D.prototype.write=function(j){if(j.length===0)return"";var x,f;if(this.lastNeed){if(x=this.fillLast(j),x===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;if(f<j.length)return x?x+this.text(j,f):this.text(j,f);return x||""},D.prototype.end=K,D.prototype.text=R,D.prototype.fillLast=function(j){if(this.lastNeed<=j.length)return j.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);j.copy(this.lastChar,this.lastTotal-this.lastNeed,0,j.length),this.lastNeed-=j.length};function A(j){if(j<=127)return 0;else if(j>>5===6)return 2;else if(j>>4===14)return 3;else if(j>>3===30)return 4;return j>>6===2?-1:-2}function z(j,x,f){var w=x.length-1;if(w<f)return 0;var d=A(x[w]);if(d>=0){if(d>0)j.lastNeed=d-1;return d}if(--w<f||d===-2)return 0;if(d=A(x[w]),d>=0){if(d>0)j.lastNeed=d-2;return d}if(--w<f||d===-2)return 0;if(d=A(x[w]),d>=0){if(d>0)if(d===2)d=0;else j.lastNeed=d-3;return d}return 0}function M(j,x,f){if((x[0]&192)!==128)return j.lastNeed=0,"�";if(j.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return j.lastNeed=1,"�";if(j.lastNeed>2&&x.length>2){if((x[2]&192)!==128)return j.lastNeed=2,"�"}}}function F(j){var x=this.lastTotal-this.lastNeed,f=M(this,j,x);if(f!==void 0)return f;if(this.lastNeed<=j.length)return j.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);j.copy(this.lastChar,x,0,j.length),this.lastNeed-=j.length}function R(j,x){var f=z(this,j,x);if(!this.lastNeed)return j.toString("utf8",x);this.lastTotal=f;var w=j.length-(f-this.lastNeed);return j.copy(this.lastChar,0,w),j.toString("utf8",x,w)}function K(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed)return x+"�";return x}function H(j,x){if((j.length-x)%2===0){var f=j.toString("utf16le",x);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=j[j.length-2],this.lastChar[1]=j[j.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=j[j.length-1],j.toString("utf16le",x,j.length-1)}function q(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,f)}return x}function P(j,x){var f=(j.length-x)%3;if(f===0)return j.toString("base64",x);if(this.lastNeed=3-f,this.lastTotal=3,f===1)this.lastChar[0]=j[j.length-1];else this.lastChar[0]=j[j.length-2],this.lastChar[1]=j[j.length-1];return j.toString("base64",x,j.length-f)}function _(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed)return x+this.lastChar.toString("base64",0,3-this.lastNeed);return x}function k(j){return j.toString(this.encoding)}function B(j){return j&&j.length?this.write(j):""}}),TQ=b0((Q,$)=>{var V=AO(),{PromisePrototypeThen:W,SymbolAsyncIterator:C,SymbolIterator:D}=n0(),{Buffer:A}=(HU(),h0(WU)),{ERR_INVALID_ARG_TYPE:z,ERR_STREAM_NULL_VALUES:M}=zU().codes;function F(R,K,H){let q;if(typeof K==="string"||K instanceof A)return new R({objectMode:!0,...H,read(){this.push(K),this.push(null)}});let P;if(K&&K[C])P=!0,q=K[C]();else if(K&&K[D])P=!1,q=K[D]();else throw new z("iterable",["Iterable"],K);let _=new R({objectMode:!0,highWaterMark:1,...H}),k=!1;_._read=function(){if(!k)k=!0,j()},_._destroy=function(x,f){W(B(x),()=>V.nextTick(f,x),(w)=>V.nextTick(f,w||x))};async function B(x){let f=x!==void 0&&x!==null,w=typeof q.throw==="function";if(f&&w){let{value:d,done:Y0}=await q.throw(x);if(await d,Y0)return}if(typeof q.return==="function"){let{value:d}=await q.return();await d}}async function j(){for(;;){try{let{value:x,done:f}=P?await q.next():q.next();if(f)_.push(null);else{let w=x&&typeof x.then==="function"?await x:x;if(w===null)throw k=!1,new M;else if(_.push(w))continue;else k=!1}}catch(x){_.destroy(x)}break}}return _}$.exports=F}),lO=b0((Q,$)=>{var V=AO(),{ArrayPrototypeIndexOf:W,NumberIsInteger:C,NumberIsNaN:D,NumberParseInt:A,ObjectDefineProperties:z,ObjectKeys:M,ObjectSetPrototypeOf:F,Promise:R,SafeSet:K,SymbolAsyncDispose:H,SymbolAsyncIterator:q,Symbol:P}=n0();$.exports=t,t.ReadableState=N0;var{EventEmitter:_}=(MO(),h0(zO)),{Stream:k,prependListener:B}=_Z(),{Buffer:j}=(HU(),h0(WU)),{addAbortSignal:x}=uO(),f=UO(),w=_U().debuglog("stream",(N)=>{w=N}),d=y$(),Y0=EO(),{getHighWaterMark:J0,getDefaultHighWaterMark:$0}=bO(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:O0,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_OUT_OF_RANGE:X,ERR_STREAM_PUSH_AFTER_EOF:J,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Z},AbortError:Y}=zU(),{validateObject:I}=PO(),L=P("kPaused"),{StringDecoder:G}=p$(),O=TQ();F(t.prototype,k.prototype),F(t,k);var E=()=>{},{errorOrDestroy:T}=Y0,S=1,v=2,g=4,p=8,n=16,V0=32,r=64,l=128,X0=256,m=512,i=1024,g0=2048,y=4096,h=8192,Q0=16384,s=32768,e=65536,F0=131072,c=262144;function o(N){return{enumerable:!1,get(){return(this.state&N)!==0},set(b){if(b)this.state|=N;else this.state&=~N}}}z(N0.prototype,{objectMode:o(S),ended:o(v),endEmitted:o(g),reading:o(p),constructed:o(n),sync:o(V0),needReadable:o(r),emittedReadable:o(l),readableListening:o(X0),resumeScheduled:o(m),errorEmitted:o(i),emitClose:o(g0),autoDestroy:o(y),destroyed:o(h),closed:o(Q0),closeEmitted:o(s),multiAwaitDrain:o(e),readingMore:o(F0),dataEmitted:o(c)});function N0(N,b,a){if(typeof a!=="boolean")a=b instanceof nU();if(this.state=g0|y|n|V0,N&&N.objectMode)this.state|=S;if(a&&N&&N.readableObjectMode)this.state|=S;if(this.highWaterMark=N?J0(this,N,"readableHighWaterMark",a):$0(!1),this.buffer=new d,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,N&&N.emitClose===!1)this.state&=~g0;if(N&&N.autoDestroy===!1)this.state&=~y;if(this.errored=null,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,N&&N.encoding)this.decoder=new G(N.encoding),this.encoding=N.encoding}function t(N){if(!(this instanceof t))return new t(N);let b=this instanceof nU();if(this._readableState=new N0(N,this,b),N){if(typeof N.read==="function")this._read=N.read;if(typeof N.destroy==="function")this._destroy=N.destroy;if(typeof N.construct==="function")this._construct=N.construct;if(N.signal&&!b)x(N.signal,this)}k.call(this,N),Y0.construct(this,()=>{if(this._readableState.needReadable)S0(this,this._readableState)})}t.prototype.destroy=Y0.destroy,t.prototype._undestroy=Y0.undestroy,t.prototype._destroy=function(N,b){b(N)},t.prototype[_.captureRejectionSymbol]=function(N){this.destroy(N)},t.prototype[H]=function(){let N;if(!this.destroyed)N=this.readableEnded?null:new Y,this.destroy(N);return new R((b,a)=>f(this,(U0)=>U0&&U0!==N?a(U0):b(null)))},t.prototype.push=function(N,b){return Z0(this,N,b,!1)},t.prototype.unshift=function(N,b){return Z0(this,N,b,!0)};function Z0(N,b,a,U0){w("readableAddChunk",b);let f0=N._readableState,I0;if((f0.state&S)===0){if(typeof b==="string"){if(a=a||f0.defaultEncoding,f0.encoding!==a)if(U0&&f0.encoding)b=j.from(b,a).toString(f0.encoding);else b=j.from(b,a),a=""}else if(b instanceof j)a="";else if(k._isUint8Array(b))b=k._uint8ArrayToBuffer(b),a="";else if(b!=null)I0=new O0("chunk",["string","Buffer","Uint8Array"],b)}if(I0)T(N,I0);else if(b===null)f0.state&=~p,E0(N,f0);else if((f0.state&S)!==0||b&&b.length>0)if(U0)if((f0.state&g)!==0)T(N,new Z);else if(f0.destroyed||f0.errored)return!1;else w0(N,f0,b,!0);else if(f0.ended)T(N,new J);else if(f0.destroyed||f0.errored)return!1;else if(f0.state&=~p,f0.decoder&&!a)if(b=f0.decoder.write(b),f0.objectMode||b.length!==0)w0(N,f0,b,!1);else S0(N,f0);else w0(N,f0,b,!1);else if(!U0)f0.state&=~p,S0(N,f0);return!f0.ended&&(f0.length<f0.highWaterMark||f0.length===0)}function w0(N,b,a,U0){if(b.flowing&&b.length===0&&!b.sync&&N.listenerCount("data")>0){if((b.state&e)!==0)b.awaitDrainWriters.clear();else b.awaitDrainWriters=null;b.dataEmitted=!0,N.emit("data",a)}else{if(b.length+=b.objectMode?1:a.length,U0)b.buffer.unshift(a);else b.buffer.push(a);if((b.state&r)!==0)K0(N)}S0(N,b)}t.prototype.isPaused=function(){let N=this._readableState;return N[L]===!0||N.flowing===!1},t.prototype.setEncoding=function(N){let b=new G(N);this._readableState.decoder=b,this._readableState.encoding=this._readableState.decoder.encoding;let a=this._readableState.buffer,U0="";for(let f0 of a)U0+=b.write(f0);if(a.clear(),U0!=="")a.push(U0);return this._readableState.length=U0.length,this};var C0=1073741824;function L0(N){if(N>C0)throw new X("size","<= 1GiB",N);else N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++;return N}function t0(N,b){if(N<=0||b.length===0&&b.ended)return 0;if((b.state&S)!==0)return 1;if(D(N)){if(b.flowing&&b.length)return b.buffer.first().length;return b.length}if(N<=b.length)return N;return b.ended?b.length:0}t.prototype.read=function(N){if(w("read",N),N===void 0)N=NaN;else if(!C(N))N=A(N,10);let b=this._readableState,a=N;if(N>b.highWaterMark)b.highWaterMark=L0(N);if(N!==0)b.state&=~l;if(N===0&&b.needReadable&&((b.highWaterMark!==0?b.length>=b.highWaterMark:b.length>0)||b.ended)){if(w("read: emitReadable",b.length,b.ended),b.length===0&&b.ended)CU(this);else K0(this);return null}if(N=t0(N,b),N===0&&b.ended){if(b.length===0)CU(this);return null}let U0=(b.state&r)!==0;if(w("need readable",U0),b.length===0||b.length-N<b.highWaterMark)U0=!0,w("length less than watermark",U0);if(b.ended||b.reading||b.destroyed||b.errored||!b.constructed)U0=!1,w("reading, ended or constructing",U0);else if(U0){if(w("do read"),b.state|=p|V0,b.length===0)b.state|=r;try{this._read(b.highWaterMark)}catch(I0){T(this,I0)}if(b.state&=~V0,!b.reading)N=t0(a,b)}let f0;if(N>0)f0=z0(N,b);else f0=null;if(f0===null)b.needReadable=b.length<=b.highWaterMark,N=0;else if(b.length-=N,b.multiAwaitDrain)b.awaitDrainWriters.clear();else b.awaitDrainWriters=null;if(b.length===0){if(!b.ended)b.needReadable=!0;if(a!==N&&b.ended)CU(this)}if(f0!==null&&!b.errorEmitted&&!b.closeEmitted)b.dataEmitted=!0,this.emit("data",f0);return f0};function E0(N,b){if(w("onEofChunk"),b.ended)return;if(b.decoder){let a=b.decoder.end();if(a&&a.length)b.buffer.push(a),b.length+=b.objectMode?1:a.length}if(b.ended=!0,b.sync)K0(N);else b.needReadable=!1,b.emittedReadable=!0,e0(N)}function K0(N){let b=N._readableState;if(w("emitReadable",b.needReadable,b.emittedReadable),b.needReadable=!1,!b.emittedReadable)w("emitReadable",b.flowing),b.emittedReadable=!0,V.nextTick(e0,N)}function e0(N){let b=N._readableState;if(w("emitReadable_",b.destroyed,b.length,b.ended),!b.destroyed&&!b.errored&&(b.length||b.ended))N.emit("readable"),b.emittedReadable=!1;b.needReadable=!b.flowing&&!b.ended&&b.length<=b.highWaterMark,T0(N)}function S0(N,b){if(!b.readingMore&&b.constructed)b.readingMore=!0,V.nextTick(H0,N,b)}function H0(N,b){while(!b.reading&&!b.ended&&(b.length<b.highWaterMark||b.flowing&&b.length===0)){let a=b.length;if(w("maybeReadMore read 0"),N.read(0),a===b.length)break}b.readingMore=!1}t.prototype._read=function(N){throw new U("_read()")},t.prototype.pipe=function(N,b){let a=this,U0=this._readableState;if(U0.pipes.length===1){if(!U0.multiAwaitDrain)U0.multiAwaitDrain=!0,U0.awaitDrainWriters=new K(U0.awaitDrainWriters?[U0.awaitDrainWriters]:[])}U0.pipes.push(N),w("pipe count=%d opts=%j",U0.pipes.length,b);let f0=(!b||b.end!==!1)&&N!==V.stdout&&N!==V.stderr?W0:y0;if(U0.endEmitted)V.nextTick(f0);else a.once("end",f0);N.on("unpipe",I0);function I0(d0,l0){if(w("onunpipe"),d0===a){if(l0&&l0.hasUnpiped===!1)l0.hasUnpiped=!0,x0()}}function W0(){w("onend"),N.end()}let s0,q0=!1;function x0(){if(w("cleanup"),N.removeListener("close",r0),N.removeListener("finish",c0),s0)N.removeListener("drain",s0);if(N.removeListener("error",D0),N.removeListener("unpipe",I0),a.removeListener("end",W0),a.removeListener("end",y0),a.removeListener("data",P0),q0=!0,s0&&U0.awaitDrainWriters&&(!N._writableState||N._writableState.needDrain))s0()}function DU(){if(!q0){if(U0.pipes.length===1&&U0.pipes[0]===N)w("false write response, pause",0),U0.awaitDrainWriters=N,U0.multiAwaitDrain=!1;else if(U0.pipes.length>1&&U0.pipes.includes(N))w("false write response, pause",U0.awaitDrainWriters.size),U0.awaitDrainWriters.add(N);a.pause()}if(!s0)s0=FU(a,N),N.on("drain",s0)}a.on("data",P0);function P0(d0){w("ondata");let l0=N.write(d0);if(w("dest.write",l0),l0===!1)DU()}function D0(d0){if(w("onerror",d0),y0(),N.removeListener("error",D0),N.listenerCount("error")===0){let l0=N._writableState||N._readableState;if(l0&&!l0.errorEmitted)T(N,d0);else N.emit("error",d0)}}B(N,"error",D0);function r0(){N.removeListener("finish",c0),y0()}N.once("close",r0);function c0(){w("onfinish"),N.removeListener("close",r0),y0()}N.once("finish",c0);function y0(){w("unpipe"),a.unpipe(N)}if(N.emit("pipe",a),N.writableNeedDrain===!0)DU();else if(!U0.flowing)w("pipe resume"),a.resume();return N};function FU(N,b){return function(){let a=N._readableState;if(a.awaitDrainWriters===b)w("pipeOnDrain",1),a.awaitDrainWriters=null;else if(a.multiAwaitDrain)w("pipeOnDrain",a.awaitDrainWriters.size),a.awaitDrainWriters.delete(b);if((!a.awaitDrainWriters||a.awaitDrainWriters.size===0)&&N.listenerCount("data"))N.resume()}}t.prototype.unpipe=function(N){let b=this._readableState,a={hasUnpiped:!1};if(b.pipes.length===0)return this;if(!N){let f0=b.pipes;b.pipes=[],this.pause();for(let I0=0;I0<f0.length;I0++)f0[I0].emit("unpipe",this,{hasUnpiped:!1});return this}let U0=W(b.pipes,N);if(U0===-1)return this;if(b.pipes.splice(U0,1),b.pipes.length===0)this.pause();return N.emit("unpipe",this,a),this},t.prototype.on=function(N,b){let a=k.prototype.on.call(this,N,b),U0=this._readableState;if(N==="data"){if(U0.readableListening=this.listenerCount("readable")>0,U0.flowing!==!1)this.resume()}else if(N==="readable"){if(!U0.endEmitted&&!U0.readableListening){if(U0.readableListening=U0.needReadable=!0,U0.flowing=!1,U0.emittedReadable=!1,w("on readable",U0.length,U0.reading),U0.length)K0(this);else if(!U0.reading)V.nextTick(k0,this)}}return a},t.prototype.addListener=t.prototype.on,t.prototype.removeListener=function(N,b){let a=k.prototype.removeListener.call(this,N,b);if(N==="readable")V.nextTick(R0,this);return a},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(N){let b=k.prototype.removeAllListeners.apply(this,arguments);if(N==="readable"||N===void 0)V.nextTick(R0,this);return b};function R0(N){let b=N._readableState;if(b.readableListening=N.listenerCount("readable")>0,b.resumeScheduled&&b[L]===!1)b.flowing=!0;else if(N.listenerCount("data")>0)N.resume();else if(!b.readableListening)b.flowing=null}function k0(N){w("readable nexttick read 0"),N.read(0)}t.prototype.resume=function(){let N=this._readableState;if(!N.flowing)w("resume"),N.flowing=!N.readableListening,RU(this,N);return N[L]=!1,this};function RU(N,b){if(!b.resumeScheduled)b.resumeScheduled=!0,V.nextTick(_0,N,b)}function _0(N,b){if(w("resume",b.reading),!b.reading)N.read(0);if(b.resumeScheduled=!1,N.emit("resume"),T0(N),b.flowing&&!b.reading)N.read(0)}t.prototype.pause=function(){if(w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)w("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[L]=!0,this};function T0(N){let b=N._readableState;w("flow",b.flowing);while(b.flowing&&N.read()!==null);}t.prototype.wrap=function(N){let b=!1;N.on("data",(U0)=>{if(!this.push(U0)&&N.pause)b=!0,N.pause()}),N.on("end",()=>{this.push(null)}),N.on("error",(U0)=>{T(this,U0)}),N.on("close",()=>{this.destroy()}),N.on("destroy",()=>{this.destroy()}),this._read=()=>{if(b&&N.resume)b=!1,N.resume()};let a=M(N);for(let U0=1;U0<a.length;U0++){let f0=a[U0];if(this[f0]===void 0&&typeof N[f0]==="function")this[f0]=N[f0].bind(N)}return this},t.prototype[q]=function(){return SU(this)},t.prototype.iterator=function(N){if(N!==void 0)I(N,"options");return SU(this,N)};function SU(N,b){if(typeof N.read!=="function")N=t.wrap(N,{objectMode:!0});let a=v0(N,b);return a.stream=N,a}async function*v0(N,b){let a=E;function U0(W0){if(this===N)a(),a=E;else a=W0}N.on("readable",U0);let f0,I0=f(N,{writable:!1},(W0)=>{f0=W0?u(f0,W0):null,a(),a=E});try{while(!0){let W0=N.destroyed?null:N.read();if(W0!==null)yield W0;else if(f0)throw f0;else if(f0===null)return;else await new R(U0)}}catch(W0){throw f0=u(f0,W0),f0}finally{if((f0||(b===null||b===void 0?void 0:b.destroyOnReturn)!==!1)&&(f0===void 0||N._readableState.autoDestroy))Y0.destroyer(N,null);else N.off("readable",U0),I0()}}z(t.prototype,{readable:{__proto__:null,get(){let N=this._readableState;return!!N&&N.readable!==!1&&!N.destroyed&&!N.errorEmitted&&!N.endEmitted},set(N){if(this._readableState)this._readableState.readable=!!N}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(N){if(this._readableState)this._readableState.flowing=N}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(N){if(!this._readableState)return;this._readableState.destroyed=N}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),z(N0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[L]!==!1},set(N){this[L]=!!N}}}),t._fromList=z0;function z0(N,b){if(b.length===0)return null;let a;if(b.objectMode)a=b.buffer.shift();else if(!N||N>=b.length){if(b.decoder)a=b.buffer.join("");else if(b.buffer.length===1)a=b.buffer.first();else a=b.buffer.concat(b.length);b.buffer.clear()}else a=b.buffer.consume(N,b.decoder);return a}function CU(N){let b=N._readableState;if(w("endReadable",b.endEmitted),!b.endEmitted)b.ended=!0,V.nextTick(j0,b,N)}function j0(N,b){if(w("endReadableNT",N.endEmitted,N.length),!N.errored&&!N.closeEmitted&&!N.endEmitted&&N.length===0){if(N.endEmitted=!0,b.emit("end"),b.writable&&b.allowHalfOpen===!1)V.nextTick(B0,b);else if(N.autoDestroy){let a=b._writableState;if(!a||a.autoDestroy&&(a.finished||a.writable===!1))b.destroy()}}}function B0(N){if(N.writable&&!N.writableEnded&&!N.destroyed)N.end()}t.from=function(N,b){return O(t,N,b)};var LU;function M0(){if(LU===void 0)LU={};return LU}t.fromWeb=function(N,b){return M0().newStreamReadableFromReadableStream(N,b)},t.toWeb=function(N,b){return M0().newReadableStreamFromStreamReadable(N,b)},t.wrap=function(N,b){var a,U0;return new t({objectMode:(a=(U0=N.readableObjectMode)!==null&&U0!==void 0?U0:N.objectMode)!==null&&a!==void 0?a:!0,...b,destroy(f0,I0){Y0.destroyer(N,f0),I0(f0)}}).wrap(N)}}),vZ=b0((Q,$)=>{var V=AO(),{ArrayPrototypeSlice:W,Error:C,FunctionPrototypeSymbolHasInstance:D,ObjectDefineProperty:A,ObjectDefineProperties:z,ObjectSetPrototypeOf:M,StringPrototypeToLowerCase:F,Symbol:R,SymbolHasInstance:K}=n0();$.exports=I,I.WritableState=Z;var{EventEmitter:H}=(MO(),h0(zO)),q=_Z().Stream,{Buffer:P}=(HU(),h0(WU)),_=EO(),{addAbortSignal:k}=uO(),{getHighWaterMark:B,getDefaultHighWaterMark:j}=bO(),{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:f,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:d,ERR_STREAM_DESTROYED:Y0,ERR_STREAM_ALREADY_FINISHED:J0,ERR_STREAM_NULL_VALUES:$0,ERR_STREAM_WRITE_AFTER_END:u,ERR_UNKNOWN_ENCODING:O0}=zU().codes,{errorOrDestroy:U}=_;M(I.prototype,q.prototype),M(I,q);function X(){}var J=R("kOnFinished");function Z(y,h,Q0){if(typeof Q0!=="boolean")Q0=h instanceof nU();if(this.objectMode=!!(y&&y.objectMode),Q0)this.objectMode=this.objectMode||!!(y&&y.writableObjectMode);this.highWaterMark=y?B(this,y,"writableHighWaterMark",Q0):j(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let s=!!(y&&y.decodeStrings===!1);this.decodeStrings=!s,this.defaultEncoding=y&&y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=T.bind(void 0,h),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Y(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!y||y.emitClose!==!1,this.autoDestroy=!y||y.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[J]=[]}function Y(y){y.buffered=[],y.bufferedIndex=0,y.allBuffers=!0,y.allNoop=!0}Z.prototype.getBuffer=function(){return W(this.buffered,this.bufferedIndex)},A(Z.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function I(y){let h=this instanceof nU();if(!h&&!D(I,this))return new I(y);if(this._writableState=new Z(y,this,h),y){if(typeof y.write==="function")this._write=y.write;if(typeof y.writev==="function")this._writev=y.writev;if(typeof y.destroy==="function")this._destroy=y.destroy;if(typeof y.final==="function")this._final=y.final;if(typeof y.construct==="function")this._construct=y.construct;if(y.signal)k(y.signal,this)}q.call(this,y),_.construct(this,()=>{let Q0=this._writableState;if(!Q0.writing)p(this,Q0);l(this,Q0)})}A(I,K,{__proto__:null,value:function(y){if(D(this,y))return!0;if(this!==I)return!1;return y&&y._writableState instanceof Z}}),I.prototype.pipe=function(){U(this,new d)};function L(y,h,Q0,s){let e=y._writableState;if(typeof Q0==="function")s=Q0,Q0=e.defaultEncoding;else{if(!Q0)Q0=e.defaultEncoding;else if(Q0!=="buffer"&&!P.isEncoding(Q0))throw new O0(Q0);if(typeof s!=="function")s=X}if(h===null)throw new $0;else if(!e.objectMode)if(typeof h==="string"){if(e.decodeStrings!==!1)h=P.from(h,Q0),Q0="buffer"}else if(h instanceof P)Q0="buffer";else if(q._isUint8Array(h))h=q._uint8ArrayToBuffer(h),Q0="buffer";else throw new x("chunk",["string","Buffer","Uint8Array"],h);let F0;if(e.ending)F0=new u;else if(e.destroyed)F0=new Y0("write");if(F0)return V.nextTick(s,F0),U(y,F0,!0),F0;return e.pendingcb++,G(y,e,h,Q0,s)}I.prototype.write=function(y,h,Q0){return L(this,y,h,Q0)===!0},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){let y=this._writableState;if(y.corked){if(y.corked--,!y.writing)p(this,y)}},I.prototype.setDefaultEncoding=function(y){if(typeof y==="string")y=F(y);if(!P.isEncoding(y))throw new O0(y);return this._writableState.defaultEncoding=y,this};function G(y,h,Q0,s,e){let F0=h.objectMode?1:Q0.length;h.length+=F0;let c=h.length<h.highWaterMark;if(!c)h.needDrain=!0;if(h.writing||h.corked||h.errored||!h.constructed){if(h.buffered.push({chunk:Q0,encoding:s,callback:e}),h.allBuffers&&s!=="buffer")h.allBuffers=!1;if(h.allNoop&&e!==X)h.allNoop=!1}else h.writelen=F0,h.writecb=e,h.writing=!0,h.sync=!0,y._write(Q0,s,h.onwrite),h.sync=!1;return c&&!h.errored&&!h.destroyed}function O(y,h,Q0,s,e,F0,c){if(h.writelen=s,h.writecb=c,h.writing=!0,h.sync=!0,h.destroyed)h.onwrite(new Y0("write"));else if(Q0)y._writev(e,h.onwrite);else y._write(e,F0,h.onwrite);h.sync=!1}function E(y,h,Q0,s){--h.pendingcb,s(Q0),g(h),U(y,Q0)}function T(y,h){let Q0=y._writableState,s=Q0.sync,e=Q0.writecb;if(typeof e!=="function"){U(y,new w);return}if(Q0.writing=!1,Q0.writecb=null,Q0.length-=Q0.writelen,Q0.writelen=0,h){if(h.stack,!Q0.errored)Q0.errored=h;if(y._readableState&&!y._readableState.errored)y._readableState.errored=h;if(s)V.nextTick(E,y,Q0,h,e);else E(y,Q0,h,e)}else{if(Q0.buffered.length>Q0.bufferedIndex)p(y,Q0);if(s)if(Q0.afterWriteTickInfo!==null&&Q0.afterWriteTickInfo.cb===e)Q0.afterWriteTickInfo.count++;else Q0.afterWriteTickInfo={count:1,cb:e,stream:y,state:Q0},V.nextTick(S,Q0.afterWriteTickInfo);else v(y,Q0,1,e)}}function S({stream:y,state:h,count:Q0,cb:s}){return h.afterWriteTickInfo=null,v(y,h,Q0,s)}function v(y,h,Q0,s){if(!h.ending&&!y.destroyed&&h.length===0&&h.needDrain)h.needDrain=!1,y.emit("drain");while(Q0-- >0)h.pendingcb--,s();if(h.destroyed)g(h);l(y,h)}function g(y){if(y.writing)return;for(let e=y.bufferedIndex;e<y.buffered.length;++e){var h;let{chunk:F0,callback:c}=y.buffered[e],o=y.objectMode?1:F0.length;y.length-=o,c((h=y.errored)!==null&&h!==void 0?h:new Y0("write"))}let Q0=y[J].splice(0);for(let e=0;e<Q0.length;e++){var s;Q0[e]((s=y.errored)!==null&&s!==void 0?s:new Y0("end"))}Y(y)}function p(y,h){if(h.corked||h.bufferProcessing||h.destroyed||!h.constructed)return;let{buffered:Q0,bufferedIndex:s,objectMode:e}=h,F0=Q0.length-s;if(!F0)return;let c=s;if(h.bufferProcessing=!0,F0>1&&y._writev){h.pendingcb-=F0-1;let o=h.allNoop?X:(t)=>{for(let Z0=c;Z0<Q0.length;++Z0)Q0[Z0].callback(t)},N0=h.allNoop&&c===0?Q0:W(Q0,c);N0.allBuffers=h.allBuffers,O(y,h,!0,h.length,N0,"",o),Y(h)}else{do{let{chunk:o,encoding:N0,callback:t}=Q0[c];Q0[c++]=null;let Z0=e?1:o.length;O(y,h,!1,Z0,o,N0,t)}while(c<Q0.length&&!h.writing);if(c===Q0.length)Y(h);else if(c>256)Q0.splice(0,c),h.bufferedIndex=0;else h.bufferedIndex=c}h.bufferProcessing=!1}I.prototype._write=function(y,h,Q0){if(this._writev)this._writev([{chunk:y,encoding:h}],Q0);else throw new f("_write()")},I.prototype._writev=null,I.prototype.end=function(y,h,Q0){let s=this._writableState;if(typeof y==="function")Q0=y,y=null,h=null;else if(typeof h==="function")Q0=h,h=null;let e;if(y!==null&&y!==void 0){let F0=L(this,y,h);if(F0 instanceof C)e=F0}if(s.corked)s.corked=1,this.uncork();if(e);else if(!s.errored&&!s.ending)s.ending=!0,l(this,s,!0),s.ended=!0;else if(s.finished)e=new J0("end");else if(s.destroyed)e=new Y0("end");if(typeof Q0==="function")if(e||s.finished)V.nextTick(Q0,e);else s[J].push(Q0);return this};function n(y){return y.ending&&!y.destroyed&&y.constructed&&y.length===0&&!y.errored&&y.buffered.length===0&&!y.finished&&!y.writing&&!y.errorEmitted&&!y.closeEmitted}function V0(y,h){let Q0=!1;function s(e){if(Q0){U(y,e!==null&&e!==void 0?e:w());return}if(Q0=!0,h.pendingcb--,e){let F0=h[J].splice(0);for(let c=0;c<F0.length;c++)F0[c](e);U(y,e,h.sync)}else if(n(h))h.prefinished=!0,y.emit("prefinish"),h.pendingcb++,V.nextTick(X0,y,h)}h.sync=!0,h.pendingcb++;try{y._final(s)}catch(e){s(e)}h.sync=!1}function r(y,h){if(!h.prefinished&&!h.finalCalled)if(typeof y._final==="function"&&!h.destroyed)h.finalCalled=!0,V0(y,h);else h.prefinished=!0,y.emit("prefinish")}function l(y,h,Q0){if(n(h)){if(r(y,h),h.pendingcb===0){if(Q0)h.pendingcb++,V.nextTick((s,e)=>{if(n(e))X0(s,e);else e.pendingcb--},y,h);else if(n(h))h.pendingcb++,X0(y,h)}}}function X0(y,h){h.pendingcb--,h.finished=!0;let Q0=h[J].splice(0);for(let s=0;s<Q0.length;s++)Q0[s]();if(y.emit("finish"),h.autoDestroy){let s=y._readableState;if(!s||s.autoDestroy&&(s.endEmitted||s.readable===!1))y.destroy()}}z(I.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(y){if(this._writableState)this._writableState.destroyed=y}},writable:{__proto__:null,get(){let y=this._writableState;return!!y&&y.writable!==!1&&!y.destroyed&&!y.errored&&!y.ending&&!y.ended},set(y){if(this._writableState)this._writableState.writable=!!y}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let y=this._writableState;if(!y)return!1;return!y.destroyed&&!y.ending&&y.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var m=_.destroy;I.prototype.destroy=function(y,h){let Q0=this._writableState;if(!Q0.destroyed&&(Q0.bufferedIndex<Q0.buffered.length||Q0[J].length))V.nextTick(g,Q0);return m.call(this,y,h),this},I.prototype._undestroy=_.undestroy,I.prototype._destroy=function(y,h){h(y)},I.prototype[H.captureRejectionSymbol]=function(y){this.destroy(y)};var i;function g0(){if(i===void 0)i={};return i}I.fromWeb=function(y,h){return g0().newStreamWritableFromWritableStream(y,h)},I.toWeb=function(y){return g0().newWritableStreamFromStreamWritable(y)}}),h$=b0((Q,$)=>{var V=AO(),W=(HU(),h0(WU)),{isReadable:C,isWritable:D,isIterable:A,isNodeStream:z,isReadableNodeStream:M,isWritableNodeStream:F,isDuplexNodeStream:R,isReadableStream:K,isWritableStream:H}=mU(),q=UO(),{AbortError:P,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:k}}=zU(),{destroyer:B}=EO(),j=nU(),x=lO(),f=vZ(),{createDeferredPromise:w}=_U(),d=TQ(),Y0=globalThis.Blob||W.Blob,J0=typeof Y0<"u"?function(J){return J instanceof Y0}:function(J){return!1},$0=globalThis.AbortController||qO().AbortController,{FunctionPrototypeCall:u}=n0();class O0 extends j{constructor(J){super(J);if((J===null||J===void 0?void 0:J.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((J===null||J===void 0?void 0:J.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}$.exports=function J(Z,Y){if(R(Z))return Z;if(M(Z))return X({readable:Z});if(F(Z))return X({writable:Z});if(z(Z))return X({writable:!1,readable:!1});if(K(Z))return X({readable:x.fromWeb(Z)});if(H(Z))return X({writable:f.fromWeb(Z)});if(typeof Z==="function"){let{value:L,write:G,final:O,destroy:E}=U(Z);if(A(L))return d(O0,L,{objectMode:!0,write:G,final:O,destroy:E});let T=L===null||L===void 0?void 0:L.then;if(typeof T==="function"){let S,v=u(T,L,(g)=>{if(g!=null)throw new k("nully","body",g)},(g)=>{B(S,g)});return S=new O0({objectMode:!0,readable:!1,write:G,final(g){O(async()=>{try{await v,V.nextTick(g,null)}catch(p){V.nextTick(g,p)}})},destroy:E})}throw new k("Iterable, AsyncIterable or AsyncFunction",Y,L)}if(J0(Z))return J(Z.arrayBuffer());if(A(Z))return d(O0,Z,{objectMode:!0,writable:!1});if(K(Z===null||Z===void 0?void 0:Z.readable)&&H(Z===null||Z===void 0?void 0:Z.writable))return O0.fromWeb(Z);if(typeof(Z===null||Z===void 0?void 0:Z.writable)==="object"||typeof(Z===null||Z===void 0?void 0:Z.readable)==="object"){let L=Z!==null&&Z!==void 0&&Z.readable?M(Z===null||Z===void 0?void 0:Z.readable)?Z===null||Z===void 0?void 0:Z.readable:J(Z.readable):void 0,G=Z!==null&&Z!==void 0&&Z.writable?F(Z===null||Z===void 0?void 0:Z.writable)?Z===null||Z===void 0?void 0:Z.writable:J(Z.writable):void 0;return X({readable:L,writable:G})}let I=Z===null||Z===void 0?void 0:Z.then;if(typeof I==="function"){let L;return u(I,Z,(G)=>{if(G!=null)L.push(G);L.push(null)},(G)=>{B(L,G)}),L=new O0({objectMode:!0,writable:!1,read(){}})}throw new _(Y,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],Z)};function U(J){let{promise:Z,resolve:Y}=w(),I=new $0,L=I.signal;return{value:J(async function*(){while(!0){let G=Z;Z=null;let{chunk:O,done:E,cb:T}=await G;if(V.nextTick(T),E)return;if(L.aborted)throw new P(void 0,{cause:L.reason});({promise:Z,resolve:Y}=w()),yield O}}(),{signal:L}),write(G,O,E){let T=Y;Y=null,T({chunk:G,done:!1,cb:E})},final(G){let O=Y;Y=null,O({done:!0,cb:G})},destroy(G,O){I.abort(),O(G)}}}function X(J){let Z=J.readable&&typeof J.readable.read!=="function"?x.wrap(J.readable):J.readable,Y=J.writable,I=!!C(Z),L=!!D(Y),G,O,E,T,S;function v(g){let p=T;if(T=null,p)p(g);else if(g)S.destroy(g)}if(S=new O0({readableObjectMode:!!(Z!==null&&Z!==void 0&&Z.readableObjectMode),writableObjectMode:!!(Y!==null&&Y!==void 0&&Y.writableObjectMode),readable:I,writable:L}),L)q(Y,(g)=>{if(L=!1,g)B(Z,g);v(g)}),S._write=function(g,p,n){if(Y.write(g,p))n();else G=n},S._final=function(g){Y.end(),O=g},Y.on("drain",function(){if(G){let g=G;G=null,g()}}),Y.on("finish",function(){if(O){let g=O;O=null,g()}});if(I)q(Z,(g)=>{if(I=!1,g)B(Z,g);v(g)}),Z.on("readable",function(){if(E){let g=E;E=null,g()}}),Z.on("end",function(){S.push(null)}),S._read=function(){while(!0){let g=Z.read();if(g===null){E=S._read;return}if(!S.push(g))return}};return S._destroy=function(g,p){if(!g&&T!==null)g=new P;if(E=null,G=null,O=null,T===null)p(g);else T=p,B(Y,g),B(Z,g)},S}}),nU=b0((Q,$)=>{var{ObjectDefineProperties:V,ObjectGetOwnPropertyDescriptor:W,ObjectKeys:C,ObjectSetPrototypeOf:D}=n0();$.exports=M;var A=lO(),z=vZ();D(M.prototype,A.prototype),D(M,A);{let H=C(z.prototype);for(let q=0;q<H.length;q++){let P=H[q];if(!M.prototype[P])M.prototype[P]=z.prototype[P]}}function M(H){if(!(this instanceof M))return new M(H);if(A.call(this,H),z.call(this,H),H){if(this.allowHalfOpen=H.allowHalfOpen!==!1,H.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(H.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}V(M.prototype,{writable:{__proto__:null,...W(z.prototype,"writable")},writableHighWaterMark:{__proto__:null,...W(z.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...W(z.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...W(z.prototype,"writableBuffer")},writableLength:{__proto__:null,...W(z.prototype,"writableLength")},writableFinished:{__proto__:null,...W(z.prototype,"writableFinished")},writableCorked:{__proto__:null,...W(z.prototype,"writableCorked")},writableEnded:{__proto__:null,...W(z.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...W(z.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(H){if(this._readableState&&this._writableState)this._readableState.destroyed=H,this._writableState.destroyed=H}}});var F;function R(){if(F===void 0)F={};return F}M.fromWeb=function(H,q){return R().newStreamDuplexFromReadableWritablePair(H,q)},M.toWeb=function(H){return R().newReadableWritablePairFromDuplex(H)};var K;M.from=function(H){if(!K)K=h$();return K(H,"body")}}),zQ=b0((Q,$)=>{var{ObjectSetPrototypeOf:V,Symbol:W}=n0();$.exports=M;var{ERR_METHOD_NOT_IMPLEMENTED:C}=zU().codes,D=nU(),{getHighWaterMark:A}=bO();V(M.prototype,D.prototype),V(M,D);var z=W("kCallback");function M(K){if(!(this instanceof M))return new M(K);let H=K?A(this,K,"readableHighWaterMark",!0):null;if(H===0)K={...K,highWaterMark:null,readableHighWaterMark:H,writableHighWaterMark:K.writableHighWaterMark||0};if(D.call(this,K),this._readableState.sync=!1,this[z]=null,K){if(typeof K.transform==="function")this._transform=K.transform;if(typeof K.flush==="function")this._flush=K.flush}this.on("prefinish",R)}function F(K){if(typeof this._flush==="function"&&!this.destroyed)this._flush((H,q)=>{if(H){if(K)K(H);else this.destroy(H);return}if(q!=null)this.push(q);if(this.push(null),K)K()});else if(this.push(null),K)K()}function R(){if(this._final!==F)F.call(this)}M.prototype._final=F,M.prototype._transform=function(K,H,q){throw new C("_transform()")},M.prototype._write=function(K,H,q){let P=this._readableState,_=this._writableState,k=P.length;this._transform(K,H,(B,j)=>{if(B){q(B);return}if(j!=null)this.push(j);if(_.ended||k===P.length||P.length<P.highWaterMark)q();else this[z]=q})},M.prototype._read=function(){if(this[z]){let K=this[z];this[z]=null,K()}}}),MQ=b0((Q,$)=>{var{ObjectSetPrototypeOf:V}=n0();$.exports=C;var W=zQ();V(C.prototype,W.prototype),V(C,W);function C(D){if(!(this instanceof C))return new C(D);W.call(this,D)}C.prototype._transform=function(D,A,z){z(null,D)}}),jZ=b0((Q,$)=>{var V=AO(),{ArrayIsArray:W,Promise:C,SymbolAsyncIterator:D,SymbolDispose:A}=n0(),z=UO(),{once:M}=_U(),F=EO(),R=nU(),{aggregateTwoErrors:K,codes:{ERR_INVALID_ARG_TYPE:H,ERR_INVALID_RETURN_VALUE:q,ERR_MISSING_ARGS:P,ERR_STREAM_DESTROYED:_,ERR_STREAM_PREMATURE_CLOSE:k},AbortError:B}=zU(),{validateFunction:j,validateAbortSignal:x}=PO(),{isIterable:f,isReadable:w,isReadableNodeStream:d,isNodeStream:Y0,isTransformStream:J0,isWebStream:$0,isReadableStream:u,isReadableFinished:O0}=mU(),U=globalThis.AbortController||qO().AbortController,X,J,Z;function Y(g,p,n){let V0=!1;g.on("close",()=>{V0=!0});let r=z(g,{readable:p,writable:n},(l)=>{V0=!l});return{destroy:(l)=>{if(V0)return;V0=!0,F.destroyer(g,l||new _("pipe"))},cleanup:r}}function I(g){return j(g[g.length-1],"streams[stream.length - 1]"),g.pop()}function L(g){if(f(g))return g;else if(d(g))return G(g);throw new H("val",["Readable","Iterable","AsyncIterable"],g)}async function*G(g){if(!J)J=lO();yield*J.prototype[D].call(g)}async function O(g,p,n,{end:V0}){let r,l=null,X0=(g0)=>{if(g0)r=g0;if(l){let y=l;l=null,y()}},m=()=>new C((g0,y)=>{if(r)y(r);else l=()=>{if(r)y(r);else g0()}});p.on("drain",X0);let i=z(p,{readable:!1},X0);try{if(p.writableNeedDrain)await m();for await(let g0 of g)if(!p.write(g0))await m();if(V0)p.end(),await m();n()}catch(g0){n(r!==g0?K(r,g0):g0)}finally{i(),p.off("drain",X0)}}async function E(g,p,n,{end:V0}){if(J0(p))p=p.writable;let r=p.getWriter();try{for await(let l of g)await r.ready,r.write(l).catch(()=>{});if(await r.ready,V0)await r.close();n()}catch(l){try{await r.abort(l),n(l)}catch(X0){n(X0)}}}function T(...g){return S(g,M(I(g)))}function S(g,p,n){if(g.length===1&&W(g[0]))g=g[0];if(g.length<2)throw new P("streams");let V0=new U,r=V0.signal,l=n===null||n===void 0?void 0:n.signal,X0=[];x(l,"options.signal");function m(){e(new B)}Z=Z||_U().addAbortListener;let i;if(l)i=Z(l,m);let g0,y,h=[],Q0=0;function s(t){e(t,--Q0===0)}function e(t,Z0){var w0;if(t&&(!g0||g0.code==="ERR_STREAM_PREMATURE_CLOSE"))g0=t;if(!g0&&!Z0)return;while(h.length)h.shift()(g0);if((w0=i)===null||w0===void 0||w0[A](),V0.abort(),Z0){if(!g0)X0.forEach((C0)=>C0());V.nextTick(p,g0,y)}}let F0;for(let t=0;t<g.length;t++){let Z0=g[t],w0=t<g.length-1,C0=t>0,L0=w0||(n===null||n===void 0?void 0:n.end)!==!1,t0=t===g.length-1;if(Y0(Z0)){let E0=function(K0){if(K0&&K0.name!=="AbortError"&&K0.code!=="ERR_STREAM_PREMATURE_CLOSE")s(K0)};var c=E0;if(L0){let{destroy:K0,cleanup:e0}=Y(Z0,w0,C0);if(h.push(K0),w(Z0)&&t0)X0.push(e0)}if(Z0.on("error",E0),w(Z0)&&t0)X0.push(()=>{Z0.removeListener("error",E0)})}if(t===0)if(typeof Z0==="function"){if(F0=Z0({signal:r}),!f(F0))throw new q("Iterable, AsyncIterable or Stream","source",F0)}else if(f(Z0)||d(Z0)||J0(Z0))F0=Z0;else F0=R.from(Z0);else if(typeof Z0==="function"){if(J0(F0)){var o;F0=L((o=F0)===null||o===void 0?void 0:o.readable)}else F0=L(F0);if(F0=Z0(F0,{signal:r}),w0){if(!f(F0,!0))throw new q("AsyncIterable",`transform[${t-1}]`,F0)}else{var N0;if(!X)X=MQ();let E0=new X({objectMode:!0}),K0=(N0=F0)===null||N0===void 0?void 0:N0.then;if(typeof K0==="function")Q0++,K0.call(F0,(H0)=>{if(y=H0,H0!=null)E0.write(H0);if(L0)E0.end();V.nextTick(s)},(H0)=>{E0.destroy(H0),V.nextTick(s,H0)});else if(f(F0,!0))Q0++,O(F0,E0,s,{end:L0});else if(u(F0)||J0(F0)){let H0=F0.readable||F0;Q0++,O(H0,E0,s,{end:L0})}else throw new q("AsyncIterable or Promise","destination",F0);F0=E0;let{destroy:e0,cleanup:S0}=Y(F0,!1,!0);if(h.push(e0),t0)X0.push(S0)}}else if(Y0(Z0)){if(d(F0)){Q0+=2;let E0=v(F0,Z0,s,{end:L0});if(w(Z0)&&t0)X0.push(E0)}else if(J0(F0)||u(F0)){let E0=F0.readable||F0;Q0++,O(E0,Z0,s,{end:L0})}else if(f(F0))Q0++,O(F0,Z0,s,{end:L0});else throw new H("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],F0);F0=Z0}else if($0(Z0)){if(d(F0))Q0++,E(L(F0),Z0,s,{end:L0});else if(u(F0)||f(F0))Q0++,E(F0,Z0,s,{end:L0});else if(J0(F0))Q0++,E(F0.readable,Z0,s,{end:L0});else throw new H("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],F0);F0=Z0}else F0=R.from(Z0)}if(r!==null&&r!==void 0&&r.aborted||l!==null&&l!==void 0&&l.aborted)V.nextTick(m);return F0}function v(g,p,n,{end:V0}){let r=!1;if(p.on("close",()=>{if(!r)n(new k)}),g.pipe(p,{end:!1}),V0){let X0=function(){r=!0,p.end()};var l=X0;if(O0(g))V.nextTick(X0);else g.once("end",X0)}else n();return z(g,{readable:!0,writable:!1},(X0)=>{let m=g._readableState;if(X0&&X0.code==="ERR_STREAM_PREMATURE_CLOSE"&&m&&m.ended&&!m.errored&&!m.errorEmitted)g.once("end",n).once("error",n);else n(X0)}),z(p,{readable:!1,writable:!0},n)}$.exports={pipelineImpl:S,pipeline:T}}),qQ=b0((Q,$)=>{var{pipeline:V}=jZ(),W=nU(),{destroyer:C}=EO(),{isNodeStream:D,isReadable:A,isWritable:z,isWebStream:M,isTransformStream:F,isWritableStream:R,isReadableStream:K}=mU(),{AbortError:H,codes:{ERR_INVALID_ARG_VALUE:q,ERR_MISSING_ARGS:P}}=zU(),_=UO();$.exports=function(...k){if(k.length===0)throw new P("streams");if(k.length===1)return W.from(k[0]);let B=[...k];if(typeof k[0]==="function")k[0]=W.from(k[0]);if(typeof k[k.length-1]==="function"){let U=k.length-1;k[U]=W.from(k[U])}for(let U=0;U<k.length;++U){if(!D(k[U])&&!M(k[U]))continue;if(U<k.length-1&&!(A(k[U])||K(k[U])||F(k[U])))throw new q(`streams[${U}]`,B[U],"must be readable");if(U>0&&!(z(k[U])||R(k[U])||F(k[U])))throw new q(`streams[${U}]`,B[U],"must be writable")}let j,x,f,w,d;function Y0(U){let X=w;if(w=null,X)X(U);else if(U)d.destroy(U);else if(!O0&&!u)d.destroy()}let J0=k[0],$0=V(k,Y0),u=!!(z(J0)||R(J0)||F(J0)),O0=!!(A($0)||K($0)||F($0));if(d=new W({writableObjectMode:!!(J0!==null&&J0!==void 0&&J0.writableObjectMode),readableObjectMode:!!($0!==null&&$0!==void 0&&$0.readableObjectMode),writable:u,readable:O0}),u){if(D(J0))d._write=function(X,J,Z){if(J0.write(X,J))Z();else j=Z},d._final=function(X){J0.end(),x=X},J0.on("drain",function(){if(j){let X=j;j=null,X()}});else if(M(J0)){let X=(F(J0)?J0.writable:J0).getWriter();d._write=async function(J,Z,Y){try{await X.ready,X.write(J).catch(()=>{}),Y()}catch(I){Y(I)}},d._final=async function(J){try{await X.ready,X.close().catch(()=>{}),x=J}catch(Z){J(Z)}}}let U=F($0)?$0.readable:$0;_(U,()=>{if(x){let X=x;x=null,X()}})}if(O0){if(D($0))$0.on("readable",function(){if(f){let U=f;f=null,U()}}),$0.on("end",function(){d.push(null)}),d._read=function(){while(!0){let U=$0.read();if(U===null){f=d._read;return}if(!d.push(U))return}};else if(M($0)){let U=(F($0)?$0.readable:$0).getReader();d._read=async function(){while(!0)try{let{value:X,done:J}=await U.read();if(!d.push(X))return;if(J){d.push(null);return}}catch{return}}}}return d._destroy=function(U,X){if(!U&&w!==null)U=new H;if(f=null,j=null,x=null,w===null)X(U);else if(w=X,D($0))C($0,U)},d}}),u$=b0((Q,$)=>{var V=globalThis.AbortController||qO().AbortController,{codes:{ERR_INVALID_ARG_VALUE:W,ERR_INVALID_ARG_TYPE:C,ERR_MISSING_ARGS:D,ERR_OUT_OF_RANGE:A},AbortError:z}=zU(),{validateAbortSignal:M,validateInteger:F,validateObject:R}=PO(),K=n0().Symbol("kWeak"),H=n0().Symbol("kResistStopPropagation"),{finished:q}=UO(),P=qQ(),{addAbortSignalNoValidate:_}=uO(),{isWritable:k,isNodeStream:B}=mU(),{deprecate:j}=_U(),{ArrayPrototypePush:x,Boolean:f,MathFloor:w,Number:d,NumberIsNaN:Y0,Promise:J0,PromiseReject:$0,PromiseResolve:u,PromisePrototypeThen:O0,Symbol:U}=n0(),X=U("kEmpty"),J=U("kEof");function Z(l,X0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");if(B(l)&&!k(l))throw new W("stream",l,"must be writable");let m=P(this,l);if(X0!==null&&X0!==void 0&&X0.signal)_(X0.signal,m);return m}function Y(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");let m=1;if((X0===null||X0===void 0?void 0:X0.concurrency)!=null)m=w(X0.concurrency);let i=m-1;if((X0===null||X0===void 0?void 0:X0.highWaterMark)!=null)i=w(X0.highWaterMark);return F(m,"options.concurrency",1),F(i,"options.highWaterMark",0),i+=m,async function*(){let g0=_U().AbortSignalAny([X0===null||X0===void 0?void 0:X0.signal].filter(f)),y=this,h=[],Q0={signal:g0},s,e,F0=!1,c=0;function o(){F0=!0,N0()}function N0(){c-=1,t()}function t(){if(e&&!F0&&c<m&&h.length<i)e(),e=null}async function Z0(){try{for await(let w0 of y){if(F0)return;if(g0.aborted)throw new z;try{if(w0=l(w0,Q0),w0===X)continue;w0=u(w0)}catch(C0){w0=$0(C0)}if(c+=1,O0(w0,N0,o),h.push(w0),s)s(),s=null;if(!F0&&(h.length>=i||c>=m))await new J0((C0)=>{e=C0})}h.push(J)}catch(w0){let C0=$0(w0);O0(C0,N0,o),h.push(C0)}finally{if(F0=!0,s)s(),s=null}}Z0();try{while(!0){while(h.length>0){let w0=await h[0];if(w0===J)return;if(g0.aborted)throw new z;if(w0!==X)yield w0;h.shift(),t()}await new J0((w0)=>{s=w0})}}finally{if(F0=!0,e)e(),e=null}}.call(this)}function I(l=void 0){if(l!=null)R(l,"options");if((l===null||l===void 0?void 0:l.signal)!=null)M(l.signal,"options.signal");return async function*(){let X0=0;for await(let i of this){var m;if(l!==null&&l!==void 0&&(m=l.signal)!==null&&m!==void 0&&m.aborted)throw new z({cause:l.signal.reason});yield[X0++,i]}}.call(this)}async function L(l,X0=void 0){for await(let m of T.call(this,l,X0))return!0;return!1}async function G(l,X0=void 0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);return!await L.call(this,async(...m)=>{return!await l(...m)},X0)}async function O(l,X0){for await(let m of T.call(this,l,X0))return m;return}async function E(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);async function m(i,g0){return await l(i,g0),X}for await(let i of Y.call(this,m,X0));}function T(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);async function m(i,g0){if(await l(i,g0))return i;return X}return Y.call(this,m,X0)}class S extends D{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function v(l,X0,m){var i;if(typeof l!=="function")throw new C("reducer",["Function","AsyncFunction"],l);if(m!=null)R(m,"options");if((m===null||m===void 0?void 0:m.signal)!=null)M(m.signal,"options.signal");let g0=arguments.length>1;if(m!==null&&m!==void 0&&(i=m.signal)!==null&&i!==void 0&&i.aborted){let e=new z(void 0,{cause:m.signal.reason});throw this.once("error",()=>{}),await q(this.destroy(e)),e}let y=new V,h=y.signal;if(m!==null&&m!==void 0&&m.signal){let e={once:!0,[K]:this,[H]:!0};m.signal.addEventListener("abort",()=>y.abort(),e)}let Q0=!1;try{for await(let e of this){var s;if(Q0=!0,m!==null&&m!==void 0&&(s=m.signal)!==null&&s!==void 0&&s.aborted)throw new z;if(!g0)X0=e,g0=!0;else X0=await l(X0,e,{signal:h})}if(!Q0&&!g0)throw new S}finally{y.abort()}return X0}async function g(l){if(l!=null)R(l,"options");if((l===null||l===void 0?void 0:l.signal)!=null)M(l.signal,"options.signal");let X0=[];for await(let i of this){var m;if(l!==null&&l!==void 0&&(m=l.signal)!==null&&m!==void 0&&m.aborted)throw new z(void 0,{cause:l.signal.reason});x(X0,i)}return X0}function p(l,X0){let m=Y.call(this,l,X0);return async function*(){for await(let i of m)yield*i}.call(this)}function n(l){if(l=d(l),Y0(l))return 0;if(l<0)throw new A("number",">= 0",l);return l}function V0(l,X0=void 0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");return l=n(l),async function*(){var m;if(X0!==null&&X0!==void 0&&(m=X0.signal)!==null&&m!==void 0&&m.aborted)throw new z;for await(let g0 of this){var i;if(X0!==null&&X0!==void 0&&(i=X0.signal)!==null&&i!==void 0&&i.aborted)throw new z;if(l--<=0)yield g0}}.call(this)}function r(l,X0=void 0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");return l=n(l),async function*(){var m;if(X0!==null&&X0!==void 0&&(m=X0.signal)!==null&&m!==void 0&&m.aborted)throw new z;for await(let g0 of this){var i;if(X0!==null&&X0!==void 0&&(i=X0.signal)!==null&&i!==void 0&&i.aborted)throw new z;if(l-- >0)yield g0;if(l<=0)return}}.call(this)}$.exports.streamReturningOperators={asIndexedPairs:j(I,"readable.asIndexedPairs will be removed in a future version."),drop:V0,filter:T,flatMap:p,map:Y,take:r,compose:Z},$.exports.promiseReturningOperators={every:G,forEach:E,reduce:v,toArray:g,some:L,find:O}}),PQ=b0((Q,$)=>{var{ArrayPrototypePop:V,Promise:W}=n0(),{isIterable:C,isNodeStream:D,isWebStream:A}=mU(),{pipelineImpl:z}=jZ(),{finished:M}=UO();kQ();function F(...R){return new W((K,H)=>{let q,P,_=R[R.length-1];if(_&&typeof _==="object"&&!D(_)&&!C(_)&&!A(_)){let k=V(R);q=k.signal,P=k.end}z(R,(k,B)=>{if(k)H(k);else K(B)},{signal:q,end:P})})}$.exports={finished:M,pipeline:F}}),kQ=b0((Q,$)=>{var{Buffer:V}=(HU(),h0(WU)),{ObjectDefineProperty:W,ObjectKeys:C,ReflectApply:D}=n0(),{promisify:{custom:A}}=_U(),{streamReturningOperators:z,promiseReturningOperators:M}=u$(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:F}}=zU(),R=qQ(),{setDefaultHighWaterMark:K,getDefaultHighWaterMark:H}=bO(),{pipeline:q}=jZ(),{destroyer:P}=EO(),_=UO(),k=PQ(),B=mU(),j=$.exports=_Z().Stream;j.isDestroyed=B.isDestroyed,j.isDisturbed=B.isDisturbed,j.isErrored=B.isErrored,j.isReadable=B.isReadable,j.isWritable=B.isWritable,j.Readable=lO();for(let f of C(z)){let w=function(...Y0){if(new.target)throw F();return j.Readable.from(D(d,this,Y0))},d=z[f];W(w,"name",{__proto__:null,value:d.name}),W(w,"length",{__proto__:null,value:d.length}),W(j.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(let f of C(M)){let w=function(...Y0){if(new.target)throw F();return D(d,this,Y0)},d=M[f];W(w,"name",{__proto__:null,value:d.name}),W(w,"length",{__proto__:null,value:d.length}),W(j.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}j.Writable=vZ(),j.Duplex=nU(),j.Transform=zQ(),j.PassThrough=MQ(),j.pipeline=q;var{addAbortSignal:x}=uO();j.addAbortSignal=x,j.finished=_,j.destroy=P,j.compose=R,j.setDefaultHighWaterMark=K,j.getDefaultHighWaterMark=H,W(j,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return k}}),W(q,A,{__proto__:null,enumerable:!0,get(){return k.pipeline}}),W(_,A,{__proto__:null,enumerable:!0,get(){return k.finished}}),j.Stream=j,j._isUint8Array=function(f){return f instanceof Uint8Array},j._uint8ArrayToBuffer=function(f){return V.from(f.buffer,f.byteOffset,f.byteLength)}}),b$=b0((Q,$)=>{var V=dO();{let W=kQ(),C=PQ(),D=W.Readable.destroy;$.exports=W.Readable,$.exports._uint8ArrayToBuffer=W._uint8ArrayToBuffer,$.exports._isUint8Array=W._isUint8Array,$.exports.isDisturbed=W.isDisturbed,$.exports.isErrored=W.isErrored,$.exports.isReadable=W.isReadable,$.exports.Readable=W.Readable,$.exports.Writable=W.Writable,$.exports.Duplex=W.Duplex,$.exports.Transform=W.Transform,$.exports.PassThrough=W.PassThrough,$.exports.addAbortSignal=W.addAbortSignal,$.exports.finished=W.finished,$.exports.destroy=W.destroy,$.exports.destroy=D,$.exports.pipeline=W.pipeline,$.exports.compose=W.compose,Object.defineProperty(W,"promises",{configurable:!0,enumerable:!0,get(){return C}}),$.exports.Stream=W.Stream}$.exports.default=$.exports});_Q.exports=b$()});var lZ={};WO(lZ,{uptime:()=>CA,type:()=>HA,totalmem:()=>KA,tmpdir:()=>fQ,tmpDir:()=>TA,release:()=>SA,platform:()=>RA,networkInterfaces:()=>DA,loadavg:()=>IA,hostname:()=>EA,homedir:()=>MA,getNetworkInterfaces:()=>gQ,freemem:()=>LA,endianness:()=>VA,cpus:()=>WA,arch:()=>FA,EOL:()=>zA});var VA=function(){return"LE"},EA=function(){if(typeof location<"u")return location.hostname;else return""},IA=function(){return[]},CA=function(){return 0},LA=function(){return Number.MAX_VALUE},KA=function(){return Number.MAX_VALUE},WA=function(){return[]},HA=function(){return"Browser"},SA=function(){if(typeof navigator<"u")return navigator.appVersion;return""},gQ=function(){return{}},DA,FA=function(){return"javascript"},RA=function(){return"browser"},fQ=function(){return"/tmp"},TA,zA=`
3
- `,MA=function(){return"/"};var dZ=HO(()=>{DA=gQ,TA=fQ});var oQ={};WO(oQ,{types:()=>gA,promisify:()=>uQ,log:()=>cQ,isUndefined:()=>CO,isSymbol:()=>wA,isString:()=>iO,isRegExp:()=>tO,isPrimitive:()=>yA,isObject:()=>LO,isNumber:()=>yQ,isNullOrUndefined:()=>fA,isNull:()=>eO,isFunction:()=>rO,isError:()=>sO,isDate:()=>tZ,isBuffer:()=>cA,isBoolean:()=>rZ,isArray:()=>wQ,inspect:()=>JO,inherits:()=>pQ,format:()=>sZ,deprecate:()=>PA,default:()=>uA,debuglog:()=>kA,callbackifyOnRejected:()=>iZ,callbackify:()=>bQ,_extend:()=>eZ,TextEncoder:()=>lQ,TextDecoder:()=>dQ});function sZ(Q,...$){if(!iO(Q)){var V=[Q];for(var W=0;W<$.length;W++)V.push(JO($[W]));return V.join(" ")}var W=0,C=$.length,D=String(Q).replace(qA,function(z){if(z==="%%")return"%";if(W>=C)return z;switch(z){case"%s":return String($[W++]);case"%d":return Number($[W++]);case"%j":try{return JSON.stringify($[W++])}catch(M){return"[Circular]"}default:return z}});for(var A=$[W];W<C;A=$[++W])if(eO(A)||!LO(A))D+=" "+A;else D+=" "+JO(A);return D}function PA(Q,$){if(typeof process>"u"||process?.noDeprecation===!0)return Q;var V=!1;function W(...C){if(!V){if(process.throwDeprecation)throw Error($);else if(process.traceDeprecation)console.trace($);else console.error($);V=!0}return Q.apply(this,...C)}return W}function _A(Q,$){var V=JO.styles[$];if(V)return"\x1B["+JO.colors[V][0]+"m"+Q+"\x1B["+JO.colors[V][1]+"m";else return Q}function vA(Q,$){return Q}function jA(Q){var $={};return Q.forEach(function(V,W){$[V]=!0}),$}function aO(Q,$,V){if(Q.customInspect&&$&&rO($.inspect)&&$.inspect!==JO&&!($.constructor&&$.constructor.prototype===$)){var W=$.inspect(V,Q);if(!iO(W))W=aO(Q,W,V);return W}var C=BA(Q,$);if(C)return C;var D=Object.keys($),A=jA(D);if(Q.showHidden)D=Object.getOwnPropertyNames($);if(sO($)&&(D.indexOf("message")>=0||D.indexOf("description")>=0))return oZ($);if(D.length===0){if(rO($)){var z=$.name?": "+$.name:"";return Q.stylize("[Function"+z+"]","special")}if(tO($))return Q.stylize(RegExp.prototype.toString.call($),"regexp");if(tZ($))return Q.stylize(Date.prototype.toString.call($),"date");if(sO($))return oZ($)}var M="",F=!1,R=["{","}"];if(wQ($))F=!0,R=["[","]"];if(rO($)){var K=$.name?": "+$.name:"";M=" [Function"+K+"]"}if(tO($))M=" "+RegExp.prototype.toString.call($);if(tZ($))M=" "+Date.prototype.toUTCString.call($);if(sO($))M=" "+oZ($);if(D.length===0&&(!F||$.length==0))return R[0]+M+R[1];if(V<0)if(tO($))return Q.stylize(RegExp.prototype.toString.call($),"regexp");else return Q.stylize("[Object]","special");Q.seen.push($);var H;if(F)H=xA(Q,$,V,A,D);else H=D.map(function(q){return mZ(Q,$,V,A,q,F)});return Q.seen.pop(),NA(H,M,R)}function BA(Q,$){if(CO($))return Q.stylize("undefined","undefined");if(iO($)){var V="'"+JSON.stringify($).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Q.stylize(V,"string")}if(yQ($))return Q.stylize(""+$,"number");if(rZ($))return Q.stylize(""+$,"boolean");if(eO($))return Q.stylize("null","null")}function oZ(Q){return"["+Error.prototype.toString.call(Q)+"]"}function xA(Q,$,V,W,C){var D=[];for(var A=0,z=$.length;A<z;++A)if(hQ($,String(A)))D.push(mZ(Q,$,V,W,String(A),!0));else D.push("");return C.forEach(function(M){if(!M.match(/^\d+$/))D.push(mZ(Q,$,V,W,M,!0))}),D}function mZ(Q,$,V,W,C,D){var A,z,M;if(M=Object.getOwnPropertyDescriptor($,C)||{value:$[C]},M.get)if(M.set)z=Q.stylize("[Getter/Setter]","special");else z=Q.stylize("[Getter]","special");else if(M.set)z=Q.stylize("[Setter]","special");if(!hQ(W,C))A="["+C+"]";if(!z)if(Q.seen.indexOf(M.value)<0){if(eO(V))z=aO(Q,M.value,null);else z=aO(Q,M.value,V-1);if(z.indexOf(`
4
- `)>-1)if(D)z=z.split(`
1
+ var qY=Object.create;var{getPrototypeOf:PY,defineProperty:KO,getOwnPropertyNames:CX,getOwnPropertyDescriptor:kY}=Object,LX=Object.prototype.hasOwnProperty;function KX(Q){return this[Q]}var _Y,vY,jY=(Q,Y,V)=>{var H=Q!=null&&typeof Q==="object";if(H){var C=Y?_Y??=new WeakMap:vY??=new WeakMap,D=C.get(Q);if(D)return D}V=Q!=null?qY(PY(Q)):{};let J=Y||!Q||!Q.__esModule?KO(V,"default",{value:Q,enumerable:!0}):V;for(let T of CX(Q))if(!LX.call(J,T))KO(J,T,{get:KX.bind(Q,T),enumerable:!0});if(H)C.set(Q,J);return J},h0=(Q)=>{var Y=(IX??=new WeakMap).get(Q),V;if(Y)return Y;if(Y=KO({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function"){for(var H of CX(Q))if(!LX.call(Y,H))KO(Y,H,{get:KX.bind(Q,H),enumerable:!(V=kY(Q,H))||V.enumerable})}return IX.set(Q,Y),Y},IX,BY=(Q,Y)=>()=>(Y||Q((Y={exports:{}}).exports,Y),Y.exports);var xY=(Q)=>Q;function NY(Q,Y){this[Q]=xY.bind(null,Y)}var HO=(Q,Y)=>{for(var V in Y)KO(Q,V,{get:Y[V],enumerable:!0,configurable:!0,set:NY.bind(Y,V)})};var WO=(Q,Y)=>()=>(Q&&(Y=Q(Q=0)),Y);var gY=((Q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Q,{get:(Y,V)=>(typeof require<"u"?require:Y)[V]}):Q)(function(Q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+Q+'" is not supported')});var HU={};HO(HU,{transcode:()=>B$,resolveObjectURL:()=>_$,kStringMaxLength:()=>sX,kMaxLength:()=>FO,isUtf8:()=>v$,isAscii:()=>j$,default:()=>x$,constants:()=>Z$,btoa:()=>eY,atob:()=>iY,INSPECT_MAX_BYTES:()=>mX,File:()=>U$,Buffer:()=>G0,Blob:()=>O$});function mY(Q){var Y=Q.length;if(Y%4>0)throw Error("Invalid string. Length must be a multiple of 4");var V=Q.indexOf("=");if(V===-1)V=Y;var H=V===Y?0:4-V%4;return[V,H]}function sY(Q,Y){return(Q+Y)*3/4-Y}function tY(Q){var Y,V=mY(Q),H=V[0],C=V[1],D=new Uint8Array(sY(H,C)),J=0,T=C>0?H-4:H,M;for(M=0;M<T;M+=4)Y=fU[Q.charCodeAt(M)]<<18|fU[Q.charCodeAt(M+1)]<<12|fU[Q.charCodeAt(M+2)]<<6|fU[Q.charCodeAt(M+3)],D[J++]=Y>>16&255,D[J++]=Y>>8&255,D[J++]=Y&255;if(C===2)Y=fU[Q.charCodeAt(M)]<<2|fU[Q.charCodeAt(M+1)]>>4,D[J++]=Y&255;if(C===1)Y=fU[Q.charCodeAt(M)]<<10|fU[Q.charCodeAt(M+1)]<<4|fU[Q.charCodeAt(M+2)]>>2,D[J++]=Y>>8&255,D[J++]=Y&255;return D}function rY(Q){return bU[Q>>18&63]+bU[Q>>12&63]+bU[Q>>6&63]+bU[Q&63]}function aY(Q,Y,V){var H,C=[];for(var D=Y;D<V;D+=3)H=(Q[D]<<16&16711680)+(Q[D+1]<<8&65280)+(Q[D+2]&255),C.push(rY(H));return C.join("")}function uX(Q){var Y,V=Q.length,H=V%3,C=[],D=16383;for(var J=0,T=V-H;J<T;J+=D)C.push(aY(Q,J,J+D>T?T:J+D));if(H===1)Y=Q[V-1],C.push(bU[Y>>2]+bU[Y<<4&63]+"==");else if(H===2)Y=(Q[V-2]<<8)+Q[V-1],C.push(bU[Y>>10]+bU[Y>>4&63]+bU[Y<<2&63]+"=");return C.join("")}function cO(Q,Y,V,H,C){var D,J,T=C*8-H-1,M=(1<<T)-1,F=M>>1,R=-7,K=V?C-1:0,W=V?-1:1,q=Q[Y+K];K+=W,D=q&(1<<-R)-1,q>>=-R,R+=T;for(;R>0;D=D*256+Q[Y+K],K+=W,R-=8);J=D&(1<<-R)-1,D>>=-R,R+=H;for(;R>0;J=J*256+Q[Y+K],K+=W,R-=8);if(D===0)D=1-F;else if(D===M)return J?NaN:(q?-1:1)*(1/0);else J=J+Math.pow(2,H),D=D-F;return(q?-1:1)*J*Math.pow(2,D-H)}function nX(Q,Y,V,H,C,D){var J,T,M,F=D*8-C-1,R=(1<<F)-1,K=R>>1,W=C===23?Math.pow(2,-24)-Math.pow(2,-77):0,q=H?0:D-1,P=H?1:-1,_=Y<0||Y===0&&1/Y<0?1:0;if(Y=Math.abs(Y),isNaN(Y)||Y===1/0)T=isNaN(Y)?1:0,J=R;else{if(J=Math.floor(Math.log(Y)/Math.LN2),Y*(M=Math.pow(2,-J))<1)J--,M*=2;if(J+K>=1)Y+=W/M;else Y+=W*Math.pow(2,1-K);if(Y*M>=2)J++,M/=2;if(J+K>=R)T=0,J=R;else if(J+K>=1)T=(Y*M-1)*Math.pow(2,C),J=J+K;else T=Y*Math.pow(2,K-1)*Math.pow(2,C),J=0}for(;C>=8;Q[V+q]=T&255,q+=P,T/=256,C-=8);J=J<<C|T,F+=C;for(;F>0;Q[V+q]=J&255,q+=P,J/=256,F-=8);Q[V+q-P]|=_*128}function oU(Q){if(Q>FO)throw RangeError('The value "'+Q+'" is invalid for option "size"');let Y=new Uint8Array(Q);return Object.setPrototypeOf(Y,G0.prototype),Y}function RZ(Q,Y,V){return class extends V{constructor(){super();Object.defineProperty(this,"message",{value:Y.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Q}]`,this.stack,delete this.name}get code(){return Q}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${Q}]: ${this.message}`}}}function G0(Q,Y,V){if(typeof Q==="number"){if(typeof Y==="string")throw TypeError('The "string" argument must be of type string. Received type number');return TZ(Q)}return tX(Q,Y,V)}function tX(Q,Y,V){if(typeof Q==="string")return $$(Q,Y);if(ArrayBuffer.isView(Q))return J$(Q);if(Q==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(lU(Q,ArrayBuffer)||Q&&lU(Q.buffer,ArrayBuffer))return DZ(Q,Y,V);if(typeof SharedArrayBuffer<"u"&&(lU(Q,SharedArrayBuffer)||Q&&lU(Q.buffer,SharedArrayBuffer)))return DZ(Q,Y,V);if(typeof Q==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let H=Q.valueOf&&Q.valueOf();if(H!=null&&H!==Q)return G0.from(H,Y,V);let C=A$(Q);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]==="function")return G0.from(Q[Symbol.toPrimitive]("string"),Y,V);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}function rX(Q){if(typeof Q!=="number")throw TypeError('"size" argument must be of type number');else if(Q<0)throw RangeError('The value "'+Q+'" is invalid for option "size"')}function Y$(Q,Y,V){if(rX(Q),Q<=0)return oU(Q);if(Y!==void 0)return typeof V==="string"?oU(Q).fill(Y,V):oU(Q).fill(Y);return oU(Q)}function TZ(Q){return rX(Q),oU(Q<0?0:zZ(Q)|0)}function $$(Q,Y){if(typeof Y!=="string"||Y==="")Y="utf8";if(!G0.isEncoding(Y))throw TypeError("Unknown encoding: "+Y);let V=aX(Q,Y)|0,H=oU(V),C=H.write(Q,Y);if(C!==V)H=H.slice(0,C);return H}function SZ(Q){let Y=Q.length<0?0:zZ(Q.length)|0,V=oU(Y);for(let H=0;H<Y;H+=1)V[H]=Q[H]&255;return V}function J$(Q){if(lU(Q,Uint8Array)){let Y=new Uint8Array(Q);return DZ(Y.buffer,Y.byteOffset,Y.byteLength)}return SZ(Q)}function DZ(Q,Y,V){if(Y<0||Q.byteLength<Y)throw RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<Y+(V||0))throw RangeError('"length" is outside of buffer bounds');let H;if(Y===void 0&&V===void 0)H=new Uint8Array(Q);else if(V===void 0)H=new Uint8Array(Q,Y);else H=new Uint8Array(Q,Y,V);return Object.setPrototypeOf(H,G0.prototype),H}function A$(Q){if(G0.isBuffer(Q)){let Y=zZ(Q.length)|0,V=oU(Y);if(V.length===0)return V;return Q.copy(V,0,0,Y),V}if(Q.length!==void 0){if(typeof Q.length!=="number"||Number.isNaN(Q.length))return oU(0);return SZ(Q)}if(Q.type==="Buffer"&&Array.isArray(Q.data))return SZ(Q.data)}function zZ(Q){if(Q>=FO)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+FO.toString(16)+" bytes");return Q|0}function aX(Q,Y){if(G0.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||lU(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);let V=Q.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&V===0)return 0;let C=!1;for(;;)switch(Y){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":return FZ(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V*2;case"hex":return V>>>1;case"base64":return $Q(Q).length;default:if(C)return H?-1:FZ(Q).length;Y=(""+Y).toLowerCase(),C=!0}}function G$(Q,Y,V){let H=!1;if(Y===void 0||Y<0)Y=0;if(Y>this.length)return"";if(V===void 0||V>this.length)V=this.length;if(V<=0)return"";if(V>>>=0,Y>>>=0,V<=Y)return"";if(!Q)Q="utf8";while(!0)switch(Q){case"hex":return D$(this,Y,V);case"utf8":case"utf-8":return iX(this,Y,V);case"ascii":return W$(this,Y,V);case"latin1":case"binary":return S$(this,Y,V);case"base64":return K$(this,Y,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F$(this,Y,V);default:if(H)throw TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),H=!0}}function QO(Q,Y,V){let H=Q[Y];Q[Y]=Q[V],Q[V]=H}function eX(Q,Y,V,H,C){if(Q.length===0)return-1;if(typeof V==="string")H=V,V=0;else if(V>2147483647)V=2147483647;else if(V<-2147483648)V=-2147483648;if(V=+V,Number.isNaN(V))V=C?0:Q.length-1;if(V<0)V=Q.length+V;if(V>=Q.length)if(C)return-1;else V=Q.length-1;else if(V<0)if(C)V=0;else return-1;if(typeof Y==="string")Y=G0.from(Y,H);if(G0.isBuffer(Y)){if(Y.length===0)return-1;return lX(Q,Y,V,H,C)}else if(typeof Y==="number"){if(Y=Y&255,typeof Uint8Array.prototype.indexOf==="function")if(C)return Uint8Array.prototype.indexOf.call(Q,Y,V);else return Uint8Array.prototype.lastIndexOf.call(Q,Y,V);return lX(Q,[Y],V,H,C)}throw TypeError("val must be string, number or Buffer")}function lX(Q,Y,V,H,C){let D=1,J=Q.length,T=Y.length;if(H!==void 0){if(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le"){if(Q.length<2||Y.length<2)return-1;D=2,J/=2,T/=2,V/=2}}function M(R,K){if(D===1)return R[K];else return R.readUInt16BE(K*D)}let F;if(C){let R=-1;for(F=V;F<J;F++)if(M(Q,F)===M(Y,R===-1?0:F-R)){if(R===-1)R=F;if(F-R+1===T)return R*D}else{if(R!==-1)F-=F-R;R=-1}}else{if(V+T>J)V=J-T;for(F=V;F>=0;F--){let R=!0;for(let K=0;K<T;K++)if(M(Q,F+K)!==M(Y,K)){R=!1;break}if(R)return F}}return-1}function V$(Q,Y,V,H){V=Number(V)||0;let C=Q.length-V;if(!H)H=C;else if(H=Number(H),H>C)H=C;let D=Y.length;if(H>D/2)H=D/2;let J;for(J=0;J<H;++J){let T=parseInt(Y.substr(J*2,2),16);if(Number.isNaN(T))return J;Q[V+J]=T}return J}function E$(Q,Y,V,H){return pO(FZ(Y,Q.length-V),Q,V,H)}function I$(Q,Y,V,H){return pO(M$(Y),Q,V,H)}function C$(Q,Y,V,H){return pO($Q(Y),Q,V,H)}function L$(Q,Y,V,H){return pO(q$(Y,Q.length-V),Q,V,H)}function K$(Q,Y,V){if(Y===0&&V===Q.length)return uX(Q);else return uX(Q.slice(Y,V))}function iX(Q,Y,V){V=Math.min(Q.length,V);let H=[],C=Y;while(C<V){let D=Q[C],J=null,T=D>239?4:D>223?3:D>191?2:1;if(C+T<=V){let M,F,R,K;switch(T){case 1:if(D<128)J=D;break;case 2:if(M=Q[C+1],(M&192)===128){if(K=(D&31)<<6|M&63,K>127)J=K}break;case 3:if(M=Q[C+1],F=Q[C+2],(M&192)===128&&(F&192)===128){if(K=(D&15)<<12|(M&63)<<6|F&63,K>2047&&(K<55296||K>57343))J=K}break;case 4:if(M=Q[C+1],F=Q[C+2],R=Q[C+3],(M&192)===128&&(F&192)===128&&(R&192)===128){if(K=(D&15)<<18|(M&63)<<12|(F&63)<<6|R&63,K>65535&&K<1114112)J=K}}}if(J===null)J=65533,T=1;else if(J>65535)J-=65536,H.push(J>>>10&1023|55296),J=56320|J&1023;H.push(J),C+=T}return H$(H)}function H$(Q){let Y=Q.length;if(Y<=dX)return String.fromCharCode.apply(String,Q);let V="",H=0;while(H<Y)V+=String.fromCharCode.apply(String,Q.slice(H,H+=dX));return V}function W$(Q,Y,V){let H="";V=Math.min(Q.length,V);for(let C=Y;C<V;++C)H+=String.fromCharCode(Q[C]&127);return H}function S$(Q,Y,V){let H="";V=Math.min(Q.length,V);for(let C=Y;C<V;++C)H+=String.fromCharCode(Q[C]);return H}function D$(Q,Y,V){let H=Q.length;if(!Y||Y<0)Y=0;if(!V||V<0||V>H)V=H;let C="";for(let D=Y;D<V;++D)C+=P$[Q[D]];return C}function F$(Q,Y,V){let H=Q.slice(Y,V),C="";for(let D=0;D<H.length-1;D+=2)C+=String.fromCharCode(H[D]+H[D+1]*256);return C}function KU(Q,Y,V){if(Q%1!==0||Q<0)throw RangeError("offset is not uint");if(Q+Y>V)throw RangeError("Trying to access beyond buffer length")}function kU(Q,Y,V,H,C,D){if(!G0.isBuffer(Q))throw TypeError('"buffer" argument must be a Buffer instance');if(Y>C||Y<D)throw RangeError('"value" argument is out of bounds');if(V+H>Q.length)throw RangeError("Index out of range")}function UQ(Q,Y,V,H,C){YQ(Y,H,C,Q,V,7);let D=Number(Y&BigInt(4294967295));Q[V++]=D,D=D>>8,Q[V++]=D,D=D>>8,Q[V++]=D,D=D>>8,Q[V++]=D;let J=Number(Y>>BigInt(32)&BigInt(4294967295));return Q[V++]=J,J=J>>8,Q[V++]=J,J=J>>8,Q[V++]=J,J=J>>8,Q[V++]=J,V}function OQ(Q,Y,V,H,C){YQ(Y,H,C,Q,V,7);let D=Number(Y&BigInt(4294967295));Q[V+7]=D,D=D>>8,Q[V+6]=D,D=D>>8,Q[V+5]=D,D=D>>8,Q[V+4]=D;let J=Number(Y>>BigInt(32)&BigInt(4294967295));return Q[V+3]=J,J=J>>8,Q[V+2]=J,J=J>>8,Q[V+1]=J,J=J>>8,Q[V]=J,V+8}function ZQ(Q,Y,V,H,C,D){if(V+H>Q.length)throw RangeError("Index out of range");if(V<0)throw RangeError("Index out of range")}function XQ(Q,Y,V,H,C){if(Y=+Y,V=V>>>0,!C)ZQ(Q,Y,V,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return nX(Q,Y,V,H,23,4),V+4}function QQ(Q,Y,V,H,C){if(Y=+Y,V=V>>>0,!C)ZQ(Q,Y,V,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return nX(Q,Y,V,H,52,8),V+8}function oX(Q){let Y="",V=Q.length,H=Q[0]==="-"?1:0;for(;V>=H+4;V-=3)Y=`_${Q.slice(V-3,V)}${Y}`;return`${Q.slice(0,V)}${Y}`}function R$(Q,Y,V){if(GO(Y,"offset"),Q[Y]===void 0||Q[Y+V]===void 0)RO(Y,Q.length-(V+1))}function YQ(Q,Y,V,H,C,D){if(Q>V||Q<Y){let J=typeof Y==="bigint"?"n":"",T;if(D>3)if(Y===0||Y===BigInt(0))T=`>= 0${J} and < 2${J} ** ${(D+1)*8}${J}`;else T=`>= -(2${J} ** ${(D+1)*8-1}${J}) and < 2 ** ${(D+1)*8-1}${J}`;else T=`>= ${Y}${J} and <= ${V}${J}`;throw new WZ("value",T,Q)}R$(H,C,D)}function GO(Q,Y){if(typeof Q!=="number")throw new Q$(Y,"number",Q)}function RO(Q,Y,V){if(Math.floor(Q)!==Q)throw GO(Q,V),new WZ(V||"offset","an integer",Q);if(Y<0)throw new X$;throw new WZ(V||"offset",`>= ${V?1:0} and <= ${Y}`,Q)}function z$(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(T$,""),Q.length<2)return"";while(Q.length%4!==0)Q=Q+"=";return Q}function FZ(Q,Y){Y=Y||1/0;let V,H=Q.length,C=null,D=[];for(let J=0;J<H;++J){if(V=Q.charCodeAt(J),V>55295&&V<57344){if(!C){if(V>56319){if((Y-=3)>-1)D.push(239,191,189);continue}else if(J+1===H){if((Y-=3)>-1)D.push(239,191,189);continue}C=V;continue}if(V<56320){if((Y-=3)>-1)D.push(239,191,189);C=V;continue}V=(C-55296<<10|V-56320)+65536}else if(C){if((Y-=3)>-1)D.push(239,191,189)}if(C=null,V<128){if((Y-=1)<0)break;D.push(V)}else if(V<2048){if((Y-=2)<0)break;D.push(V>>6|192,V&63|128)}else if(V<65536){if((Y-=3)<0)break;D.push(V>>12|224,V>>6&63|128,V&63|128)}else if(V<1114112){if((Y-=4)<0)break;D.push(V>>18|240,V>>12&63|128,V>>6&63|128,V&63|128)}else throw Error("Invalid code point")}return D}function M$(Q){let Y=[];for(let V=0;V<Q.length;++V)Y.push(Q.charCodeAt(V)&255);return Y}function q$(Q,Y){let V,H,C,D=[];for(let J=0;J<Q.length;++J){if((Y-=2)<0)break;V=Q.charCodeAt(J),H=V>>8,C=V%256,D.push(C),D.push(H)}return D}function $Q(Q){return tY(z$(Q))}function pO(Q,Y,V,H){let C;for(C=0;C<H;++C){if(C+V>=Y.length||C>=Q.length)break;Y[C+V]=Q[C]}return C}function lU(Q,Y){return Q instanceof Y||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===Y.name}function eU(Q){return typeof BigInt>"u"?k$:Q}function k$(){throw Error("BigInt not supported")}function MZ(Q){return()=>{throw Error(Q+" is not implemented for node:buffer browser polyfill")}}var bU,fU,HZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",XO,hX,bX,mX=50,FO=2147483647,sX=536870888,eY,iY,U$,O$,Z$,X$,Q$,WZ,dX=4096,T$,P$,_$,v$,j$=(Q)=>{for(let Y of Q)if(Y.charCodeAt(0)>127)return!1;return!0},B$,x$;var WU=WO(()=>{bU=[],fU=[];for(XO=0,hX=HZ.length;XO<hX;++XO)bU[XO]=HZ[XO],fU[HZ.charCodeAt(XO)]=XO;fU[45]=62;fU[95]=63;bX=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,eY=globalThis.btoa,iY=globalThis.atob,U$=globalThis.File,O$=globalThis.Blob,Z$={MAX_LENGTH:FO,MAX_STRING_LENGTH:sX};X$=RZ("ERR_BUFFER_OUT_OF_BOUNDS",function(Q){if(Q)return`${Q} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),Q$=RZ("ERR_INVALID_ARG_TYPE",function(Q,Y){return`The "${Q}" argument must be of type number. Received type ${typeof Y}`},TypeError),WZ=RZ("ERR_OUT_OF_RANGE",function(Q,Y,V){let H=`The value of "${Q}" is out of range.`,C=V;if(Number.isInteger(V)&&Math.abs(V)>4294967296)C=oX(String(V));else if(typeof V==="bigint"){if(C=String(V),V>BigInt(2)**BigInt(32)||V<-(BigInt(2)**BigInt(32)))C=oX(C);C+="n"}return H+=` It must be ${Y}. Received ${C}`,H},RangeError);Object.defineProperty(G0.prototype,"parent",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.buffer}});Object.defineProperty(G0.prototype,"offset",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.byteOffset}});G0.poolSize=8192;G0.from=function(Q,Y,V){return tX(Q,Y,V)};Object.setPrototypeOf(G0.prototype,Uint8Array.prototype);Object.setPrototypeOf(G0,Uint8Array);G0.alloc=function(Q,Y,V){return Y$(Q,Y,V)};G0.allocUnsafe=function(Q){return TZ(Q)};G0.allocUnsafeSlow=function(Q){return TZ(Q)};G0.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==G0.prototype};G0.compare=function(Q,Y){if(lU(Q,Uint8Array))Q=G0.from(Q,Q.offset,Q.byteLength);if(lU(Y,Uint8Array))Y=G0.from(Y,Y.offset,Y.byteLength);if(!G0.isBuffer(Q)||!G0.isBuffer(Y))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===Y)return 0;let V=Q.length,H=Y.length;for(let C=0,D=Math.min(V,H);C<D;++C)if(Q[C]!==Y[C]){V=Q[C],H=Y[C];break}if(V<H)return-1;if(H<V)return 1;return 0};G0.isEncoding=function(Q){switch(String(Q).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}};G0.concat=function(Q,Y){if(!Array.isArray(Q))throw TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return G0.alloc(0);let V;if(Y===void 0){Y=0;for(V=0;V<Q.length;++V)Y+=Q[V].length}let H=G0.allocUnsafe(Y),C=0;for(V=0;V<Q.length;++V){let D=Q[V];if(lU(D,Uint8Array))if(C+D.length>H.length){if(!G0.isBuffer(D))D=G0.from(D);D.copy(H,C)}else Uint8Array.prototype.set.call(H,D,C);else if(!G0.isBuffer(D))throw TypeError('"list" argument must be an Array of Buffers');else D.copy(H,C);C+=D.length}return H};G0.byteLength=aX;G0.prototype._isBuffer=!0;G0.prototype.swap16=function(){let Q=this.length;if(Q%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let Y=0;Y<Q;Y+=2)QO(this,Y,Y+1);return this};G0.prototype.swap32=function(){let Q=this.length;if(Q%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let Y=0;Y<Q;Y+=4)QO(this,Y,Y+3),QO(this,Y+1,Y+2);return this};G0.prototype.swap64=function(){let Q=this.length;if(Q%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let Y=0;Y<Q;Y+=8)QO(this,Y,Y+7),QO(this,Y+1,Y+6),QO(this,Y+2,Y+5),QO(this,Y+3,Y+4);return this};G0.prototype.toString=function(){let Q=this.length;if(Q===0)return"";if(arguments.length===0)return iX(this,0,Q);return G$.apply(this,arguments)};G0.prototype.toLocaleString=G0.prototype.toString;G0.prototype.equals=function(Q){if(!G0.isBuffer(Q))throw TypeError("Argument must be a Buffer");if(this===Q)return!0;return G0.compare(this,Q)===0};G0.prototype.inspect=function(){let Q="",Y=mX;if(Q=this.toString("hex",0,Y).replace(/(.{2})/g,"$1 ").trim(),this.length>Y)Q+=" ... ";return"<Buffer "+Q+">"};if(bX)G0.prototype[bX]=G0.prototype.inspect;G0.prototype.compare=function(Q,Y,V,H,C){if(lU(Q,Uint8Array))Q=G0.from(Q,Q.offset,Q.byteLength);if(!G0.isBuffer(Q))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if(Y===void 0)Y=0;if(V===void 0)V=Q?Q.length:0;if(H===void 0)H=0;if(C===void 0)C=this.length;if(Y<0||V>Q.length||H<0||C>this.length)throw RangeError("out of range index");if(H>=C&&Y>=V)return 0;if(H>=C)return-1;if(Y>=V)return 1;if(Y>>>=0,V>>>=0,H>>>=0,C>>>=0,this===Q)return 0;let D=C-H,J=V-Y,T=Math.min(D,J),M=this.slice(H,C),F=Q.slice(Y,V);for(let R=0;R<T;++R)if(M[R]!==F[R]){D=M[R],J=F[R];break}if(D<J)return-1;if(J<D)return 1;return 0};G0.prototype.includes=function(Q,Y,V){return this.indexOf(Q,Y,V)!==-1};G0.prototype.indexOf=function(Q,Y,V){return eX(this,Q,Y,V,!0)};G0.prototype.lastIndexOf=function(Q,Y,V){return eX(this,Q,Y,V,!1)};G0.prototype.write=function(Q,Y,V,H){if(Y===void 0)H="utf8",V=this.length,Y=0;else if(V===void 0&&typeof Y==="string")H=Y,V=this.length,Y=0;else if(isFinite(Y))if(Y=Y>>>0,isFinite(V)){if(V=V>>>0,H===void 0)H="utf8"}else H=V,V=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let C=this.length-Y;if(V===void 0||V>C)V=C;if(Q.length>0&&(V<0||Y<0)||Y>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!H)H="utf8";let D=!1;for(;;)switch(H){case"hex":return V$(this,Q,Y,V);case"utf8":case"utf-8":return E$(this,Q,Y,V);case"ascii":case"latin1":case"binary":return I$(this,Q,Y,V);case"base64":return C$(this,Q,Y,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L$(this,Q,Y,V);default:if(D)throw TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),D=!0}};G0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};G0.prototype.slice=function(Q,Y){let V=this.length;if(Q=~~Q,Y=Y===void 0?V:~~Y,Q<0){if(Q+=V,Q<0)Q=0}else if(Q>V)Q=V;if(Y<0){if(Y+=V,Y<0)Y=0}else if(Y>V)Y=V;if(Y<Q)Y=Q;let H=this.subarray(Q,Y);return Object.setPrototypeOf(H,G0.prototype),H};G0.prototype.readUintLE=G0.prototype.readUIntLE=function(Q,Y,V){if(Q=Q>>>0,Y=Y>>>0,!V)KU(Q,Y,this.length);let H=this[Q],C=1,D=0;while(++D<Y&&(C*=256))H+=this[Q+D]*C;return H};G0.prototype.readUintBE=G0.prototype.readUIntBE=function(Q,Y,V){if(Q=Q>>>0,Y=Y>>>0,!V)KU(Q,Y,this.length);let H=this[Q+--Y],C=1;while(Y>0&&(C*=256))H+=this[Q+--Y]*C;return H};G0.prototype.readUint8=G0.prototype.readUInt8=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,1,this.length);return this[Q]};G0.prototype.readUint16LE=G0.prototype.readUInt16LE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,2,this.length);return this[Q]|this[Q+1]<<8};G0.prototype.readUint16BE=G0.prototype.readUInt16BE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,2,this.length);return this[Q]<<8|this[Q+1]};G0.prototype.readUint32LE=G0.prototype.readUInt32LE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,4,this.length);return(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216};G0.prototype.readUint32BE=G0.prototype.readUInt32BE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,4,this.length);return this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])};G0.prototype.readBigUInt64LE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let Y=this[Q],V=this[Q+7];if(Y===void 0||V===void 0)RO(Q,this.length-8);let H=Y+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216,C=this[++Q]+this[++Q]*256+this[++Q]*65536+V*16777216;return BigInt(H)+(BigInt(C)<<BigInt(32))});G0.prototype.readBigUInt64BE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let Y=this[Q],V=this[Q+7];if(Y===void 0||V===void 0)RO(Q,this.length-8);let H=Y*16777216+this[++Q]*65536+this[++Q]*256+this[++Q],C=this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+V;return(BigInt(H)<<BigInt(32))+BigInt(C)});G0.prototype.readIntLE=function(Q,Y,V){if(Q=Q>>>0,Y=Y>>>0,!V)KU(Q,Y,this.length);let H=this[Q],C=1,D=0;while(++D<Y&&(C*=256))H+=this[Q+D]*C;if(C*=128,H>=C)H-=Math.pow(2,8*Y);return H};G0.prototype.readIntBE=function(Q,Y,V){if(Q=Q>>>0,Y=Y>>>0,!V)KU(Q,Y,this.length);let H=Y,C=1,D=this[Q+--H];while(H>0&&(C*=256))D+=this[Q+--H]*C;if(C*=128,D>=C)D-=Math.pow(2,8*Y);return D};G0.prototype.readInt8=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,1,this.length);if(!(this[Q]&128))return this[Q];return(255-this[Q]+1)*-1};G0.prototype.readInt16LE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,2,this.length);let V=this[Q]|this[Q+1]<<8;return V&32768?V|4294901760:V};G0.prototype.readInt16BE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,2,this.length);let V=this[Q+1]|this[Q]<<8;return V&32768?V|4294901760:V};G0.prototype.readInt32LE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,4,this.length);return this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24};G0.prototype.readInt32BE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,4,this.length);return this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]};G0.prototype.readBigInt64LE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let Y=this[Q],V=this[Q+7];if(Y===void 0||V===void 0)RO(Q,this.length-8);let H=this[Q+4]+this[Q+5]*256+this[Q+6]*65536+(V<<24);return(BigInt(H)<<BigInt(32))+BigInt(Y+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216)});G0.prototype.readBigInt64BE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let Y=this[Q],V=this[Q+7];if(Y===void 0||V===void 0)RO(Q,this.length-8);let H=(Y<<24)+this[++Q]*65536+this[++Q]*256+this[++Q];return(BigInt(H)<<BigInt(32))+BigInt(this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+V)});G0.prototype.readFloatLE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,4,this.length);return cO(this,Q,!0,23,4)};G0.prototype.readFloatBE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,4,this.length);return cO(this,Q,!1,23,4)};G0.prototype.readDoubleLE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,8,this.length);return cO(this,Q,!0,52,8)};G0.prototype.readDoubleBE=function(Q,Y){if(Q=Q>>>0,!Y)KU(Q,8,this.length);return cO(this,Q,!1,52,8)};G0.prototype.writeUintLE=G0.prototype.writeUIntLE=function(Q,Y,V,H){if(Q=+Q,Y=Y>>>0,V=V>>>0,!H){let J=Math.pow(2,8*V)-1;kU(this,Q,Y,V,J,0)}let C=1,D=0;this[Y]=Q&255;while(++D<V&&(C*=256))this[Y+D]=Q/C&255;return Y+V};G0.prototype.writeUintBE=G0.prototype.writeUIntBE=function(Q,Y,V,H){if(Q=+Q,Y=Y>>>0,V=V>>>0,!H){let J=Math.pow(2,8*V)-1;kU(this,Q,Y,V,J,0)}let C=V-1,D=1;this[Y+C]=Q&255;while(--C>=0&&(D*=256))this[Y+C]=Q/D&255;return Y+V};G0.prototype.writeUint8=G0.prototype.writeUInt8=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,1,255,0);return this[Y]=Q&255,Y+1};G0.prototype.writeUint16LE=G0.prototype.writeUInt16LE=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,2,65535,0);return this[Y]=Q&255,this[Y+1]=Q>>>8,Y+2};G0.prototype.writeUint16BE=G0.prototype.writeUInt16BE=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,2,65535,0);return this[Y]=Q>>>8,this[Y+1]=Q&255,Y+2};G0.prototype.writeUint32LE=G0.prototype.writeUInt32LE=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,4,4294967295,0);return this[Y+3]=Q>>>24,this[Y+2]=Q>>>16,this[Y+1]=Q>>>8,this[Y]=Q&255,Y+4};G0.prototype.writeUint32BE=G0.prototype.writeUInt32BE=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,4,4294967295,0);return this[Y]=Q>>>24,this[Y+1]=Q>>>16,this[Y+2]=Q>>>8,this[Y+3]=Q&255,Y+4};G0.prototype.writeBigUInt64LE=eU(function(Q,Y=0){return UQ(this,Q,Y,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeBigUInt64BE=eU(function(Q,Y=0){return OQ(this,Q,Y,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeIntLE=function(Q,Y,V,H){if(Q=+Q,Y=Y>>>0,!H){let T=Math.pow(2,8*V-1);kU(this,Q,Y,V,T-1,-T)}let C=0,D=1,J=0;this[Y]=Q&255;while(++C<V&&(D*=256)){if(Q<0&&J===0&&this[Y+C-1]!==0)J=1;this[Y+C]=(Q/D>>0)-J&255}return Y+V};G0.prototype.writeIntBE=function(Q,Y,V,H){if(Q=+Q,Y=Y>>>0,!H){let T=Math.pow(2,8*V-1);kU(this,Q,Y,V,T-1,-T)}let C=V-1,D=1,J=0;this[Y+C]=Q&255;while(--C>=0&&(D*=256)){if(Q<0&&J===0&&this[Y+C+1]!==0)J=1;this[Y+C]=(Q/D>>0)-J&255}return Y+V};G0.prototype.writeInt8=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,1,127,-128);if(Q<0)Q=255+Q+1;return this[Y]=Q&255,Y+1};G0.prototype.writeInt16LE=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,2,32767,-32768);return this[Y]=Q&255,this[Y+1]=Q>>>8,Y+2};G0.prototype.writeInt16BE=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,2,32767,-32768);return this[Y]=Q>>>8,this[Y+1]=Q&255,Y+2};G0.prototype.writeInt32LE=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,4,2147483647,-2147483648);return this[Y]=Q&255,this[Y+1]=Q>>>8,this[Y+2]=Q>>>16,this[Y+3]=Q>>>24,Y+4};G0.prototype.writeInt32BE=function(Q,Y,V){if(Q=+Q,Y=Y>>>0,!V)kU(this,Q,Y,4,2147483647,-2147483648);if(Q<0)Q=4294967295+Q+1;return this[Y]=Q>>>24,this[Y+1]=Q>>>16,this[Y+2]=Q>>>8,this[Y+3]=Q&255,Y+4};G0.prototype.writeBigInt64LE=eU(function(Q,Y=0){return UQ(this,Q,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeBigInt64BE=eU(function(Q,Y=0){return OQ(this,Q,Y,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeFloatLE=function(Q,Y,V){return XQ(this,Q,Y,!0,V)};G0.prototype.writeFloatBE=function(Q,Y,V){return XQ(this,Q,Y,!1,V)};G0.prototype.writeDoubleLE=function(Q,Y,V){return QQ(this,Q,Y,!0,V)};G0.prototype.writeDoubleBE=function(Q,Y,V){return QQ(this,Q,Y,!1,V)};G0.prototype.copy=function(Q,Y,V,H){if(!G0.isBuffer(Q))throw TypeError("argument should be a Buffer");if(!V)V=0;if(!H&&H!==0)H=this.length;if(Y>=Q.length)Y=Q.length;if(!Y)Y=0;if(H>0&&H<V)H=V;if(H===V)return 0;if(Q.length===0||this.length===0)return 0;if(Y<0)throw RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw RangeError("Index out of range");if(H<0)throw RangeError("sourceEnd out of bounds");if(H>this.length)H=this.length;if(Q.length-Y<H-V)H=Q.length-Y+V;let C=H-V;if(this===Q&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(Y,V,H);else Uint8Array.prototype.set.call(Q,this.subarray(V,H),Y);return C};G0.prototype.fill=function(Q,Y,V,H){if(typeof Q==="string"){if(typeof Y==="string")H=Y,Y=0,V=this.length;else if(typeof V==="string")H=V,V=this.length;if(H!==void 0&&typeof H!=="string")throw TypeError("encoding must be a string");if(typeof H==="string"&&!G0.isEncoding(H))throw TypeError("Unknown encoding: "+H);if(Q.length===1){let D=Q.charCodeAt(0);if(H==="utf8"&&D<128||H==="latin1")Q=D}}else if(typeof Q==="number")Q=Q&255;else if(typeof Q==="boolean")Q=Number(Q);if(Y<0||this.length<Y||this.length<V)throw RangeError("Out of range index");if(V<=Y)return this;if(Y=Y>>>0,V=V===void 0?this.length:V>>>0,!Q)Q=0;let C;if(typeof Q==="number")for(C=Y;C<V;++C)this[C]=Q;else{let D=G0.isBuffer(Q)?Q:G0.from(Q,H),J=D.length;if(J===0)throw TypeError('The value "'+Q+'" is invalid for argument "value"');for(C=0;C<V-Y;++C)this[C+Y]=D[C%J]}return this};T$=/[^+/0-9A-Za-z-_]/g;P$=function(){let Q=Array(256);for(let Y=0;Y<16;++Y){let V=Y*16;for(let H=0;H<16;++H)Q[V+H]="0123456789abcdef"[Y]+"0123456789abcdef"[H]}return Q}();_$=MZ("resolveObjectURL"),v$=MZ("isUtf8"),B$=MZ("transcode"),x$=G0});var zO={};HO(zO,{setMaxListeners:()=>WQ,once:()=>KQ,listenerCount:()=>SQ,init:()=>iU,getMaxListeners:()=>FQ,getEventListeners:()=>HQ,default:()=>u$,captureRejectionSymbol:()=>EQ,addAbortListener:()=>RQ,EventEmitter:()=>iU});function IQ(Q,Y){var{_events:V}=Q;if(Y[0]??=Error("Unhandled error."),!V)throw Y[0];var H=V[VQ];if(H)for(var C of AQ.call(H))C.apply(Q,Y);var D=V.error;if(!D)throw Y[0];for(var C of AQ.call(D))C.apply(Q,Y);return!0}function f$(Q,Y,V,H){Y.then(void 0,function(C){queueMicrotask(()=>w$(Q,C,V,H))})}function w$(Q,Y,V,H){if(typeof Q[JQ]==="function")Q[JQ](Y,V,...H);else try{Q[YO]=!1,Q.emit("error",Y)}finally{Q[YO]=!0}}function CQ(Q,Y,V){V.warned=!0;let H=Error(`Possible EventEmitter memory leak detected. ${V.length} ${String(Y)} listeners added to [${Q.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);H.name="MaxListenersExceededWarning",H.emitter=Q,H.type=Y,H.count=V.length,console.warn(H)}function LQ(Q,Y,...V){this.removeListener(Q,Y),Y.apply(this,V)}function KQ(Q,Y,V){var H=V?.signal;if(DQ(H,"options.signal"),H?.aborted)throw new qZ(void 0,{cause:H?.reason});let{resolve:C,reject:D,promise:J}=$newPromiseCapability(Promise),T=(R)=>{if(Q.removeListener(Y,M),H!=null)hO(H,"abort",F);D(R)},M=(...R)=>{if(typeof Q.removeListener==="function")Q.removeListener("error",T);if(H!=null)hO(H,"abort",F);C(R)};if(GQ(Q,Y,M,{once:!0}),Y!=="error"&&typeof Q.once==="function")Q.once("error",T);function F(){hO(Q,Y,M),hO(Q,"error",T),D(new qZ(void 0,{cause:H?.reason}))}if(H!=null)GQ(H,"abort",F,{once:!0});return J}function HQ(Q,Y){return Q.listeners(Y)}function WQ(Q,...Y){kZ(Q,"setMaxListeners",0);var V;if(Y&&(V=Y.length))for(let H=0;H<V;H++)Y[H].setMaxListeners(Q);else $O=Q}function SQ(Q,Y){return Q.listenerCount(Y)}function hO(Q,Y,V,H){if(typeof Q.removeListener==="function")Q.removeListener(Y,V);else Q.removeEventListener(Y,V,H)}function GQ(Q,Y,V,H){if(typeof Q.on==="function")if(H.once)Q.once(Y,V);else Q.on(Y,V);else Q.addEventListener(Y,V,H)}function VO(Q,Y,V){let H=TypeError(`The "${Q}" argument must be of type ${Y}. Received ${V}`);return H.code="ERR_INVALID_ARG_TYPE",H}function p$(Q,Y,V){let H=RangeError(`The "${Q}" argument is out of range. It must be ${Y}. Received ${V}`);return H.code="ERR_OUT_OF_RANGE",H}function DQ(Q,Y){if(Q!==void 0&&(Q===null||typeof Q!=="object"||!("aborted"in Q)))throw VO(Y,"AbortSignal",Q)}function kZ(Q,Y,V,H){if(typeof Q!=="number")throw VO(Y,"number",Q);if(V!=null&&Q<V||H!=null&&Q>H||(V!=null||H!=null)&&Number.isNaN(Q))throw p$(Y,`${V!=null?`>= ${V}`:""}${V!=null&&H!=null?" && ":""}${H!=null?`<= ${H}`:""}`,Q)}function TO(Q){if(typeof Q!=="function")throw TypeError("The listener must be a function")}function h$(Q,Y){if(typeof Q!=="boolean")throw VO(Y,"boolean",Q)}function FQ(Q){return Q?._maxListeners??$O}function RQ(Q,Y){if(Q===void 0)throw VO("signal","AbortSignal",Q);if(DQ(Q,"signal"),typeof Y!=="function")throw VO("listener","function",Y);let V;if(Q.aborted)queueMicrotask(()=>Y());else Q.addEventListener("abort",Y,{__proto__:null,once:!0}),V=()=>{Q.removeEventListener("abort",Y)};return{__proto__:null,[Symbol.dispose](){V?.()}}}var PZ,YO,VQ,N$,g$,JQ,EQ,AQ,$O=10,iU=function(Q){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[YO]=Q?.captureRejections?Boolean(Q?.captureRejections):o0[YO])this.emit=c$},o0,y$=function(Q,...Y){if(Q==="error")return IQ(this,Y);var{_events:V}=this;if(V===void 0)return!1;var H=V[Q];if(H===void 0)return!1;let C=H.length>1?H.slice():H;for(let D=0,{length:J}=C;D<J;D++){let T=C[D];switch(Y.length){case 0:T.call(this);break;case 1:T.call(this,Y[0]);break;case 2:T.call(this,Y[0],Y[1]);break;case 3:T.call(this,Y[0],Y[1],Y[2]);break;default:T.apply(this,Y);break}}return!0},c$=function(Q,...Y){if(Q==="error")return IQ(this,Y);var{_events:V}=this;if(V===void 0)return!1;var H=V[Q];if(H===void 0)return!1;let C=H.length>1?H.slice():H;for(let D=0,{length:J}=C;D<J;D++){let T=C[D],M;switch(Y.length){case 0:M=T.call(this);break;case 1:M=T.call(this,Y[0]);break;case 2:M=T.call(this,Y[0],Y[1]);break;case 3:M=T.call(this,Y[0],Y[1],Y[2]);break;default:M=T.apply(this,Y);break}if(M!==void 0&&typeof M?.then==="function"&&M.then===Promise.prototype.then)f$(this,M,Q,Y)}return!0},qZ,u$;var MO=WO(()=>{PZ=Symbol.for,YO=Symbol("kCapture"),VQ=PZ("events.errorMonitor"),N$=Symbol("events.maxEventTargetListeners"),g$=Symbol("events.maxEventTargetListenersWarned"),JQ=PZ("nodejs.rejection"),EQ=PZ("nodejs.rejection"),AQ=Array.prototype.slice,o0=iU.prototype={};o0._events=void 0;o0._eventsCount=0;o0._maxListeners=void 0;o0.setMaxListeners=function(Q){return kZ(Q,"setMaxListeners",0),this._maxListeners=Q,this};o0.constructor=iU;o0.getMaxListeners=function(){return this?._maxListeners??$O};o0.emit=y$;o0.addListener=function(Q,Y){TO(Y);var V=this._events;if(!V)V=this._events={__proto__:null},this._eventsCount=0;else if(V.newListener)this.emit("newListener",Q,Y.listener??Y);var H=V[Q];if(!H)V[Q]=[Y],this._eventsCount++;else{H.push(Y);var C=this._maxListeners??$O;if(C>0&&H.length>C&&!H.warned)CQ(this,Q,H)}return this};o0.on=o0.addListener;o0.prependListener=function(Q,Y){TO(Y);var V=this._events;if(!V)V=this._events={__proto__:null},this._eventsCount=0;else if(V.newListener)this.emit("newListener",Q,Y.listener??Y);var H=V[Q];if(!H)V[Q]=[Y],this._eventsCount++;else{H.unshift(Y);var C=this._maxListeners??$O;if(C>0&&H.length>C&&!H.warned)CQ(this,Q,H)}return this};o0.once=function(Q,Y){TO(Y);let V=LQ.bind(this,Q,Y);return V.listener=Y,this.addListener(Q,V),this};o0.prependOnceListener=function(Q,Y){TO(Y);let V=LQ.bind(this,Q,Y);return V.listener=Y,this.prependListener(Q,V),this};o0.removeListener=function(Q,Y){TO(Y);var{_events:V}=this;if(!V)return this;var H=V[Q];if(!H)return this;var C=H.length;let D=-1;for(let J=C-1;J>=0;J--)if(H[J]===Y||H[J].listener===Y){D=J;break}if(D<0)return this;if(D===0)H.shift();else H.splice(D,1);if(H.length===0)delete V[Q],this._eventsCount--;return this};o0.off=o0.removeListener;o0.removeAllListeners=function(Q){var{_events:Y}=this;if(Q&&Y){if(Y[Q])delete Y[Q],this._eventsCount--}else this._events={__proto__:null};return this};o0.listeners=function(Q){var{_events:Y}=this;if(!Y)return[];var V=Y[Q];if(!V)return[];return V.map((H)=>H.listener??H)};o0.rawListeners=function(Q){var{_events:Y}=this;if(!Y)return[];var V=Y[Q];if(!V)return[];return V.slice()};o0.listenerCount=function(Q){var{_events:Y}=this;if(!Y)return 0;return Y[Q]?.length??0};o0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};o0[YO]=!1;qZ=class qZ extends Error{constructor(Q="The operation was aborted",Y=void 0){if(Y!==void 0&&typeof Y!=="object")throw VO("options","Object",Y);super(Q,Y);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(iU,{captureRejections:{get(){return o0[YO]},set(Q){h$(Q,"EventEmitter.captureRejections"),o0[YO]=Q},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return $O},set:(Q)=>{kZ(Q,"defaultMaxListeners",0),$O=Q}},kMaxEventTargetListeners:{value:N$,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:g$,enumerable:!1,configurable:!1,writable:!1}});Object.assign(iU,{once:KQ,getEventListeners:HQ,getMaxListeners:FQ,setMaxListeners:WQ,EventEmitter:iU,usingDomains:!1,captureRejectionSymbol:EQ,errorMonitor:VQ,addAbortListener:RQ,init:iU,listenerCount:SQ});u$=iU});var dO=BY((EE,vQ)=>{var b0=(Q,Y)=>()=>(Y||Q((Y={exports:{}}).exports,Y),Y.exports),n0=b0((Q,Y)=>{class V extends Error{constructor(H){if(!Array.isArray(H))throw TypeError(`Expected input to be an Array, got ${typeof H}`);let C="";for(let D=0;D<H.length;D++)C+=` ${H[D].stack}
2
+ `;super(C);this.name="AggregateError",this.errors=H}}Y.exports={AggregateError:V,ArrayIsArray(H){return Array.isArray(H)},ArrayPrototypeIncludes(H,C){return H.includes(C)},ArrayPrototypeIndexOf(H,C){return H.indexOf(C)},ArrayPrototypeJoin(H,C){return H.join(C)},ArrayPrototypeMap(H,C){return H.map(C)},ArrayPrototypePop(H,C){return H.pop(C)},ArrayPrototypePush(H,C){return H.push(C)},ArrayPrototypeSlice(H,C,D){return H.slice(C,D)},Error,FunctionPrototypeCall(H,C,...D){return H.call(C,...D)},FunctionPrototypeSymbolHasInstance(H,C){return Function.prototype[Symbol.hasInstance].call(H,C)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(H,C){return Object.defineProperties(H,C)},ObjectDefineProperty(H,C,D){return Object.defineProperty(H,C,D)},ObjectGetOwnPropertyDescriptor(H,C){return Object.getOwnPropertyDescriptor(H,C)},ObjectKeys(H){return Object.keys(H)},ObjectSetPrototypeOf(H,C){return Object.setPrototypeOf(H,C)},Promise,PromisePrototypeCatch(H,C){return H.catch(C)},PromisePrototypeThen(H,C,D){return H.then(C,D)},PromiseReject(H){return Promise.reject(H)},PromiseResolve(H){return Promise.resolve(H)},ReflectApply:Reflect.apply,RegExpPrototypeTest(H,C){return H.test(C)},SafeSet:Set,String,StringPrototypeSlice(H,C,D){return H.slice(C,D)},StringPrototypeToLowerCase(H){return H.toLowerCase()},StringPrototypeToUpperCase(H){return H.toUpperCase()},StringPrototypeTrim(H){return H.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(H,C,D){return H.set(C,D)},Boolean,Uint8Array}}),TQ=b0((Q,Y)=>{Y.exports={format(V,...H){return V.replace(/%([sdifj])/g,function(...[C,D]){let J=H.shift();if(D==="f")return J.toFixed(6);else if(D==="j")return JSON.stringify(J);else if(D==="s"&&typeof J==="object")return`${J.constructor!==Object?J.constructor.name:""} {}`.trim();else return J.toString()})},inspect(V){switch(typeof V){case"string":if(V.includes("'")){if(!V.includes('"'))return`"${V}"`;else if(!V.includes("`")&&!V.includes("${"))return`\`${V}\``}return`'${V}'`;case"number":if(isNaN(V))return"NaN";else if(Object.is(V,-0))return String(V);return V;case"bigint":return`${String(V)}n`;case"boolean":case"undefined":return String(V);case"object":return"{}"}}}}),zU=b0((Q,Y)=>{var{format:V,inspect:H}=TQ(),{AggregateError:C}=n0(),D=globalThis.AggregateError||C,J=Symbol("kIsNodeError"),T=["string","function","number","object","Function","Object","boolean","bigint","symbol"],M=/^([A-Z][a-z0-9]*)+$/,F={};function R(B,j){if(!B)throw new F.ERR_INTERNAL_ASSERTION(j)}function K(B){let j="",x=B.length,f=B[0]==="-"?1:0;for(;x>=f+4;x-=3)j=`_${B.slice(x-3,x)}${j}`;return`${B.slice(0,x)}${j}`}function W(B,j,x){if(typeof j==="function")return R(j.length<=x.length,`Code: ${B}; The provided arguments length (${x.length}) does not match the required ones (${j.length}).`),j(...x);let f=(j.match(/%[dfijoOs]/g)||[]).length;if(R(f===x.length,`Code: ${B}; The provided arguments length (${x.length}) does not match the required ones (${f}).`),x.length===0)return j;return V(j,...x)}function q(B,j,x){if(!x)x=Error;class f extends x{constructor(...w){super(W(B,j,w))}toString(){return`${this.name} [${B}]: ${this.message}`}}Object.defineProperties(f.prototype,{name:{value:x.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${B}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),f.prototype.code=B,f.prototype[J]=!0,F[B]=f}function P(B){let j="__node_internal_"+B.name;return Object.defineProperty(B,"name",{value:j}),B}function _(B,j){if(B&&j&&B!==j){if(Array.isArray(j.errors))return j.errors.push(B),j;let x=new D([j,B],j.message);return x.code=j.code,x}return B||j}class k extends Error{constructor(B="The operation was aborted",j=void 0){if(j!==void 0&&typeof j!=="object")throw new F.ERR_INVALID_ARG_TYPE("options","Object",j);super(B,j);this.code="ABORT_ERR",this.name="AbortError"}}q("ERR_ASSERTION","%s",Error),q("ERR_INVALID_ARG_TYPE",(B,j,x)=>{if(R(typeof B==="string","'name' must be a string"),!Array.isArray(j))j=[j];let f="The ";if(B.endsWith(" argument"))f+=`${B} `;else f+=`"${B}" ${B.includes(".")?"property":"argument"} `;f+="must be ";let w=[],d=[],Y0=[];for(let $0 of j)if(R(typeof $0==="string","All expected entries have to be of type string"),T.includes($0))w.push($0.toLowerCase());else if(M.test($0))d.push($0);else R($0!=="object",'The value "object" should be written as "Object"'),Y0.push($0);if(d.length>0){let $0=w.indexOf("object");if($0!==-1)w.splice(w,$0,1),d.push("Object")}if(w.length>0){switch(w.length){case 1:f+=`of type ${w[0]}`;break;case 2:f+=`one of type ${w[0]} or ${w[1]}`;break;default:{let $0=w.pop();f+=`one of type ${w.join(", ")}, or ${$0}`}}if(d.length>0||Y0.length>0)f+=" or "}if(d.length>0){switch(d.length){case 1:f+=`an instance of ${d[0]}`;break;case 2:f+=`an instance of ${d[0]} or ${d[1]}`;break;default:{let $0=d.pop();f+=`an instance of ${d.join(", ")}, or ${$0}`}}if(Y0.length>0)f+=" or "}switch(Y0.length){case 0:break;case 1:if(Y0[0].toLowerCase()!==Y0[0])f+="an ";f+=`${Y0[0]}`;break;case 2:f+=`one of ${Y0[0]} or ${Y0[1]}`;break;default:{let $0=Y0.pop();f+=`one of ${Y0.join(", ")}, or ${$0}`}}if(x==null)f+=`. Received ${x}`;else if(typeof x==="function"&&x.name)f+=`. Received function ${x.name}`;else if(typeof x==="object"){var A0;if((A0=x.constructor)!==null&&A0!==void 0&&A0.name)f+=`. Received an instance of ${x.constructor.name}`;else{let $0=H(x,{depth:-1});f+=`. Received ${$0}`}}else{let $0=H(x,{colors:!1});if($0.length>25)$0=`${$0.slice(0,25)}...`;f+=`. Received type ${typeof x} (${$0})`}return f},TypeError),q("ERR_INVALID_ARG_VALUE",(B,j,x="is invalid")=>{let f=H(j);if(f.length>128)f=f.slice(0,128)+"...";return`The ${B.includes(".")?"property":"argument"} '${B}' ${x}. Received ${f}`},TypeError),q("ERR_INVALID_RETURN_VALUE",(B,j,x)=>{var f;let w=x!==null&&x!==void 0&&(f=x.constructor)!==null&&f!==void 0&&f.name?`instance of ${x.constructor.name}`:`type ${typeof x}`;return`Expected ${B} to be returned from the "${j}" function but got ${w}.`},TypeError),q("ERR_MISSING_ARGS",(...B)=>{R(B.length>0,"At least one arg needs to be specified");let j,x=B.length;switch(B=(Array.isArray(B)?B:[B]).map((f)=>`"${f}"`).join(" or "),x){case 1:j+=`The ${B[0]} argument`;break;case 2:j+=`The ${B[0]} and ${B[1]} arguments`;break;default:{let f=B.pop();j+=`The ${B.join(", ")}, and ${f} arguments`}break}return`${j} must be specified`},TypeError),q("ERR_OUT_OF_RANGE",(B,j,x)=>{R(j,'Missing "range" argument');let f;if(Number.isInteger(x)&&Math.abs(x)>4294967296)f=K(String(x));else if(typeof x==="bigint"){f=String(x);let w=BigInt(2)**BigInt(32);if(x>w||x<-w)f=K(f);f+="n"}else f=H(x);return`The value of "${B}" is out of range. It must be ${j}. Received ${f}`},RangeError),q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),q("ERR_STREAM_WRITE_AFTER_END","write after end",Error),q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Y.exports={AbortError:k,aggregateTwoErrors:P(_),hideStackFrames:P,codes:F}}),b$=b0((Q,Y)=>{Object.defineProperty(Q,"__esModule",{value:!0});var V=new WeakMap,H=new WeakMap;function C(u){let O0=V.get(u);return console.assert(O0!=null,"'this' is expected an Event object, but got",u),O0}function D(u){if(u.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",u.passiveListener);return}if(!u.event.cancelable)return;if(u.canceled=!0,typeof u.event.preventDefault==="function")u.event.preventDefault()}function J(u,O0){V.set(this,{eventTarget:u,event:O0,eventPhase:2,currentTarget:u,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:O0.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let U=Object.keys(O0);for(let X=0;X<U.length;++X){let A=U[X];if(!(A in this))Object.defineProperty(this,A,T(A))}}if(J.prototype={get type(){return C(this).event.type},get target(){return C(this).eventTarget},get currentTarget(){return C(this).currentTarget},composedPath(){let u=C(this).currentTarget;if(u==null)return[];return[u]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return C(this).eventPhase},stopPropagation(){let u=C(this);if(u.stopped=!0,typeof u.event.stopPropagation==="function")u.event.stopPropagation()},stopImmediatePropagation(){let u=C(this);if(u.stopped=!0,u.immediateStopped=!0,typeof u.event.stopImmediatePropagation==="function")u.event.stopImmediatePropagation()},get bubbles(){return Boolean(C(this).event.bubbles)},get cancelable(){return Boolean(C(this).event.cancelable)},preventDefault(){D(C(this))},get defaultPrevented(){return C(this).canceled},get composed(){return Boolean(C(this).event.composed)},get timeStamp(){return C(this).timeStamp},get srcElement(){return C(this).eventTarget},get cancelBubble(){return C(this).stopped},set cancelBubble(u){if(!u)return;let O0=C(this);if(O0.stopped=!0,typeof O0.event.cancelBubble==="boolean")O0.event.cancelBubble=!0},get returnValue(){return!C(this).canceled},set returnValue(u){if(!u)D(C(this))},initEvent(){}},Object.defineProperty(J.prototype,"constructor",{value:J,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(J.prototype,window.Event.prototype),H.set(window.Event.prototype,J);function T(u){return{get(){return C(this).event[u]},set(O0){C(this).event[u]=O0},configurable:!0,enumerable:!0}}function M(u){return{value(){let O0=C(this).event;return O0[u].apply(O0,arguments)},configurable:!0,enumerable:!0}}function F(u,O0){let U=Object.keys(O0);if(U.length===0)return u;function X(A,Z){u.call(this,A,Z)}X.prototype=Object.create(u.prototype,{constructor:{value:X,configurable:!0,writable:!0}});for(let A=0;A<U.length;++A){let Z=U[A];if(!(Z in u.prototype)){let $=typeof Object.getOwnPropertyDescriptor(O0,Z).value==="function";Object.defineProperty(X.prototype,Z,$?M(Z):T(Z))}}return X}function R(u){if(u==null||u===Object.prototype)return J;let O0=H.get(u);if(O0==null)O0=F(R(Object.getPrototypeOf(u)),u),H.set(u,O0);return O0}function K(u,O0){return new(R(Object.getPrototypeOf(O0)))(u,O0)}function W(u){return C(u).immediateStopped}function q(u,O0){C(u).eventPhase=O0}function P(u,O0){C(u).currentTarget=O0}function _(u,O0){C(u).passiveListener=O0}var k=new WeakMap,B=1,j=2,x=3;function f(u){return u!==null&&typeof u==="object"}function w(u){let O0=k.get(u);if(O0==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return O0}function d(u){return{get(){let O0=w(this).get(u);while(O0!=null){if(O0.listenerType===x)return O0.listener;O0=O0.next}return null},set(O0){if(typeof O0!=="function"&&!f(O0))O0=null;let U=w(this),X=null,A=U.get(u);while(A!=null){if(A.listenerType===x)if(X!==null)X.next=A.next;else if(A.next!==null)U.set(u,A.next);else U.delete(u);else X=A;A=A.next}if(O0!==null){let Z={listener:O0,listenerType:x,passive:!1,once:!1,next:null};if(X===null)U.set(u,Z);else X.next=Z}},configurable:!0,enumerable:!0}}function Y0(u,O0){Object.defineProperty(u,`on${O0}`,d(O0))}function A0(u){function O0(){$0.call(this)}O0.prototype=Object.create($0.prototype,{constructor:{value:O0,configurable:!0,writable:!0}});for(let U=0;U<u.length;++U)Y0(O0.prototype,u[U]);return O0}function $0(){if(this instanceof $0){k.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return A0(arguments[0]);if(arguments.length>0){let u=Array(arguments.length);for(let O0=0;O0<arguments.length;++O0)u[O0]=arguments[O0];return A0(u)}throw TypeError("Cannot call a class as a function")}if($0.prototype={addEventListener(u,O0,U){if(O0==null)return;if(typeof O0!=="function"&&!f(O0))throw TypeError("'listener' should be a function or an object.");let X=w(this),A=f(U),Z=(A?Boolean(U.capture):Boolean(U))?B:j,$={listener:O0,listenerType:Z,passive:A&&Boolean(U.passive),once:A&&Boolean(U.once),next:null},I=X.get(u);if(I===void 0){X.set(u,$);return}let L=null;while(I!=null){if(I.listener===O0&&I.listenerType===Z)return;L=I,I=I.next}L.next=$},removeEventListener(u,O0,U){if(O0==null)return;let X=w(this),A=(f(U)?Boolean(U.capture):Boolean(U))?B:j,Z=null,$=X.get(u);while($!=null){if($.listener===O0&&$.listenerType===A){if(Z!==null)Z.next=$.next;else if($.next!==null)X.set(u,$.next);else X.delete(u);return}Z=$,$=$.next}},dispatchEvent(u){if(u==null||typeof u.type!=="string")throw TypeError('"event.type" should be a string.');let O0=w(this),U=u.type,X=O0.get(U);if(X==null)return!0;let A=K(this,u),Z=null;while(X!=null){if(X.once)if(Z!==null)Z.next=X.next;else if(X.next!==null)O0.set(U,X.next);else O0.delete(U);else Z=X;if(_(A,X.passive?X.listener:null),typeof X.listener==="function")try{X.listener.call(this,A)}catch($){if(typeof console<"u"&&typeof console.error==="function")console.error($)}else if(X.listenerType!==x&&typeof X.listener.handleEvent==="function")X.listener.handleEvent(A);if(W(A))break;X=X.next}return _(A,null),q(A,0),P(A,null),!A.defaultPrevented}},Object.defineProperty($0.prototype,"constructor",{value:$0,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf($0.prototype,window.EventTarget.prototype);Q.defineEventAttribute=Y0,Q.EventTarget=$0,Q.default=$0,Y.exports=$0,Y.exports.EventTarget=Y.exports.default=$0,Y.exports.defineEventAttribute=Y0}),qO=b0((Q,Y)=>{Object.defineProperty(Q,"__esModule",{value:!0});var V=b$();class H extends V.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let R=J.get(this);if(typeof R!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return R}}V.defineEventAttribute(H.prototype,"abort");function C(){let R=Object.create(H.prototype);return V.EventTarget.call(R),J.set(R,!1),R}function D(R){if(J.get(R)!==!1)return;J.set(R,!0),R.dispatchEvent({type:"abort"})}var J=new WeakMap;if(Object.defineProperties(H.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(H.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class T{constructor(){M.set(this,C())}get signal(){return F(this)}abort(){D(F(this))}}var M=new WeakMap;function F(R){let K=M.get(R);if(K==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${R===null?"null":typeof R}`);return K}if(Object.defineProperties(T.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(T.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Q.AbortController=T,Q.AbortSignal=H,Q.default=T,Y.exports=T,Y.exports.AbortController=Y.exports.default=T,Y.exports.AbortSignal=H}),_U=b0((Q,Y)=>{var V=(WU(),h0(HU)),{format:H,inspect:C}=TQ(),{codes:{ERR_INVALID_ARG_TYPE:D}}=zU(),{kResistStopPropagation:J,AggregateError:T,SymbolDispose:M}=n0(),F=globalThis.AbortSignal||qO().AbortSignal,R=globalThis.AbortController||qO().AbortController,K=Object.getPrototypeOf(async function(){}).constructor,W=globalThis.Blob||V.Blob,q=typeof W<"u"?function(k){return k instanceof W}:function(k){return!1},P=(k,B)=>{if(k!==void 0&&(k===null||typeof k!=="object"||!("aborted"in k)))throw new D(B,"AbortSignal",k)},_=(k,B)=>{if(typeof k!=="function")throw new D(B,"Function",k)};Y.exports={AggregateError:T,kEmptyObject:Object.freeze({}),once(k){let B=!1;return function(...j){if(B)return;B=!0,k.apply(this,j)}},createDeferredPromise:function(){let k,B;return{promise:new Promise((j,x)=>{k=j,B=x}),resolve:k,reject:B}},promisify(k){return new Promise((B,j)=>{k((x,...f)=>{if(x)return j(x);return B(...f)})})},debuglog(){return function(){}},format:H,inspect:C,types:{isAsyncFunction(k){return k instanceof K},isArrayBufferView(k){return ArrayBuffer.isView(k)}},isBlob:q,deprecate(k,B){return k},addAbortListener:(MO(),h0(zO)).addAbortListener||function(k,B){if(k===void 0)throw new D("signal","AbortSignal",k);P(k,"signal"),_(B,"listener");let j;if(k.aborted)queueMicrotask(()=>B());else k.addEventListener("abort",B,{__proto__:null,once:!0,[J]:!0}),j=()=>{k.removeEventListener("abort",B)};return{__proto__:null,[M](){var x;(x=j)===null||x===void 0||x()}}},AbortSignalAny:F.any||function(k){if(k.length===1)return k[0];let B=new R,j=()=>B.abort();return k.forEach((x)=>{P(x,"signals"),x.addEventListener("abort",j,{once:!0})}),B.signal.addEventListener("abort",()=>{k.forEach((x)=>x.removeEventListener("abort",j))},{once:!0}),B.signal}},Y.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),PO=b0((Q,Y)=>{var{ArrayIsArray:V,ArrayPrototypeIncludes:H,ArrayPrototypeJoin:C,ArrayPrototypeMap:D,NumberIsInteger:J,NumberIsNaN:T,NumberMAX_SAFE_INTEGER:M,NumberMIN_SAFE_INTEGER:F,NumberParseInt:R,ObjectPrototypeHasOwnProperty:K,RegExpPrototypeExec:W,String:q,StringPrototypeToUpperCase:P,StringPrototypeTrim:_}=n0(),{hideStackFrames:k,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:j,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:f,ERR_UNKNOWN_SIGNAL:w}}=zU(),{normalizeEncoding:d}=_U(),{isAsyncFunction:Y0,isArrayBufferView:A0}=_U().types,$0={};function u(c){return c===(c|0)}function O0(c){return c===c>>>0}var U=/^[0-7]+$/,X="must be a 32-bit unsigned integer or an octal string";function A(c,o,N0){if(typeof c>"u")c=N0;if(typeof c==="string"){if(W(U,c)===null)throw new x(o,c,X);c=R(c,8)}return I(c,o),c}var Z=k((c,o,N0=F,s=M)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!J(c))throw new f(o,"an integer",c);if(c<N0||c>s)throw new f(o,`>= ${N0} && <= ${s}`,c)}),$=k((c,o,N0=-2147483648,s=2147483647)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!J(c))throw new f(o,"an integer",c);if(c<N0||c>s)throw new f(o,`>= ${N0} && <= ${s}`,c)}),I=k((c,o,N0=!1)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!J(c))throw new f(o,"an integer",c);let s=N0?1:0,Z0=4294967295;if(c<s||c>Z0)throw new f(o,`>= ${s} && <= ${Z0}`,c)});function L(c,o){if(typeof c!=="string")throw new j(o,"string",c)}function G(c,o,N0=void 0,s){if(typeof c!=="number")throw new j(o,"number",c);if(N0!=null&&c<N0||s!=null&&c>s||(N0!=null||s!=null)&&T(c))throw new f(o,`${N0!=null?`>= ${N0}`:""}${N0!=null&&s!=null?" && ":""}${s!=null?`<= ${s}`:""}`,c)}var O=k((c,o,N0)=>{if(!H(N0,c)){let s="must be one of: "+C(D(N0,(Z0)=>typeof Z0==="string"?`'${Z0}'`:q(Z0)),", ");throw new x(o,c,s)}});function E(c,o){if(typeof c!=="boolean")throw new j(o,"boolean",c)}function z(c,o,N0){return c==null||!K(c,o)?N0:c[o]}var S=k((c,o,N0=null)=>{let s=z(N0,"allowArray",!1),Z0=z(N0,"allowFunction",!1);if(!z(N0,"nullable",!1)&&c===null||!s&&V(c)||typeof c!=="object"&&(!Z0||typeof c!=="function"))throw new j(o,"Object",c)}),v=k((c,o)=>{if(c!=null&&typeof c!=="object"&&typeof c!=="function")throw new j(o,"a dictionary",c)}),g=k((c,o,N0=0)=>{if(!V(c))throw new j(o,"Array",c);if(c.length<N0){let s=`must be longer than ${N0}`;throw new x(o,c,s)}});function p(c,o){g(c,o);for(let N0=0;N0<c.length;N0++)L(c[N0],`${o}[${N0}]`)}function n(c,o){g(c,o);for(let N0=0;N0<c.length;N0++)E(c[N0],`${o}[${N0}]`)}function V0(c,o){g(c,o);for(let N0=0;N0<c.length;N0++){let s=c[N0],Z0=`${o}[${N0}]`;if(s==null)throw new j(Z0,"AbortSignal",s);i(s,Z0)}}function r(c,o="signal"){if(L(c,o),$0[c]===void 0){if($0[P(c)]!==void 0)throw new w(c+" (signals must use all capital letters)");throw new w(c)}}var l=k((c,o="buffer")=>{if(!A0(c))throw new j(o,["Buffer","TypedArray","DataView"],c)});function X0(c,o){let N0=d(o),s=c.length;if(N0==="hex"&&s%2!==0)throw new x("encoding",o,`is invalid for data of length ${s}`)}function m(c,o="Port",N0=!0){if(typeof c!=="number"&&typeof c!=="string"||typeof c==="string"&&_(c).length===0||+c!==+c>>>0||c>65535||c===0&&!N0)throw new B(o,c,N0);return c|0}var i=k((c,o)=>{if(c!==void 0&&(c===null||typeof c!=="object"||!("aborted"in c)))throw new j(o,"AbortSignal",c)}),g0=k((c,o)=>{if(typeof c!=="function")throw new j(o,"Function",c)}),y=k((c,o)=>{if(typeof c!=="function"||Y0(c))throw new j(o,"Function",c)}),h=k((c,o)=>{if(c!==void 0)throw new j(o,"undefined",c)});function Q0(c,o,N0){if(!H(N0,c))throw new j(o,`('${C(N0,"|")}')`,c)}var t=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function e(c,o){if(typeof c>"u"||!W(t,c))throw new x(o,c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function F0(c){if(typeof c==="string")return e(c,"hints"),c;else if(V(c)){let o=c.length,N0="";if(o===0)return N0;for(let s=0;s<o;s++){let Z0=c[s];if(e(Z0,"hints"),N0+=Z0,s!==o-1)N0+=", "}return N0}throw new x("hints",c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Y.exports={isInt32:u,isUint32:O0,parseFileMode:A,validateArray:g,validateStringArray:p,validateBooleanArray:n,validateAbortSignalArray:V0,validateBoolean:E,validateBuffer:l,validateDictionary:v,validateEncoding:X0,validateFunction:g0,validateInt32:$,validateInteger:Z,validateNumber:G,validateObject:S,validateOneOf:O,validatePlainFunction:y,validatePort:m,validateSignalName:r,validateString:L,validateUint32:I,validateUndefined:h,validateUnion:Q0,validateAbortSignal:i,validateLinkHeaderValue:F0}}),JO=b0((Q,Y)=>{Y.exports=globalThis.process}),mU=b0((Q,Y)=>{var{SymbolAsyncIterator:V,SymbolIterator:H,SymbolFor:C}=n0(),D=C("nodejs.stream.destroyed"),J=C("nodejs.stream.errored"),T=C("nodejs.stream.readable"),M=C("nodejs.stream.writable"),F=C("nodejs.stream.disturbed"),R=C("nodejs.webstream.isClosedPromise"),K=C("nodejs.webstream.controllerErrorFunction");function W(z,S=!1){var v;return!!(z&&typeof z.pipe==="function"&&typeof z.on==="function"&&(!S||typeof z.pause==="function"&&typeof z.resume==="function")&&(!z._writableState||((v=z._readableState)===null||v===void 0?void 0:v.readable)!==!1)&&(!z._writableState||z._readableState))}function q(z){var S;return!!(z&&typeof z.write==="function"&&typeof z.on==="function"&&(!z._readableState||((S=z._writableState)===null||S===void 0?void 0:S.writable)!==!1))}function P(z){return!!(z&&typeof z.pipe==="function"&&z._readableState&&typeof z.on==="function"&&typeof z.write==="function")}function _(z){return z&&(z._readableState||z._writableState||typeof z.write==="function"&&typeof z.on==="function"||typeof z.pipe==="function"&&typeof z.on==="function")}function k(z){return!!(z&&!_(z)&&typeof z.pipeThrough==="function"&&typeof z.getReader==="function"&&typeof z.cancel==="function")}function B(z){return!!(z&&!_(z)&&typeof z.getWriter==="function"&&typeof z.abort==="function")}function j(z){return!!(z&&!_(z)&&typeof z.readable==="object"&&typeof z.writable==="object")}function x(z){return k(z)||B(z)||j(z)}function f(z,S){if(z==null)return!1;if(S===!0)return typeof z[V]==="function";if(S===!1)return typeof z[H]==="function";return typeof z[V]==="function"||typeof z[H]==="function"}function w(z){if(!_(z))return null;let{_writableState:S,_readableState:v}=z,g=S||v;return!!(z.destroyed||z[D]||g!==null&&g!==void 0&&g.destroyed)}function d(z){if(!q(z))return null;if(z.writableEnded===!0)return!0;let S=z._writableState;if(S!==null&&S!==void 0&&S.errored)return!1;if(typeof(S===null||S===void 0?void 0:S.ended)!=="boolean")return null;return S.ended}function Y0(z,S){if(!q(z))return null;if(z.writableFinished===!0)return!0;let v=z._writableState;if(v!==null&&v!==void 0&&v.errored)return!1;if(typeof(v===null||v===void 0?void 0:v.finished)!=="boolean")return null;return!!(v.finished||S===!1&&v.ended===!0&&v.length===0)}function A0(z){if(!W(z))return null;if(z.readableEnded===!0)return!0;let S=z._readableState;if(!S||S.errored)return!1;if(typeof(S===null||S===void 0?void 0:S.ended)!=="boolean")return null;return S.ended}function $0(z,S){if(!W(z))return null;let v=z._readableState;if(v!==null&&v!==void 0&&v.errored)return!1;if(typeof(v===null||v===void 0?void 0:v.endEmitted)!=="boolean")return null;return!!(v.endEmitted||S===!1&&v.ended===!0&&v.length===0)}function u(z){if(z&&z[T]!=null)return z[T];if(typeof(z===null||z===void 0?void 0:z.readable)!=="boolean")return null;if(w(z))return!1;return W(z)&&z.readable&&!$0(z)}function O0(z){if(z&&z[M]!=null)return z[M];if(typeof(z===null||z===void 0?void 0:z.writable)!=="boolean")return null;if(w(z))return!1;return q(z)&&z.writable&&!d(z)}function U(z,S){if(!_(z))return null;if(w(z))return!0;if((S===null||S===void 0?void 0:S.readable)!==!1&&u(z))return!1;if((S===null||S===void 0?void 0:S.writable)!==!1&&O0(z))return!1;return!0}function X(z){var S,v;if(!_(z))return null;if(z.writableErrored)return z.writableErrored;return(S=(v=z._writableState)===null||v===void 0?void 0:v.errored)!==null&&S!==void 0?S:null}function A(z){var S,v;if(!_(z))return null;if(z.readableErrored)return z.readableErrored;return(S=(v=z._readableState)===null||v===void 0?void 0:v.errored)!==null&&S!==void 0?S:null}function Z(z){if(!_(z))return null;if(typeof z.closed==="boolean")return z.closed;let{_writableState:S,_readableState:v}=z;if(typeof(S===null||S===void 0?void 0:S.closed)==="boolean"||typeof(v===null||v===void 0?void 0:v.closed)==="boolean")return(S===null||S===void 0?void 0:S.closed)||(v===null||v===void 0?void 0:v.closed);if(typeof z._closed==="boolean"&&$(z))return z._closed;return null}function $(z){return typeof z._closed==="boolean"&&typeof z._defaultKeepAlive==="boolean"&&typeof z._removedConnection==="boolean"&&typeof z._removedContLen==="boolean"}function I(z){return typeof z._sent100==="boolean"&&$(z)}function L(z){var S;return typeof z._consuming==="boolean"&&typeof z._dumped==="boolean"&&((S=z.req)===null||S===void 0?void 0:S.upgradeOrConnect)===void 0}function G(z){if(!_(z))return null;let{_writableState:S,_readableState:v}=z,g=S||v;return!g&&I(z)||!!(g&&g.autoDestroy&&g.emitClose&&g.closed===!1)}function O(z){var S;return!!(z&&((S=z[F])!==null&&S!==void 0?S:z.readableDidRead||z.readableAborted))}function E(z){var S,v,g,p,n,V0,r,l,X0,m;return!!(z&&((S=(v=(g=(p=(n=(V0=z[J])!==null&&V0!==void 0?V0:z.readableErrored)!==null&&n!==void 0?n:z.writableErrored)!==null&&p!==void 0?p:(r=z._readableState)===null||r===void 0?void 0:r.errorEmitted)!==null&&g!==void 0?g:(l=z._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&v!==void 0?v:(X0=z._readableState)===null||X0===void 0?void 0:X0.errored)!==null&&S!==void 0?S:(m=z._writableState)===null||m===void 0?void 0:m.errored))}Y.exports={isDestroyed:w,kIsDestroyed:D,isDisturbed:O,kIsDisturbed:F,isErrored:E,kIsErrored:J,isReadable:u,kIsReadable:T,kIsClosedPromise:R,kControllerErrorFunction:K,kIsWritable:M,isClosed:Z,isDuplexNodeStream:P,isFinished:U,isIterable:f,isReadableNodeStream:W,isReadableStream:k,isReadableEnded:A0,isReadableFinished:$0,isReadableErrored:A,isNodeStream:_,isWebStream:x,isWritable:O0,isWritableNodeStream:q,isWritableStream:B,isWritableEnded:d,isWritableFinished:Y0,isWritableErrored:X,isServerRequest:L,isServerResponse:I,willEmitClose:G,isTransformStream:j}}),UO=b0((Q,Y)=>{var V=JO(),{AbortError:H,codes:C}=zU(),{ERR_INVALID_ARG_TYPE:D,ERR_STREAM_PREMATURE_CLOSE:J}=C,{kEmptyObject:T,once:M}=_U(),{validateAbortSignal:F,validateFunction:R,validateObject:K,validateBoolean:W}=PO(),{Promise:q,PromisePrototypeThen:P,SymbolDispose:_}=n0(),{isClosed:k,isReadable:B,isReadableNodeStream:j,isReadableStream:x,isReadableFinished:f,isReadableErrored:w,isWritable:d,isWritableNodeStream:Y0,isWritableStream:A0,isWritableFinished:$0,isWritableErrored:u,isNodeStream:O0,willEmitClose:U,kIsClosedPromise:X}=mU(),A;function Z(O){return O.setHeader&&typeof O.abort==="function"}var $=()=>{};function I(O,E,z){var S,v;if(arguments.length===2)z=E,E=T;else if(E==null)E=T;else K(E,"options");if(R(z,"callback"),F(E.signal,"options.signal"),z=M(z),x(O)||A0(O))return L(O,E,z);if(!O0(O))throw new D("stream",["ReadableStream","WritableStream","Stream"],O);let g=(S=E.readable)!==null&&S!==void 0?S:j(O),p=(v=E.writable)!==null&&v!==void 0?v:Y0(O),n=O._writableState,V0=O._readableState,r=()=>{if(!O.writable)m()},l=U(O)&&j(O)===g&&Y0(O)===p,X0=$0(O,!1),m=()=>{if(X0=!0,O.destroyed)l=!1;if(l&&(!O.readable||g))return;if(!g||i)z.call(O)},i=f(O,!1),g0=()=>{if(i=!0,O.destroyed)l=!1;if(l&&(!O.writable||p))return;if(!p||X0)z.call(O)},y=(c)=>{z.call(O,c)},h=k(O),Q0=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return z.call(O,c);if(g&&!i&&j(O,!0)){if(!f(O,!1))return z.call(O,new J)}if(p&&!X0){if(!$0(O,!1))return z.call(O,new J)}z.call(O)},t=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return z.call(O,c);z.call(O)},e=()=>{O.req.on("finish",m)};if(Z(O)){if(O.on("complete",m),!l)O.on("abort",Q0);if(O.req)e();else O.on("request",e)}else if(p&&!n)O.on("end",r),O.on("close",r);if(!l&&typeof O.aborted==="boolean")O.on("aborted",Q0);if(O.on("end",g0),O.on("finish",m),E.error!==!1)O.on("error",y);if(O.on("close",Q0),h)V.nextTick(Q0);else if(n!==null&&n!==void 0&&n.errorEmitted||V0!==null&&V0!==void 0&&V0.errorEmitted){if(!l)V.nextTick(t)}else if(!g&&(!l||B(O))&&(X0||d(O)===!1))V.nextTick(t);else if(!p&&(!l||d(O))&&(i||B(O)===!1))V.nextTick(t);else if(V0&&O.req&&O.aborted)V.nextTick(t);let F0=()=>{if(z=$,O.removeListener("aborted",Q0),O.removeListener("complete",m),O.removeListener("abort",Q0),O.removeListener("request",e),O.req)O.req.removeListener("finish",m);O.removeListener("end",r),O.removeListener("close",r),O.removeListener("finish",m),O.removeListener("end",g0),O.removeListener("error",y),O.removeListener("close",Q0)};if(E.signal&&!h){let c=()=>{let o=z;F0(),o.call(O,new H(void 0,{cause:E.signal.reason}))};if(E.signal.aborted)V.nextTick(c);else{A=A||_U().addAbortListener;let o=A(E.signal,c),N0=z;z=M((...s)=>{o[_](),N0.apply(O,s)})}}return F0}function L(O,E,z){let S=!1,v=$;if(E.signal)if(v=()=>{S=!0,z.call(O,new H(void 0,{cause:E.signal.reason}))},E.signal.aborted)V.nextTick(v);else{A=A||_U().addAbortListener;let p=A(E.signal,v),n=z;z=M((...V0)=>{p[_](),n.apply(O,V0)})}let g=(...p)=>{if(!S)V.nextTick(()=>z.apply(O,p))};return P(O[X].promise,g,g),$}function G(O,E){var z;let S=!1;if(E===null)E=T;if((z=E)!==null&&z!==void 0&&z.cleanup)W(E.cleanup,"cleanup"),S=E.cleanup;return new q((v,g)=>{let p=I(O,E,(n)=>{if(S)p();if(n)g(n);else v()})})}Y.exports=I,Y.exports.finished=G}),EO=b0((Q,Y)=>{var V=JO(),{aggregateTwoErrors:H,codes:{ERR_MULTIPLE_CALLBACK:C},AbortError:D}=zU(),{Symbol:J}=n0(),{kIsDestroyed:T,isDestroyed:M,isFinished:F,isServerRequest:R}=mU(),K=J("kDestroy"),W=J("kConstruct");function q(U,X,A){if(U){if(U.stack,X&&!X.errored)X.errored=U;if(A&&!A.errored)A.errored=U}}function P(U,X){let A=this._readableState,Z=this._writableState,$=Z||A;if(Z!==null&&Z!==void 0&&Z.destroyed||A!==null&&A!==void 0&&A.destroyed){if(typeof X==="function")X();return this}if(q(U,Z,A),Z)Z.destroyed=!0;if(A)A.destroyed=!0;if(!$.constructed)this.once(K,function(I){_(this,H(I,U),X)});else _(this,U,X);return this}function _(U,X,A){let Z=!1;function $(I){if(Z)return;Z=!0;let{_readableState:L,_writableState:G}=U;if(q(I,G,L),G)G.closed=!0;if(L)L.closed=!0;if(typeof A==="function")A(I);if(I)V.nextTick(k,U,I);else V.nextTick(B,U)}try{U._destroy(X||null,$)}catch(I){$(I)}}function k(U,X){j(U,X),B(U)}function B(U){let{_readableState:X,_writableState:A}=U;if(A)A.closeEmitted=!0;if(X)X.closeEmitted=!0;if(A!==null&&A!==void 0&&A.emitClose||X!==null&&X!==void 0&&X.emitClose)U.emit("close")}function j(U,X){let{_readableState:A,_writableState:Z}=U;if(Z!==null&&Z!==void 0&&Z.errorEmitted||A!==null&&A!==void 0&&A.errorEmitted)return;if(Z)Z.errorEmitted=!0;if(A)A.errorEmitted=!0;U.emit("error",X)}function x(){let U=this._readableState,X=this._writableState;if(U)U.constructed=!0,U.closed=!1,U.closeEmitted=!1,U.destroyed=!1,U.errored=null,U.errorEmitted=!1,U.reading=!1,U.ended=U.readable===!1,U.endEmitted=U.readable===!1;if(X)X.constructed=!0,X.destroyed=!1,X.closed=!1,X.closeEmitted=!1,X.errored=null,X.errorEmitted=!1,X.finalCalled=!1,X.prefinished=!1,X.ended=X.writable===!1,X.ending=X.writable===!1,X.finished=X.writable===!1}function f(U,X,A){let{_readableState:Z,_writableState:$}=U;if($!==null&&$!==void 0&&$.destroyed||Z!==null&&Z!==void 0&&Z.destroyed)return this;if(Z!==null&&Z!==void 0&&Z.autoDestroy||$!==null&&$!==void 0&&$.autoDestroy)U.destroy(X);else if(X){if(X.stack,$&&!$.errored)$.errored=X;if(Z&&!Z.errored)Z.errored=X;if(A)V.nextTick(j,U,X);else j(U,X)}}function w(U,X){if(typeof U._construct!=="function")return;let{_readableState:A,_writableState:Z}=U;if(A)A.constructed=!1;if(Z)Z.constructed=!1;if(U.once(W,X),U.listenerCount(W)>1)return;V.nextTick(d,U)}function d(U){let X=!1;function A(Z){if(X){f(U,Z!==null&&Z!==void 0?Z:new C);return}X=!0;let{_readableState:$,_writableState:I}=U,L=I||$;if($)$.constructed=!0;if(I)I.constructed=!0;if(L.destroyed)U.emit(K,Z);else if(Z)f(U,Z,!0);else V.nextTick(Y0,U)}try{U._construct((Z)=>{V.nextTick(A,Z)})}catch(Z){V.nextTick(A,Z)}}function Y0(U){U.emit(W)}function A0(U){return(U===null||U===void 0?void 0:U.setHeader)&&typeof U.abort==="function"}function $0(U){U.emit("close")}function u(U,X){U.emit("error",X),V.nextTick($0,U)}function O0(U,X){if(!U||M(U))return;if(!X&&!F(U))X=new D;if(R(U))U.socket=null,U.destroy(X);else if(A0(U))U.abort();else if(A0(U.req))U.req.abort();else if(typeof U.destroy==="function")U.destroy(X);else if(typeof U.close==="function")U.close();else if(X)V.nextTick(u,U,X);else V.nextTick($0,U);if(!U.destroyed)U[T]=!0}Y.exports={construct:w,destroyer:O0,destroy:P,undestroy:x,errorOrDestroy:f}}),_Z=b0((Q,Y)=>{var{ArrayIsArray:V,ObjectSetPrototypeOf:H}=n0(),{EventEmitter:C}=(MO(),h0(zO));function D(T){C.call(this,T)}H(D.prototype,C.prototype),H(D,C),D.prototype.pipe=function(T,M){let F=this;function R(B){if(T.writable&&T.write(B)===!1&&F.pause)F.pause()}F.on("data",R);function K(){if(F.readable&&F.resume)F.resume()}if(T.on("drain",K),!T._isStdio&&(!M||M.end!==!1))F.on("end",q),F.on("close",P);let W=!1;function q(){if(W)return;W=!0,T.end()}function P(){if(W)return;if(W=!0,typeof T.destroy==="function")T.destroy()}function _(B){if(k(),C.listenerCount(this,"error")===0)this.emit("error",B)}J(F,"error",_),J(T,"error",_);function k(){F.removeListener("data",R),T.removeListener("drain",K),F.removeListener("end",q),F.removeListener("close",P),F.removeListener("error",_),T.removeListener("error",_),F.removeListener("end",k),F.removeListener("close",k),T.removeListener("close",k)}return F.on("end",k),F.on("close",k),T.on("close",k),T.emit("pipe",F),T};function J(T,M,F){if(typeof T.prependListener==="function")return T.prependListener(M,F);if(!T._events||!T._events[M])T.on(M,F);else if(V(T._events[M]))T._events[M].unshift(F);else T._events[M]=[F,T._events[M]]}Y.exports={Stream:D,prependListener:J}}),uO=b0((Q,Y)=>{var{SymbolDispose:V}=n0(),{AbortError:H,codes:C}=zU(),{isNodeStream:D,isWebStream:J,kControllerErrorFunction:T}=mU(),M=UO(),{ERR_INVALID_ARG_TYPE:F}=C,R,K=(W,q)=>{if(typeof W!=="object"||!("aborted"in W))throw new F(q,"AbortSignal",W)};Y.exports.addAbortSignal=function(W,q){if(K(W,"signal"),!D(q)&&!J(q))throw new F("stream",["ReadableStream","WritableStream","Stream"],q);return Y.exports.addAbortSignalNoValidate(W,q)},Y.exports.addAbortSignalNoValidate=function(W,q){if(typeof W!=="object"||!("aborted"in W))return q;let P=D(q)?()=>{q.destroy(new H(void 0,{cause:W.reason}))}:()=>{q[T](new H(void 0,{cause:W.reason}))};if(W.aborted)P();else{R=R||_U().addAbortListener;let _=R(W,P);M(q,_[V])}return q}}),l$=b0((Q,Y)=>{var{StringPrototypeSlice:V,SymbolIterator:H,TypedArrayPrototypeSet:C,Uint8Array:D}=n0(),{Buffer:J}=(WU(),h0(HU)),{inspect:T}=_U();Y.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(M){let F={data:M,next:null};if(this.length>0)this.tail.next=F;else this.head=F;this.tail=F,++this.length}unshift(M){let F={data:M,next:this.head};if(this.length===0)this.tail=F;this.head=F,++this.length}shift(){if(this.length===0)return;let M=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,M}clear(){this.head=this.tail=null,this.length=0}join(M){if(this.length===0)return"";let F=this.head,R=""+F.data;while((F=F.next)!==null)R+=M+F.data;return R}concat(M){if(this.length===0)return J.alloc(0);let F=J.allocUnsafe(M>>>0),R=this.head,K=0;while(R)C(F,R.data,K),K+=R.data.length,R=R.next;return F}consume(M,F){let R=this.head.data;if(M<R.length){let K=R.slice(0,M);return this.head.data=R.slice(M),K}if(M===R.length)return this.shift();return F?this._getString(M):this._getBuffer(M)}first(){return this.head.data}*[H](){for(let M=this.head;M;M=M.next)yield M.data}_getString(M){let F="",R=this.head,K=0;do{let W=R.data;if(M>W.length)F+=W,M-=W.length;else{if(M===W.length)if(F+=W,++K,R.next)this.head=R.next;else this.head=this.tail=null;else F+=V(W,0,M),this.head=R,R.data=V(W,M);break}++K}while((R=R.next)!==null);return this.length-=K,F}_getBuffer(M){let F=J.allocUnsafe(M),R=M,K=this.head,W=0;do{let q=K.data;if(M>q.length)C(F,q,R-M),M-=q.length;else{if(M===q.length)if(C(F,q,R-M),++W,K.next)this.head=K.next;else this.head=this.tail=null;else C(F,new D(q.buffer,q.byteOffset,M),R-M),this.head=K,K.data=q.slice(M);break}++W}while((K=K.next)!==null);return this.length-=W,F}[Symbol.for("nodejs.util.inspect.custom")](M,F){return T(this,{...F,depth:0,customInspect:!1})}}}),bO=b0((Q,Y)=>{var{MathFloor:V,NumberIsInteger:H}=n0(),{validateInteger:C}=PO(),{ERR_INVALID_ARG_VALUE:D}=zU().codes,J=16384,T=16;function M(W,q,P){return W.highWaterMark!=null?W.highWaterMark:q?W[P]:null}function F(W){return W?T:J}function R(W,q){if(C(q,"value",0),W)T=q;else J=q}function K(W,q,P,_){let k=M(q,_,P);if(k!=null){if(!H(k)||k<0){let B=_?`options.${P}`:"options.highWaterMark";throw new D(B,k)}return V(k)}return F(W.objectMode)}Y.exports={getHighWaterMark:K,getDefaultHighWaterMark:F,setDefaultHighWaterMark:R}}),d$=b0((Q,Y)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=(WU(),h0(HU)),H=V.Buffer;function C(J,T){for(var M in J)T[M]=J[M]}if(H.from&&H.alloc&&H.allocUnsafe&&H.allocUnsafeSlow)Y.exports=V;else C(V,Q),Q.Buffer=D;function D(J,T,M){return H(J,T,M)}D.prototype=Object.create(H.prototype),C(H,D),D.from=function(J,T,M){if(typeof J==="number")throw TypeError("Argument must not be a number");return H(J,T,M)},D.alloc=function(J,T,M){if(typeof J!=="number")throw TypeError("Argument must be a number");var F=H(J);if(T!==void 0)if(typeof M==="string")F.fill(T,M);else F.fill(T);else F.fill(0);return F},D.allocUnsafe=function(J){if(typeof J!=="number")throw TypeError("Argument must be a number");return H(J)},D.allocUnsafeSlow=function(J){if(typeof J!=="number")throw TypeError("Argument must be a number");return V.SlowBuffer(J)}}),o$=b0((Q)=>{var Y=d$().Buffer,V=Y.isEncoding||function(j){switch(j=""+j,j&&j.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 H(j){if(!j)return"utf8";var x;while(!0)switch(j){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 j;default:if(x)return;j=(""+j).toLowerCase(),x=!0}}function C(j){var x=H(j);if(typeof x!=="string"&&(Y.isEncoding===V||!V(j)))throw Error("Unknown encoding: "+j);return x||j}Q.StringDecoder=D;function D(j){this.encoding=C(j);var x;switch(this.encoding){case"utf16le":this.text=W,this.end=q,x=4;break;case"utf8":this.fillLast=F,x=4;break;case"base64":this.text=P,this.end=_,x=3;break;default:this.write=k,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Y.allocUnsafe(x)}D.prototype.write=function(j){if(j.length===0)return"";var x,f;if(this.lastNeed){if(x=this.fillLast(j),x===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;if(f<j.length)return x?x+this.text(j,f):this.text(j,f);return x||""},D.prototype.end=K,D.prototype.text=R,D.prototype.fillLast=function(j){if(this.lastNeed<=j.length)return j.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);j.copy(this.lastChar,this.lastTotal-this.lastNeed,0,j.length),this.lastNeed-=j.length};function J(j){if(j<=127)return 0;else if(j>>5===6)return 2;else if(j>>4===14)return 3;else if(j>>3===30)return 4;return j>>6===2?-1:-2}function T(j,x,f){var w=x.length-1;if(w<f)return 0;var d=J(x[w]);if(d>=0){if(d>0)j.lastNeed=d-1;return d}if(--w<f||d===-2)return 0;if(d=J(x[w]),d>=0){if(d>0)j.lastNeed=d-2;return d}if(--w<f||d===-2)return 0;if(d=J(x[w]),d>=0){if(d>0)if(d===2)d=0;else j.lastNeed=d-3;return d}return 0}function M(j,x,f){if((x[0]&192)!==128)return j.lastNeed=0,"�";if(j.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return j.lastNeed=1,"�";if(j.lastNeed>2&&x.length>2){if((x[2]&192)!==128)return j.lastNeed=2,"�"}}}function F(j){var x=this.lastTotal-this.lastNeed,f=M(this,j,x);if(f!==void 0)return f;if(this.lastNeed<=j.length)return j.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);j.copy(this.lastChar,x,0,j.length),this.lastNeed-=j.length}function R(j,x){var f=T(this,j,x);if(!this.lastNeed)return j.toString("utf8",x);this.lastTotal=f;var w=j.length-(f-this.lastNeed);return j.copy(this.lastChar,0,w),j.toString("utf8",x,w)}function K(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed)return x+"�";return x}function W(j,x){if((j.length-x)%2===0){var f=j.toString("utf16le",x);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=j[j.length-2],this.lastChar[1]=j[j.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=j[j.length-1],j.toString("utf16le",x,j.length-1)}function q(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,f)}return x}function P(j,x){var f=(j.length-x)%3;if(f===0)return j.toString("base64",x);if(this.lastNeed=3-f,this.lastTotal=3,f===1)this.lastChar[0]=j[j.length-1];else this.lastChar[0]=j[j.length-2],this.lastChar[1]=j[j.length-1];return j.toString("base64",x,j.length-f)}function _(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed)return x+this.lastChar.toString("base64",0,3-this.lastNeed);return x}function k(j){return j.toString(this.encoding)}function B(j){return j&&j.length?this.write(j):""}}),zQ=b0((Q,Y)=>{var V=JO(),{PromisePrototypeThen:H,SymbolAsyncIterator:C,SymbolIterator:D}=n0(),{Buffer:J}=(WU(),h0(HU)),{ERR_INVALID_ARG_TYPE:T,ERR_STREAM_NULL_VALUES:M}=zU().codes;function F(R,K,W){let q;if(typeof K==="string"||K instanceof J)return new R({objectMode:!0,...W,read(){this.push(K),this.push(null)}});let P;if(K&&K[C])P=!0,q=K[C]();else if(K&&K[D])P=!1,q=K[D]();else throw new T("iterable",["Iterable"],K);let _=new R({objectMode:!0,highWaterMark:1,...W}),k=!1;_._read=function(){if(!k)k=!0,j()},_._destroy=function(x,f){H(B(x),()=>V.nextTick(f,x),(w)=>V.nextTick(f,w||x))};async function B(x){let f=x!==void 0&&x!==null,w=typeof q.throw==="function";if(f&&w){let{value:d,done:Y0}=await q.throw(x);if(await d,Y0)return}if(typeof q.return==="function"){let{value:d}=await q.return();await d}}async function j(){for(;;){try{let{value:x,done:f}=P?await q.next():q.next();if(f)_.push(null);else{let w=x&&typeof x.then==="function"?await x:x;if(w===null)throw k=!1,new M;else if(_.push(w))continue;else k=!1}}catch(x){_.destroy(x)}break}}return _}Y.exports=F}),lO=b0((Q,Y)=>{var V=JO(),{ArrayPrototypeIndexOf:H,NumberIsInteger:C,NumberIsNaN:D,NumberParseInt:J,ObjectDefineProperties:T,ObjectKeys:M,ObjectSetPrototypeOf:F,Promise:R,SafeSet:K,SymbolAsyncDispose:W,SymbolAsyncIterator:q,Symbol:P}=n0();Y.exports=s,s.ReadableState=N0;var{EventEmitter:_}=(MO(),h0(zO)),{Stream:k,prependListener:B}=_Z(),{Buffer:j}=(WU(),h0(HU)),{addAbortSignal:x}=uO(),f=UO(),w=_U().debuglog("stream",(N)=>{w=N}),d=l$(),Y0=EO(),{getHighWaterMark:A0,getDefaultHighWaterMark:$0}=bO(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:O0,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_OUT_OF_RANGE:X,ERR_STREAM_PUSH_AFTER_EOF:A,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Z},AbortError:$}=zU(),{validateObject:I}=PO(),L=P("kPaused"),{StringDecoder:G}=o$(),O=zQ();F(s.prototype,k.prototype),F(s,k);var E=()=>{},{errorOrDestroy:z}=Y0,S=1,v=2,g=4,p=8,n=16,V0=32,r=64,l=128,X0=256,m=512,i=1024,g0=2048,y=4096,h=8192,Q0=16384,t=32768,e=65536,F0=131072,c=262144;function o(N){return{enumerable:!1,get(){return(this.state&N)!==0},set(b){if(b)this.state|=N;else this.state&=~N}}}T(N0.prototype,{objectMode:o(S),ended:o(v),endEmitted:o(g),reading:o(p),constructed:o(n),sync:o(V0),needReadable:o(r),emittedReadable:o(l),readableListening:o(X0),resumeScheduled:o(m),errorEmitted:o(i),emitClose:o(g0),autoDestroy:o(y),destroyed:o(h),closed:o(Q0),closeEmitted:o(t),multiAwaitDrain:o(e),readingMore:o(F0),dataEmitted:o(c)});function N0(N,b,a){if(typeof a!=="boolean")a=b instanceof nU();if(this.state=g0|y|n|V0,N&&N.objectMode)this.state|=S;if(a&&N&&N.readableObjectMode)this.state|=S;if(this.highWaterMark=N?A0(this,N,"readableHighWaterMark",a):$0(!1),this.buffer=new d,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,N&&N.emitClose===!1)this.state&=~g0;if(N&&N.autoDestroy===!1)this.state&=~y;if(this.errored=null,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,N&&N.encoding)this.decoder=new G(N.encoding),this.encoding=N.encoding}function s(N){if(!(this instanceof s))return new s(N);let b=this instanceof nU();if(this._readableState=new N0(N,this,b),N){if(typeof N.read==="function")this._read=N.read;if(typeof N.destroy==="function")this._destroy=N.destroy;if(typeof N.construct==="function")this._construct=N.construct;if(N.signal&&!b)x(N.signal,this)}k.call(this,N),Y0.construct(this,()=>{if(this._readableState.needReadable)S0(this,this._readableState)})}s.prototype.destroy=Y0.destroy,s.prototype._undestroy=Y0.undestroy,s.prototype._destroy=function(N,b){b(N)},s.prototype[_.captureRejectionSymbol]=function(N){this.destroy(N)},s.prototype[W]=function(){let N;if(!this.destroyed)N=this.readableEnded?null:new $,this.destroy(N);return new R((b,a)=>f(this,(U0)=>U0&&U0!==N?a(U0):b(null)))},s.prototype.push=function(N,b){return Z0(this,N,b,!1)},s.prototype.unshift=function(N,b){return Z0(this,N,b,!0)};function Z0(N,b,a,U0){w("readableAddChunk",b);let f0=N._readableState,I0;if((f0.state&S)===0){if(typeof b==="string"){if(a=a||f0.defaultEncoding,f0.encoding!==a)if(U0&&f0.encoding)b=j.from(b,a).toString(f0.encoding);else b=j.from(b,a),a=""}else if(b instanceof j)a="";else if(k._isUint8Array(b))b=k._uint8ArrayToBuffer(b),a="";else if(b!=null)I0=new O0("chunk",["string","Buffer","Uint8Array"],b)}if(I0)z(N,I0);else if(b===null)f0.state&=~p,E0(N,f0);else if((f0.state&S)!==0||b&&b.length>0)if(U0)if((f0.state&g)!==0)z(N,new Z);else if(f0.destroyed||f0.errored)return!1;else w0(N,f0,b,!0);else if(f0.ended)z(N,new A);else if(f0.destroyed||f0.errored)return!1;else if(f0.state&=~p,f0.decoder&&!a)if(b=f0.decoder.write(b),f0.objectMode||b.length!==0)w0(N,f0,b,!1);else S0(N,f0);else w0(N,f0,b,!1);else if(!U0)f0.state&=~p,S0(N,f0);return!f0.ended&&(f0.length<f0.highWaterMark||f0.length===0)}function w0(N,b,a,U0){if(b.flowing&&b.length===0&&!b.sync&&N.listenerCount("data")>0){if((b.state&e)!==0)b.awaitDrainWriters.clear();else b.awaitDrainWriters=null;b.dataEmitted=!0,N.emit("data",a)}else{if(b.length+=b.objectMode?1:a.length,U0)b.buffer.unshift(a);else b.buffer.push(a);if((b.state&r)!==0)K0(N)}S0(N,b)}s.prototype.isPaused=function(){let N=this._readableState;return N[L]===!0||N.flowing===!1},s.prototype.setEncoding=function(N){let b=new G(N);this._readableState.decoder=b,this._readableState.encoding=this._readableState.decoder.encoding;let a=this._readableState.buffer,U0="";for(let f0 of a)U0+=b.write(f0);if(a.clear(),U0!=="")a.push(U0);return this._readableState.length=U0.length,this};var C0=1073741824;function L0(N){if(N>C0)throw new X("size","<= 1GiB",N);else N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++;return N}function s0(N,b){if(N<=0||b.length===0&&b.ended)return 0;if((b.state&S)!==0)return 1;if(D(N)){if(b.flowing&&b.length)return b.buffer.first().length;return b.length}if(N<=b.length)return N;return b.ended?b.length:0}s.prototype.read=function(N){if(w("read",N),N===void 0)N=NaN;else if(!C(N))N=J(N,10);let b=this._readableState,a=N;if(N>b.highWaterMark)b.highWaterMark=L0(N);if(N!==0)b.state&=~l;if(N===0&&b.needReadable&&((b.highWaterMark!==0?b.length>=b.highWaterMark:b.length>0)||b.ended)){if(w("read: emitReadable",b.length,b.ended),b.length===0&&b.ended)CU(this);else K0(this);return null}if(N=s0(N,b),N===0&&b.ended){if(b.length===0)CU(this);return null}let U0=(b.state&r)!==0;if(w("need readable",U0),b.length===0||b.length-N<b.highWaterMark)U0=!0,w("length less than watermark",U0);if(b.ended||b.reading||b.destroyed||b.errored||!b.constructed)U0=!1,w("reading, ended or constructing",U0);else if(U0){if(w("do read"),b.state|=p|V0,b.length===0)b.state|=r;try{this._read(b.highWaterMark)}catch(I0){z(this,I0)}if(b.state&=~V0,!b.reading)N=s0(a,b)}let f0;if(N>0)f0=z0(N,b);else f0=null;if(f0===null)b.needReadable=b.length<=b.highWaterMark,N=0;else if(b.length-=N,b.multiAwaitDrain)b.awaitDrainWriters.clear();else b.awaitDrainWriters=null;if(b.length===0){if(!b.ended)b.needReadable=!0;if(a!==N&&b.ended)CU(this)}if(f0!==null&&!b.errorEmitted&&!b.closeEmitted)b.dataEmitted=!0,this.emit("data",f0);return f0};function E0(N,b){if(w("onEofChunk"),b.ended)return;if(b.decoder){let a=b.decoder.end();if(a&&a.length)b.buffer.push(a),b.length+=b.objectMode?1:a.length}if(b.ended=!0,b.sync)K0(N);else b.needReadable=!1,b.emittedReadable=!0,e0(N)}function K0(N){let b=N._readableState;if(w("emitReadable",b.needReadable,b.emittedReadable),b.needReadable=!1,!b.emittedReadable)w("emitReadable",b.flowing),b.emittedReadable=!0,V.nextTick(e0,N)}function e0(N){let b=N._readableState;if(w("emitReadable_",b.destroyed,b.length,b.ended),!b.destroyed&&!b.errored&&(b.length||b.ended))N.emit("readable"),b.emittedReadable=!1;b.needReadable=!b.flowing&&!b.ended&&b.length<=b.highWaterMark,T0(N)}function S0(N,b){if(!b.readingMore&&b.constructed)b.readingMore=!0,V.nextTick(W0,N,b)}function W0(N,b){while(!b.reading&&!b.ended&&(b.length<b.highWaterMark||b.flowing&&b.length===0)){let a=b.length;if(w("maybeReadMore read 0"),N.read(0),a===b.length)break}b.readingMore=!1}s.prototype._read=function(N){throw new U("_read()")},s.prototype.pipe=function(N,b){let a=this,U0=this._readableState;if(U0.pipes.length===1){if(!U0.multiAwaitDrain)U0.multiAwaitDrain=!0,U0.awaitDrainWriters=new K(U0.awaitDrainWriters?[U0.awaitDrainWriters]:[])}U0.pipes.push(N),w("pipe count=%d opts=%j",U0.pipes.length,b);let f0=(!b||b.end!==!1)&&N!==V.stdout&&N!==V.stderr?H0:y0;if(U0.endEmitted)V.nextTick(f0);else a.once("end",f0);N.on("unpipe",I0);function I0(d0,l0){if(w("onunpipe"),d0===a){if(l0&&l0.hasUnpiped===!1)l0.hasUnpiped=!0,x0()}}function H0(){w("onend"),N.end()}let t0,q0=!1;function x0(){if(w("cleanup"),N.removeListener("close",r0),N.removeListener("finish",c0),t0)N.removeListener("drain",t0);if(N.removeListener("error",D0),N.removeListener("unpipe",I0),a.removeListener("end",H0),a.removeListener("end",y0),a.removeListener("data",P0),q0=!0,t0&&U0.awaitDrainWriters&&(!N._writableState||N._writableState.needDrain))t0()}function DU(){if(!q0){if(U0.pipes.length===1&&U0.pipes[0]===N)w("false write response, pause",0),U0.awaitDrainWriters=N,U0.multiAwaitDrain=!1;else if(U0.pipes.length>1&&U0.pipes.includes(N))w("false write response, pause",U0.awaitDrainWriters.size),U0.awaitDrainWriters.add(N);a.pause()}if(!t0)t0=FU(a,N),N.on("drain",t0)}a.on("data",P0);function P0(d0){w("ondata");let l0=N.write(d0);if(w("dest.write",l0),l0===!1)DU()}function D0(d0){if(w("onerror",d0),y0(),N.removeListener("error",D0),N.listenerCount("error")===0){let l0=N._writableState||N._readableState;if(l0&&!l0.errorEmitted)z(N,d0);else N.emit("error",d0)}}B(N,"error",D0);function r0(){N.removeListener("finish",c0),y0()}N.once("close",r0);function c0(){w("onfinish"),N.removeListener("close",r0),y0()}N.once("finish",c0);function y0(){w("unpipe"),a.unpipe(N)}if(N.emit("pipe",a),N.writableNeedDrain===!0)DU();else if(!U0.flowing)w("pipe resume"),a.resume();return N};function FU(N,b){return function(){let a=N._readableState;if(a.awaitDrainWriters===b)w("pipeOnDrain",1),a.awaitDrainWriters=null;else if(a.multiAwaitDrain)w("pipeOnDrain",a.awaitDrainWriters.size),a.awaitDrainWriters.delete(b);if((!a.awaitDrainWriters||a.awaitDrainWriters.size===0)&&N.listenerCount("data"))N.resume()}}s.prototype.unpipe=function(N){let b=this._readableState,a={hasUnpiped:!1};if(b.pipes.length===0)return this;if(!N){let f0=b.pipes;b.pipes=[],this.pause();for(let I0=0;I0<f0.length;I0++)f0[I0].emit("unpipe",this,{hasUnpiped:!1});return this}let U0=H(b.pipes,N);if(U0===-1)return this;if(b.pipes.splice(U0,1),b.pipes.length===0)this.pause();return N.emit("unpipe",this,a),this},s.prototype.on=function(N,b){let a=k.prototype.on.call(this,N,b),U0=this._readableState;if(N==="data"){if(U0.readableListening=this.listenerCount("readable")>0,U0.flowing!==!1)this.resume()}else if(N==="readable"){if(!U0.endEmitted&&!U0.readableListening){if(U0.readableListening=U0.needReadable=!0,U0.flowing=!1,U0.emittedReadable=!1,w("on readable",U0.length,U0.reading),U0.length)K0(this);else if(!U0.reading)V.nextTick(k0,this)}}return a},s.prototype.addListener=s.prototype.on,s.prototype.removeListener=function(N,b){let a=k.prototype.removeListener.call(this,N,b);if(N==="readable")V.nextTick(R0,this);return a},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(N){let b=k.prototype.removeAllListeners.apply(this,arguments);if(N==="readable"||N===void 0)V.nextTick(R0,this);return b};function R0(N){let b=N._readableState;if(b.readableListening=N.listenerCount("readable")>0,b.resumeScheduled&&b[L]===!1)b.flowing=!0;else if(N.listenerCount("data")>0)N.resume();else if(!b.readableListening)b.flowing=null}function k0(N){w("readable nexttick read 0"),N.read(0)}s.prototype.resume=function(){let N=this._readableState;if(!N.flowing)w("resume"),N.flowing=!N.readableListening,RU(this,N);return N[L]=!1,this};function RU(N,b){if(!b.resumeScheduled)b.resumeScheduled=!0,V.nextTick(_0,N,b)}function _0(N,b){if(w("resume",b.reading),!b.reading)N.read(0);if(b.resumeScheduled=!1,N.emit("resume"),T0(N),b.flowing&&!b.reading)N.read(0)}s.prototype.pause=function(){if(w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)w("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[L]=!0,this};function T0(N){let b=N._readableState;w("flow",b.flowing);while(b.flowing&&N.read()!==null);}s.prototype.wrap=function(N){let b=!1;N.on("data",(U0)=>{if(!this.push(U0)&&N.pause)b=!0,N.pause()}),N.on("end",()=>{this.push(null)}),N.on("error",(U0)=>{z(this,U0)}),N.on("close",()=>{this.destroy()}),N.on("destroy",()=>{this.destroy()}),this._read=()=>{if(b&&N.resume)b=!1,N.resume()};let a=M(N);for(let U0=1;U0<a.length;U0++){let f0=a[U0];if(this[f0]===void 0&&typeof N[f0]==="function")this[f0]=N[f0].bind(N)}return this},s.prototype[q]=function(){return SU(this)},s.prototype.iterator=function(N){if(N!==void 0)I(N,"options");return SU(this,N)};function SU(N,b){if(typeof N.read!=="function")N=s.wrap(N,{objectMode:!0});let a=v0(N,b);return a.stream=N,a}async function*v0(N,b){let a=E;function U0(H0){if(this===N)a(),a=E;else a=H0}N.on("readable",U0);let f0,I0=f(N,{writable:!1},(H0)=>{f0=H0?u(f0,H0):null,a(),a=E});try{while(!0){let H0=N.destroyed?null:N.read();if(H0!==null)yield H0;else if(f0)throw f0;else if(f0===null)return;else await new R(U0)}}catch(H0){throw f0=u(f0,H0),f0}finally{if((f0||(b===null||b===void 0?void 0:b.destroyOnReturn)!==!1)&&(f0===void 0||N._readableState.autoDestroy))Y0.destroyer(N,null);else N.off("readable",U0),I0()}}T(s.prototype,{readable:{__proto__:null,get(){let N=this._readableState;return!!N&&N.readable!==!1&&!N.destroyed&&!N.errorEmitted&&!N.endEmitted},set(N){if(this._readableState)this._readableState.readable=!!N}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(N){if(this._readableState)this._readableState.flowing=N}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(N){if(!this._readableState)return;this._readableState.destroyed=N}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),T(N0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[L]!==!1},set(N){this[L]=!!N}}}),s._fromList=z0;function z0(N,b){if(b.length===0)return null;let a;if(b.objectMode)a=b.buffer.shift();else if(!N||N>=b.length){if(b.decoder)a=b.buffer.join("");else if(b.buffer.length===1)a=b.buffer.first();else a=b.buffer.concat(b.length);b.buffer.clear()}else a=b.buffer.consume(N,b.decoder);return a}function CU(N){let b=N._readableState;if(w("endReadable",b.endEmitted),!b.endEmitted)b.ended=!0,V.nextTick(j0,b,N)}function j0(N,b){if(w("endReadableNT",N.endEmitted,N.length),!N.errored&&!N.closeEmitted&&!N.endEmitted&&N.length===0){if(N.endEmitted=!0,b.emit("end"),b.writable&&b.allowHalfOpen===!1)V.nextTick(B0,b);else if(N.autoDestroy){let a=b._writableState;if(!a||a.autoDestroy&&(a.finished||a.writable===!1))b.destroy()}}}function B0(N){if(N.writable&&!N.writableEnded&&!N.destroyed)N.end()}s.from=function(N,b){return O(s,N,b)};var LU;function M0(){if(LU===void 0)LU={};return LU}s.fromWeb=function(N,b){return M0().newStreamReadableFromReadableStream(N,b)},s.toWeb=function(N,b){return M0().newReadableStreamFromStreamReadable(N,b)},s.wrap=function(N,b){var a,U0;return new s({objectMode:(a=(U0=N.readableObjectMode)!==null&&U0!==void 0?U0:N.objectMode)!==null&&a!==void 0?a:!0,...b,destroy(f0,I0){Y0.destroyer(N,f0),I0(f0)}}).wrap(N)}}),vZ=b0((Q,Y)=>{var V=JO(),{ArrayPrototypeSlice:H,Error:C,FunctionPrototypeSymbolHasInstance:D,ObjectDefineProperty:J,ObjectDefineProperties:T,ObjectSetPrototypeOf:M,StringPrototypeToLowerCase:F,Symbol:R,SymbolHasInstance:K}=n0();Y.exports=I,I.WritableState=Z;var{EventEmitter:W}=(MO(),h0(zO)),q=_Z().Stream,{Buffer:P}=(WU(),h0(HU)),_=EO(),{addAbortSignal:k}=uO(),{getHighWaterMark:B,getDefaultHighWaterMark:j}=bO(),{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:f,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:d,ERR_STREAM_DESTROYED:Y0,ERR_STREAM_ALREADY_FINISHED:A0,ERR_STREAM_NULL_VALUES:$0,ERR_STREAM_WRITE_AFTER_END:u,ERR_UNKNOWN_ENCODING:O0}=zU().codes,{errorOrDestroy:U}=_;M(I.prototype,q.prototype),M(I,q);function X(){}var A=R("kOnFinished");function Z(y,h,Q0){if(typeof Q0!=="boolean")Q0=h instanceof nU();if(this.objectMode=!!(y&&y.objectMode),Q0)this.objectMode=this.objectMode||!!(y&&y.writableObjectMode);this.highWaterMark=y?B(this,y,"writableHighWaterMark",Q0):j(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let t=!!(y&&y.decodeStrings===!1);this.decodeStrings=!t,this.defaultEncoding=y&&y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=z.bind(void 0,h),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,$(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!y||y.emitClose!==!1,this.autoDestroy=!y||y.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[A]=[]}function $(y){y.buffered=[],y.bufferedIndex=0,y.allBuffers=!0,y.allNoop=!0}Z.prototype.getBuffer=function(){return H(this.buffered,this.bufferedIndex)},J(Z.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function I(y){let h=this instanceof nU();if(!h&&!D(I,this))return new I(y);if(this._writableState=new Z(y,this,h),y){if(typeof y.write==="function")this._write=y.write;if(typeof y.writev==="function")this._writev=y.writev;if(typeof y.destroy==="function")this._destroy=y.destroy;if(typeof y.final==="function")this._final=y.final;if(typeof y.construct==="function")this._construct=y.construct;if(y.signal)k(y.signal,this)}q.call(this,y),_.construct(this,()=>{let Q0=this._writableState;if(!Q0.writing)p(this,Q0);l(this,Q0)})}J(I,K,{__proto__:null,value:function(y){if(D(this,y))return!0;if(this!==I)return!1;return y&&y._writableState instanceof Z}}),I.prototype.pipe=function(){U(this,new d)};function L(y,h,Q0,t){let e=y._writableState;if(typeof Q0==="function")t=Q0,Q0=e.defaultEncoding;else{if(!Q0)Q0=e.defaultEncoding;else if(Q0!=="buffer"&&!P.isEncoding(Q0))throw new O0(Q0);if(typeof t!=="function")t=X}if(h===null)throw new $0;else if(!e.objectMode)if(typeof h==="string"){if(e.decodeStrings!==!1)h=P.from(h,Q0),Q0="buffer"}else if(h instanceof P)Q0="buffer";else if(q._isUint8Array(h))h=q._uint8ArrayToBuffer(h),Q0="buffer";else throw new x("chunk",["string","Buffer","Uint8Array"],h);let F0;if(e.ending)F0=new u;else if(e.destroyed)F0=new Y0("write");if(F0)return V.nextTick(t,F0),U(y,F0,!0),F0;return e.pendingcb++,G(y,e,h,Q0,t)}I.prototype.write=function(y,h,Q0){return L(this,y,h,Q0)===!0},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){let y=this._writableState;if(y.corked){if(y.corked--,!y.writing)p(this,y)}},I.prototype.setDefaultEncoding=function(y){if(typeof y==="string")y=F(y);if(!P.isEncoding(y))throw new O0(y);return this._writableState.defaultEncoding=y,this};function G(y,h,Q0,t,e){let F0=h.objectMode?1:Q0.length;h.length+=F0;let c=h.length<h.highWaterMark;if(!c)h.needDrain=!0;if(h.writing||h.corked||h.errored||!h.constructed){if(h.buffered.push({chunk:Q0,encoding:t,callback:e}),h.allBuffers&&t!=="buffer")h.allBuffers=!1;if(h.allNoop&&e!==X)h.allNoop=!1}else h.writelen=F0,h.writecb=e,h.writing=!0,h.sync=!0,y._write(Q0,t,h.onwrite),h.sync=!1;return c&&!h.errored&&!h.destroyed}function O(y,h,Q0,t,e,F0,c){if(h.writelen=t,h.writecb=c,h.writing=!0,h.sync=!0,h.destroyed)h.onwrite(new Y0("write"));else if(Q0)y._writev(e,h.onwrite);else y._write(e,F0,h.onwrite);h.sync=!1}function E(y,h,Q0,t){--h.pendingcb,t(Q0),g(h),U(y,Q0)}function z(y,h){let Q0=y._writableState,t=Q0.sync,e=Q0.writecb;if(typeof e!=="function"){U(y,new w);return}if(Q0.writing=!1,Q0.writecb=null,Q0.length-=Q0.writelen,Q0.writelen=0,h){if(h.stack,!Q0.errored)Q0.errored=h;if(y._readableState&&!y._readableState.errored)y._readableState.errored=h;if(t)V.nextTick(E,y,Q0,h,e);else E(y,Q0,h,e)}else{if(Q0.buffered.length>Q0.bufferedIndex)p(y,Q0);if(t)if(Q0.afterWriteTickInfo!==null&&Q0.afterWriteTickInfo.cb===e)Q0.afterWriteTickInfo.count++;else Q0.afterWriteTickInfo={count:1,cb:e,stream:y,state:Q0},V.nextTick(S,Q0.afterWriteTickInfo);else v(y,Q0,1,e)}}function S({stream:y,state:h,count:Q0,cb:t}){return h.afterWriteTickInfo=null,v(y,h,Q0,t)}function v(y,h,Q0,t){if(!h.ending&&!y.destroyed&&h.length===0&&h.needDrain)h.needDrain=!1,y.emit("drain");while(Q0-- >0)h.pendingcb--,t();if(h.destroyed)g(h);l(y,h)}function g(y){if(y.writing)return;for(let e=y.bufferedIndex;e<y.buffered.length;++e){var h;let{chunk:F0,callback:c}=y.buffered[e],o=y.objectMode?1:F0.length;y.length-=o,c((h=y.errored)!==null&&h!==void 0?h:new Y0("write"))}let Q0=y[A].splice(0);for(let e=0;e<Q0.length;e++){var t;Q0[e]((t=y.errored)!==null&&t!==void 0?t:new Y0("end"))}$(y)}function p(y,h){if(h.corked||h.bufferProcessing||h.destroyed||!h.constructed)return;let{buffered:Q0,bufferedIndex:t,objectMode:e}=h,F0=Q0.length-t;if(!F0)return;let c=t;if(h.bufferProcessing=!0,F0>1&&y._writev){h.pendingcb-=F0-1;let o=h.allNoop?X:(s)=>{for(let Z0=c;Z0<Q0.length;++Z0)Q0[Z0].callback(s)},N0=h.allNoop&&c===0?Q0:H(Q0,c);N0.allBuffers=h.allBuffers,O(y,h,!0,h.length,N0,"",o),$(h)}else{do{let{chunk:o,encoding:N0,callback:s}=Q0[c];Q0[c++]=null;let Z0=e?1:o.length;O(y,h,!1,Z0,o,N0,s)}while(c<Q0.length&&!h.writing);if(c===Q0.length)$(h);else if(c>256)Q0.splice(0,c),h.bufferedIndex=0;else h.bufferedIndex=c}h.bufferProcessing=!1}I.prototype._write=function(y,h,Q0){if(this._writev)this._writev([{chunk:y,encoding:h}],Q0);else throw new f("_write()")},I.prototype._writev=null,I.prototype.end=function(y,h,Q0){let t=this._writableState;if(typeof y==="function")Q0=y,y=null,h=null;else if(typeof h==="function")Q0=h,h=null;let e;if(y!==null&&y!==void 0){let F0=L(this,y,h);if(F0 instanceof C)e=F0}if(t.corked)t.corked=1,this.uncork();if(e);else if(!t.errored&&!t.ending)t.ending=!0,l(this,t,!0),t.ended=!0;else if(t.finished)e=new A0("end");else if(t.destroyed)e=new Y0("end");if(typeof Q0==="function")if(e||t.finished)V.nextTick(Q0,e);else t[A].push(Q0);return this};function n(y){return y.ending&&!y.destroyed&&y.constructed&&y.length===0&&!y.errored&&y.buffered.length===0&&!y.finished&&!y.writing&&!y.errorEmitted&&!y.closeEmitted}function V0(y,h){let Q0=!1;function t(e){if(Q0){U(y,e!==null&&e!==void 0?e:w());return}if(Q0=!0,h.pendingcb--,e){let F0=h[A].splice(0);for(let c=0;c<F0.length;c++)F0[c](e);U(y,e,h.sync)}else if(n(h))h.prefinished=!0,y.emit("prefinish"),h.pendingcb++,V.nextTick(X0,y,h)}h.sync=!0,h.pendingcb++;try{y._final(t)}catch(e){t(e)}h.sync=!1}function r(y,h){if(!h.prefinished&&!h.finalCalled)if(typeof y._final==="function"&&!h.destroyed)h.finalCalled=!0,V0(y,h);else h.prefinished=!0,y.emit("prefinish")}function l(y,h,Q0){if(n(h)){if(r(y,h),h.pendingcb===0){if(Q0)h.pendingcb++,V.nextTick((t,e)=>{if(n(e))X0(t,e);else e.pendingcb--},y,h);else if(n(h))h.pendingcb++,X0(y,h)}}}function X0(y,h){h.pendingcb--,h.finished=!0;let Q0=h[A].splice(0);for(let t=0;t<Q0.length;t++)Q0[t]();if(y.emit("finish"),h.autoDestroy){let t=y._readableState;if(!t||t.autoDestroy&&(t.endEmitted||t.readable===!1))y.destroy()}}T(I.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(y){if(this._writableState)this._writableState.destroyed=y}},writable:{__proto__:null,get(){let y=this._writableState;return!!y&&y.writable!==!1&&!y.destroyed&&!y.errored&&!y.ending&&!y.ended},set(y){if(this._writableState)this._writableState.writable=!!y}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let y=this._writableState;if(!y)return!1;return!y.destroyed&&!y.ending&&y.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var m=_.destroy;I.prototype.destroy=function(y,h){let Q0=this._writableState;if(!Q0.destroyed&&(Q0.bufferedIndex<Q0.buffered.length||Q0[A].length))V.nextTick(g,Q0);return m.call(this,y,h),this},I.prototype._undestroy=_.undestroy,I.prototype._destroy=function(y,h){h(y)},I.prototype[W.captureRejectionSymbol]=function(y){this.destroy(y)};var i;function g0(){if(i===void 0)i={};return i}I.fromWeb=function(y,h){return g0().newStreamWritableFromWritableStream(y,h)},I.toWeb=function(y){return g0().newWritableStreamFromStreamWritable(y)}}),n$=b0((Q,Y)=>{var V=JO(),H=(WU(),h0(HU)),{isReadable:C,isWritable:D,isIterable:J,isNodeStream:T,isReadableNodeStream:M,isWritableNodeStream:F,isDuplexNodeStream:R,isReadableStream:K,isWritableStream:W}=mU(),q=UO(),{AbortError:P,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:k}}=zU(),{destroyer:B}=EO(),j=nU(),x=lO(),f=vZ(),{createDeferredPromise:w}=_U(),d=zQ(),Y0=globalThis.Blob||H.Blob,A0=typeof Y0<"u"?function(A){return A instanceof Y0}:function(A){return!1},$0=globalThis.AbortController||qO().AbortController,{FunctionPrototypeCall:u}=n0();class O0 extends j{constructor(A){super(A);if((A===null||A===void 0?void 0:A.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((A===null||A===void 0?void 0:A.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}Y.exports=function A(Z,$){if(R(Z))return Z;if(M(Z))return X({readable:Z});if(F(Z))return X({writable:Z});if(T(Z))return X({writable:!1,readable:!1});if(K(Z))return X({readable:x.fromWeb(Z)});if(W(Z))return X({writable:f.fromWeb(Z)});if(typeof Z==="function"){let{value:L,write:G,final:O,destroy:E}=U(Z);if(J(L))return d(O0,L,{objectMode:!0,write:G,final:O,destroy:E});let z=L===null||L===void 0?void 0:L.then;if(typeof z==="function"){let S,v=u(z,L,(g)=>{if(g!=null)throw new k("nully","body",g)},(g)=>{B(S,g)});return S=new O0({objectMode:!0,readable:!1,write:G,final(g){O(async()=>{try{await v,V.nextTick(g,null)}catch(p){V.nextTick(g,p)}})},destroy:E})}throw new k("Iterable, AsyncIterable or AsyncFunction",$,L)}if(A0(Z))return A(Z.arrayBuffer());if(J(Z))return d(O0,Z,{objectMode:!0,writable:!1});if(K(Z===null||Z===void 0?void 0:Z.readable)&&W(Z===null||Z===void 0?void 0:Z.writable))return O0.fromWeb(Z);if(typeof(Z===null||Z===void 0?void 0:Z.writable)==="object"||typeof(Z===null||Z===void 0?void 0:Z.readable)==="object"){let L=Z!==null&&Z!==void 0&&Z.readable?M(Z===null||Z===void 0?void 0:Z.readable)?Z===null||Z===void 0?void 0:Z.readable:A(Z.readable):void 0,G=Z!==null&&Z!==void 0&&Z.writable?F(Z===null||Z===void 0?void 0:Z.writable)?Z===null||Z===void 0?void 0:Z.writable:A(Z.writable):void 0;return X({readable:L,writable:G})}let I=Z===null||Z===void 0?void 0:Z.then;if(typeof I==="function"){let L;return u(I,Z,(G)=>{if(G!=null)L.push(G);L.push(null)},(G)=>{B(L,G)}),L=new O0({objectMode:!0,writable:!1,read(){}})}throw new _($,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],Z)};function U(A){let{promise:Z,resolve:$}=w(),I=new $0,L=I.signal;return{value:A(async function*(){while(!0){let G=Z;Z=null;let{chunk:O,done:E,cb:z}=await G;if(V.nextTick(z),E)return;if(L.aborted)throw new P(void 0,{cause:L.reason});({promise:Z,resolve:$}=w()),yield O}}(),{signal:L}),write(G,O,E){let z=$;$=null,z({chunk:G,done:!1,cb:E})},final(G){let O=$;$=null,O({done:!0,cb:G})},destroy(G,O){I.abort(),O(G)}}}function X(A){let Z=A.readable&&typeof A.readable.read!=="function"?x.wrap(A.readable):A.readable,$=A.writable,I=!!C(Z),L=!!D($),G,O,E,z,S;function v(g){let p=z;if(z=null,p)p(g);else if(g)S.destroy(g)}if(S=new O0({readableObjectMode:!!(Z!==null&&Z!==void 0&&Z.readableObjectMode),writableObjectMode:!!($!==null&&$!==void 0&&$.writableObjectMode),readable:I,writable:L}),L)q($,(g)=>{if(L=!1,g)B(Z,g);v(g)}),S._write=function(g,p,n){if($.write(g,p))n();else G=n},S._final=function(g){$.end(),O=g},$.on("drain",function(){if(G){let g=G;G=null,g()}}),$.on("finish",function(){if(O){let g=O;O=null,g()}});if(I)q(Z,(g)=>{if(I=!1,g)B(Z,g);v(g)}),Z.on("readable",function(){if(E){let g=E;E=null,g()}}),Z.on("end",function(){S.push(null)}),S._read=function(){while(!0){let g=Z.read();if(g===null){E=S._read;return}if(!S.push(g))return}};return S._destroy=function(g,p){if(!g&&z!==null)g=new P;if(E=null,G=null,O=null,z===null)p(g);else z=p,B($,g),B(Z,g)},S}}),nU=b0((Q,Y)=>{var{ObjectDefineProperties:V,ObjectGetOwnPropertyDescriptor:H,ObjectKeys:C,ObjectSetPrototypeOf:D}=n0();Y.exports=M;var J=lO(),T=vZ();D(M.prototype,J.prototype),D(M,J);{let W=C(T.prototype);for(let q=0;q<W.length;q++){let P=W[q];if(!M.prototype[P])M.prototype[P]=T.prototype[P]}}function M(W){if(!(this instanceof M))return new M(W);if(J.call(this,W),T.call(this,W),W){if(this.allowHalfOpen=W.allowHalfOpen!==!1,W.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(W.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}V(M.prototype,{writable:{__proto__:null,...H(T.prototype,"writable")},writableHighWaterMark:{__proto__:null,...H(T.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...H(T.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...H(T.prototype,"writableBuffer")},writableLength:{__proto__:null,...H(T.prototype,"writableLength")},writableFinished:{__proto__:null,...H(T.prototype,"writableFinished")},writableCorked:{__proto__:null,...H(T.prototype,"writableCorked")},writableEnded:{__proto__:null,...H(T.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...H(T.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(W){if(this._readableState&&this._writableState)this._readableState.destroyed=W,this._writableState.destroyed=W}}});var F;function R(){if(F===void 0)F={};return F}M.fromWeb=function(W,q){return R().newStreamDuplexFromReadableWritablePair(W,q)},M.toWeb=function(W){return R().newReadableWritablePairFromDuplex(W)};var K;M.from=function(W){if(!K)K=n$();return K(W,"body")}}),MQ=b0((Q,Y)=>{var{ObjectSetPrototypeOf:V,Symbol:H}=n0();Y.exports=M;var{ERR_METHOD_NOT_IMPLEMENTED:C}=zU().codes,D=nU(),{getHighWaterMark:J}=bO();V(M.prototype,D.prototype),V(M,D);var T=H("kCallback");function M(K){if(!(this instanceof M))return new M(K);let W=K?J(this,K,"readableHighWaterMark",!0):null;if(W===0)K={...K,highWaterMark:null,readableHighWaterMark:W,writableHighWaterMark:K.writableHighWaterMark||0};if(D.call(this,K),this._readableState.sync=!1,this[T]=null,K){if(typeof K.transform==="function")this._transform=K.transform;if(typeof K.flush==="function")this._flush=K.flush}this.on("prefinish",R)}function F(K){if(typeof this._flush==="function"&&!this.destroyed)this._flush((W,q)=>{if(W){if(K)K(W);else this.destroy(W);return}if(q!=null)this.push(q);if(this.push(null),K)K()});else if(this.push(null),K)K()}function R(){if(this._final!==F)F.call(this)}M.prototype._final=F,M.prototype._transform=function(K,W,q){throw new C("_transform()")},M.prototype._write=function(K,W,q){let P=this._readableState,_=this._writableState,k=P.length;this._transform(K,W,(B,j)=>{if(B){q(B);return}if(j!=null)this.push(j);if(_.ended||k===P.length||P.length<P.highWaterMark)q();else this[T]=q})},M.prototype._read=function(){if(this[T]){let K=this[T];this[T]=null,K()}}}),qQ=b0((Q,Y)=>{var{ObjectSetPrototypeOf:V}=n0();Y.exports=C;var H=MQ();V(C.prototype,H.prototype),V(C,H);function C(D){if(!(this instanceof C))return new C(D);H.call(this,D)}C.prototype._transform=function(D,J,T){T(null,D)}}),jZ=b0((Q,Y)=>{var V=JO(),{ArrayIsArray:H,Promise:C,SymbolAsyncIterator:D,SymbolDispose:J}=n0(),T=UO(),{once:M}=_U(),F=EO(),R=nU(),{aggregateTwoErrors:K,codes:{ERR_INVALID_ARG_TYPE:W,ERR_INVALID_RETURN_VALUE:q,ERR_MISSING_ARGS:P,ERR_STREAM_DESTROYED:_,ERR_STREAM_PREMATURE_CLOSE:k},AbortError:B}=zU(),{validateFunction:j,validateAbortSignal:x}=PO(),{isIterable:f,isReadable:w,isReadableNodeStream:d,isNodeStream:Y0,isTransformStream:A0,isWebStream:$0,isReadableStream:u,isReadableFinished:O0}=mU(),U=globalThis.AbortController||qO().AbortController,X,A,Z;function $(g,p,n){let V0=!1;g.on("close",()=>{V0=!0});let r=T(g,{readable:p,writable:n},(l)=>{V0=!l});return{destroy:(l)=>{if(V0)return;V0=!0,F.destroyer(g,l||new _("pipe"))},cleanup:r}}function I(g){return j(g[g.length-1],"streams[stream.length - 1]"),g.pop()}function L(g){if(f(g))return g;else if(d(g))return G(g);throw new W("val",["Readable","Iterable","AsyncIterable"],g)}async function*G(g){if(!A)A=lO();yield*A.prototype[D].call(g)}async function O(g,p,n,{end:V0}){let r,l=null,X0=(g0)=>{if(g0)r=g0;if(l){let y=l;l=null,y()}},m=()=>new C((g0,y)=>{if(r)y(r);else l=()=>{if(r)y(r);else g0()}});p.on("drain",X0);let i=T(p,{readable:!1},X0);try{if(p.writableNeedDrain)await m();for await(let g0 of g)if(!p.write(g0))await m();if(V0)p.end(),await m();n()}catch(g0){n(r!==g0?K(r,g0):g0)}finally{i(),p.off("drain",X0)}}async function E(g,p,n,{end:V0}){if(A0(p))p=p.writable;let r=p.getWriter();try{for await(let l of g)await r.ready,r.write(l).catch(()=>{});if(await r.ready,V0)await r.close();n()}catch(l){try{await r.abort(l),n(l)}catch(X0){n(X0)}}}function z(...g){return S(g,M(I(g)))}function S(g,p,n){if(g.length===1&&H(g[0]))g=g[0];if(g.length<2)throw new P("streams");let V0=new U,r=V0.signal,l=n===null||n===void 0?void 0:n.signal,X0=[];x(l,"options.signal");function m(){e(new B)}Z=Z||_U().addAbortListener;let i;if(l)i=Z(l,m);let g0,y,h=[],Q0=0;function t(s){e(s,--Q0===0)}function e(s,Z0){var w0;if(s&&(!g0||g0.code==="ERR_STREAM_PREMATURE_CLOSE"))g0=s;if(!g0&&!Z0)return;while(h.length)h.shift()(g0);if((w0=i)===null||w0===void 0||w0[J](),V0.abort(),Z0){if(!g0)X0.forEach((C0)=>C0());V.nextTick(p,g0,y)}}let F0;for(let s=0;s<g.length;s++){let Z0=g[s],w0=s<g.length-1,C0=s>0,L0=w0||(n===null||n===void 0?void 0:n.end)!==!1,s0=s===g.length-1;if(Y0(Z0)){let E0=function(K0){if(K0&&K0.name!=="AbortError"&&K0.code!=="ERR_STREAM_PREMATURE_CLOSE")t(K0)};var c=E0;if(L0){let{destroy:K0,cleanup:e0}=$(Z0,w0,C0);if(h.push(K0),w(Z0)&&s0)X0.push(e0)}if(Z0.on("error",E0),w(Z0)&&s0)X0.push(()=>{Z0.removeListener("error",E0)})}if(s===0)if(typeof Z0==="function"){if(F0=Z0({signal:r}),!f(F0))throw new q("Iterable, AsyncIterable or Stream","source",F0)}else if(f(Z0)||d(Z0)||A0(Z0))F0=Z0;else F0=R.from(Z0);else if(typeof Z0==="function"){if(A0(F0)){var o;F0=L((o=F0)===null||o===void 0?void 0:o.readable)}else F0=L(F0);if(F0=Z0(F0,{signal:r}),w0){if(!f(F0,!0))throw new q("AsyncIterable",`transform[${s-1}]`,F0)}else{var N0;if(!X)X=qQ();let E0=new X({objectMode:!0}),K0=(N0=F0)===null||N0===void 0?void 0:N0.then;if(typeof K0==="function")Q0++,K0.call(F0,(W0)=>{if(y=W0,W0!=null)E0.write(W0);if(L0)E0.end();V.nextTick(t)},(W0)=>{E0.destroy(W0),V.nextTick(t,W0)});else if(f(F0,!0))Q0++,O(F0,E0,t,{end:L0});else if(u(F0)||A0(F0)){let W0=F0.readable||F0;Q0++,O(W0,E0,t,{end:L0})}else throw new q("AsyncIterable or Promise","destination",F0);F0=E0;let{destroy:e0,cleanup:S0}=$(F0,!1,!0);if(h.push(e0),s0)X0.push(S0)}}else if(Y0(Z0)){if(d(F0)){Q0+=2;let E0=v(F0,Z0,t,{end:L0});if(w(Z0)&&s0)X0.push(E0)}else if(A0(F0)||u(F0)){let E0=F0.readable||F0;Q0++,O(E0,Z0,t,{end:L0})}else if(f(F0))Q0++,O(F0,Z0,t,{end:L0});else throw new W("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],F0);F0=Z0}else if($0(Z0)){if(d(F0))Q0++,E(L(F0),Z0,t,{end:L0});else if(u(F0)||f(F0))Q0++,E(F0,Z0,t,{end:L0});else if(A0(F0))Q0++,E(F0.readable,Z0,t,{end:L0});else throw new W("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],F0);F0=Z0}else F0=R.from(Z0)}if(r!==null&&r!==void 0&&r.aborted||l!==null&&l!==void 0&&l.aborted)V.nextTick(m);return F0}function v(g,p,n,{end:V0}){let r=!1;if(p.on("close",()=>{if(!r)n(new k)}),g.pipe(p,{end:!1}),V0){let X0=function(){r=!0,p.end()};var l=X0;if(O0(g))V.nextTick(X0);else g.once("end",X0)}else n();return T(g,{readable:!0,writable:!1},(X0)=>{let m=g._readableState;if(X0&&X0.code==="ERR_STREAM_PREMATURE_CLOSE"&&m&&m.ended&&!m.errored&&!m.errorEmitted)g.once("end",n).once("error",n);else n(X0)}),T(p,{readable:!1,writable:!0},n)}Y.exports={pipelineImpl:S,pipeline:z}}),PQ=b0((Q,Y)=>{var{pipeline:V}=jZ(),H=nU(),{destroyer:C}=EO(),{isNodeStream:D,isReadable:J,isWritable:T,isWebStream:M,isTransformStream:F,isWritableStream:R,isReadableStream:K}=mU(),{AbortError:W,codes:{ERR_INVALID_ARG_VALUE:q,ERR_MISSING_ARGS:P}}=zU(),_=UO();Y.exports=function(...k){if(k.length===0)throw new P("streams");if(k.length===1)return H.from(k[0]);let B=[...k];if(typeof k[0]==="function")k[0]=H.from(k[0]);if(typeof k[k.length-1]==="function"){let U=k.length-1;k[U]=H.from(k[U])}for(let U=0;U<k.length;++U){if(!D(k[U])&&!M(k[U]))continue;if(U<k.length-1&&!(J(k[U])||K(k[U])||F(k[U])))throw new q(`streams[${U}]`,B[U],"must be readable");if(U>0&&!(T(k[U])||R(k[U])||F(k[U])))throw new q(`streams[${U}]`,B[U],"must be writable")}let j,x,f,w,d;function Y0(U){let X=w;if(w=null,X)X(U);else if(U)d.destroy(U);else if(!O0&&!u)d.destroy()}let A0=k[0],$0=V(k,Y0),u=!!(T(A0)||R(A0)||F(A0)),O0=!!(J($0)||K($0)||F($0));if(d=new H({writableObjectMode:!!(A0!==null&&A0!==void 0&&A0.writableObjectMode),readableObjectMode:!!($0!==null&&$0!==void 0&&$0.readableObjectMode),writable:u,readable:O0}),u){if(D(A0))d._write=function(X,A,Z){if(A0.write(X,A))Z();else j=Z},d._final=function(X){A0.end(),x=X},A0.on("drain",function(){if(j){let X=j;j=null,X()}});else if(M(A0)){let X=(F(A0)?A0.writable:A0).getWriter();d._write=async function(A,Z,$){try{await X.ready,X.write(A).catch(()=>{}),$()}catch(I){$(I)}},d._final=async function(A){try{await X.ready,X.close().catch(()=>{}),x=A}catch(Z){A(Z)}}}let U=F($0)?$0.readable:$0;_(U,()=>{if(x){let X=x;x=null,X()}})}if(O0){if(D($0))$0.on("readable",function(){if(f){let U=f;f=null,U()}}),$0.on("end",function(){d.push(null)}),d._read=function(){while(!0){let U=$0.read();if(U===null){f=d._read;return}if(!d.push(U))return}};else if(M($0)){let U=(F($0)?$0.readable:$0).getReader();d._read=async function(){while(!0)try{let{value:X,done:A}=await U.read();if(!d.push(X))return;if(A){d.push(null);return}}catch{return}}}}return d._destroy=function(U,X){if(!U&&w!==null)U=new W;if(f=null,j=null,x=null,w===null)X(U);else if(w=X,D($0))C($0,U)},d}}),m$=b0((Q,Y)=>{var V=globalThis.AbortController||qO().AbortController,{codes:{ERR_INVALID_ARG_VALUE:H,ERR_INVALID_ARG_TYPE:C,ERR_MISSING_ARGS:D,ERR_OUT_OF_RANGE:J},AbortError:T}=zU(),{validateAbortSignal:M,validateInteger:F,validateObject:R}=PO(),K=n0().Symbol("kWeak"),W=n0().Symbol("kResistStopPropagation"),{finished:q}=UO(),P=PQ(),{addAbortSignalNoValidate:_}=uO(),{isWritable:k,isNodeStream:B}=mU(),{deprecate:j}=_U(),{ArrayPrototypePush:x,Boolean:f,MathFloor:w,Number:d,NumberIsNaN:Y0,Promise:A0,PromiseReject:$0,PromiseResolve:u,PromisePrototypeThen:O0,Symbol:U}=n0(),X=U("kEmpty"),A=U("kEof");function Z(l,X0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");if(B(l)&&!k(l))throw new H("stream",l,"must be writable");let m=P(this,l);if(X0!==null&&X0!==void 0&&X0.signal)_(X0.signal,m);return m}function $(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");let m=1;if((X0===null||X0===void 0?void 0:X0.concurrency)!=null)m=w(X0.concurrency);let i=m-1;if((X0===null||X0===void 0?void 0:X0.highWaterMark)!=null)i=w(X0.highWaterMark);return F(m,"options.concurrency",1),F(i,"options.highWaterMark",0),i+=m,async function*(){let g0=_U().AbortSignalAny([X0===null||X0===void 0?void 0:X0.signal].filter(f)),y=this,h=[],Q0={signal:g0},t,e,F0=!1,c=0;function o(){F0=!0,N0()}function N0(){c-=1,s()}function s(){if(e&&!F0&&c<m&&h.length<i)e(),e=null}async function Z0(){try{for await(let w0 of y){if(F0)return;if(g0.aborted)throw new T;try{if(w0=l(w0,Q0),w0===X)continue;w0=u(w0)}catch(C0){w0=$0(C0)}if(c+=1,O0(w0,N0,o),h.push(w0),t)t(),t=null;if(!F0&&(h.length>=i||c>=m))await new A0((C0)=>{e=C0})}h.push(A)}catch(w0){let C0=$0(w0);O0(C0,N0,o),h.push(C0)}finally{if(F0=!0,t)t(),t=null}}Z0();try{while(!0){while(h.length>0){let w0=await h[0];if(w0===A)return;if(g0.aborted)throw new T;if(w0!==X)yield w0;h.shift(),s()}await new A0((w0)=>{t=w0})}}finally{if(F0=!0,e)e(),e=null}}.call(this)}function I(l=void 0){if(l!=null)R(l,"options");if((l===null||l===void 0?void 0:l.signal)!=null)M(l.signal,"options.signal");return async function*(){let X0=0;for await(let i of this){var m;if(l!==null&&l!==void 0&&(m=l.signal)!==null&&m!==void 0&&m.aborted)throw new T({cause:l.signal.reason});yield[X0++,i]}}.call(this)}async function L(l,X0=void 0){for await(let m of z.call(this,l,X0))return!0;return!1}async function G(l,X0=void 0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);return!await L.call(this,async(...m)=>{return!await l(...m)},X0)}async function O(l,X0){for await(let m of z.call(this,l,X0))return m;return}async function E(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);async function m(i,g0){return await l(i,g0),X}for await(let i of $.call(this,m,X0));}function z(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);async function m(i,g0){if(await l(i,g0))return i;return X}return $.call(this,m,X0)}class S extends D{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function v(l,X0,m){var i;if(typeof l!=="function")throw new C("reducer",["Function","AsyncFunction"],l);if(m!=null)R(m,"options");if((m===null||m===void 0?void 0:m.signal)!=null)M(m.signal,"options.signal");let g0=arguments.length>1;if(m!==null&&m!==void 0&&(i=m.signal)!==null&&i!==void 0&&i.aborted){let e=new T(void 0,{cause:m.signal.reason});throw this.once("error",()=>{}),await q(this.destroy(e)),e}let y=new V,h=y.signal;if(m!==null&&m!==void 0&&m.signal){let e={once:!0,[K]:this,[W]:!0};m.signal.addEventListener("abort",()=>y.abort(),e)}let Q0=!1;try{for await(let e of this){var t;if(Q0=!0,m!==null&&m!==void 0&&(t=m.signal)!==null&&t!==void 0&&t.aborted)throw new T;if(!g0)X0=e,g0=!0;else X0=await l(X0,e,{signal:h})}if(!Q0&&!g0)throw new S}finally{y.abort()}return X0}async function g(l){if(l!=null)R(l,"options");if((l===null||l===void 0?void 0:l.signal)!=null)M(l.signal,"options.signal");let X0=[];for await(let i of this){var m;if(l!==null&&l!==void 0&&(m=l.signal)!==null&&m!==void 0&&m.aborted)throw new T(void 0,{cause:l.signal.reason});x(X0,i)}return X0}function p(l,X0){let m=$.call(this,l,X0);return async function*(){for await(let i of m)yield*i}.call(this)}function n(l){if(l=d(l),Y0(l))return 0;if(l<0)throw new J("number",">= 0",l);return l}function V0(l,X0=void 0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");return l=n(l),async function*(){var m;if(X0!==null&&X0!==void 0&&(m=X0.signal)!==null&&m!==void 0&&m.aborted)throw new T;for await(let g0 of this){var i;if(X0!==null&&X0!==void 0&&(i=X0.signal)!==null&&i!==void 0&&i.aborted)throw new T;if(l--<=0)yield g0}}.call(this)}function r(l,X0=void 0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");return l=n(l),async function*(){var m;if(X0!==null&&X0!==void 0&&(m=X0.signal)!==null&&m!==void 0&&m.aborted)throw new T;for await(let g0 of this){var i;if(X0!==null&&X0!==void 0&&(i=X0.signal)!==null&&i!==void 0&&i.aborted)throw new T;if(l-- >0)yield g0;if(l<=0)return}}.call(this)}Y.exports.streamReturningOperators={asIndexedPairs:j(I,"readable.asIndexedPairs will be removed in a future version."),drop:V0,filter:z,flatMap:p,map:$,take:r,compose:Z},Y.exports.promiseReturningOperators={every:G,forEach:E,reduce:v,toArray:g,some:L,find:O}}),kQ=b0((Q,Y)=>{var{ArrayPrototypePop:V,Promise:H}=n0(),{isIterable:C,isNodeStream:D,isWebStream:J}=mU(),{pipelineImpl:T}=jZ(),{finished:M}=UO();_Q();function F(...R){return new H((K,W)=>{let q,P,_=R[R.length-1];if(_&&typeof _==="object"&&!D(_)&&!C(_)&&!J(_)){let k=V(R);q=k.signal,P=k.end}T(R,(k,B)=>{if(k)W(k);else K(B)},{signal:q,end:P})})}Y.exports={finished:M,pipeline:F}}),_Q=b0((Q,Y)=>{var{Buffer:V}=(WU(),h0(HU)),{ObjectDefineProperty:H,ObjectKeys:C,ReflectApply:D}=n0(),{promisify:{custom:J}}=_U(),{streamReturningOperators:T,promiseReturningOperators:M}=m$(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:F}}=zU(),R=PQ(),{setDefaultHighWaterMark:K,getDefaultHighWaterMark:W}=bO(),{pipeline:q}=jZ(),{destroyer:P}=EO(),_=UO(),k=kQ(),B=mU(),j=Y.exports=_Z().Stream;j.isDestroyed=B.isDestroyed,j.isDisturbed=B.isDisturbed,j.isErrored=B.isErrored,j.isReadable=B.isReadable,j.isWritable=B.isWritable,j.Readable=lO();for(let f of C(T)){let w=function(...Y0){if(new.target)throw F();return j.Readable.from(D(d,this,Y0))},d=T[f];H(w,"name",{__proto__:null,value:d.name}),H(w,"length",{__proto__:null,value:d.length}),H(j.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(let f of C(M)){let w=function(...Y0){if(new.target)throw F();return D(d,this,Y0)},d=M[f];H(w,"name",{__proto__:null,value:d.name}),H(w,"length",{__proto__:null,value:d.length}),H(j.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}j.Writable=vZ(),j.Duplex=nU(),j.Transform=MQ(),j.PassThrough=qQ(),j.pipeline=q;var{addAbortSignal:x}=uO();j.addAbortSignal=x,j.finished=_,j.destroy=P,j.compose=R,j.setDefaultHighWaterMark=K,j.getDefaultHighWaterMark=W,H(j,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return k}}),H(q,J,{__proto__:null,enumerable:!0,get(){return k.pipeline}}),H(_,J,{__proto__:null,enumerable:!0,get(){return k.finished}}),j.Stream=j,j._isUint8Array=function(f){return f instanceof Uint8Array},j._uint8ArrayToBuffer=function(f){return V.from(f.buffer,f.byteOffset,f.byteLength)}}),s$=b0((Q,Y)=>{var V=dO();{let H=_Q(),C=kQ(),D=H.Readable.destroy;Y.exports=H.Readable,Y.exports._uint8ArrayToBuffer=H._uint8ArrayToBuffer,Y.exports._isUint8Array=H._isUint8Array,Y.exports.isDisturbed=H.isDisturbed,Y.exports.isErrored=H.isErrored,Y.exports.isReadable=H.isReadable,Y.exports.Readable=H.Readable,Y.exports.Writable=H.Writable,Y.exports.Duplex=H.Duplex,Y.exports.Transform=H.Transform,Y.exports.PassThrough=H.PassThrough,Y.exports.addAbortSignal=H.addAbortSignal,Y.exports.finished=H.finished,Y.exports.destroy=H.destroy,Y.exports.destroy=D,Y.exports.pipeline=H.pipeline,Y.exports.compose=H.compose,Object.defineProperty(H,"promises",{configurable:!0,enumerable:!0,get(){return C}}),Y.exports.Stream=H.Stream}Y.exports.default=Y.exports});vQ.exports=s$()});var lZ={};HO(lZ,{uptime:()=>FJ,type:()=>MJ,totalmem:()=>TJ,tmpdir:()=>wQ,tmpDir:()=>vJ,release:()=>qJ,platform:()=>_J,networkInterfaces:()=>PJ,loadavg:()=>DJ,hostname:()=>SJ,homedir:()=>BJ,getNetworkInterfaces:()=>fQ,freemem:()=>RJ,endianness:()=>WJ,cpus:()=>zJ,arch:()=>kJ,EOL:()=>jJ});var WJ=function(){return"LE"},SJ=function(){if(typeof location<"u")return location.hostname;else return""},DJ=function(){return[]},FJ=function(){return 0},RJ=function(){return Number.MAX_VALUE},TJ=function(){return Number.MAX_VALUE},zJ=function(){return[]},MJ=function(){return"Browser"},qJ=function(){if(typeof navigator<"u")return navigator.appVersion;return""},fQ=function(){return{}},PJ,kJ=function(){return"javascript"},_J=function(){return"browser"},wQ=function(){return"/tmp"},vJ,jJ=`
3
+ `,BJ=function(){return"/"};var dZ=WO(()=>{PJ=fQ,vJ=wQ});var nQ={};HO(nQ,{types:()=>uJ,promisify:()=>bQ,log:()=>pQ,isUndefined:()=>CO,isSymbol:()=>lJ,isString:()=>iO,isRegExp:()=>sO,isPrimitive:()=>dJ,isObject:()=>LO,isNumber:()=>cQ,isNullOrUndefined:()=>bJ,isNull:()=>eO,isFunction:()=>rO,isError:()=>tO,isDate:()=>sZ,isBuffer:()=>oJ,isBoolean:()=>rZ,isArray:()=>yQ,inspect:()=>AO,inherits:()=>hQ,format:()=>tZ,deprecate:()=>NJ,default:()=>sJ,debuglog:()=>gJ,callbackifyOnRejected:()=>iZ,callbackify:()=>lQ,_extend:()=>eZ,TextEncoder:()=>dQ,TextDecoder:()=>oQ});function tZ(Q,...Y){if(!iO(Q)){var V=[Q];for(var H=0;H<Y.length;H++)V.push(AO(Y[H]));return V.join(" ")}var H=0,C=Y.length,D=String(Q).replace(xJ,function(T){if(T==="%%")return"%";if(H>=C)return T;switch(T){case"%s":return String(Y[H++]);case"%d":return Number(Y[H++]);case"%j":try{return JSON.stringify(Y[H++])}catch(M){return"[Circular]"}default:return T}});for(var J=Y[H];H<C;J=Y[++H])if(eO(J)||!LO(J))D+=" "+J;else D+=" "+AO(J);return D}function NJ(Q,Y){if(typeof process>"u"||process?.noDeprecation===!0)return Q;var V=!1;function H(...C){if(!V){if(process.throwDeprecation)throw Error(Y);else if(process.traceDeprecation)console.trace(Y);else console.error(Y);V=!0}return Q.apply(this,...C)}return H}function fJ(Q,Y){var V=AO.styles[Y];if(V)return"\x1B["+AO.colors[V][0]+"m"+Q+"\x1B["+AO.colors[V][1]+"m";else return Q}function wJ(Q,Y){return Q}function yJ(Q){var Y={};return Q.forEach(function(V,H){Y[V]=!0}),Y}function aO(Q,Y,V){if(Q.customInspect&&Y&&rO(Y.inspect)&&Y.inspect!==AO&&!(Y.constructor&&Y.constructor.prototype===Y)){var H=Y.inspect(V,Q);if(!iO(H))H=aO(Q,H,V);return H}var C=cJ(Q,Y);if(C)return C;var D=Object.keys(Y),J=yJ(D);if(Q.showHidden)D=Object.getOwnPropertyNames(Y);if(tO(Y)&&(D.indexOf("message")>=0||D.indexOf("description")>=0))return oZ(Y);if(D.length===0){if(rO(Y)){var T=Y.name?": "+Y.name:"";return Q.stylize("[Function"+T+"]","special")}if(sO(Y))return Q.stylize(RegExp.prototype.toString.call(Y),"regexp");if(sZ(Y))return Q.stylize(Date.prototype.toString.call(Y),"date");if(tO(Y))return oZ(Y)}var M="",F=!1,R=["{","}"];if(yQ(Y))F=!0,R=["[","]"];if(rO(Y)){var K=Y.name?": "+Y.name:"";M=" [Function"+K+"]"}if(sO(Y))M=" "+RegExp.prototype.toString.call(Y);if(sZ(Y))M=" "+Date.prototype.toUTCString.call(Y);if(tO(Y))M=" "+oZ(Y);if(D.length===0&&(!F||Y.length==0))return R[0]+M+R[1];if(V<0)if(sO(Y))return Q.stylize(RegExp.prototype.toString.call(Y),"regexp");else return Q.stylize("[Object]","special");Q.seen.push(Y);var W;if(F)W=pJ(Q,Y,V,J,D);else W=D.map(function(q){return mZ(Q,Y,V,J,q,F)});return Q.seen.pop(),hJ(W,M,R)}function cJ(Q,Y){if(CO(Y))return Q.stylize("undefined","undefined");if(iO(Y)){var V="'"+JSON.stringify(Y).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Q.stylize(V,"string")}if(cQ(Y))return Q.stylize(""+Y,"number");if(rZ(Y))return Q.stylize(""+Y,"boolean");if(eO(Y))return Q.stylize("null","null")}function oZ(Q){return"["+Error.prototype.toString.call(Q)+"]"}function pJ(Q,Y,V,H,C){var D=[];for(var J=0,T=Y.length;J<T;++J)if(uQ(Y,String(J)))D.push(mZ(Q,Y,V,H,String(J),!0));else D.push("");return C.forEach(function(M){if(!M.match(/^\d+$/))D.push(mZ(Q,Y,V,H,M,!0))}),D}function mZ(Q,Y,V,H,C,D){var J,T,M;if(M=Object.getOwnPropertyDescriptor(Y,C)||{value:Y[C]},M.get)if(M.set)T=Q.stylize("[Getter/Setter]","special");else T=Q.stylize("[Getter]","special");else if(M.set)T=Q.stylize("[Setter]","special");if(!uQ(H,C))J="["+C+"]";if(!T)if(Q.seen.indexOf(M.value)<0){if(eO(V))T=aO(Q,M.value,null);else T=aO(Q,M.value,V-1);if(T.indexOf(`
4
+ `)>-1)if(D)T=T.split(`
5
5
  `).map(function(F){return" "+F}).join(`
6
- `).slice(2);else z=`
7
- `+z.split(`
6
+ `).slice(2);else T=`
7
+ `+T.split(`
8
8
  `).map(function(F){return" "+F}).join(`
9
- `)}else z=Q.stylize("[Circular]","special");if(CO(A)){if(D&&C.match(/^\d+$/))return z;if(A=JSON.stringify(""+C),A.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))A=A.slice(1,-1),A=Q.stylize(A,"name");else A=A.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),A=Q.stylize(A,"string")}return A+": "+z}function NA(Q,$,V){var W=0,C=Q.reduce(function(D,A){if(W++,A.indexOf(`
10
- `)>=0)W++;return D+A.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(C>60)return V[0]+($===""?"":$+`
9
+ `)}else T=Q.stylize("[Circular]","special");if(CO(J)){if(D&&C.match(/^\d+$/))return T;if(J=JSON.stringify(""+C),J.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))J=J.slice(1,-1),J=Q.stylize(J,"name");else J=J.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),J=Q.stylize(J,"string")}return J+": "+T}function hJ(Q,Y,V){var H=0,C=Q.reduce(function(D,J){if(H++,J.indexOf(`
10
+ `)>=0)H++;return D+J.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(C>60)return V[0]+(Y===""?"":Y+`
11
11
  `)+" "+Q.join(`,
12
- `)+" "+V[1];return V[0]+$+" "+Q.join(", ")+" "+V[1]}function wQ(Q){return Array.isArray(Q)}function rZ(Q){return typeof Q==="boolean"}function eO(Q){return Q===null}function fA(Q){return Q==null}function yQ(Q){return typeof Q==="number"}function iO(Q){return typeof Q==="string"}function wA(Q){return typeof Q==="symbol"}function CO(Q){return Q===void 0}function tO(Q){return LO(Q)&&aZ(Q)==="[object RegExp]"}function LO(Q){return typeof Q==="object"&&Q!==null}function tZ(Q){return LO(Q)&&aZ(Q)==="[object Date]"}function sO(Q){return LO(Q)&&(aZ(Q)==="[object Error]"||Q instanceof Error)}function rO(Q){return typeof Q==="function"}function yA(Q){return Q===null||typeof Q==="boolean"||typeof Q==="number"||typeof Q==="string"||typeof Q==="symbol"||typeof Q>"u"}function cA(Q){return Q instanceof Buffer}function aZ(Q){return Object.prototype.toString.call(Q)}function nZ(Q){return Q<10?"0"+Q.toString(10):Q.toString(10)}function hA(){var Q=new Date,$=[nZ(Q.getHours()),nZ(Q.getMinutes()),nZ(Q.getSeconds())].join(":");return[Q.getDate(),pA[Q.getMonth()],$].join(" ")}function cQ(...Q){console.log("%s - %s",hA(),sZ.apply(null,Q))}function pQ(Q,$){if($)Q.super_=$,Q.prototype=Object.create($.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})}function eZ(Q,$){if(!$||!LO($))return Q;var V=Object.keys($),W=V.length;while(W--)Q[V[W]]=$[V[W]];return Q}function hQ(Q,$){return Object.prototype.hasOwnProperty.call(Q,$)}function iZ(Q,$){if(!Q){var V=Error("Promise was rejected with a falsy value");V.reason=Q,Q=V}return $(Q)}function bQ(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');function $(...V){var W=V.pop();if(typeof W!=="function")throw TypeError("The last argument must be of type Function");var C=this,D=function(...A){return W.apply(C,...A)};Q.apply(this,V).then(function(A){process.nextTick(D.bind(null,null,A))},function(A){process.nextTick(iZ.bind(null,A,D))})}return Object.setPrototypeOf($,Object.getPrototypeOf(Q)),Object.defineProperties($,Object.getOwnPropertyDescriptors(Q)),$}var qA,kA,JO,gA=()=>{},pA,uQ,lQ,dQ,uA;var nQ=HO(()=>{qA=/%[sdj%]/g;kA=((Q={},$={},V)=>((V=typeof process<"u"&&!1)&&(V=V.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),$=new RegExp("^"+V+"$","i"),(W)=>{if(W=W.toUpperCase(),!Q[W])if($.test(W))Q[W]=function(...C){console.error("%s: %s",W,pid,sZ.apply(null,...C))};else Q[W]=function(){};return Q[W]}))(),JO=((Q)=>(Q.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Q.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Q.custom=Symbol.for("nodejs.util.inspect.custom"),Q))(function(Q,$,...V){var W={seen:[],stylize:vA};if(V.length>=1)W.depth=V[0];if(V.length>=2)W.colors=V[1];if(rZ($))W.showHidden=$;else if($)eZ(W,$);if(CO(W.showHidden))W.showHidden=!1;if(CO(W.depth))W.depth=2;if(CO(W.colors))W.colors=!1;if(W.colors)W.stylize=_A;return aO(W,Q,W.depth)});pA=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];uQ=((Q)=>(Q.custom=Symbol.for("nodejs.util.promisify.custom"),Q))(function(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&Q[kCustomPromisifiedSymbol]){var $=Q[kCustomPromisifiedSymbol];if(typeof $!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty($,kCustomPromisifiedSymbol,{value:$,enumerable:!1,writable:!1,configurable:!0}),$}function $(...V){var W,C,D=new Promise(function(A,z){W=A,C=z});V.push(function(A,z){if(A)C(A);else W(z)});try{Q.apply(this,V)}catch(A){C(A)}return D}if(Object.setPrototypeOf($,Object.getPrototypeOf(Q)),kCustomPromisifiedSymbol)Object.defineProperty($,kCustomPromisifiedSymbol,{value:$,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties($,Object.getOwnPropertyDescriptors(Q))});({TextEncoder:lQ,TextDecoder:dQ}=globalThis),uA={TextEncoder:lQ,TextDecoder:dQ,promisify:uQ,log:cQ,inherits:pQ,_extend:eZ,callbackifyOnRejected:iZ,callbackify:bQ}});var vU={};WO(vU,{webcrypto:()=>LV,rng:()=>PG,randomUUID:()=>EV,randomFillSync:()=>$V,randomFill:()=>YV,randomBytes:()=>kG,publicEncrypt:()=>OV,publicDecrypt:()=>XV,pseudoRandomBytes:()=>qG,prng:()=>MG,privateEncrypt:()=>ZV,privateDecrypt:()=>QV,pbkdf2Sync:()=>gG,pbkdf2:()=>NG,listCiphers:()=>dG,getRandomValues:()=>VV,getHashes:()=>xG,getDiffieHellman:()=>mG,getCurves:()=>CV,getCiphers:()=>lG,default:()=>KV,createVerify:()=>eG,createSign:()=>rG,createHmac:()=>BG,createHash:()=>vG,createECDH:()=>UV,createDiffieHellmanGroup:()=>nG,createDiffieHellman:()=>tG,createDecipheriv:()=>bG,createDecipher:()=>hG,createCredentials:()=>AV,createCipheriv:()=>cG,createCipher:()=>wG,constants:()=>JV,Verify:()=>iG,Sign:()=>aG,Hmac:()=>jG,Hash:()=>_G,DiffieHellmanGroup:()=>oG,DiffieHellman:()=>sG,Decipheriv:()=>uG,Decipher:()=>pG,DEFAULT_ENCODING:()=>GV,Cipheriv:()=>yG,Cipher:()=>fG});function CV(){return IV}var bA,lA,mQ,dA,oA,nA=(Q,$,V)=>{V=Q!=null?bA(lA(Q)):{};let W=$||!Q||!Q.__esModule?mQ(V,"default",{value:Q,enumerable:!0}):V;for(let C of dA(Q))if(!oA.call(W,C))mQ(W,C,{get:()=>Q[C],enumerable:!0});return W},A0=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports),UZ,OZ,sQ,mA,OX,ZX,MU,tA,vO,rQ,sA,rA,aA,eA,aQ,iA,UJ,OJ,ZJ,XJ,QJ,YJ,$J,AJ,JJ,jO,ZZ,eQ,GJ,iQ,UY,VJ,BO,XX,QX,EJ,OY,YX,IJ,ZY,CJ,XY,QY,LJ,KJ,WJ,HJ,SJ,DJ,FJ,RJ,TJ,zJ,MJ,qJ,PJ,kJ,$X,YY,_J,$Y,vJ,jJ,BJ,xJ,tU,OO,AY,yU,JY,XZ,NJ,xU,gJ,fJ,wJ,GY,dU,xO,VY,yJ,EY,cJ,IY,pJ,hJ,uJ,bJ,AX,lJ,JX,dJ,oJ,nJ,mJ,tJ,sJ,rJ,aJ,eJ,iJ,UG,OG,ZG,XG,tQ,QG,_O,YG,CY,LY,$G,AG,KY,JG,GG,NO,VG,EG,IG,CG,LG,KG,WY,WG,HY,SY,DY,GX,FY,HG,RY,SG,DG,UX,FG,RG,TG,zG,p0,MG,qG,PG,kG,_G,vG,jG,BG,xG,NG,gG,fG,wG,yG,cG,pG,hG,uG,bG,lG,dG,oG,nG,mG,tG,sG,rG,aG,eG,iG,UV,OV,ZV,XV,QV,YV,$V,AV,JV,GV="buffer",VV=(Q)=>{return crypto.getRandomValues(Q)},EV=()=>{return crypto.randomUUID()},IV,LV,KV;var jU=HO(()=>{bA=Object.create,{getPrototypeOf:lA,defineProperty:mQ,getOwnPropertyNames:dA}=Object,oA=Object.prototype.hasOwnProperty,UZ=A0((Q,$)=>{$.exports=(jU(),h0(vU)).randomBytes}),OZ=A0((Q,$)=>{$.exports=(jU(),h0(vU)).createHash}),sQ=A0((Q,$)=>{$.exports=(jU(),h0(vU)).createHmac}),mA=A0((Q,$)=>{$.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"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:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"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:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),OX=A0((Q,$)=>{var V=isFinite,W=Math.pow(2,30)-1;$.exports=function(C,D){if(typeof C!=="number")throw TypeError("Iterations not a number");if(C<0||!V(C))throw TypeError("Bad iterations");if(typeof D!=="number")throw TypeError("Key length not a number");if(D<0||D>W||D!==D)throw TypeError("Bad key length")}}),ZX=A0((Q,$)=>{var V;if(globalThis.process&&globalThis.process.browser)V="utf-8";else if(globalThis.process&&globalThis.process.version)W=parseInt(process.version.split(".")[0].slice(1),10),V=W>=6?"utf-8":"binary";else V="utf-8";var W;$.exports=V}),MU=A0((Q,$)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=(HU(),h0(WU)),W=V.Buffer;function C(A,z){for(var M in A)z[M]=A[M]}if(W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow)$.exports=V;else C(V,Q),Q.Buffer=D;function D(A,z,M){return W(A,z,M)}D.prototype=Object.create(W.prototype),C(W,D),D.from=function(A,z,M){if(typeof A==="number")throw TypeError("Argument must not be a number");return W(A,z,M)},D.alloc=function(A,z,M){if(typeof A!=="number")throw TypeError("Argument must be a number");var F=W(A);if(z!==void 0)if(typeof M==="string")F.fill(z,M);else F.fill(z);else F.fill(0);return F},D.allocUnsafe=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return W(A)},D.allocUnsafeSlow=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return V.SlowBuffer(A)}}),tA=A0((Q,$)=>{var V={}.toString;$.exports=Array.isArray||function(W){return V.call(W)=="[object Array]"}}),vO=A0((Q,$)=>{$.exports=TypeError}),rQ=A0((Q,$)=>{$.exports=Object}),sA=A0((Q,$)=>{$.exports=Error}),rA=A0((Q,$)=>{$.exports=EvalError}),aA=A0((Q,$)=>{$.exports=RangeError}),eA=A0((Q,$)=>{$.exports=ReferenceError}),aQ=A0((Q,$)=>{$.exports=SyntaxError}),iA=A0((Q,$)=>{$.exports=URIError}),UJ=A0((Q,$)=>{$.exports=Math.abs}),OJ=A0((Q,$)=>{$.exports=Math.floor}),ZJ=A0((Q,$)=>{$.exports=Math.max}),XJ=A0((Q,$)=>{$.exports=Math.min}),QJ=A0((Q,$)=>{$.exports=Math.pow}),YJ=A0((Q,$)=>{$.exports=Math.round}),$J=A0((Q,$)=>{$.exports=Number.isNaN||function(V){return V!==V}}),AJ=A0((Q,$)=>{var V=$J();$.exports=function(W){if(V(W)||W===0)return W;return W<0?-1:1}}),JJ=A0((Q,$)=>{$.exports=Object.getOwnPropertyDescriptor}),jO=A0((Q,$)=>{var V=JJ();if(V)try{V([],"length")}catch(W){V=null}$.exports=V}),ZZ=A0((Q,$)=>{var V=Object.defineProperty||!1;if(V)try{V({},"a",{value:1})}catch(W){V=!1}$.exports=V}),eQ=A0((Q,$)=>{$.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var V={},W=Symbol("test"),C=Object(W);if(typeof W==="string")return!1;if(Object.prototype.toString.call(W)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(C)!=="[object Symbol]")return!1;var D=42;V[W]=D;for(var A in V)return!1;if(typeof Object.keys==="function"&&Object.keys(V).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(V).length!==0)return!1;var z=Object.getOwnPropertySymbols(V);if(z.length!==1||z[0]!==W)return!1;if(!Object.prototype.propertyIsEnumerable.call(V,W))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var M=Object.getOwnPropertyDescriptor(V,W);if(M.value!==D||M.enumerable!==!0)return!1}return!0}}),GJ=A0((Q,$)=>{var V=typeof Symbol<"u"&&Symbol,W=eQ();$.exports=function(){if(typeof V!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof V("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return W()}}),iQ=A0((Q,$)=>{$.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),UY=A0((Q,$)=>{var V=rQ();$.exports=V.getPrototypeOf||null}),VJ=A0((Q,$)=>{var V="Function.prototype.bind called on incompatible ",W=Object.prototype.toString,C=Math.max,D="[object Function]",A=function(F,R){var K=[];for(var H=0;H<F.length;H+=1)K[H]=F[H];for(var q=0;q<R.length;q+=1)K[q+F.length]=R[q];return K},z=function(F,R){var K=[];for(var H=R||0,q=0;H<F.length;H+=1,q+=1)K[q]=F[H];return K},M=function(F,R){var K="";for(var H=0;H<F.length;H+=1)if(K+=F[H],H+1<F.length)K+=R;return K};$.exports=function(F){var R=this;if(typeof R!=="function"||W.apply(R)!==D)throw TypeError(V+R);var K=z(arguments,1),H,q=function(){if(this instanceof H){var j=R.apply(this,A(K,arguments));if(Object(j)===j)return j;return this}return R.apply(F,A(K,arguments))},P=C(0,R.length-K.length),_=[];for(var k=0;k<P;k++)_[k]="$"+k;if(H=Function("binder","return function ("+M(_,",")+"){ return binder.apply(this,arguments); }")(q),R.prototype){var B=function(){};B.prototype=R.prototype,H.prototype=new B,B.prototype=null}return H}}),BO=A0((Q,$)=>{var V=VJ();$.exports=Function.prototype.bind||V}),XX=A0((Q,$)=>{$.exports=Function.prototype.call}),QX=A0((Q,$)=>{$.exports=Function.prototype.apply}),EJ=A0((Q,$)=>{$.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),OY=A0((Q,$)=>{var V=BO(),W=QX(),C=XX(),D=EJ();$.exports=D||V.call(C,W)}),YX=A0((Q,$)=>{var V=BO(),W=vO(),C=XX(),D=OY();$.exports=function(A){if(A.length<1||typeof A[0]!=="function")throw new W("a function is required");return D(V,C,A)}}),IJ=A0((Q,$)=>{var V=YX(),W=jO(),C;try{C=[].__proto__===Array.prototype}catch(M){if(!M||typeof M!=="object"||!("code"in M)||M.code!=="ERR_PROTO_ACCESS")throw M}var D=!!C&&W&&W(Object.prototype,"__proto__"),A=Object,z=A.getPrototypeOf;$.exports=D&&typeof D.get==="function"?V([D.get]):typeof z==="function"?function(M){return z(M==null?M:A(M))}:!1}),ZY=A0((Q,$)=>{var V=iQ(),W=UY(),C=IJ();$.exports=V?function(D){return V(D)}:W?function(D){if(!D||typeof D!=="object"&&typeof D!=="function")throw TypeError("getProto: not an object");return W(D)}:C?function(D){return C(D)}:null}),CJ=A0((Q,$)=>{var V=Function.prototype.call,W=Object.prototype.hasOwnProperty,C=BO();$.exports=C.call(V,W)}),XY=A0((Q,$)=>{var V,W=rQ(),C=sA(),D=rA(),A=aA(),z=eA(),M=aQ(),F=vO(),R=iA(),K=UJ(),H=OJ(),q=ZJ(),P=XJ(),_=QJ(),k=YJ(),B=AJ(),j=Function,x=function(X0){try{return j('"use strict"; return ('+X0+").constructor;")()}catch(m){}},f=jO(),w=ZZ(),d=function(){throw new F},Y0=f?function(){try{return arguments.callee,d}catch(X0){try{return f(arguments,"callee").get}catch(m){return d}}}():d,J0=GJ()(),$0=ZY(),u=UY(),O0=iQ(),U=QX(),X=XX(),J={},Z=typeof Uint8Array>"u"||!$0?V:$0(Uint8Array),Y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?V:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?V:ArrayBuffer,"%ArrayIteratorPrototype%":J0&&$0?$0([][Symbol.iterator]()):V,"%AsyncFromSyncIteratorPrototype%":V,"%AsyncFunction%":J,"%AsyncGenerator%":J,"%AsyncGeneratorFunction%":J,"%AsyncIteratorPrototype%":J,"%Atomics%":typeof Atomics>"u"?V:Atomics,"%BigInt%":typeof BigInt>"u"?V:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?V:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?V:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?V:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":C,"%eval%":eval,"%EvalError%":D,"%Float16Array%":typeof Float16Array>"u"?V:Float16Array,"%Float32Array%":typeof Float32Array>"u"?V:Float32Array,"%Float64Array%":typeof Float64Array>"u"?V:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?V:FinalizationRegistry,"%Function%":j,"%GeneratorFunction%":J,"%Int8Array%":typeof Int8Array>"u"?V:Int8Array,"%Int16Array%":typeof Int16Array>"u"?V:Int16Array,"%Int32Array%":typeof Int32Array>"u"?V:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":J0&&$0?$0($0([][Symbol.iterator]())):V,"%JSON%":typeof JSON==="object"?JSON:V,"%Map%":typeof Map>"u"?V:Map,"%MapIteratorPrototype%":typeof Map>"u"||!J0||!$0?V:$0(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":W,"%Object.getOwnPropertyDescriptor%":f,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?V:Promise,"%Proxy%":typeof Proxy>"u"?V:Proxy,"%RangeError%":A,"%ReferenceError%":z,"%Reflect%":typeof Reflect>"u"?V:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?V:Set,"%SetIteratorPrototype%":typeof Set>"u"||!J0||!$0?V:$0(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?V:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":J0&&$0?$0(""[Symbol.iterator]()):V,"%Symbol%":J0?Symbol:V,"%SyntaxError%":M,"%ThrowTypeError%":Y0,"%TypedArray%":Z,"%TypeError%":F,"%Uint8Array%":typeof Uint8Array>"u"?V:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?V:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?V:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?V:Uint32Array,"%URIError%":R,"%WeakMap%":typeof WeakMap>"u"?V:WeakMap,"%WeakRef%":typeof WeakRef>"u"?V:WeakRef,"%WeakSet%":typeof WeakSet>"u"?V:WeakSet,"%Function.prototype.call%":X,"%Function.prototype.apply%":U,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":u,"%Math.abs%":K,"%Math.floor%":H,"%Math.max%":q,"%Math.min%":P,"%Math.pow%":_,"%Math.round%":k,"%Math.sign%":B,"%Reflect.getPrototypeOf%":O0};if($0)try{null.error}catch(X0){I=$0($0(X0)),Y["%Error.prototype%"]=I}var I,L=function X0(m){var i;if(m==="%AsyncFunction%")i=x("async function () {}");else if(m==="%GeneratorFunction%")i=x("function* () {}");else if(m==="%AsyncGeneratorFunction%")i=x("async function* () {}");else if(m==="%AsyncGenerator%"){var g0=X0("%AsyncGeneratorFunction%");if(g0)i=g0.prototype}else if(m==="%AsyncIteratorPrototype%"){var y=X0("%AsyncGenerator%");if(y&&$0)i=$0(y.prototype)}return Y[m]=i,i},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=BO(),E=CJ(),T=O.call(X,Array.prototype.concat),S=O.call(U,Array.prototype.splice),v=O.call(X,String.prototype.replace),g=O.call(X,String.prototype.slice),p=O.call(X,RegExp.prototype.exec),n=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V0=/\\(\\)?/g,r=function(X0){var m=g(X0,0,1),i=g(X0,-1);if(m==="%"&&i!=="%")throw new M("invalid intrinsic syntax, expected closing `%`");else if(i==="%"&&m!=="%")throw new M("invalid intrinsic syntax, expected opening `%`");var g0=[];return v(X0,n,function(y,h,Q0,s){g0[g0.length]=Q0?v(s,V0,"$1"):h||y}),g0},l=function(X0,m){var i=X0,g0;if(E(G,i))g0=G[i],i="%"+g0[0]+"%";if(E(Y,i)){var y=Y[i];if(y===J)y=L(i);if(typeof y>"u"&&!m)throw new F("intrinsic "+X0+" exists, but is not available. Please file an issue!");return{alias:g0,name:i,value:y}}throw new M("intrinsic "+X0+" does not exist!")};$.exports=function(X0,m){if(typeof X0!=="string"||X0.length===0)throw new F("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof m!=="boolean")throw new F('"allowMissing" argument must be a boolean');if(p(/^%?[^%]*%?$/,X0)===null)throw new M("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=r(X0),g0=i.length>0?i[0]:"",y=l("%"+g0+"%",m),h=y.name,Q0=y.value,s=!1,e=y.alias;if(e)g0=e[0],S(i,T([0,1],e));for(var F0=1,c=!0;F0<i.length;F0+=1){var o=i[F0],N0=g(o,0,1),t=g(o,-1);if((N0==='"'||N0==="'"||N0==="`"||(t==='"'||t==="'"||t==="`"))&&N0!==t)throw new M("property names with quotes must have matching quotes");if(o==="constructor"||!c)s=!0;if(g0+="."+o,h="%"+g0+"%",E(Y,h))Q0=Y[h];else if(Q0!=null){if(!(o in Q0)){if(!m)throw new F("base intrinsic for "+X0+" exists, but the property is not available.");return}if(f&&F0+1>=i.length){var Z0=f(Q0,o);if(c=!!Z0,c&&"get"in Z0&&!("originalValue"in Z0.get))Q0=Z0.get;else Q0=Q0[o]}else c=E(Q0,o),Q0=Q0[o];if(c&&!s)Y[h]=Q0}}return Q0}}),QY=A0((Q,$)=>{var V=XY(),W=YX(),C=W([V("%String.prototype.indexOf%")]);$.exports=function(D,A){var z=V(D,!!A);if(typeof z==="function"&&C(D,".prototype.")>-1)return W([z]);return z}}),LJ=A0((Q,$)=>{var V=Function.prototype.toString,W=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,C,D;if(typeof W==="function"&&typeof Object.defineProperty==="function")try{C=Object.defineProperty({},"length",{get:function(){throw D}}),D={},W(function(){throw 42},null,C)}catch(f){if(f!==D)W=null}else W=null;var A=/^\s*class\b/,z=function(f){try{var w=V.call(f);return A.test(w)}catch(d){return!1}},M=function(f){try{if(z(f))return!1;return V.call(f),!0}catch(w){return!1}},F=Object.prototype.toString,R="[object Object]",K="[object Function]",H="[object GeneratorFunction]",q="[object HTMLAllCollection]",P="[object HTML document.all class]",_="[object HTMLCollection]",k=typeof Symbol==="function"&&!!Symbol.toStringTag,B=!(0 in[,]),j=function(){return!1};if(typeof document==="object"){if(x=document.all,F.call(x)===F.call(document.all))j=function(f){if((B||!f)&&(typeof f>"u"||typeof f==="object"))try{var w=F.call(f);return(w===q||w===P||w===_||w===R)&&f("")==null}catch(d){}return!1}}var x;$.exports=W?function(f){if(j(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;try{W(f,null,C)}catch(w){if(w!==D)return!1}return!z(f)&&M(f)}:function(f){if(j(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;if(k)return M(f);if(z(f))return!1;var w=F.call(f);if(w!==K&&w!==H&&!/^\[object HTML/.test(w))return!1;return M(f)}}),KJ=A0((Q,$)=>{var V=LJ(),W=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=function(F,R,K){for(var H=0,q=F.length;H<q;H++)if(C.call(F,H))if(K==null)R(F[H],H,F);else R.call(K,F[H],H,F)},A=function(F,R,K){for(var H=0,q=F.length;H<q;H++)if(K==null)R(F.charAt(H),H,F);else R.call(K,F.charAt(H),H,F)},z=function(F,R,K){for(var H in F)if(C.call(F,H))if(K==null)R(F[H],H,F);else R.call(K,F[H],H,F)};function M(F){return W.call(F)==="[object Array]"}$.exports=function(F,R,K){if(!V(R))throw TypeError("iterator must be a function");var H;if(arguments.length>=3)H=K;if(M(F))D(F,R,H);else if(typeof F==="string")A(F,R,H);else z(F,R,H)}}),WJ=A0((Q,$)=>{$.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),HJ=A0((Q,$)=>{var V=WJ(),W=typeof globalThis>"u"?globalThis:globalThis;$.exports=function(){var C=[];for(var D=0;D<V.length;D++)if(typeof W[V[D]]==="function")C[C.length]=V[D];return C}}),SJ=A0((Q,$)=>{var V=ZZ(),W=aQ(),C=vO(),D=jO();$.exports=function(A,z,M){if(!A||typeof A!=="object"&&typeof A!=="function")throw new C("`obj` must be an object or a function`");if(typeof z!=="string"&&typeof z!=="symbol")throw new C("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new C("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new C("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new C("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new C("`loose`, if provided, must be a boolean");var F=arguments.length>3?arguments[3]:null,R=arguments.length>4?arguments[4]:null,K=arguments.length>5?arguments[5]:null,H=arguments.length>6?arguments[6]:!1,q=!!D&&D(A,z);if(V)V(A,z,{configurable:K===null&&q?q.configurable:!K,enumerable:F===null&&q?q.enumerable:!F,value:M,writable:R===null&&q?q.writable:!R});else if(H||!F&&!R&&!K)A[z]=M;else throw new W("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),DJ=A0((Q,$)=>{var V=ZZ(),W=function(){return!!V};W.hasArrayLengthDefineBug=function(){if(!V)return null;try{return V([],"length",{value:1}).length!==1}catch(C){return!0}},$.exports=W}),FJ=A0((Q,$)=>{var V=XY(),W=SJ(),C=DJ()(),D=jO(),A=vO(),z=V("%Math.floor%");$.exports=function(M,F){if(typeof M!=="function")throw new A("`fn` is not a function");if(typeof F!=="number"||F<0||F>4294967295||z(F)!==F)throw new A("`length` must be a positive 32-bit integer");var R=arguments.length>2&&!!arguments[2],K=!0,H=!0;if("length"in M&&D){var q=D(M,"length");if(q&&!q.configurable)K=!1;if(q&&!q.writable)H=!1}if(K||H||!R)if(C)W(M,"length",F,!0,!0);else W(M,"length",F);return M}}),RJ=A0((Q,$)=>{var V=BO(),W=QX(),C=OY();$.exports=function(){return C(V,W,arguments)}}),TJ=A0((Q,$)=>{var V=FJ(),W=ZZ(),C=YX(),D=RJ();if($.exports=function(A){var z=C(arguments),M=A.length-(arguments.length-1);return V(z,1+(M>0?M:0),!0)},W)W($.exports,"apply",{value:D});else $.exports.apply=D}),zJ=A0((Q,$)=>{var V=eQ();$.exports=function(){return V()&&!!Symbol.toStringTag}}),MJ=A0((Q,$)=>{var V=KJ(),W=HJ(),C=TJ(),D=QY(),A=jO(),z=ZY(),M=D("Object.prototype.toString"),F=zJ()(),R=typeof globalThis>"u"?globalThis:globalThis,K=W(),H=D("String.prototype.slice"),q=D("Array.prototype.indexOf",!0)||function(B,j){for(var x=0;x<B.length;x+=1)if(B[x]===j)return x;return-1},P={__proto__:null};if(F&&A&&z)V(K,function(B){var j=new R[B];if(Symbol.toStringTag in j&&z){var x=z(j),f=A(x,Symbol.toStringTag);if(!f&&x){var w=z(x);f=A(w,Symbol.toStringTag)}P["$"+B]=C(f.get)}});else V(K,function(B){var j=new R[B],x=j.slice||j.set;if(x)P["$"+B]=C(x)});var _=function(B){var j=!1;return V(P,function(x,f){if(!j)try{if("$"+x(B)===f)j=H(f,1)}catch(w){}}),j},k=function(B){var j=!1;return V(P,function(x,f){if(!j)try{x(B),j=H(f,1)}catch(w){}}),j};$.exports=function(B){if(!B||typeof B!=="object")return!1;if(!F){var j=H(M(B),8,-1);if(q(K,j)>-1)return j;if(j!=="Object")return!1;return k(B)}if(!A)return null;return _(B)}}),qJ=A0((Q,$)=>{var V=MJ();$.exports=function(W){return!!V(W)}}),PJ=A0((Q,$)=>{var V=vO(),W=QY(),C=W("TypedArray.prototype.buffer",!0),D=qJ();$.exports=C||function(A){if(!D(A))throw new V("Not a Typed Array");return A.buffer}}),kJ=A0((Q,$)=>{var V=MU().Buffer,W=tA(),C=PJ(),D=ArrayBuffer.isView||function(F){try{return C(F),!0}catch(R){return!1}},A=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",M=z&&(V.prototype instanceof Uint8Array||V.TYPED_ARRAY_SUPPORT);$.exports=function(F,R){if(V.isBuffer(F)){if(F.constructor&&!("isBuffer"in F))return V.from(F);return F}if(typeof F==="string")return V.from(F,R);if(z&&D(F)){if(F.byteLength===0)return V.alloc(0);if(M){var K=V.from(F.buffer,F.byteOffset,F.byteLength);if(K.byteLength===F.byteLength)return K}var H=F instanceof Uint8Array?F:new Uint8Array(F.buffer,F.byteOffset,F.byteLength),q=V.from(H);if(q.length===F.byteLength)return q}if(A&&F instanceof Uint8Array)return V.from(F);var P=W(F);if(P)for(var _=0;_<F.length;_+=1){var k=F[_];if(typeof k!=="number"||k<0||k>255||~~k!==k)throw RangeError("Array items must be numbers in the range 0-255.")}if(P||V.isBuffer(F)&&F.constructor&&typeof F.constructor.isBuffer==="function"&&F.constructor.isBuffer(F))return V.from(F);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),$X=A0((Q,$)=>{var V=MU().Buffer,W=kJ(),C=typeof Uint8Array<"u",D=C&&typeof ArrayBuffer<"u",A=D&&ArrayBuffer.isView;$.exports=function(z,M,F){if(typeof z==="string"||V.isBuffer(z)||C&&z instanceof Uint8Array||A&&A(z))return W(z,M);throw TypeError(F+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),YY=A0((Q,$)=>{var V={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},W={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},C=sQ(),D=MU().Buffer,A=OX(),z=ZX(),M=$X();function F(R,K,H,q,P){A(H,q),R=M(R,z,"Password"),K=M(K,z,"Salt");var _=(P||"sha1").toLowerCase(),k=W[_]||_,B=V[k];if(typeof B!=="number"||!B)throw TypeError("Digest algorithm not supported: "+P);var j=D.allocUnsafe(q),x=D.allocUnsafe(K.length+4);K.copy(x,0,0,K.length);var f=0,w=B,d=Math.ceil(q/w);for(var Y0=1;Y0<=d;Y0++){x.writeUInt32BE(Y0,K.length);var J0=C(k,R).update(x).digest(),$0=J0;for(var u=1;u<H;u++){$0=C(k,R).update($0).digest();for(var O0=0;O0<w;O0++)J0[O0]^=$0[O0]}J0.copy(j,f),f+=w}return j}$.exports=F}),_J=A0((Q,$)=>{var V=MU().Buffer,W=OX(),C=ZX(),D=YY(),A=$X(),z,M=globalThis.crypto&&globalThis.crypto.subtle,F={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"},R=[],K;function H(){if(K)return K;if(globalThis.process&&globalThis.process.nextTick)K=globalThis.process.nextTick;else if(globalThis.queueMicrotask)K=globalThis.queueMicrotask;else if(globalThis.setImmediate)K=globalThis.setImmediate;else K=globalThis.setTimeout;return K}function q(k,B,j,x,f){return M.importKey("raw",k,{name:"PBKDF2"},!1,["deriveBits"]).then(function(w){return M.deriveBits({name:"PBKDF2",salt:B,iterations:j,hash:{name:f}},w,x<<3)}).then(function(w){return V.from(w)})}function P(k){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!M||!M.importKey||!M.deriveBits)return Promise.resolve(!1);if(R[k]!==void 0)return R[k];z=z||V.alloc(8);var B=q(z,z,10,128,k).then(function(){return!0},function(){return!1});return R[k]=B,B}function _(k,B){k.then(function(j){H()(function(){B(null,j)})},function(j){H()(function(){B(j)})})}$.exports=function(k,B,j,x,f,w){if(typeof f==="function")w=f,f=void 0;if(W(j,x),k=A(k,C,"Password"),B=A(B,C,"Salt"),typeof w!=="function")throw Error("No callback provided to pbkdf2");f=f||"sha1";var d=F[f.toLowerCase()];if(!d||typeof globalThis.Promise!=="function"){H()(function(){var Y0;try{Y0=D(k,B,j,x,f)}catch(J0){w(J0);return}w(null,Y0)});return}_(P(d).then(function(Y0){if(Y0)return q(k,B,j,x,d);return D(k,B,j,x,f)}),w)}}),$Y=A0((Q)=>{var $=(jU(),h0(vU)),V=OX(),W=ZX(),C=$X();function D(z,M,F,R,K,H){if(V(F,R),z=C(z,W,"Password"),M=C(M,W,"Salt"),typeof K==="function")H=K,K="sha1";if(typeof H!=="function")throw Error("No callback provided to pbkdf2");return $.pbkdf2(z,M,F,R,K,H)}function A(z,M,F,R,K){return V(F,R),z=C(z,W,"Password"),M=C(M,W,"Salt"),K=K||"sha1",$.pbkdf2Sync(z,M,F,R,K)}if(!$.pbkdf2Sync||$.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)Q.pbkdf2Sync=YY(),Q.pbkdf2=_J();else Q.pbkdf2Sync=A,Q.pbkdf2=D}),vJ=A0((Q)=>{var $=(jU(),h0(vU));Q.createCipher=Q.Cipher=$.createCipher,Q.createCipheriv=Q.Cipheriv=$.createCipheriv,Q.createDecipher=Q.Decipher=$.createDecipher,Q.createDecipheriv=Q.Decipheriv=$.createDecipheriv,Q.listCiphers=Q.getCiphers=$.getCiphers}),jJ=A0((Q)=>{var $=(jU(),h0(vU));Q.DiffieHellmanGroup=$.DiffieHellmanGroup,Q.createDiffieHellmanGroup=$.createDiffieHellmanGroup,Q.getDiffieHellman=$.getDiffieHellman,Q.createDiffieHellman=$.createDiffieHellman,Q.DiffieHellman=$.DiffieHellman}),BJ=A0((Q)=>{var $=(jU(),h0(vU));Q.createSign=$.createSign,Q.Sign=$.Sign,Q.createVerify=$.createVerify,Q.Verify=$.Verify}),xJ=A0((Q,$)=>{$.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{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/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{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"},dependencies:{"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"}}}),tU=A0((Q,$)=>{(function(V,W){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function D(U,X){U.super_=X;var J=function(){};J.prototype=X.prototype,U.prototype=new J,U.prototype.constructor=U}function A(U,X,J){if(A.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")J=X,X=10;this._init(U||0,X||10,J||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(U){}A.isBN=function(U){if(U instanceof A)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===A.wordSize&&Array.isArray(U.words)},A.max=function(U,X){if(U.cmp(X)>0)return U;return X},A.min=function(U,X){if(U.cmp(X)<0)return U;return X},A.prototype._init=function(U,X,J){if(typeof U==="number")return this._initNumber(U,X,J);if(typeof U==="object")return this._initArray(U,X,J);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,J);else if(this._parseBase(U,X,Z),J==="le")this._initArray(this.toArray(),X,J)}},A.prototype._initNumber=function(U,X,J){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(J!=="le")return;this._initArray(this.toArray(),X,J)},A.prototype._initArray=function(U,X,J){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,I,L=0;if(J==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=I<<L&67108863,this.words[Y+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,Y++}else if(J==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=I<<L&67108863,this.words[Y+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,Y++}return this.strip()};function M(U,X){var J=U.charCodeAt(X);if(J>=65&&J<=70)return J-55;else if(J>=97&&J<=102)return J-87;else return J-48&15}function F(U,X,J){var Z=M(U,J);if(J-1>=X)Z|=M(U,J-1)<<4;return Z}A.prototype._parseHex=function(U,X,J){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,I=0,L;if(J==="be")for(Z=U.length-1;Z>=X;Z-=2)if(L=F(U,X,Z)<<Y,this.words[I]|=L&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=L>>>26;else Y+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(L=F(U,X,Z)<<Y,this.words[I]|=L&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=L>>>26;else Y+=8}this.strip()};function R(U,X,J,Z){var Y=0,I=Math.min(U.length,J);for(var L=X;L<I;L++){var G=U.charCodeAt(L)-48;if(Y*=Z,G>=49)Y+=G-49+10;else if(G>=17)Y+=G-17+10;else Y+=G}return Y}A.prototype._parseBase=function(U,X,J){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var I=U.length-J,L=I%Z,G=Math.min(I,I-L)+J,O=0;for(var E=J;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(L!==0){var T=1;O=R(U,E,U.length,X);for(E=0;E<L;E++)T*=X;if(this.imuln(T),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},A.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},A.prototype.clone=function(){var U=new A(null);return this.copy(U),U},A.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},A.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},A.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var K=["","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"],H=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(U,X){U=U||10,X=X|0||1;var J;if(U===16||U==="hex"){J="";var Z=0,Y=0;for(var I=0;I<this.length;I++){var L=this.words[I],G=((L<<Z|Y)&16777215).toString(16);if(Y=L>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if(Y!==0||I!==this.length-1)J=K[6-G.length]+G+J;else J=G+J}if(Y!==0)J=Y.toString(16)+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}if(U===(U|0)&&U>=2&&U<=36){var O=H[U],E=q[U];J="";var T=this.clone();T.negative=0;while(!T.isZero()){var S=T.modn(E).toString(U);if(T=T.idivn(E),!T.isZero())J=K[O-S.length]+S+J;else J=S+J}if(this.isZero())J="0"+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},A.prototype.toJSON=function(){return this.toString(16)},A.prototype.toBuffer=function(U,X){return C(typeof z<"u"),this.toArrayLike(z,U,X)},A.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},A.prototype.toArrayLike=function(U,X,J){var Z=this.byteLength(),Y=J||Math.max(1,Z);C(Z<=Y,"byte array longer than desired length"),C(Y>0,"Requested array length <= 0"),this.strip();var I=X==="le",L=new U(Y),G,O,E=this.clone();if(!I){for(O=0;O<Y-Z;O++)L[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[Y-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[O]=G;for(;O<Y;O++)L[O]=0}return L},Math.clz32)A.prototype._countBits=function(U){return 32-Math.clz32(U)};else A.prototype._countBits=function(U){var X=U,J=0;if(X>=4096)J+=13,X>>>=13;if(X>=64)J+=7,X>>>=7;if(X>=8)J+=4,X>>>=4;if(X>=2)J+=2,X>>>=2;return J+X};A.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,J=0;if((X&8191)===0)J+=13,X>>>=13;if((X&127)===0)J+=7,X>>>=7;if((X&15)===0)J+=4,X>>>=4;if((X&3)===0)J+=2,X>>>=2;if((X&1)===0)J++;return J},A.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var J=0;J<X.length;J++){var Z=J/26|0,Y=J%26;X[J]=(U.words[Z]&1<<Y)>>>Y}return X}A.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var J=this._zeroBits(this.words[X]);if(U+=J,J!==26)break}return U},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},A.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},A.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},A.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},A.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},A.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var J=0;J<X.length;J++)this.words[J]=this.words[J]&U.words[J];return this.length=X.length,this.strip()},A.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},A.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},A.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},A.prototype.iuxor=function(U){var X,J;if(this.length>U.length)X=this,J=U;else X=U,J=this;for(var Z=0;Z<J.length;Z++)this.words[Z]=X.words[Z]^J.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},A.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},A.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},A.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},A.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,J=U%26;if(this._expand(X),J>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(J>0)this.words[Z]=~this.words[Z]&67108863>>26-J;return this.strip()},A.prototype.notn=function(U){return this.clone().inotn(U)},A.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var J=U/26|0,Z=U%26;if(this._expand(J+1),X)this.words[J]=this.words[J]|1<<Z;else this.words[J]=this.words[J]&~(1<<Z);return this.strip()},A.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var J,Z;if(this.length>U.length)J=this,Z=U;else J=U,Z=this;var Y=0;for(var I=0;I<Z.length;I++)X=(J.words[I]|0)+(Z.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;for(;Y!==0&&I<J.length;I++)X=(J.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;if(this.length=J.length,Y!==0)this.words[this.length]=Y,this.length++;else if(J!==this)for(;I<J.length;I++)this.words[I]=J.words[I];return this},A.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},A.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var J=this.cmp(U);if(J===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if(J>0)Z=this,Y=U;else Z=U,Y=this;var I=0;for(var L=0;L<Y.length;L++)X=(Z.words[L]|0)-(Y.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;for(;I!==0&&L<Z.length;L++)X=(Z.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;if(I===0&&L<Z.length&&Z!==this)for(;L<Z.length;L++)this.words[L]=Z.words[L];if(this.length=Math.max(this.length,L),Z!==this)this.negative=1;return this.strip()},A.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,J){J.negative=X.negative^U.negative;var Z=U.length+X.length|0;J.length=Z,Z=Z-1|0;var Y=U.words[0]|0,I=X.words[0]|0,L=Y*I,G=L&67108863,O=L/67108864|0;J.words[0]=G;for(var E=1;E<Z;E++){var T=O>>>26,S=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;Y=U.words[p]|0,I=X.words[g]|0,L=Y*I+S,T+=L/67108864|0,S=L&67108863}J.words[E]=S|0,O=T|0}if(O!==0)J.words[E]=O|0;else J.length--;return J.strip()}var k=function(U,X,J){var Z=U.words,Y=X.words,I=J.words,L=0,G,O,E,T=Z[0]|0,S=T&8191,v=T>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,s=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,t=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,L0=w0>>>13,t0=Z[9]|0,E0=t0&8191,K0=t0>>>13,e0=Y[0]|0,S0=e0&8191,H0=e0>>>13,FU=Y[1]|0,R0=FU&8191,k0=FU>>>13,RU=Y[2]|0,_0=RU&8191,T0=RU>>>13,SU=Y[3]|0,v0=SU&8191,z0=SU>>>13,CU=Y[4]|0,j0=CU&8191,B0=CU>>>13,LU=Y[5]|0,M0=LU&8191,N=LU>>>13,b=Y[6]|0,a=b&8191,U0=b>>>13,f0=Y[7]|0,I0=f0&8191,W0=f0>>>13,s0=Y[8]|0,q0=s0&8191,x0=s0>>>13,DU=Y[9]|0,P0=DU&8191,D0=DU>>>13;J.negative=U.negative^X.negative,J.length=19,G=Math.imul(S,S0),O=Math.imul(S,H0),O=O+Math.imul(v,S0)|0,E=Math.imul(v,H0);var r0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,S0),O=Math.imul(p,H0),O=O+Math.imul(n,S0)|0,E=Math.imul(n,H0),G=G+Math.imul(S,R0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,S0),O=Math.imul(r,H0),O=O+Math.imul(l,S0)|0,E=Math.imul(l,H0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(S,_0)|0,O=O+Math.imul(S,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,S0),O=Math.imul(m,H0),O=O+Math.imul(i,S0)|0,E=Math.imul(i,H0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(S,v0)|0,O=O+Math.imul(S,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,S0),O=Math.imul(y,H0),O=O+Math.imul(h,S0)|0,E=Math.imul(h,H0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(S,j0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(s,S0),O=Math.imul(s,H0),O=O+Math.imul(e,S0)|0,E=Math.imul(e,H0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(S,M0)|0,O=O+Math.imul(S,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,S0),O=Math.imul(c,H0),O=O+Math.imul(o,S0)|0,E=Math.imul(o,H0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(S,a)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(t,S0),O=Math.imul(t,H0),O=O+Math.imul(Z0,S0)|0,E=Math.imul(Z0,H0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(S,I0)|0,O=O+Math.imul(S,W0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,W0)|0;var OU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,S0),O=Math.imul(C0,H0),O=O+Math.imul(L0,S0)|0,E=Math.imul(L0,H0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,W0)|0,G=G+Math.imul(S,q0)|0,O=O+Math.imul(S,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,S0),O=Math.imul(E0,H0),O=O+Math.imul(K0,S0)|0,E=Math.imul(K0,H0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(L0,R0)|0,E=E+Math.imul(L0,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,W0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(S,P0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,D0)|0;var XU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(K0,R0)|0,E=Math.imul(K0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(L0,_0)|0,E=E+Math.imul(L0,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,W0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,D0)|0;var QU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(K0,_0)|0,E=Math.imul(K0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(L0,v0)|0,E=E+Math.imul(L0,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,W0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,D0)|0;var YU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(K0,v0)|0,E=Math.imul(K0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(L0,j0)|0,E=E+Math.imul(L0,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,W0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,D0)|0;var $U=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(K0,j0)|0,E=Math.imul(K0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(L0,M0)|0,E=E+Math.imul(L0,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,W0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,D0)|0;var AU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(K0,M0)|0,E=Math.imul(K0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(L0,a)|0,E=E+Math.imul(L0,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,W0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,D0)|0;var JU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(K0,a)|0,E=Math.imul(K0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,W0)|0,O=O+Math.imul(L0,I0)|0,E=E+Math.imul(L0,W0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,D0)|0;var GU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,W0),O=O+Math.imul(K0,I0)|0,E=Math.imul(K0,W0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(L0,q0)|0,E=E+Math.imul(L0,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,D0)|0;var VU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(K0,q0)|0,E=Math.imul(K0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,D0)|0,O=O+Math.imul(L0,P0)|0,E=E+Math.imul(L0,D0)|0;var EU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,D0),O=O+Math.imul(K0,P0)|0,E=Math.imul(K0,D0);var IU=(L+G|0)+((O&8191)<<13)|0;if(L=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=$U,I[13]=AU,I[14]=JU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,L!==0)I[19]=L,J.length++;return J};if(!Math.imul)k=_;function B(U,X,J){J.negative=X.negative^U.negative,J.length=U.length+X.length;var Z=0,Y=0;for(var I=0;I<J.length-1;I++){var L=Y;Y=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var T=I-E,S=U.words[T]|0,v=X.words[E]|0,g=S*v,p=g&67108863;L=L+(g/67108864|0)|0,p=p+G|0,G=p&67108863,L=L+(p>>>26)|0,Y+=L>>>26,L&=67108863}J.words[I]=G,Z=L,L=Y}if(Z!==0)J.words[I]=Z;else J.length--;return J.strip()}function j(U,X,J){var Z=new x;return Z.mulp(U,X,J)}A.prototype.mulTo=function(U,X){var J,Z=this.length+U.length;if(this.length===10&&U.length===10)J=k(this,U,X);else if(Z<63)J=_(this,U,X);else if(Z<1024)J=B(this,U,X);else J=j(this,U,X);return J};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),J=A.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,J,U);return X},x.prototype.revBin=function(U,X,J){if(U===0||U===J-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},x.prototype.permute=function(U,X,J,Z,Y,I){for(var L=0;L<I;L++)Z[L]=X[U[L]],Y[L]=J[U[L]]},x.prototype.transform=function(U,X,J,Z,Y,I){this.permute(I,U,X,J,Z,Y);for(var L=1;L<Y;L<<=1){var G=L<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var T=0;T<Y;T+=G){var S=O,v=E;for(var g=0;g<L;g++){var p=J[T+g],n=Z[T+g],V0=J[T+g+L],r=Z[T+g+L],l=S*V0-v*r;if(r=S*r+v*V0,V0=l,J[T+g]=p+V0,Z[T+g]=n+r,J[T+g+L]=p-V0,Z[T+g+L]=n-r,g!==G)l=O*S-E*v,v=O*v+E*S,S=l}}}},x.prototype.guessLen13b=function(U,X){var J=Math.max(X,U)|1,Z=J&1,Y=0;for(J=J/2|0;J;J=J>>>1)Y++;return 1<<Y+1+Z},x.prototype.conjugate=function(U,X,J){if(J<=1)return;for(var Z=0;Z<J/2;Z++){var Y=U[Z];U[Z]=U[J-Z-1],U[J-Z-1]=Y,Y=X[Z],X[Z]=-X[J-Z-1],X[J-Z-1]=-Y}},x.prototype.normalize13b=function(U,X){var J=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+J;if(U[Z]=Y&67108863,Y<67108864)J=0;else J=Y/67108864|0}return U},x.prototype.convert13b=function(U,X,J,Z){var Y=0;for(var I=0;I<X;I++)Y=Y+(U[I]|0),J[2*I]=Y&8191,Y=Y>>>13,J[2*I+1]=Y&8191,Y=Y>>>13;for(I=2*X;I<Z;++I)J[I]=0;C(Y===0),C((Y&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var J=0;J<U;J++)X[J]=0;return X},x.prototype.mulp=function(U,X,J){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),I=this.stub(Z),L=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),T=Array(Z),S=Array(Z),v=J.words;v.length=Z,this.convert13b(U.words,U.length,L,Z),this.convert13b(X.words,X.length,E,Z),this.transform(L,I,G,O,Z,Y),this.transform(E,I,T,S,Z,Y);for(var g=0;g<Z;g++){var p=G[g]*T[g]-O[g]*S[g];O[g]=G[g]*S[g]+O[g]*T[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,Y),this.conjugate(v,I,Z),this.normalize13b(v,Z),J.negative=U.negative^X.negative,J.length=U.length+X.length,J.strip()},A.prototype.mul=function(U){var X=new A(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},A.prototype.mulf=function(U){var X=new A(null);return X.words=Array(this.length+U.length),j(this,U,X)},A.prototype.imul=function(U){return this.clone().mulTo(U,this)},A.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var J=0;J<this.length;J++){var Z=(this.words[J]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[J]=Y&67108863}if(X!==0)this.words[J]=X,this.length++;return this.length=U===0?1:this.length,this},A.prototype.muln=function(U){return this.clone().imuln(U)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(U){var X=P(U);if(X.length===0)return new A(1);var J=this;for(var Z=0;Z<X.length;Z++,J=J.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=J.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;J=J.mul(Y)}return J},A.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var I=0;for(Y=0;Y<this.length;Y++){var L=this.words[Y]&Z,G=(this.words[Y]|0)-L<<X;this.words[Y]=G|I,I=L>>>26-X}if(I)this.words[Y]=I,this.length++}if(J!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+J]=this.words[Y];for(Y=0;Y<J;Y++)this.words[Y]=0;this.length+=J}return this.strip()},A.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},A.prototype.iushrn=function(U,X,J){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,I=Math.min((U-Y)/26,this.length),L=67108863^67108863>>>Y<<Y,G=J;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var T=this.words[O]|0;this.words[O]=E<<26-Y|T>>>Y,E=T&L}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},A.prototype.ishrn=function(U,X,J){return C(this.negative===0),this.iushrn(U,X,J)},A.prototype.shln=function(U){return this.clone().ishln(U)},A.prototype.ushln=function(U){return this.clone().iushln(U)},A.prototype.shrn=function(U){return this.clone().ishrn(U)},A.prototype.ushrn=function(U){return this.clone().iushrn(U)},A.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return!1;var Y=this.words[J];return!!(Y&Z)},A.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=J)return this;if(X!==0)J++;if(this.length=Math.min(J,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},A.prototype.maskn=function(U){return this.clone().imaskn(U)},A.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},A.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},A.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},A.prototype.addn=function(U){return this.clone().iaddn(U)},A.prototype.subn=function(U){return this.clone().isubn(U)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(U,X,J){var Z=U.length+J,Y;this._expand(Z);var I,L=0;for(Y=0;Y<U.length;Y++){I=(this.words[Y+J]|0)+L;var G=(U.words[Y]|0)*X;I-=G&67108863,L=(I>>26)-(G/67108864|0),this.words[Y+J]=I&67108863}for(;Y<this.length-J;Y++)I=(this.words[Y+J]|0)+L,L=I>>26,this.words[Y+J]=I&67108863;if(L===0)return this.strip();C(L===-1),L=0;for(Y=0;Y<this.length;Y++)I=-(this.words[Y]|0)+L,L=I>>26,this.words[Y]=I&67108863;return this.negative=1,this.strip()},A.prototype._wordDiv=function(U,X){var J=this.length-U.length,Z=this.clone(),Y=U,I=Y.words[Y.length-1]|0,L=this._countBits(I);if(J=26-L,J!==0)Y=Y.ushln(J),Z.iushln(J),I=Y.words[Y.length-1]|0;var G=Z.length-Y.length,O;if(X!=="mod"){O=new A(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var T=Z.clone()._ishlnsubmul(Y,1,G);if(T.negative===0){if(Z=T,O)O.words[G]=1}for(var S=G-1;S>=0;S--){var v=(Z.words[Y.length+S]|0)*67108864+(Z.words[Y.length+S-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul(Y,v,S);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul(Y,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&J!==0)Z.iushrn(J);return{div:O||null,mod:Z}},A.prototype.divmod=function(U,X,J){if(C(!U.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var Z,Y,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.isub(U)}return{div:I.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new A(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new A(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new A(this.modn(U.words[0]))}}return this._wordDiv(U,X)},A.prototype.div=function(U){return this.divmod(U,"div",!1).div},A.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},A.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},A.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var J=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),I=J.cmp(Z);if(I<0||Y===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},A.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,J=0;for(var Z=this.length-1;Z>=0;Z--)J=(X*J+(this.words[Z]|0))%U;return J},A.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var J=this.length-1;J>=0;J--){var Z=(this.words[J]|0)+X*67108864;this.words[J]=Z/U|0,X=Z%U}return this.strip()},A.prototype.divn=function(U){return this.clone().idivn(U)},A.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=new A(0),L=new A(1),G=0;while(X.isEven()&&J.isEven())X.iushrn(1),J.iushrn(1),++G;var O=J.clone(),E=X.clone();while(!X.isZero()){for(var T=0,S=1;(X.words[0]&S)===0&&T<26;++T,S<<=1);if(T>0){X.iushrn(T);while(T-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(E);Z.iushrn(1),Y.iushrn(1)}}for(var v=0,g=1;(J.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){J.iushrn(v);while(v-- >0){if(I.isOdd()||L.isOdd())I.iadd(O),L.isub(E);I.iushrn(1),L.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(I),Y.isub(L);else J.isub(X),I.isub(Z),L.isub(Y)}return{a:I,b:L,gcd:J.iushln(G)}},A.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=J.clone();while(X.cmpn(1)>0&&J.cmpn(1)>0){for(var L=0,G=1;(X.words[0]&G)===0&&L<26;++L,G<<=1);if(L>0){X.iushrn(L);while(L-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(J.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){J.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(I);Y.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(Y);else J.isub(X),Y.isub(Z)}var T;if(X.cmpn(1)===0)T=Z;else T=Y;if(T.cmpn(0)<0)T.iadd(U);return T},A.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),J=U.clone();X.negative=0,J.negative=0;for(var Z=0;X.isEven()&&J.isEven();Z++)X.iushrn(1),J.iushrn(1);do{while(X.isEven())X.iushrn(1);while(J.isEven())J.iushrn(1);var Y=X.cmp(J);if(Y<0){var I=X;X=J,J=I}else if(Y===0||J.cmpn(1)===0)break;X.isub(J)}while(!0);return J.iushln(Z)},A.prototype.invm=function(U){return this.egcd(U).a.umod(U)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(U){return this.words[0]&U},A.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return this._expand(J+1),this.words[J]|=Z,this;var Y=Z;for(var I=J;Y!==0&&I<this.length;I++){var L=this.words[I]|0;L+=Y,Y=L>>>26,L&=67108863,this.words[I]=L}if(Y!==0)this.words[I]=Y,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var J;if(this.length>1)J=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;J=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-J|0;return J},A.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},A.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var J=this.length-1;J>=0;J--){var Z=this.words[J]|0,Y=U.words[J]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},A.prototype.gtn=function(U){return this.cmpn(U)===1},A.prototype.gt=function(U){return this.cmp(U)===1},A.prototype.gten=function(U){return this.cmpn(U)>=0},A.prototype.gte=function(U){return this.cmp(U)>=0},A.prototype.ltn=function(U){return this.cmpn(U)===-1},A.prototype.lt=function(U){return this.cmp(U)===-1},A.prototype.lten=function(U){return this.cmpn(U)<=0},A.prototype.lte=function(U){return this.cmp(U)<=0},A.prototype.eqn=function(U){return this.cmpn(U)===0},A.prototype.eq=function(U){return this.cmp(U)===0},A.red=function(U){return new u(U)},A.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(U){return this.red=U,this},A.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},A.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},A.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},A.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},A.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},A.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},A.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},A.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new A(X,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new A(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,J;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),J=X.bitLength();while(J>this.n);var Z=J<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D(d,w),d.prototype.split=function(U,X){var J=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&J;for(Y=10;Y<U.length;Y++){var L=U.words[Y]|0;U.words[Y-10]=(L&J)<<4|I>>>22,I=L}if(I>>>=22,U.words[Y-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var J=0;J<U.length;J++){var Z=U.words[J]|0;X+=Z*977,U.words[J]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(Y0,w);function J0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(J0,w);function $0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D($0,w),$0.prototype.imulK=function(U){var X=0;for(var J=0;J<U.length;J++){var Z=(U.words[J]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[J]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},A._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new J0;else if(U==="p25519")X=new $0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=A._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var J=U.add(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var J=U.iadd(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J},u.prototype.sub=function(U,X){this._verify2(U,X);var J=U.sub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var J=U.isub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var J=this.m.add(new A(1)).iushrn(2);return this.pow(U,J)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);C(!Z.isZero());var I=new A(1).toRed(this),L=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new A(2*O*O).toRed(this);while(this.pow(O,G).cmp(L)!==0)O.redIAdd(L);var E=this.pow(O,Z),T=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),v=Y;while(S.cmp(I)!==0){var g=S;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new A(1).iushln(v-p-1));T=T.redMul(n),E=n.redSqr(),S=S.redMul(E),v=p}return T},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new A(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var J=4,Z=Array(1<<J);Z[0]=new A(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var I=Z[0],L=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var E=X.words[Y];for(var T=O-1;T>=0;T--){var S=E>>T&1;if(I!==Z[0])I=this.sqr(I);if(S===0&&L===0){G=0;continue}if(L<<=1,L|=S,G++,G!==J&&(Y!==0||T!==0))continue;I=this.mul(I,Z[L]),G=0,L=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},A.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(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)}D(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var J=U.imul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new A(0)._forceRed(this);var J=U.mul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof $>"u"||$,Q)}),OO=A0((Q,$)=>{$.exports=V;function V(W,C){if(!W)throw Error(C||"Assertion failed")}V.equal=function(W,C,D){if(W!=C)throw Error(D||"Assertion failed: "+W+" != "+C)}}),AY=A0((Q)=>{var $=Q;function V(D,A){if(Array.isArray(D))return D.slice();if(!D)return[];var z=[];if(typeof D!=="string"){for(var M=0;M<D.length;M++)z[M]=D[M]|0;return z}if(A==="hex"){if(D=D.replace(/[^a-z0-9]+/ig,""),D.length%2!==0)D="0"+D;for(var M=0;M<D.length;M+=2)z.push(parseInt(D[M]+D[M+1],16))}else for(var M=0;M<D.length;M++){var F=D.charCodeAt(M),R=F>>8,K=F&255;if(R)z.push(R,K);else z.push(K)}return z}$.toArray=V;function W(D){if(D.length===1)return"0"+D;else return D}$.zero2=W;function C(D){var A="";for(var z=0;z<D.length;z++)A+=W(D[z].toString(16));return A}$.toHex=C,$.encode=function(D,A){if(A==="hex")return C(D);else return D}}),yU=A0((Q)=>{var $=Q,V=tU(),W=OO(),C=AY();$.assert=W,$.toArray=C.toArray,$.zero2=C.zero2,$.toHex=C.toHex,$.encode=C.encode;function D(R,K,H){var q=Array(Math.max(R.bitLength(),H)+1),P;for(P=0;P<q.length;P+=1)q[P]=0;var _=1<<K+1,k=R.clone();for(P=0;P<q.length;P++){var B,j=k.andln(_-1);if(k.isOdd()){if(j>(_>>1)-1)B=(_>>1)-j;else B=j;k.isubn(B)}else B=0;q[P]=B,k.iushrn(1)}return q}$.getNAF=D;function A(R,K){var H=[[],[]];R=R.clone(),K=K.clone();var q=0,P=0,_;while(R.cmpn(-q)>0||K.cmpn(-P)>0){var k=R.andln(3)+q&3,B=K.andln(3)+P&3;if(k===3)k=-1;if(B===3)B=-1;var j;if((k&1)===0)j=0;else if(_=R.andln(7)+q&7,(_===3||_===5)&&B===2)j=-k;else j=k;H[0].push(j);var x;if((B&1)===0)x=0;else if(_=K.andln(7)+P&7,(_===3||_===5)&&k===2)x=-B;else x=B;if(H[1].push(x),2*q===j+1)q=1-q;if(2*P===x+1)P=1-P;R.iushrn(1),K.iushrn(1)}return H}$.getJSF=A;function z(R,K,H){var q="_"+K;R.prototype[K]=function(){return this[q]!==void 0?this[q]:this[q]=H.call(this)}}$.cachedProperty=z;function M(R){return typeof R==="string"?$.toArray(R,"hex"):R}$.parseBytes=M;function F(R){return new V(R,"hex","le")}$.intFromLE=F}),JY=A0((Q,$)=>{var V;$.exports=function(D){if(!V)V=new W(null);return V.generate(D)};function W(D){this.rand=D}if($.exports.Rand=W,W.prototype.generate=function(D){return this._rand(D)},W.prototype._rand=function(D){if(this.rand.getBytes)return this.rand.getBytes(D);var A=new Uint8Array(D);for(var z=0;z<A.length;z++)A[z]=this.rand.getByte();return A},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)W.prototype._rand=function(D){var A=new Uint8Array(D);return self.crypto.getRandomValues(A),A};else if(self.msCrypto&&self.msCrypto.getRandomValues)W.prototype._rand=function(D){var A=new Uint8Array(D);return self.msCrypto.getRandomValues(A),A};else if(typeof window==="object")W.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(C=(jU(),h0(vU)),typeof C.randomBytes!=="function")throw Error("Not supported");W.prototype._rand=function(D){return C.randomBytes(D)}}catch(D){}var C}),XZ=A0((Q,$)=>{var V=tU(),W=yU(),C=W.getNAF,D=W.getJSF,A=W.assert;function z(F,R){this.type=F,this.p=new V(R.p,16),this.red=R.prime?V.red(R.prime):V.mont(this.p),this.zero=new V(0).toRed(this.red),this.one=new V(1).toRed(this.red),this.two=new V(2).toRed(this.red),this.n=R.n&&new V(R.n,16),this.g=R.g&&this.pointFromJSON(R.g,R.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var K=this.n&&this.p.div(this.n);if(!K||K.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}$.exports=z,z.prototype.point=function(){throw Error("Not implemented")},z.prototype.validate=function(){throw Error("Not implemented")},z.prototype._fixedNafMul=function(F,R){A(F.precomputed);var K=F._getDoubles(),H=C(R,1,this._bitLength),q=(1<<K.step+1)-(K.step%2===0?2:1);q/=3;var P=[],_,k;for(_=0;_<H.length;_+=K.step){k=0;for(var B=_+K.step-1;B>=_;B--)k=(k<<1)+H[B];P.push(k)}var j=this.jpoint(null,null,null),x=this.jpoint(null,null,null);for(var f=q;f>0;f--){for(_=0;_<P.length;_++)if(k=P[_],k===f)x=x.mixedAdd(K.points[_]);else if(k===-f)x=x.mixedAdd(K.points[_].neg());j=j.add(x)}return j.toP()},z.prototype._wnafMul=function(F,R){var K=4,H=F._getNAFPoints(K);K=H.wnd;var q=H.points,P=C(R,K,this._bitLength),_=this.jpoint(null,null,null);for(var k=P.length-1;k>=0;k--){for(var B=0;k>=0&&P[k]===0;k--)B++;if(k>=0)B++;if(_=_.dblp(B),k<0)break;var j=P[k];if(A(j!==0),F.type==="affine")if(j>0)_=_.mixedAdd(q[j-1>>1]);else _=_.mixedAdd(q[-j-1>>1].neg());else if(j>0)_=_.add(q[j-1>>1]);else _=_.add(q[-j-1>>1].neg())}return F.type==="affine"?_.toP():_},z.prototype._wnafMulAdd=function(F,R,K,H,q){var P=this._wnafT1,_=this._wnafT2,k=this._wnafT3,B=0,j,x,f;for(j=0;j<H;j++){f=R[j];var w=f._getNAFPoints(F);P[j]=w.wnd,_[j]=w.points}for(j=H-1;j>=1;j-=2){var d=j-1,Y0=j;if(P[d]!==1||P[Y0]!==1){k[d]=C(K[d],P[d],this._bitLength),k[Y0]=C(K[Y0],P[Y0],this._bitLength),B=Math.max(k[d].length,B),B=Math.max(k[Y0].length,B);continue}var J0=[R[d],null,null,R[Y0]];if(R[d].y.cmp(R[Y0].y)===0)J0[1]=R[d].add(R[Y0]),J0[2]=R[d].toJ().mixedAdd(R[Y0].neg());else if(R[d].y.cmp(R[Y0].y.redNeg())===0)J0[1]=R[d].toJ().mixedAdd(R[Y0]),J0[2]=R[d].add(R[Y0].neg());else J0[1]=R[d].toJ().mixedAdd(R[Y0]),J0[2]=R[d].toJ().mixedAdd(R[Y0].neg());var $0=[-3,-1,-5,-7,0,7,5,1,3],u=D(K[d],K[Y0]);B=Math.max(u[0].length,B),k[d]=Array(B),k[Y0]=Array(B);for(x=0;x<B;x++){var O0=u[0][x]|0,U=u[1][x]|0;k[d][x]=$0[(O0+1)*3+(U+1)],k[Y0][x]=0,_[d]=J0}}var X=this.jpoint(null,null,null),J=this._wnafT4;for(j=B;j>=0;j--){var Z=0;while(j>=0){var Y=!0;for(x=0;x<H;x++)if(J[x]=k[x][j]|0,J[x]!==0)Y=!1;if(!Y)break;Z++,j--}if(j>=0)Z++;if(X=X.dblp(Z),j<0)break;for(x=0;x<H;x++){var I=J[x];if(I===0)continue;else if(I>0)f=_[x][I-1>>1];else if(I<0)f=_[x][-I-1>>1].neg();if(f.type==="affine")X=X.mixedAdd(f);else X=X.add(f)}}for(j=0;j<H;j++)_[j]=null;if(q)return X;else return X.toP()};function M(F,R){this.curve=F,this.type=R,this.precomputed=null}z.BasePoint=M,M.prototype.eq=function(){throw Error("Not implemented")},M.prototype.validate=function(){return this.curve.validate(this)},z.prototype.decodePoint=function(F,R){F=W.toArray(F,R);var K=this.p.byteLength();if((F[0]===4||F[0]===6||F[0]===7)&&F.length-1===2*K){if(F[0]===6)A(F[F.length-1]%2===0);else if(F[0]===7)A(F[F.length-1]%2===1);var H=this.point(F.slice(1,1+K),F.slice(1+K,1+2*K));return H}else if((F[0]===2||F[0]===3)&&F.length-1===K)return this.pointFromX(F.slice(1,1+K),F[0]===3);throw Error("Unknown point format")},M.prototype.encodeCompressed=function(F){return this.encode(F,!0)},M.prototype._encode=function(F){var R=this.curve.p.byteLength(),K=this.getX().toArray("be",R);if(F)return[this.getY().isEven()?2:3].concat(K);return[4].concat(K,this.getY().toArray("be",R))},M.prototype.encode=function(F,R){return W.encode(this._encode(R),F)},M.prototype.precompute=function(F){if(this.precomputed)return this;var R={doubles:null,naf:null,beta:null};return R.naf=this._getNAFPoints(8),R.doubles=this._getDoubles(4,F),R.beta=this._getBeta(),this.precomputed=R,this},M.prototype._hasDoubles=function(F){if(!this.precomputed)return!1;var R=this.precomputed.doubles;if(!R)return!1;return R.points.length>=Math.ceil((F.bitLength()+1)/R.step)},M.prototype._getDoubles=function(F,R){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var K=[this],H=this;for(var q=0;q<R;q+=F){for(var P=0;P<F;P++)H=H.dbl();K.push(H)}return{step:F,points:K}},M.prototype._getNAFPoints=function(F){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var R=[this],K=(1<<F)-1,H=K===1?null:this.dbl();for(var q=1;q<K;q++)R[q]=R[q-1].add(H);return{wnd:F,points:R}},M.prototype._getBeta=function(){return null},M.prototype.dblp=function(F){var R=this;for(var K=0;K<F;K++)R=R.dbl();return R}}),NJ=A0((Q,$)=>{if(typeof Object.create==="function")$.exports=function(V,W){if(W)V.super_=W,V.prototype=Object.create(W.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}})};else $.exports=function(V,W){if(W){V.super_=W;var C=function(){};C.prototype=W.prototype,V.prototype=new C,V.prototype.constructor=V}}}),xU=A0((Q,$)=>{try{if(V=(nQ(),h0(oQ)),typeof V.inherits!=="function")throw"";$.exports=V.inherits}catch(W){$.exports=NJ()}var V}),gJ=A0((Q,$)=>{var V=yU(),W=tU(),C=xU(),D=XZ(),A=V.assert;function z(R){D.call(this,"short",R),this.a=new W(R.a,16).toRed(this.red),this.b=new W(R.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(R),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}C(z,D),$.exports=z,z.prototype._getEndomorphism=function(R){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var K,H;if(R.beta)K=new W(R.beta,16).toRed(this.red);else{var q=this._getEndoRoots(this.p);K=q[0].cmp(q[1])<0?q[0]:q[1],K=K.toRed(this.red)}if(R.lambda)H=new W(R.lambda,16);else{var P=this._getEndoRoots(this.n);if(this.g.mul(P[0]).x.cmp(this.g.x.redMul(K))===0)H=P[0];else H=P[1],A(this.g.mul(H).x.cmp(this.g.x.redMul(K))===0)}var _;if(R.basis)_=R.basis.map(function(k){return{a:new W(k.a,16),b:new W(k.b,16)}});else _=this._getEndoBasis(H);return{beta:K,lambda:H,basis:_}},z.prototype._getEndoRoots=function(R){var K=R===this.p?this.red:W.mont(R),H=new W(2).toRed(K).redInvm(),q=H.redNeg(),P=new W(3).toRed(K).redNeg().redSqrt().redMul(H),_=q.redAdd(P).fromRed(),k=q.redSub(P).fromRed();return[_,k]},z.prototype._getEndoBasis=function(R){var K=this.n.ushrn(Math.floor(this.n.bitLength()/2)),H=R,q=this.n.clone(),P=new W(1),_=new W(0),k=new W(0),B=new W(1),j,x,f,w,d,Y0,J0,$0=0,u,O0;while(H.cmpn(0)!==0){var U=q.div(H);u=q.sub(U.mul(H)),O0=k.sub(U.mul(P));var X=B.sub(U.mul(_));if(!f&&u.cmp(K)<0)j=J0.neg(),x=P,f=u.neg(),w=O0;else if(f&&++$0===2)break;J0=u,q=H,H=u,k=P,P=O0,B=_,_=X}d=u.neg(),Y0=O0;var J=f.sqr().add(w.sqr()),Z=d.sqr().add(Y0.sqr());if(Z.cmp(J)>=0)d=j,Y0=x;if(f.negative)f=f.neg(),w=w.neg();if(d.negative)d=d.neg(),Y0=Y0.neg();return[{a:f,b:w},{a:d,b:Y0}]},z.prototype._endoSplit=function(R){var K=this.endo.basis,H=K[0],q=K[1],P=q.b.mul(R).divRound(this.n),_=H.b.neg().mul(R).divRound(this.n),k=P.mul(H.a),B=_.mul(q.a),j=P.mul(H.b),x=_.mul(q.b),f=R.sub(k).sub(B),w=j.add(x).neg();return{k1:f,k2:w}},z.prototype.pointFromX=function(R,K){if(R=new W(R,16),!R.red)R=R.toRed(this.red);var H=R.redSqr().redMul(R).redIAdd(R.redMul(this.a)).redIAdd(this.b),q=H.redSqrt();if(q.redSqr().redSub(H).cmp(this.zero)!==0)throw Error("invalid point");var P=q.fromRed().isOdd();if(K&&!P||!K&&P)q=q.redNeg();return this.point(R,q)},z.prototype.validate=function(R){if(R.inf)return!0;var{x:K,y:H}=R,q=this.a.redMul(K),P=K.redSqr().redMul(K).redIAdd(q).redIAdd(this.b);return H.redSqr().redISub(P).cmpn(0)===0},z.prototype._endoWnafMulAdd=function(R,K,H){var q=this._endoWnafT1,P=this._endoWnafT2;for(var _=0;_<R.length;_++){var k=this._endoSplit(K[_]),B=R[_],j=B._getBeta();if(k.k1.negative)k.k1.ineg(),B=B.neg(!0);if(k.k2.negative)k.k2.ineg(),j=j.neg(!0);q[_*2]=B,q[_*2+1]=j,P[_*2]=k.k1,P[_*2+1]=k.k2}var x=this._wnafMulAdd(1,q,P,_*2,H);for(var f=0;f<_*2;f++)q[f]=null,P[f]=null;return x};function M(R,K,H,q){if(D.BasePoint.call(this,R,"affine"),K===null&&H===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new W(K,16),this.y=new W(H,16),q)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}C(M,D.BasePoint),z.prototype.point=function(R,K,H){return new M(this,R,K,H)},z.prototype.pointFromJSON=function(R,K){return M.fromJSON(this,R,K)},M.prototype._getBeta=function(){if(!this.curve.endo)return;var R=this.precomputed;if(R&&R.beta)return R.beta;var K=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(R){var H=this.curve,q=function(P){return H.point(P.x.redMul(H.endo.beta),P.y)};R.beta=K,K.precomputed={beta:null,naf:R.naf&&{wnd:R.naf.wnd,points:R.naf.points.map(q)},doubles:R.doubles&&{step:R.doubles.step,points:R.doubles.points.map(q)}}}return K},M.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[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)}}]},M.fromJSON=function(R,K,H){if(typeof K==="string")K=JSON.parse(K);var q=R.point(K[0],K[1],H);if(!K[2])return q;function P(k){return R.point(k[0],k[1],H)}var _=K[2];return q.precomputed={beta:null,doubles:_.doubles&&{step:_.doubles.step,points:[q].concat(_.doubles.points.map(P))},naf:_.naf&&{wnd:_.naf.wnd,points:[q].concat(_.naf.points.map(P))}},q},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.inf},M.prototype.add=function(R){if(this.inf)return R;if(R.inf)return this;if(this.eq(R))return this.dbl();if(this.neg().eq(R))return this.curve.point(null,null);if(this.x.cmp(R.x)===0)return this.curve.point(null,null);var K=this.y.redSub(R.y);if(K.cmpn(0)!==0)K=K.redMul(this.x.redSub(R.x).redInvm());var H=K.redSqr().redISub(this.x).redISub(R.x),q=K.redMul(this.x.redSub(H)).redISub(this.y);return this.curve.point(H,q)},M.prototype.dbl=function(){if(this.inf)return this;var R=this.y.redAdd(this.y);if(R.cmpn(0)===0)return this.curve.point(null,null);var K=this.curve.a,H=this.x.redSqr(),q=R.redInvm(),P=H.redAdd(H).redIAdd(H).redIAdd(K).redMul(q),_=P.redSqr().redISub(this.x.redAdd(this.x)),k=P.redMul(this.x.redSub(_)).redISub(this.y);return this.curve.point(_,k)},M.prototype.getX=function(){return this.x.fromRed()},M.prototype.getY=function(){return this.y.fromRed()},M.prototype.mul=function(R){if(R=new W(R,16),this.isInfinity())return this;else if(this._hasDoubles(R))return this.curve._fixedNafMul(this,R);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[R]);else return this.curve._wnafMul(this,R)},M.prototype.mulAdd=function(R,K,H){var q=[this,K],P=[R,H];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P);else return this.curve._wnafMulAdd(1,q,P,2)},M.prototype.jmulAdd=function(R,K,H){var q=[this,K],P=[R,H];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P,!0);else return this.curve._wnafMulAdd(1,q,P,2,!0)},M.prototype.eq=function(R){return this===R||this.inf===R.inf&&(this.inf||this.x.cmp(R.x)===0&&this.y.cmp(R.y)===0)},M.prototype.neg=function(R){if(this.inf)return this;var K=this.curve.point(this.x,this.y.redNeg());if(R&&this.precomputed){var H=this.precomputed,q=function(P){return P.neg()};K.precomputed={naf:H.naf&&{wnd:H.naf.wnd,points:H.naf.points.map(q)},doubles:H.doubles&&{step:H.doubles.step,points:H.doubles.points.map(q)}}}return K},M.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var R=this.curve.jpoint(this.x,this.y,this.curve.one);return R};function F(R,K,H,q){if(D.BasePoint.call(this,R,"jacobian"),K===null&&H===null&&q===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new W(0);else this.x=new W(K,16),this.y=new W(H,16),this.z=new W(q,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}C(F,D.BasePoint),z.prototype.jpoint=function(R,K,H){return new F(this,R,K,H)},F.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var R=this.z.redInvm(),K=R.redSqr(),H=this.x.redMul(K),q=this.y.redMul(K).redMul(R);return this.curve.point(H,q)},F.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},F.prototype.add=function(R){if(this.isInfinity())return R;if(R.isInfinity())return this;var K=R.z.redSqr(),H=this.z.redSqr(),q=this.x.redMul(K),P=R.x.redMul(H),_=this.y.redMul(K.redMul(R.z)),k=R.y.redMul(H.redMul(this.z)),B=q.redSub(P),j=_.redSub(k);if(B.cmpn(0)===0)if(j.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var x=B.redSqr(),f=x.redMul(B),w=q.redMul(x),d=j.redSqr().redIAdd(f).redISub(w).redISub(w),Y0=j.redMul(w.redISub(d)).redISub(_.redMul(f)),J0=this.z.redMul(R.z).redMul(B);return this.curve.jpoint(d,Y0,J0)},F.prototype.mixedAdd=function(R){if(this.isInfinity())return R.toJ();if(R.isInfinity())return this;var K=this.z.redSqr(),H=this.x,q=R.x.redMul(K),P=this.y,_=R.y.redMul(K).redMul(this.z),k=H.redSub(q),B=P.redSub(_);if(k.cmpn(0)===0)if(B.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var j=k.redSqr(),x=j.redMul(k),f=H.redMul(j),w=B.redSqr().redIAdd(x).redISub(f).redISub(f),d=B.redMul(f.redISub(w)).redISub(P.redMul(x)),Y0=this.z.redMul(k);return this.curve.jpoint(w,d,Y0)},F.prototype.dblp=function(R){if(R===0)return this;if(this.isInfinity())return this;if(!R)return this.dbl();var K;if(this.curve.zeroA||this.curve.threeA){var H=this;for(K=0;K<R;K++)H=H.dbl();return H}var q=this.curve.a,P=this.curve.tinv,_=this.x,k=this.y,B=this.z,j=B.redSqr().redSqr(),x=k.redAdd(k);for(K=0;K<R;K++){var f=_.redSqr(),w=x.redSqr(),d=w.redSqr(),Y0=f.redAdd(f).redIAdd(f).redIAdd(q.redMul(j)),J0=_.redMul(w),$0=Y0.redSqr().redISub(J0.redAdd(J0)),u=J0.redISub($0),O0=Y0.redMul(u);O0=O0.redIAdd(O0).redISub(d);var U=x.redMul(B);if(K+1<R)j=j.redMul(d);_=$0,B=U,x=O0}return this.curve.jpoint(_,x.redMul(P),B)},F.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},F.prototype._zeroDbl=function(){var R,K,H;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q),j=B.redSqr().redISub(k).redISub(k),x=_.redIAdd(_);x=x.redIAdd(x),x=x.redIAdd(x),R=j,K=B.redMul(k.redISub(j)).redISub(x),H=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),w=this.y.redSqr(),d=w.redSqr(),Y0=this.x.redAdd(w).redSqr().redISub(f).redISub(d);Y0=Y0.redIAdd(Y0);var J0=f.redAdd(f).redIAdd(f),$0=J0.redSqr(),u=d.redIAdd(d);u=u.redIAdd(u),u=u.redIAdd(u),R=$0.redISub(Y0).redISub(Y0),K=J0.redMul(Y0.redISub(R)).redISub(u),H=this.y.redMul(this.z),H=H.redIAdd(H)}return this.curve.jpoint(R,K,H)},F.prototype._threeDbl=function(){var R,K,H;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q).redIAdd(this.curve.a),j=B.redSqr().redISub(k).redISub(k);R=j;var x=_.redIAdd(_);x=x.redIAdd(x),x=x.redIAdd(x),K=B.redMul(k.redISub(j)).redISub(x),H=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),w=this.y.redSqr(),d=this.x.redMul(w),Y0=this.x.redSub(f).redMul(this.x.redAdd(f));Y0=Y0.redAdd(Y0).redIAdd(Y0);var J0=d.redIAdd(d);J0=J0.redIAdd(J0);var $0=J0.redAdd(J0);R=Y0.redSqr().redISub($0),H=this.y.redAdd(this.z).redSqr().redISub(w).redISub(f);var u=w.redSqr();u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u),K=Y0.redMul(J0.redISub(R)).redISub(u)}return this.curve.jpoint(R,K,H)},F.prototype._dbl=function(){var R=this.curve.a,K=this.x,H=this.y,q=this.z,P=q.redSqr().redSqr(),_=K.redSqr(),k=H.redSqr(),B=_.redAdd(_).redIAdd(_).redIAdd(R.redMul(P)),j=K.redAdd(K);j=j.redIAdd(j);var x=j.redMul(k),f=B.redSqr().redISub(x.redAdd(x)),w=x.redISub(f),d=k.redSqr();d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var Y0=B.redMul(w).redISub(d),J0=H.redAdd(H).redMul(q);return this.curve.jpoint(f,Y0,J0)},F.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var R=this.x.redSqr(),K=this.y.redSqr(),H=this.z.redSqr(),q=K.redSqr(),P=R.redAdd(R).redIAdd(R),_=P.redSqr(),k=this.x.redAdd(K).redSqr().redISub(R).redISub(q);k=k.redIAdd(k),k=k.redAdd(k).redIAdd(k),k=k.redISub(_);var B=k.redSqr(),j=q.redIAdd(q);j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var x=P.redIAdd(k).redSqr().redISub(_).redISub(B).redISub(j),f=K.redMul(x);f=f.redIAdd(f),f=f.redIAdd(f);var w=this.x.redMul(B).redISub(f);w=w.redIAdd(w),w=w.redIAdd(w);var d=this.y.redMul(x.redMul(j.redISub(x)).redISub(k.redMul(B)));d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var Y0=this.z.redAdd(k).redSqr().redISub(H).redISub(B);return this.curve.jpoint(w,d,Y0)},F.prototype.mul=function(R,K){return R=new W(R,K),this.curve._wnafMul(this,R)},F.prototype.eq=function(R){if(R.type==="affine")return this.eq(R.toJ());if(this===R)return!0;var K=this.z.redSqr(),H=R.z.redSqr();if(this.x.redMul(H).redISub(R.x.redMul(K)).cmpn(0)!==0)return!1;var q=K.redMul(this.z),P=H.redMul(R.z);return this.y.redMul(P).redISub(R.y.redMul(q)).cmpn(0)===0},F.prototype.eqXToP=function(R){var K=this.z.redSqr(),H=R.toRed(this.curve.red).redMul(K);if(this.x.cmp(H)===0)return!0;var q=R.clone(),P=this.curve.redN.redMul(K);for(;;){if(q.iadd(this.curve.n),q.cmp(this.curve.p)>=0)return!1;if(H.redIAdd(P),this.x.cmp(H)===0)return!0}},F.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},F.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),fJ=A0((Q,$)=>{var V=tU(),W=xU(),C=XZ(),D=yU();function A(M){C.call(this,"mont",M),this.a=new V(M.a,16).toRed(this.red),this.b=new V(M.b,16).toRed(this.red),this.i4=new V(4).toRed(this.red).redInvm(),this.two=new V(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}W(A,C),$.exports=A,A.prototype.validate=function(M){var F=M.normalize().x,R=F.redSqr(),K=R.redMul(F).redAdd(R.redMul(this.a)).redAdd(F),H=K.redSqrt();return H.redSqr().cmp(K)===0};function z(M,F,R){if(C.BasePoint.call(this,M,"projective"),F===null&&R===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new V(F,16),this.z=new V(R,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}W(z,C.BasePoint),A.prototype.decodePoint=function(M,F){return this.point(D.toArray(M,F),1)},A.prototype.point=function(M,F){return new z(this,M,F)},A.prototype.pointFromJSON=function(M){return z.fromJSON(this,M)},z.prototype.precompute=function(){},z.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},z.fromJSON=function(M,F){return new z(M,F[0],F[1]||M.one)},z.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},z.prototype.isInfinity=function(){return this.z.cmpn(0)===0},z.prototype.dbl=function(){var M=this.x.redAdd(this.z),F=M.redSqr(),R=this.x.redSub(this.z),K=R.redSqr(),H=F.redSub(K),q=F.redMul(K),P=H.redMul(K.redAdd(this.curve.a24.redMul(H)));return this.curve.point(q,P)},z.prototype.add=function(){throw Error("Not supported on Montgomery curve")},z.prototype.diffAdd=function(M,F){var R=this.x.redAdd(this.z),K=this.x.redSub(this.z),H=M.x.redAdd(M.z),q=M.x.redSub(M.z),P=q.redMul(R),_=H.redMul(K),k=F.z.redMul(P.redAdd(_).redSqr()),B=F.x.redMul(P.redISub(_).redSqr());return this.curve.point(k,B)},z.prototype.mul=function(M){var F=M.clone(),R=this,K=this.curve.point(null,null),H=this;for(var q=[];F.cmpn(0)!==0;F.iushrn(1))q.push(F.andln(1));for(var P=q.length-1;P>=0;P--)if(q[P]===0)R=R.diffAdd(K,H),K=K.dbl();else K=R.diffAdd(K,H),R=R.dbl();return K},z.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.eq=function(M){return this.getX().cmp(M.getX())===0},z.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},z.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),wJ=A0((Q,$)=>{var V=yU(),W=tU(),C=xU(),D=XZ(),A=V.assert;function z(F){this.twisted=(F.a|0)!==1,this.mOneA=this.twisted&&(F.a|0)===-1,this.extended=this.mOneA,D.call(this,"edwards",F),this.a=new W(F.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new W(F.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new W(F.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),A(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(F.c|0)===1}C(z,D),$.exports=z,z.prototype._mulA=function(F){if(this.mOneA)return F.redNeg();else return this.a.redMul(F)},z.prototype._mulC=function(F){if(this.oneC)return F;else return this.c.redMul(F)},z.prototype.jpoint=function(F,R,K,H){return this.point(F,R,K,H)},z.prototype.pointFromX=function(F,R){if(F=new W(F,16),!F.red)F=F.toRed(this.red);var K=F.redSqr(),H=this.c2.redSub(this.a.redMul(K)),q=this.one.redSub(this.c2.redMul(this.d).redMul(K)),P=H.redMul(q.redInvm()),_=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");var k=_.fromRed().isOdd();if(R&&!k||!R&&k)_=_.redNeg();return this.point(F,_)},z.prototype.pointFromY=function(F,R){if(F=new W(F,16),!F.red)F=F.toRed(this.red);var K=F.redSqr(),H=K.redSub(this.c2),q=K.redMul(this.d).redMul(this.c2).redSub(this.a),P=H.redMul(q.redInvm());if(P.cmp(this.zero)===0)if(R)throw Error("invalid point");else return this.point(this.zero,F);var _=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");if(_.fromRed().isOdd()!==R)_=_.redNeg();return this.point(_,F)},z.prototype.validate=function(F){if(F.isInfinity())return!0;F.normalize();var R=F.x.redSqr(),K=F.y.redSqr(),H=R.redMul(this.a).redAdd(K),q=this.c2.redMul(this.one.redAdd(this.d.redMul(R).redMul(K)));return H.cmp(q)===0};function M(F,R,K,H,q){if(D.BasePoint.call(this,F,"projective"),R===null&&K===null&&H===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new W(R,16),this.y=new W(K,16),this.z=H?new W(H,16):this.curve.one,this.t=q&&new W(q,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}C(M,D.BasePoint),z.prototype.pointFromJSON=function(F){return M.fromJSON(this,F)},z.prototype.point=function(F,R,K,H){return new M(this,F,R,K,H)},M.fromJSON=function(F,R){return new M(F,R[0],R[1],R[2])},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},M.prototype._extDbl=function(){var F=this.x.redSqr(),R=this.y.redSqr(),K=this.z.redSqr();K=K.redIAdd(K);var H=this.curve._mulA(F),q=this.x.redAdd(this.y).redSqr().redISub(F).redISub(R),P=H.redAdd(R),_=P.redSub(K),k=H.redSub(R),B=q.redMul(_),j=P.redMul(k),x=q.redMul(k),f=_.redMul(P);return this.curve.point(B,j,f,x)},M.prototype._projDbl=function(){var F=this.x.redAdd(this.y).redSqr(),R=this.x.redSqr(),K=this.y.redSqr(),H,q,P,_,k,B;if(this.curve.twisted){_=this.curve._mulA(R);var j=_.redAdd(K);if(this.zOne)H=F.redSub(R).redSub(K).redMul(j.redSub(this.curve.two)),q=j.redMul(_.redSub(K)),P=j.redSqr().redSub(j).redSub(j);else k=this.z.redSqr(),B=j.redSub(k).redISub(k),H=F.redSub(R).redISub(K).redMul(B),q=j.redMul(_.redSub(K)),P=j.redMul(B)}else _=R.redAdd(K),k=this.curve._mulC(this.z).redSqr(),B=_.redSub(k).redSub(k),H=this.curve._mulC(F.redISub(_)).redMul(B),q=this.curve._mulC(_).redMul(R.redISub(K)),P=_.redMul(B);return this.curve.point(H,q,P)},M.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},M.prototype._extAdd=function(F){var R=this.y.redSub(this.x).redMul(F.y.redSub(F.x)),K=this.y.redAdd(this.x).redMul(F.y.redAdd(F.x)),H=this.t.redMul(this.curve.dd).redMul(F.t),q=this.z.redMul(F.z.redAdd(F.z)),P=K.redSub(R),_=q.redSub(H),k=q.redAdd(H),B=K.redAdd(R),j=P.redMul(_),x=k.redMul(B),f=P.redMul(B),w=_.redMul(k);return this.curve.point(j,x,w,f)},M.prototype._projAdd=function(F){var R=this.z.redMul(F.z),K=R.redSqr(),H=this.x.redMul(F.x),q=this.y.redMul(F.y),P=this.curve.d.redMul(H).redMul(q),_=K.redSub(P),k=K.redAdd(P),B=this.x.redAdd(this.y).redMul(F.x.redAdd(F.y)).redISub(H).redISub(q),j=R.redMul(_).redMul(B),x,f;if(this.curve.twisted)x=R.redMul(k).redMul(q.redSub(this.curve._mulA(H))),f=_.redMul(k);else x=R.redMul(k).redMul(q.redSub(H)),f=this.curve._mulC(_).redMul(k);return this.curve.point(j,x,f)},M.prototype.add=function(F){if(this.isInfinity())return F;if(F.isInfinity())return this;if(this.curve.extended)return this._extAdd(F);else return this._projAdd(F)},M.prototype.mul=function(F){if(this._hasDoubles(F))return this.curve._fixedNafMul(this,F);else return this.curve._wnafMul(this,F)},M.prototype.mulAdd=function(F,R,K){return this.curve._wnafMulAdd(1,[this,R],[F,K],2,!1)},M.prototype.jmulAdd=function(F,R,K){return this.curve._wnafMulAdd(1,[this,R],[F,K],2,!0)},M.prototype.normalize=function(){if(this.zOne)return this;var F=this.z.redInvm();if(this.x=this.x.redMul(F),this.y=this.y.redMul(F),this.t)this.t=this.t.redMul(F);return this.z=this.curve.one,this.zOne=!0,this},M.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},M.prototype.getX=function(){return this.normalize(),this.x.fromRed()},M.prototype.getY=function(){return this.normalize(),this.y.fromRed()},M.prototype.eq=function(F){return this===F||this.getX().cmp(F.getX())===0&&this.getY().cmp(F.getY())===0},M.prototype.eqXToP=function(F){var R=F.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(R)===0)return!0;var K=F.clone(),H=this.curve.redN.redMul(this.z);for(;;){if(K.iadd(this.curve.n),K.cmp(this.curve.p)>=0)return!1;if(R.redIAdd(H),this.x.cmp(R)===0)return!0}},M.prototype.toP=M.prototype.normalize,M.prototype.mixedAdd=M.prototype.add}),GY=A0((Q)=>{var $=Q;$.base=XZ(),$.short=gJ(),$.mont=fJ(),$.edwards=wJ()}),dU=A0((Q)=>{var $=OO(),V=xU();Q.inherits=V;function W(X,J){if((X.charCodeAt(J)&64512)!==55296)return!1;if(J<0||J+1>=X.length)return!1;return(X.charCodeAt(J+1)&64512)===56320}function C(X,J){if(Array.isArray(X))return X.slice();if(!X)return[];var Z=[];if(typeof X==="string"){if(!J){var Y=0;for(var I=0;I<X.length;I++){var L=X.charCodeAt(I);if(L<128)Z[Y++]=L;else if(L<2048)Z[Y++]=L>>6|192,Z[Y++]=L&63|128;else if(W(X,I))L=65536+((L&1023)<<10)+(X.charCodeAt(++I)&1023),Z[Y++]=L>>18|240,Z[Y++]=L>>12&63|128,Z[Y++]=L>>6&63|128,Z[Y++]=L&63|128;else Z[Y++]=L>>12|224,Z[Y++]=L>>6&63|128,Z[Y++]=L&63|128}}else if(J==="hex"){if(X=X.replace(/[^a-z0-9]+/ig,""),X.length%2!==0)X="0"+X;for(I=0;I<X.length;I+=2)Z.push(parseInt(X[I]+X[I+1],16))}}else for(I=0;I<X.length;I++)Z[I]=X[I]|0;return Z}Q.toArray=C;function D(X){var J="";for(var Z=0;Z<X.length;Z++)J+=M(X[Z].toString(16));return J}Q.toHex=D;function A(X){var J=X>>>24|X>>>8&65280|X<<8&16711680|(X&255)<<24;return J>>>0}Q.htonl=A;function z(X,J){var Z="";for(var Y=0;Y<X.length;Y++){var I=X[Y];if(J==="little")I=A(I);Z+=F(I.toString(16))}return Z}Q.toHex32=z;function M(X){if(X.length===1)return"0"+X;else return X}Q.zero2=M;function F(X){if(X.length===7)return"0"+X;else if(X.length===6)return"00"+X;else if(X.length===5)return"000"+X;else if(X.length===4)return"0000"+X;else if(X.length===3)return"00000"+X;else if(X.length===2)return"000000"+X;else if(X.length===1)return"0000000"+X;else return X}Q.zero8=F;function R(X,J,Z,Y){var I=Z-J;$(I%4===0);var L=Array(I/4);for(var G=0,O=J;G<L.length;G++,O+=4){var E;if(Y==="big")E=X[O]<<24|X[O+1]<<16|X[O+2]<<8|X[O+3];else E=X[O+3]<<24|X[O+2]<<16|X[O+1]<<8|X[O];L[G]=E>>>0}return L}Q.join32=R;function K(X,J){var Z=Array(X.length*4);for(var Y=0,I=0;Y<X.length;Y++,I+=4){var L=X[Y];if(J==="big")Z[I]=L>>>24,Z[I+1]=L>>>16&255,Z[I+2]=L>>>8&255,Z[I+3]=L&255;else Z[I+3]=L>>>24,Z[I+2]=L>>>16&255,Z[I+1]=L>>>8&255,Z[I]=L&255}return Z}Q.split32=K;function H(X,J){return X>>>J|X<<32-J}Q.rotr32=H;function q(X,J){return X<<J|X>>>32-J}Q.rotl32=q;function P(X,J){return X+J>>>0}Q.sum32=P;function _(X,J,Z){return X+J+Z>>>0}Q.sum32_3=_;function k(X,J,Z,Y){return X+J+Z+Y>>>0}Q.sum32_4=k;function B(X,J,Z,Y,I){return X+J+Z+Y+I>>>0}Q.sum32_5=B;function j(X,J,Z,Y){var I=X[J],L=X[J+1],G=Y+L>>>0,O=(G<Y?1:0)+Z+I;X[J]=O>>>0,X[J+1]=G}Q.sum64=j;function x(X,J,Z,Y){var I=J+Y>>>0,L=(I<J?1:0)+X+Z;return L>>>0}Q.sum64_hi=x;function f(X,J,Z,Y){var I=J+Y;return I>>>0}Q.sum64_lo=f;function w(X,J,Z,Y,I,L,G,O){var E=0,T=J;T=T+Y>>>0,E+=T<J?1:0,T=T+L>>>0,E+=T<L?1:0,T=T+O>>>0,E+=T<O?1:0;var S=X+Z+I+G+E;return S>>>0}Q.sum64_4_hi=w;function d(X,J,Z,Y,I,L,G,O){var E=J+Y+L+O;return E>>>0}Q.sum64_4_lo=d;function Y0(X,J,Z,Y,I,L,G,O,E,T){var S=0,v=J;v=v+Y>>>0,S+=v<J?1:0,v=v+L>>>0,S+=v<L?1:0,v=v+O>>>0,S+=v<O?1:0,v=v+T>>>0,S+=v<T?1:0;var g=X+Z+I+G+E+S;return g>>>0}Q.sum64_5_hi=Y0;function J0(X,J,Z,Y,I,L,G,O,E,T){var S=J+Y+L+O+T;return S>>>0}Q.sum64_5_lo=J0;function $0(X,J,Z){var Y=J<<32-Z|X>>>Z;return Y>>>0}Q.rotr64_hi=$0;function u(X,J,Z){var Y=X<<32-Z|J>>>Z;return Y>>>0}Q.rotr64_lo=u;function O0(X,J,Z){return X>>>Z}Q.shr64_hi=O0;function U(X,J,Z){var Y=X<<32-Z|J>>>Z;return Y>>>0}Q.shr64_lo=U}),xO=A0((Q)=>{var $=dU(),V=OO();function W(){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}Q.BlockHash=W,W.prototype.update=function(C,D){if(C=$.toArray(C,D),!this.pending)this.pending=C;else this.pending=this.pending.concat(C);if(this.pendingTotal+=C.length,this.pending.length>=this._delta8){C=this.pending;var A=C.length%this._delta8;if(this.pending=C.slice(C.length-A,C.length),this.pending.length===0)this.pending=null;C=$.join32(C,0,C.length-A,this.endian);for(var z=0;z<C.length;z+=this._delta32)this._update(C,z,z+this._delta32)}return this},W.prototype.digest=function(C){return this.update(this._pad()),V(this.pending===null),this._digest(C)},W.prototype._pad=function(){var C=this.pendingTotal,D=this._delta8,A=D-(C+this.padLength)%D,z=Array(A+this.padLength);z[0]=128;for(var M=1;M<A;M++)z[M]=0;if(C<<=3,this.endian==="big"){for(var F=8;F<this.padLength;F++)z[M++]=0;z[M++]=0,z[M++]=0,z[M++]=0,z[M++]=0,z[M++]=C>>>24&255,z[M++]=C>>>16&255,z[M++]=C>>>8&255,z[M++]=C&255}else{z[M++]=C&255,z[M++]=C>>>8&255,z[M++]=C>>>16&255,z[M++]=C>>>24&255,z[M++]=0,z[M++]=0,z[M++]=0,z[M++]=0;for(F=8;F<this.padLength;F++)z[M++]=0}return z}}),VY=A0((Q)=>{var $=dU(),V=$.rotr32;function W(K,H,q,P){if(K===0)return C(H,q,P);if(K===1||K===3)return A(H,q,P);if(K===2)return D(H,q,P)}Q.ft_1=W;function C(K,H,q){return K&H^~K&q}Q.ch32=C;function D(K,H,q){return K&H^K&q^H&q}Q.maj32=D;function A(K,H,q){return K^H^q}Q.p32=A;function z(K){return V(K,2)^V(K,13)^V(K,22)}Q.s0_256=z;function M(K){return V(K,6)^V(K,11)^V(K,25)}Q.s1_256=M;function F(K){return V(K,7)^V(K,18)^K>>>3}Q.g0_256=F;function R(K){return V(K,17)^V(K,19)^K>>>10}Q.g1_256=R}),yJ=A0((Q,$)=>{var V=dU(),W=xO(),C=VY(),D=V.rotl32,A=V.sum32,z=V.sum32_5,M=C.ft_1,F=W.BlockHash,R=[1518500249,1859775393,2400959708,3395469782];function K(){if(!(this instanceof K))return new K;F.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}V.inherits(K,F),$.exports=K,K.blockSize=512,K.outSize=160,K.hmacStrength=80,K.padLength=64,K.prototype._update=function(H,q){var P=this.W;for(var _=0;_<16;_++)P[_]=H[q+_];for(;_<P.length;_++)P[_]=D(P[_-3]^P[_-8]^P[_-14]^P[_-16],1);var k=this.h[0],B=this.h[1],j=this.h[2],x=this.h[3],f=this.h[4];for(_=0;_<P.length;_++){var w=~~(_/20),d=z(D(k,5),M(w,B,j,x),f,P[_],R[w]);f=x,x=j,j=D(B,30),B=k,k=d}this.h[0]=A(this.h[0],k),this.h[1]=A(this.h[1],B),this.h[2]=A(this.h[2],j),this.h[3]=A(this.h[3],x),this.h[4]=A(this.h[4],f)},K.prototype._digest=function(H){if(H==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")}}),EY=A0((Q,$)=>{var V=dU(),W=xO(),C=VY(),D=OO(),A=V.sum32,z=V.sum32_4,M=V.sum32_5,F=C.ch32,R=C.maj32,K=C.s0_256,H=C.s1_256,q=C.g0_256,P=C.g1_256,_=W.BlockHash,k=[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 B(){if(!(this instanceof B))return new B;_.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=k,this.W=Array(64)}V.inherits(B,_),$.exports=B,B.blockSize=512,B.outSize=256,B.hmacStrength=192,B.padLength=64,B.prototype._update=function(j,x){var f=this.W;for(var w=0;w<16;w++)f[w]=j[x+w];for(;w<f.length;w++)f[w]=z(P(f[w-2]),f[w-7],q(f[w-15]),f[w-16]);var d=this.h[0],Y0=this.h[1],J0=this.h[2],$0=this.h[3],u=this.h[4],O0=this.h[5],U=this.h[6],X=this.h[7];D(this.k.length===f.length);for(w=0;w<f.length;w++){var J=M(X,H(u),F(u,O0,U),this.k[w],f[w]),Z=A(K(d),R(d,Y0,J0));X=U,U=O0,O0=u,u=A($0,J),$0=J0,J0=Y0,Y0=d,d=A(J,Z)}this.h[0]=A(this.h[0],d),this.h[1]=A(this.h[1],Y0),this.h[2]=A(this.h[2],J0),this.h[3]=A(this.h[3],$0),this.h[4]=A(this.h[4],u),this.h[5]=A(this.h[5],O0),this.h[6]=A(this.h[6],U),this.h[7]=A(this.h[7],X)},B.prototype._digest=function(j){if(j==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")}}),cJ=A0((Q,$)=>{var V=dU(),W=EY();function C(){if(!(this instanceof C))return new C;W.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}V.inherits(C,W),$.exports=C,C.blockSize=512,C.outSize=224,C.hmacStrength=192,C.padLength=64,C.prototype._digest=function(D){if(D==="hex")return V.toHex32(this.h.slice(0,7),"big");else return V.split32(this.h.slice(0,7),"big")}}),IY=A0((Q,$)=>{var V=dU(),W=xO(),C=OO(),D=V.rotr64_hi,A=V.rotr64_lo,z=V.shr64_hi,M=V.shr64_lo,F=V.sum64,R=V.sum64_hi,K=V.sum64_lo,H=V.sum64_4_hi,q=V.sum64_4_lo,P=V.sum64_5_hi,_=V.sum64_5_lo,k=W.BlockHash,B=[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 j(){if(!(this instanceof j))return new j;k.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=B,this.W=Array(160)}V.inherits(j,k),$.exports=j,j.blockSize=1024,j.outSize=512,j.hmacStrength=192,j.padLength=128,j.prototype._prepareBlock=function(Z,Y){var I=this.W;for(var L=0;L<32;L++)I[L]=Z[Y+L];for(;L<I.length;L+=2){var G=X(I[L-4],I[L-3]),O=J(I[L-4],I[L-3]),E=I[L-14],T=I[L-13],S=O0(I[L-30],I[L-29]),v=U(I[L-30],I[L-29]),g=I[L-32],p=I[L-31];I[L]=H(G,O,E,T,S,v,g,p),I[L+1]=q(G,O,E,T,S,v,g,p)}},j.prototype._update=function(Z,Y){this._prepareBlock(Z,Y);var I=this.W,L=this.h[0],G=this.h[1],O=this.h[2],E=this.h[3],T=this.h[4],S=this.h[5],v=this.h[6],g=this.h[7],p=this.h[8],n=this.h[9],V0=this.h[10],r=this.h[11],l=this.h[12],X0=this.h[13],m=this.h[14],i=this.h[15];C(this.k.length===I.length);for(var g0=0;g0<I.length;g0+=2){var y=m,h=i,Q0=$0(p,n),s=u(p,n),e=x(p,n,V0,r,l,X0),F0=f(p,n,V0,r,l,X0),c=this.k[g0],o=this.k[g0+1],N0=I[g0],t=I[g0+1],Z0=P(y,h,Q0,s,e,F0,c,o,N0,t),w0=_(y,h,Q0,s,e,F0,c,o,N0,t);y=Y0(L,G),h=J0(L,G),Q0=w(L,G,O,E,T,S),s=d(L,G,O,E,T,S);var C0=R(y,h,Q0,s),L0=K(y,h,Q0,s);m=l,i=X0,l=V0,X0=r,V0=p,r=n,p=R(v,g,Z0,w0),n=K(g,g,Z0,w0),v=T,g=S,T=O,S=E,O=L,E=G,L=R(Z0,w0,C0,L0),G=K(Z0,w0,C0,L0)}F(this.h,0,L,G),F(this.h,2,O,E),F(this.h,4,T,S),F(this.h,6,v,g),F(this.h,8,p,n),F(this.h,10,V0,r),F(this.h,12,l,X0),F(this.h,14,m,i)},j.prototype._digest=function(Z){if(Z==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")};function x(Z,Y,I,L,G){var O=Z&I^~Z&G;if(O<0)O+=4294967296;return O}function f(Z,Y,I,L,G,O){var E=Y&L^~Y&O;if(E<0)E+=4294967296;return E}function w(Z,Y,I,L,G){var O=Z&I^Z&G^I&G;if(O<0)O+=4294967296;return O}function d(Z,Y,I,L,G,O){var E=Y&L^Y&O^L&O;if(E<0)E+=4294967296;return E}function Y0(Z,Y){var I=D(Z,Y,28),L=D(Y,Z,2),G=D(Y,Z,7),O=I^L^G;if(O<0)O+=4294967296;return O}function J0(Z,Y){var I=A(Z,Y,28),L=A(Y,Z,2),G=A(Y,Z,7),O=I^L^G;if(O<0)O+=4294967296;return O}function $0(Z,Y){var I=D(Z,Y,14),L=D(Z,Y,18),G=D(Y,Z,9),O=I^L^G;if(O<0)O+=4294967296;return O}function u(Z,Y){var I=A(Z,Y,14),L=A(Z,Y,18),G=A(Y,Z,9),O=I^L^G;if(O<0)O+=4294967296;return O}function O0(Z,Y){var I=D(Z,Y,1),L=D(Z,Y,8),G=z(Z,Y,7),O=I^L^G;if(O<0)O+=4294967296;return O}function U(Z,Y){var I=A(Z,Y,1),L=A(Z,Y,8),G=M(Z,Y,7),O=I^L^G;if(O<0)O+=4294967296;return O}function X(Z,Y){var I=D(Z,Y,19),L=D(Y,Z,29),G=z(Z,Y,6),O=I^L^G;if(O<0)O+=4294967296;return O}function J(Z,Y){var I=A(Z,Y,19),L=A(Y,Z,29),G=M(Z,Y,6),O=I^L^G;if(O<0)O+=4294967296;return O}}),pJ=A0((Q,$)=>{var V=dU(),W=IY();function C(){if(!(this instanceof C))return new C;W.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}V.inherits(C,W),$.exports=C,C.blockSize=1024,C.outSize=384,C.hmacStrength=192,C.padLength=128,C.prototype._digest=function(D){if(D==="hex")return V.toHex32(this.h.slice(0,12),"big");else return V.split32(this.h.slice(0,12),"big")}}),hJ=A0((Q)=>{Q.sha1=yJ(),Q.sha224=cJ(),Q.sha256=EY(),Q.sha384=pJ(),Q.sha512=IY()}),uJ=A0((Q)=>{var $=dU(),V=xO(),W=$.rotl32,C=$.sum32,D=$.sum32_3,A=$.sum32_4,z=V.BlockHash;function M(){if(!(this instanceof M))return new M;z.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}$.inherits(M,z),Q.ripemd160=M,M.blockSize=512,M.outSize=160,M.hmacStrength=192,M.padLength=64,M.prototype._update=function(k,B){var j=this.h[0],x=this.h[1],f=this.h[2],w=this.h[3],d=this.h[4],Y0=j,J0=x,$0=f,u=w,O0=d;for(var U=0;U<80;U++){var X=C(W(A(j,F(U,x,f,w),k[H[U]+B],R(U)),P[U]),d);j=d,d=w,w=W(f,10),f=x,x=X,X=C(W(A(Y0,F(79-U,J0,$0,u),k[q[U]+B],K(U)),_[U]),O0),Y0=O0,O0=u,u=W($0,10),$0=J0,J0=X}X=D(this.h[1],f,u),this.h[1]=D(this.h[2],w,O0),this.h[2]=D(this.h[3],d,Y0),this.h[3]=D(this.h[4],j,J0),this.h[4]=D(this.h[0],x,$0),this.h[0]=X},M.prototype._digest=function(k){if(k==="hex")return $.toHex32(this.h,"little");else return $.split32(this.h,"little")};function F(k,B,j,x){if(k<=15)return B^j^x;else if(k<=31)return B&j|~B&x;else if(k<=47)return(B|~j)^x;else if(k<=63)return B&x|j&~x;else return B^(j|~x)}function R(k){if(k<=15)return 0;else if(k<=31)return 1518500249;else if(k<=47)return 1859775393;else if(k<=63)return 2400959708;else return 2840853838}function K(k){if(k<=15)return 1352829926;else if(k<=31)return 1548603684;else if(k<=47)return 1836072691;else if(k<=63)return 2053994217;else return 0}var H=[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],q=[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],P=[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],_=[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]}),bJ=A0((Q,$)=>{var V=dU(),W=OO();function C(D,A,z){if(!(this instanceof C))return new C(D,A,z);this.Hash=D,this.blockSize=D.blockSize/8,this.outSize=D.outSize/8,this.inner=null,this.outer=null,this._init(V.toArray(A,z))}$.exports=C,C.prototype._init=function(D){if(D.length>this.blockSize)D=new this.Hash().update(D).digest();W(D.length<=this.blockSize);for(var A=D.length;A<this.blockSize;A++)D.push(0);for(A=0;A<D.length;A++)D[A]^=54;this.inner=new this.Hash().update(D);for(A=0;A<D.length;A++)D[A]^=106;this.outer=new this.Hash().update(D)},C.prototype.update=function(D,A){return this.inner.update(D,A),this},C.prototype.digest=function(D){return this.outer.update(this.inner.digest()),this.outer.digest(D)}}),AX=A0((Q)=>{var $=Q;$.utils=dU(),$.common=xO(),$.sha=hJ(),$.ripemd=uJ(),$.hmac=bJ(),$.sha1=$.sha.sha1,$.sha256=$.sha.sha256,$.sha224=$.sha.sha224,$.sha384=$.sha.sha384,$.sha512=$.sha.sha512,$.ripemd160=$.ripemd.ripemd160}),lJ=A0((Q,$)=>{$.exports={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"]]}}}),JX=A0((Q)=>{var $=Q,V=AX(),W=GY(),C=yU(),D=C.assert;function A(F){if(F.type==="short")this.curve=new W.short(F);else if(F.type==="edwards")this.curve=new W.edwards(F);else this.curve=new W.mont(F);this.g=this.curve.g,this.n=this.curve.n,this.hash=F.hash,D(this.g.validate(),"Invalid curve"),D(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}$.PresetCurve=A;function z(F,R){Object.defineProperty($,F,{configurable:!0,enumerable:!0,get:function(){var K=new A(R);return Object.defineProperty($,F,{configurable:!0,enumerable:!0,value:K}),K}})}z("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:V.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),z("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:V.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),z("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:V.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),z("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:V.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"]}),z("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:V.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"]}),z("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:V.sha256,gRed:!1,g:["9"]}),z("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:V.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var M;try{M=lJ()}catch(F){M=void 0}z("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:V.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",M]})}),dJ=A0((Q,$)=>{var V=AX(),W=AY(),C=OO();function D(A){if(!(this instanceof D))return new D(A);this.hash=A.hash,this.predResist=!!A.predResist,this.outLen=this.hash.outSize,this.minEntropy=A.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var z=W.toArray(A.entropy,A.entropyEnc||"hex"),M=W.toArray(A.nonce,A.nonceEnc||"hex"),F=W.toArray(A.pers,A.persEnc||"hex");C(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(z,M,F)}$.exports=D,D.prototype._init=function(A,z,M){var F=A.concat(z).concat(M);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var R=0;R<this.V.length;R++)this.K[R]=0,this.V[R]=1;this._update(F),this._reseed=1,this.reseedInterval=281474976710656},D.prototype._hmac=function(){return new V.hmac(this.hash,this.K)},D.prototype._update=function(A){var z=this._hmac().update(this.V).update([0]);if(A)z=z.update(A);if(this.K=z.digest(),this.V=this._hmac().update(this.V).digest(),!A)return;this.K=this._hmac().update(this.V).update([1]).update(A).digest(),this.V=this._hmac().update(this.V).digest()},D.prototype.reseed=function(A,z,M,F){if(typeof z!=="string")F=M,M=z,z=null;A=W.toArray(A,z),M=W.toArray(M,F),C(A.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(A.concat(M||[])),this._reseed=1},D.prototype.generate=function(A,z,M,F){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof z!=="string")F=M,M=z,z=null;if(M)M=W.toArray(M,F||"hex"),this._update(M);var R=[];while(R.length<A)this.V=this._hmac().update(this.V).digest(),R=R.concat(this.V);var K=R.slice(0,A);return this._update(M),this._reseed++,W.encode(K,z)}}),oJ=A0((Q,$)=>{var V=tU(),W=yU(),C=W.assert;function D(A,z){if(this.ec=A,this.priv=null,this.pub=null,z.priv)this._importPrivate(z.priv,z.privEnc);if(z.pub)this._importPublic(z.pub,z.pubEnc)}$.exports=D,D.fromPublic=function(A,z,M){if(z instanceof D)return z;return new D(A,{pub:z,pubEnc:M})},D.fromPrivate=function(A,z,M){if(z instanceof D)return z;return new D(A,{priv:z,privEnc:M})},D.prototype.validate=function(){var A=this.getPublic();if(A.isInfinity())return{result:!1,reason:"Invalid public key"};if(!A.validate())return{result:!1,reason:"Public key is not a point"};if(!A.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},D.prototype.getPublic=function(A,z){if(typeof A==="string")z=A,A=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!z)return this.pub;return this.pub.encode(z,A)},D.prototype.getPrivate=function(A){if(A==="hex")return this.priv.toString(16,2);else return this.priv},D.prototype._importPrivate=function(A,z){this.priv=new V(A,z||16),this.priv=this.priv.umod(this.ec.curve.n)},D.prototype._importPublic=function(A,z){if(A.x||A.y){if(this.ec.curve.type==="mont")C(A.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")C(A.x&&A.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(A.x,A.y);return}this.pub=this.ec.curve.decodePoint(A,z)},D.prototype.derive=function(A){if(!A.validate())C(A.validate(),"public point not validated");return A.mul(this.priv).getX()},D.prototype.sign=function(A,z,M){return this.ec.sign(A,this,z,M)},D.prototype.verify=function(A,z,M){return this.ec.verify(A,z,this,void 0,M)},D.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),nJ=A0((Q,$)=>{var V=tU(),W=yU(),C=W.assert;function D(R,K){if(R instanceof D)return R;if(this._importDER(R,K))return;if(C(R.r&&R.s,"Signature without r or s"),this.r=new V(R.r,16),this.s=new V(R.s,16),R.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=R.recoveryParam}$.exports=D;function A(){this.place=0}function z(R,K){var H=R[K.place++];if(!(H&128))return H;var q=H&15;if(q===0||q>4)return!1;if(R[K.place]===0)return!1;var P=0;for(var _=0,k=K.place;_<q;_++,k++)P<<=8,P|=R[k],P>>>=0;if(P<=127)return!1;return K.place=k,P}function M(R){var K=0,H=R.length-1;while(!R[K]&&!(R[K+1]&128)&&K<H)K++;if(K===0)return R;return R.slice(K)}D.prototype._importDER=function(R,K){R=W.toArray(R,K);var H=new A;if(R[H.place++]!==48)return!1;var q=z(R,H);if(q===!1)return!1;if(q+H.place!==R.length)return!1;if(R[H.place++]!==2)return!1;var P=z(R,H);if(P===!1)return!1;if((R[H.place]&128)!==0)return!1;var _=R.slice(H.place,P+H.place);if(H.place+=P,R[H.place++]!==2)return!1;var k=z(R,H);if(k===!1)return!1;if(R.length!==k+H.place)return!1;if((R[H.place]&128)!==0)return!1;var B=R.slice(H.place,k+H.place);if(_[0]===0)if(_[1]&128)_=_.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new V(_),this.s=new V(B),this.recoveryParam=null,!0};function F(R,K){if(K<128){R.push(K);return}var H=1+(Math.log(K)/Math.LN2>>>3);R.push(H|128);while(--H)R.push(K>>>(H<<3)&255);R.push(K)}D.prototype.toDER=function(R){var K=this.r.toArray(),H=this.s.toArray();if(K[0]&128)K=[0].concat(K);if(H[0]&128)H=[0].concat(H);K=M(K),H=M(H);while(!H[0]&&!(H[1]&128))H=H.slice(1);var q=[2];F(q,K.length),q=q.concat(K),q.push(2),F(q,H.length);var P=q.concat(H),_=[48];return F(_,P.length),_=_.concat(P),W.encode(_,R)}}),mJ=A0((Q,$)=>{var V=tU(),W=dJ(),C=yU(),D=JX(),A=JY(),z=C.assert,M=oJ(),F=nJ();function R(K){if(!(this instanceof R))return new R(K);if(typeof K==="string")z(Object.prototype.hasOwnProperty.call(D,K),"Unknown curve "+K),K=D[K];if(K instanceof D.PresetCurve)K={curve:K};this.curve=K.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=K.curve.g,this.g.precompute(K.curve.n.bitLength()+1),this.hash=K.hash||K.curve.hash}$.exports=R,R.prototype.keyPair=function(K){return new M(this,K)},R.prototype.keyFromPrivate=function(K,H){return M.fromPrivate(this,K,H)},R.prototype.keyFromPublic=function(K,H){return M.fromPublic(this,K,H)},R.prototype.genKeyPair=function(K){if(!K)K={};var H=new W({hash:this.hash,pers:K.pers,persEnc:K.persEnc||"utf8",entropy:K.entropy||A(this.hash.hmacStrength),entropyEnc:K.entropy&&K.entropyEnc||"utf8",nonce:this.n.toArray()}),q=this.n.byteLength(),P=this.n.sub(new V(2));for(;;){var _=new V(H.generate(q));if(_.cmp(P)>0)continue;return _.iaddn(1),this.keyFromPrivate(_)}},R.prototype._truncateToN=function(K,H,q){var P;if(V.isBN(K)||typeof K==="number")K=new V(K,16),P=K.byteLength();else if(typeof K==="object")P=K.length,K=new V(K,16);else{var _=K.toString();P=_.length+1>>>1,K=new V(_,16)}if(typeof q!=="number")q=P*8;var k=q-this.n.bitLength();if(k>0)K=K.ushrn(k);if(!H&&K.cmp(this.n)>=0)return K.sub(this.n);else return K},R.prototype.sign=function(K,H,q,P){if(typeof q==="object")P=q,q=null;if(!P)P={};if(typeof K!=="string"&&typeof K!=="number"&&!V.isBN(K)){z(typeof K==="object"&&K&&typeof K.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),z(K.length>>>0===K.length);for(var _=0;_<K.length;_++)z((K[_]&255)===K[_])}H=this.keyFromPrivate(H,q),K=this._truncateToN(K,!1,P.msgBitLength),z(!K.isNeg(),"Can not sign a negative message");var k=this.n.byteLength(),B=H.getPrivate().toArray("be",k),j=K.toArray("be",k);z(new V(j).eq(K),"Can not sign message");var x=new W({hash:this.hash,entropy:B,nonce:j,pers:P.pers,persEnc:P.persEnc||"utf8"}),f=this.n.sub(new V(1));for(var w=0;;w++){var d=P.k?P.k(w):new V(x.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),d.cmpn(1)<=0||d.cmp(f)>=0)continue;var Y0=this.g.mul(d);if(Y0.isInfinity())continue;var J0=Y0.getX(),$0=J0.umod(this.n);if($0.cmpn(0)===0)continue;var u=d.invm(this.n).mul($0.mul(H.getPrivate()).iadd(K));if(u=u.umod(this.n),u.cmpn(0)===0)continue;var O0=(Y0.getY().isOdd()?1:0)|(J0.cmp($0)!==0?2:0);if(P.canonical&&u.cmp(this.nh)>0)u=this.n.sub(u),O0^=1;return new F({r:$0,s:u,recoveryParam:O0})}},R.prototype.verify=function(K,H,q,P,_){if(!_)_={};K=this._truncateToN(K,!1,_.msgBitLength),q=this.keyFromPublic(q,P),H=new F(H,"hex");var{r:k,s:B}=H;if(k.cmpn(1)<0||k.cmp(this.n)>=0)return!1;if(B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var j=B.invm(this.n),x=j.mul(K).umod(this.n),f=j.mul(k).umod(this.n),w;if(!this.curve._maxwellTrick){if(w=this.g.mulAdd(x,q.getPublic(),f),w.isInfinity())return!1;return w.getX().umod(this.n).cmp(k)===0}if(w=this.g.jmulAdd(x,q.getPublic(),f),w.isInfinity())return!1;return w.eqXToP(k)},R.prototype.recoverPubKey=function(K,H,q,P){z((3&q)===q,"The recovery param is more than two bits"),H=new F(H,P);var _=this.n,k=new V(K),B=H.r,j=H.s,x=q&1,f=q>>1;if(B.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");if(f)B=this.curve.pointFromX(B.add(this.curve.n),x);else B=this.curve.pointFromX(B,x);var w=H.r.invm(_),d=_.sub(k).mul(w).umod(_),Y0=j.mul(w).umod(_);return this.g.mulAdd(d,B,Y0)},R.prototype.getKeyRecoveryParam=function(K,H,q,P){if(H=new F(H,P),H.recoveryParam!==null)return H.recoveryParam;for(var _=0;_<4;_++){var k;try{k=this.recoverPubKey(K,H,_)}catch(B){continue}if(k.eq(q))return _}throw Error("Unable to find valid recovery factor")}}),tJ=A0((Q,$)=>{var V=yU(),W=V.assert,C=V.parseBytes,D=V.cachedProperty;function A(z,M){if(this.eddsa=z,this._secret=C(M.secret),z.isPoint(M.pub))this._pub=M.pub;else this._pubBytes=C(M.pub)}A.fromPublic=function(z,M){if(M instanceof A)return M;return new A(z,{pub:M})},A.fromSecret=function(z,M){if(M instanceof A)return M;return new A(z,{secret:M})},A.prototype.secret=function(){return this._secret},D(A,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),D(A,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),D(A,"privBytes",function(){var z=this.eddsa,M=this.hash(),F=z.encodingLength-1,R=M.slice(0,z.encodingLength);return R[0]&=248,R[F]&=127,R[F]|=64,R}),D(A,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),D(A,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),D(A,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),A.prototype.sign=function(z){return W(this._secret,"KeyPair can only verify"),this.eddsa.sign(z,this)},A.prototype.verify=function(z,M){return this.eddsa.verify(z,M,this)},A.prototype.getSecret=function(z){return W(this._secret,"KeyPair is public only"),V.encode(this.secret(),z)},A.prototype.getPublic=function(z){return V.encode(this.pubBytes(),z)},$.exports=A}),sJ=A0((Q,$)=>{var V=tU(),W=yU(),C=W.assert,D=W.cachedProperty,A=W.parseBytes;function z(M,F){if(this.eddsa=M,typeof F!=="object")F=A(F);if(Array.isArray(F))C(F.length===M.encodingLength*2,"Signature has invalid size"),F={R:F.slice(0,M.encodingLength),S:F.slice(M.encodingLength)};if(C(F.R&&F.S,"Signature without R or S"),M.isPoint(F.R))this._R=F.R;if(F.S instanceof V)this._S=F.S;this._Rencoded=Array.isArray(F.R)?F.R:F.Rencoded,this._Sencoded=Array.isArray(F.S)?F.S:F.Sencoded}D(z,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),D(z,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),D(z,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),D(z,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),z.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},z.prototype.toHex=function(){return W.encode(this.toBytes(),"hex").toUpperCase()},$.exports=z}),rJ=A0((Q,$)=>{var V=AX(),W=JX(),C=yU(),D=C.assert,A=C.parseBytes,z=tJ(),M=sJ();function F(R){if(D(R==="ed25519","only tested with ed25519 so far"),!(this instanceof F))return new F(R);R=W[R].curve,this.curve=R,this.g=R.g,this.g.precompute(R.n.bitLength()+1),this.pointClass=R.point().constructor,this.encodingLength=Math.ceil(R.n.bitLength()/8),this.hash=V.sha512}$.exports=F,F.prototype.sign=function(R,K){R=A(R);var H=this.keyFromSecret(K),q=this.hashInt(H.messagePrefix(),R),P=this.g.mul(q),_=this.encodePoint(P),k=this.hashInt(_,H.pubBytes(),R).mul(H.priv()),B=q.add(k).umod(this.curve.n);return this.makeSignature({R:P,S:B,Rencoded:_})},F.prototype.verify=function(R,K,H){if(R=A(R),K=this.makeSignature(K),K.S().gte(K.eddsa.curve.n)||K.S().isNeg())return!1;var q=this.keyFromPublic(H),P=this.hashInt(K.Rencoded(),q.pubBytes(),R),_=this.g.mul(K.S()),k=K.R().add(q.pub().mul(P));return k.eq(_)},F.prototype.hashInt=function(){var R=this.hash();for(var K=0;K<arguments.length;K++)R.update(arguments[K]);return C.intFromLE(R.digest()).umod(this.curve.n)},F.prototype.keyFromPublic=function(R){return z.fromPublic(this,R)},F.prototype.keyFromSecret=function(R){return z.fromSecret(this,R)},F.prototype.makeSignature=function(R){if(R instanceof M)return R;return new M(this,R)},F.prototype.encodePoint=function(R){var K=R.getY().toArray("le",this.encodingLength);return K[this.encodingLength-1]|=R.getX().isOdd()?128:0,K},F.prototype.decodePoint=function(R){R=C.parseBytes(R);var K=R.length-1,H=R.slice(0,K).concat(R[K]&-129),q=(R[K]&128)!==0,P=C.intFromLE(H);return this.curve.pointFromY(P,q)},F.prototype.encodeInt=function(R){return R.toArray("le",this.encodingLength)},F.prototype.decodeInt=function(R){return C.intFromLE(R)},F.prototype.isPoint=function(R){return R instanceof this.pointClass}}),aJ=A0((Q)=>{var $=Q;$.version=xJ().version,$.utils=yU(),$.rand=JY(),$.curve=GY(),$.curves=JX(),$.ec=mJ(),$.eddsa=rJ()}),eJ=A0((Q,$)=>{(function(V,W){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function D(U,X){U.super_=X;var J=function(){};J.prototype=X.prototype,U.prototype=new J,U.prototype.constructor=U}function A(U,X,J){if(A.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")J=X,X=10;this._init(U||0,X||10,J||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(U){}A.isBN=function(U){if(U instanceof A)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===A.wordSize&&Array.isArray(U.words)},A.max=function(U,X){if(U.cmp(X)>0)return U;return X},A.min=function(U,X){if(U.cmp(X)<0)return U;return X},A.prototype._init=function(U,X,J){if(typeof U==="number")return this._initNumber(U,X,J);if(typeof U==="object")return this._initArray(U,X,J);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,J);else if(this._parseBase(U,X,Z),J==="le")this._initArray(this.toArray(),X,J)}},A.prototype._initNumber=function(U,X,J){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(J!=="le")return;this._initArray(this.toArray(),X,J)},A.prototype._initArray=function(U,X,J){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,I,L=0;if(J==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=I<<L&67108863,this.words[Y+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,Y++}else if(J==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=I<<L&67108863,this.words[Y+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,Y++}return this.strip()};function M(U,X){var J=U.charCodeAt(X);if(J>=65&&J<=70)return J-55;else if(J>=97&&J<=102)return J-87;else return J-48&15}function F(U,X,J){var Z=M(U,J);if(J-1>=X)Z|=M(U,J-1)<<4;return Z}A.prototype._parseHex=function(U,X,J){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,I=0,L;if(J==="be")for(Z=U.length-1;Z>=X;Z-=2)if(L=F(U,X,Z)<<Y,this.words[I]|=L&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=L>>>26;else Y+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(L=F(U,X,Z)<<Y,this.words[I]|=L&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=L>>>26;else Y+=8}this.strip()};function R(U,X,J,Z){var Y=0,I=Math.min(U.length,J);for(var L=X;L<I;L++){var G=U.charCodeAt(L)-48;if(Y*=Z,G>=49)Y+=G-49+10;else if(G>=17)Y+=G-17+10;else Y+=G}return Y}A.prototype._parseBase=function(U,X,J){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var I=U.length-J,L=I%Z,G=Math.min(I,I-L)+J,O=0;for(var E=J;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(L!==0){var T=1;O=R(U,E,U.length,X);for(E=0;E<L;E++)T*=X;if(this.imuln(T),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},A.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},A.prototype.clone=function(){var U=new A(null);return this.copy(U),U},A.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},A.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},A.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var K=["","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"],H=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(U,X){U=U||10,X=X|0||1;var J;if(U===16||U==="hex"){J="";var Z=0,Y=0;for(var I=0;I<this.length;I++){var L=this.words[I],G=((L<<Z|Y)&16777215).toString(16);if(Y=L>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if(Y!==0||I!==this.length-1)J=K[6-G.length]+G+J;else J=G+J}if(Y!==0)J=Y.toString(16)+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}if(U===(U|0)&&U>=2&&U<=36){var O=H[U],E=q[U];J="";var T=this.clone();T.negative=0;while(!T.isZero()){var S=T.modn(E).toString(U);if(T=T.idivn(E),!T.isZero())J=K[O-S.length]+S+J;else J=S+J}if(this.isZero())J="0"+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},A.prototype.toJSON=function(){return this.toString(16)},A.prototype.toBuffer=function(U,X){return C(typeof z<"u"),this.toArrayLike(z,U,X)},A.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},A.prototype.toArrayLike=function(U,X,J){var Z=this.byteLength(),Y=J||Math.max(1,Z);C(Z<=Y,"byte array longer than desired length"),C(Y>0,"Requested array length <= 0"),this.strip();var I=X==="le",L=new U(Y),G,O,E=this.clone();if(!I){for(O=0;O<Y-Z;O++)L[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[Y-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[O]=G;for(;O<Y;O++)L[O]=0}return L},Math.clz32)A.prototype._countBits=function(U){return 32-Math.clz32(U)};else A.prototype._countBits=function(U){var X=U,J=0;if(X>=4096)J+=13,X>>>=13;if(X>=64)J+=7,X>>>=7;if(X>=8)J+=4,X>>>=4;if(X>=2)J+=2,X>>>=2;return J+X};A.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,J=0;if((X&8191)===0)J+=13,X>>>=13;if((X&127)===0)J+=7,X>>>=7;if((X&15)===0)J+=4,X>>>=4;if((X&3)===0)J+=2,X>>>=2;if((X&1)===0)J++;return J},A.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var J=0;J<X.length;J++){var Z=J/26|0,Y=J%26;X[J]=(U.words[Z]&1<<Y)>>>Y}return X}A.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var J=this._zeroBits(this.words[X]);if(U+=J,J!==26)break}return U},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},A.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},A.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},A.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},A.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},A.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var J=0;J<X.length;J++)this.words[J]=this.words[J]&U.words[J];return this.length=X.length,this.strip()},A.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},A.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},A.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},A.prototype.iuxor=function(U){var X,J;if(this.length>U.length)X=this,J=U;else X=U,J=this;for(var Z=0;Z<J.length;Z++)this.words[Z]=X.words[Z]^J.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},A.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},A.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},A.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},A.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,J=U%26;if(this._expand(X),J>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(J>0)this.words[Z]=~this.words[Z]&67108863>>26-J;return this.strip()},A.prototype.notn=function(U){return this.clone().inotn(U)},A.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var J=U/26|0,Z=U%26;if(this._expand(J+1),X)this.words[J]=this.words[J]|1<<Z;else this.words[J]=this.words[J]&~(1<<Z);return this.strip()},A.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var J,Z;if(this.length>U.length)J=this,Z=U;else J=U,Z=this;var Y=0;for(var I=0;I<Z.length;I++)X=(J.words[I]|0)+(Z.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;for(;Y!==0&&I<J.length;I++)X=(J.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;if(this.length=J.length,Y!==0)this.words[this.length]=Y,this.length++;else if(J!==this)for(;I<J.length;I++)this.words[I]=J.words[I];return this},A.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},A.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var J=this.cmp(U);if(J===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if(J>0)Z=this,Y=U;else Z=U,Y=this;var I=0;for(var L=0;L<Y.length;L++)X=(Z.words[L]|0)-(Y.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;for(;I!==0&&L<Z.length;L++)X=(Z.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;if(I===0&&L<Z.length&&Z!==this)for(;L<Z.length;L++)this.words[L]=Z.words[L];if(this.length=Math.max(this.length,L),Z!==this)this.negative=1;return this.strip()},A.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,J){J.negative=X.negative^U.negative;var Z=U.length+X.length|0;J.length=Z,Z=Z-1|0;var Y=U.words[0]|0,I=X.words[0]|0,L=Y*I,G=L&67108863,O=L/67108864|0;J.words[0]=G;for(var E=1;E<Z;E++){var T=O>>>26,S=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;Y=U.words[p]|0,I=X.words[g]|0,L=Y*I+S,T+=L/67108864|0,S=L&67108863}J.words[E]=S|0,O=T|0}if(O!==0)J.words[E]=O|0;else J.length--;return J.strip()}var k=function(U,X,J){var Z=U.words,Y=X.words,I=J.words,L=0,G,O,E,T=Z[0]|0,S=T&8191,v=T>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,s=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,t=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,L0=w0>>>13,t0=Z[9]|0,E0=t0&8191,K0=t0>>>13,e0=Y[0]|0,S0=e0&8191,H0=e0>>>13,FU=Y[1]|0,R0=FU&8191,k0=FU>>>13,RU=Y[2]|0,_0=RU&8191,T0=RU>>>13,SU=Y[3]|0,v0=SU&8191,z0=SU>>>13,CU=Y[4]|0,j0=CU&8191,B0=CU>>>13,LU=Y[5]|0,M0=LU&8191,N=LU>>>13,b=Y[6]|0,a=b&8191,U0=b>>>13,f0=Y[7]|0,I0=f0&8191,W0=f0>>>13,s0=Y[8]|0,q0=s0&8191,x0=s0>>>13,DU=Y[9]|0,P0=DU&8191,D0=DU>>>13;J.negative=U.negative^X.negative,J.length=19,G=Math.imul(S,S0),O=Math.imul(S,H0),O=O+Math.imul(v,S0)|0,E=Math.imul(v,H0);var r0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,S0),O=Math.imul(p,H0),O=O+Math.imul(n,S0)|0,E=Math.imul(n,H0),G=G+Math.imul(S,R0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,S0),O=Math.imul(r,H0),O=O+Math.imul(l,S0)|0,E=Math.imul(l,H0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(S,_0)|0,O=O+Math.imul(S,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,S0),O=Math.imul(m,H0),O=O+Math.imul(i,S0)|0,E=Math.imul(i,H0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(S,v0)|0,O=O+Math.imul(S,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,S0),O=Math.imul(y,H0),O=O+Math.imul(h,S0)|0,E=Math.imul(h,H0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(S,j0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(s,S0),O=Math.imul(s,H0),O=O+Math.imul(e,S0)|0,E=Math.imul(e,H0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(S,M0)|0,O=O+Math.imul(S,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,S0),O=Math.imul(c,H0),O=O+Math.imul(o,S0)|0,E=Math.imul(o,H0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(S,a)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(t,S0),O=Math.imul(t,H0),O=O+Math.imul(Z0,S0)|0,E=Math.imul(Z0,H0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(S,I0)|0,O=O+Math.imul(S,W0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,W0)|0;var OU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,S0),O=Math.imul(C0,H0),O=O+Math.imul(L0,S0)|0,E=Math.imul(L0,H0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,W0)|0,G=G+Math.imul(S,q0)|0,O=O+Math.imul(S,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,S0),O=Math.imul(E0,H0),O=O+Math.imul(K0,S0)|0,E=Math.imul(K0,H0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(L0,R0)|0,E=E+Math.imul(L0,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,W0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(S,P0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,D0)|0;var XU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(K0,R0)|0,E=Math.imul(K0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(L0,_0)|0,E=E+Math.imul(L0,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,W0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,D0)|0;var QU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(K0,_0)|0,E=Math.imul(K0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(L0,v0)|0,E=E+Math.imul(L0,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,W0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,D0)|0;var YU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(K0,v0)|0,E=Math.imul(K0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(L0,j0)|0,E=E+Math.imul(L0,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,W0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,D0)|0;var $U=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(K0,j0)|0,E=Math.imul(K0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(L0,M0)|0,E=E+Math.imul(L0,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,W0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,D0)|0;var AU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(K0,M0)|0,E=Math.imul(K0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(L0,a)|0,E=E+Math.imul(L0,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,W0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,D0)|0;var JU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(K0,a)|0,E=Math.imul(K0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,W0)|0,O=O+Math.imul(L0,I0)|0,E=E+Math.imul(L0,W0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,D0)|0;var GU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,W0),O=O+Math.imul(K0,I0)|0,E=Math.imul(K0,W0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(L0,q0)|0,E=E+Math.imul(L0,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,D0)|0;var VU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(K0,q0)|0,E=Math.imul(K0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,D0)|0,O=O+Math.imul(L0,P0)|0,E=E+Math.imul(L0,D0)|0;var EU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,D0),O=O+Math.imul(K0,P0)|0,E=Math.imul(K0,D0);var IU=(L+G|0)+((O&8191)<<13)|0;if(L=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=$U,I[13]=AU,I[14]=JU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,L!==0)I[19]=L,J.length++;return J};if(!Math.imul)k=_;function B(U,X,J){J.negative=X.negative^U.negative,J.length=U.length+X.length;var Z=0,Y=0;for(var I=0;I<J.length-1;I++){var L=Y;Y=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var T=I-E,S=U.words[T]|0,v=X.words[E]|0,g=S*v,p=g&67108863;L=L+(g/67108864|0)|0,p=p+G|0,G=p&67108863,L=L+(p>>>26)|0,Y+=L>>>26,L&=67108863}J.words[I]=G,Z=L,L=Y}if(Z!==0)J.words[I]=Z;else J.length--;return J.strip()}function j(U,X,J){var Z=new x;return Z.mulp(U,X,J)}A.prototype.mulTo=function(U,X){var J,Z=this.length+U.length;if(this.length===10&&U.length===10)J=k(this,U,X);else if(Z<63)J=_(this,U,X);else if(Z<1024)J=B(this,U,X);else J=j(this,U,X);return J};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),J=A.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,J,U);return X},x.prototype.revBin=function(U,X,J){if(U===0||U===J-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},x.prototype.permute=function(U,X,J,Z,Y,I){for(var L=0;L<I;L++)Z[L]=X[U[L]],Y[L]=J[U[L]]},x.prototype.transform=function(U,X,J,Z,Y,I){this.permute(I,U,X,J,Z,Y);for(var L=1;L<Y;L<<=1){var G=L<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var T=0;T<Y;T+=G){var S=O,v=E;for(var g=0;g<L;g++){var p=J[T+g],n=Z[T+g],V0=J[T+g+L],r=Z[T+g+L],l=S*V0-v*r;if(r=S*r+v*V0,V0=l,J[T+g]=p+V0,Z[T+g]=n+r,J[T+g+L]=p-V0,Z[T+g+L]=n-r,g!==G)l=O*S-E*v,v=O*v+E*S,S=l}}}},x.prototype.guessLen13b=function(U,X){var J=Math.max(X,U)|1,Z=J&1,Y=0;for(J=J/2|0;J;J=J>>>1)Y++;return 1<<Y+1+Z},x.prototype.conjugate=function(U,X,J){if(J<=1)return;for(var Z=0;Z<J/2;Z++){var Y=U[Z];U[Z]=U[J-Z-1],U[J-Z-1]=Y,Y=X[Z],X[Z]=-X[J-Z-1],X[J-Z-1]=-Y}},x.prototype.normalize13b=function(U,X){var J=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+J;if(U[Z]=Y&67108863,Y<67108864)J=0;else J=Y/67108864|0}return U},x.prototype.convert13b=function(U,X,J,Z){var Y=0;for(var I=0;I<X;I++)Y=Y+(U[I]|0),J[2*I]=Y&8191,Y=Y>>>13,J[2*I+1]=Y&8191,Y=Y>>>13;for(I=2*X;I<Z;++I)J[I]=0;C(Y===0),C((Y&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var J=0;J<U;J++)X[J]=0;return X},x.prototype.mulp=function(U,X,J){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),I=this.stub(Z),L=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),T=Array(Z),S=Array(Z),v=J.words;v.length=Z,this.convert13b(U.words,U.length,L,Z),this.convert13b(X.words,X.length,E,Z),this.transform(L,I,G,O,Z,Y),this.transform(E,I,T,S,Z,Y);for(var g=0;g<Z;g++){var p=G[g]*T[g]-O[g]*S[g];O[g]=G[g]*S[g]+O[g]*T[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,Y),this.conjugate(v,I,Z),this.normalize13b(v,Z),J.negative=U.negative^X.negative,J.length=U.length+X.length,J.strip()},A.prototype.mul=function(U){var X=new A(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},A.prototype.mulf=function(U){var X=new A(null);return X.words=Array(this.length+U.length),j(this,U,X)},A.prototype.imul=function(U){return this.clone().mulTo(U,this)},A.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var J=0;J<this.length;J++){var Z=(this.words[J]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[J]=Y&67108863}if(X!==0)this.words[J]=X,this.length++;return this.length=U===0?1:this.length,this},A.prototype.muln=function(U){return this.clone().imuln(U)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(U){var X=P(U);if(X.length===0)return new A(1);var J=this;for(var Z=0;Z<X.length;Z++,J=J.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=J.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;J=J.mul(Y)}return J},A.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var I=0;for(Y=0;Y<this.length;Y++){var L=this.words[Y]&Z,G=(this.words[Y]|0)-L<<X;this.words[Y]=G|I,I=L>>>26-X}if(I)this.words[Y]=I,this.length++}if(J!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+J]=this.words[Y];for(Y=0;Y<J;Y++)this.words[Y]=0;this.length+=J}return this.strip()},A.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},A.prototype.iushrn=function(U,X,J){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,I=Math.min((U-Y)/26,this.length),L=67108863^67108863>>>Y<<Y,G=J;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var T=this.words[O]|0;this.words[O]=E<<26-Y|T>>>Y,E=T&L}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},A.prototype.ishrn=function(U,X,J){return C(this.negative===0),this.iushrn(U,X,J)},A.prototype.shln=function(U){return this.clone().ishln(U)},A.prototype.ushln=function(U){return this.clone().iushln(U)},A.prototype.shrn=function(U){return this.clone().ishrn(U)},A.prototype.ushrn=function(U){return this.clone().iushrn(U)},A.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return!1;var Y=this.words[J];return!!(Y&Z)},A.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=J)return this;if(X!==0)J++;if(this.length=Math.min(J,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},A.prototype.maskn=function(U){return this.clone().imaskn(U)},A.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},A.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},A.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},A.prototype.addn=function(U){return this.clone().iaddn(U)},A.prototype.subn=function(U){return this.clone().isubn(U)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(U,X,J){var Z=U.length+J,Y;this._expand(Z);var I,L=0;for(Y=0;Y<U.length;Y++){I=(this.words[Y+J]|0)+L;var G=(U.words[Y]|0)*X;I-=G&67108863,L=(I>>26)-(G/67108864|0),this.words[Y+J]=I&67108863}for(;Y<this.length-J;Y++)I=(this.words[Y+J]|0)+L,L=I>>26,this.words[Y+J]=I&67108863;if(L===0)return this.strip();C(L===-1),L=0;for(Y=0;Y<this.length;Y++)I=-(this.words[Y]|0)+L,L=I>>26,this.words[Y]=I&67108863;return this.negative=1,this.strip()},A.prototype._wordDiv=function(U,X){var J=this.length-U.length,Z=this.clone(),Y=U,I=Y.words[Y.length-1]|0,L=this._countBits(I);if(J=26-L,J!==0)Y=Y.ushln(J),Z.iushln(J),I=Y.words[Y.length-1]|0;var G=Z.length-Y.length,O;if(X!=="mod"){O=new A(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var T=Z.clone()._ishlnsubmul(Y,1,G);if(T.negative===0){if(Z=T,O)O.words[G]=1}for(var S=G-1;S>=0;S--){var v=(Z.words[Y.length+S]|0)*67108864+(Z.words[Y.length+S-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul(Y,v,S);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul(Y,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&J!==0)Z.iushrn(J);return{div:O||null,mod:Z}},A.prototype.divmod=function(U,X,J){if(C(!U.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var Z,Y,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.isub(U)}return{div:I.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new A(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new A(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new A(this.modn(U.words[0]))}}return this._wordDiv(U,X)},A.prototype.div=function(U){return this.divmod(U,"div",!1).div},A.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},A.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},A.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var J=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),I=J.cmp(Z);if(I<0||Y===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},A.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,J=0;for(var Z=this.length-1;Z>=0;Z--)J=(X*J+(this.words[Z]|0))%U;return J},A.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var J=this.length-1;J>=0;J--){var Z=(this.words[J]|0)+X*67108864;this.words[J]=Z/U|0,X=Z%U}return this.strip()},A.prototype.divn=function(U){return this.clone().idivn(U)},A.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=new A(0),L=new A(1),G=0;while(X.isEven()&&J.isEven())X.iushrn(1),J.iushrn(1),++G;var O=J.clone(),E=X.clone();while(!X.isZero()){for(var T=0,S=1;(X.words[0]&S)===0&&T<26;++T,S<<=1);if(T>0){X.iushrn(T);while(T-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(E);Z.iushrn(1),Y.iushrn(1)}}for(var v=0,g=1;(J.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){J.iushrn(v);while(v-- >0){if(I.isOdd()||L.isOdd())I.iadd(O),L.isub(E);I.iushrn(1),L.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(I),Y.isub(L);else J.isub(X),I.isub(Z),L.isub(Y)}return{a:I,b:L,gcd:J.iushln(G)}},A.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=J.clone();while(X.cmpn(1)>0&&J.cmpn(1)>0){for(var L=0,G=1;(X.words[0]&G)===0&&L<26;++L,G<<=1);if(L>0){X.iushrn(L);while(L-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(J.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){J.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(I);Y.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(Y);else J.isub(X),Y.isub(Z)}var T;if(X.cmpn(1)===0)T=Z;else T=Y;if(T.cmpn(0)<0)T.iadd(U);return T},A.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),J=U.clone();X.negative=0,J.negative=0;for(var Z=0;X.isEven()&&J.isEven();Z++)X.iushrn(1),J.iushrn(1);do{while(X.isEven())X.iushrn(1);while(J.isEven())J.iushrn(1);var Y=X.cmp(J);if(Y<0){var I=X;X=J,J=I}else if(Y===0||J.cmpn(1)===0)break;X.isub(J)}while(!0);return J.iushln(Z)},A.prototype.invm=function(U){return this.egcd(U).a.umod(U)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(U){return this.words[0]&U},A.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return this._expand(J+1),this.words[J]|=Z,this;var Y=Z;for(var I=J;Y!==0&&I<this.length;I++){var L=this.words[I]|0;L+=Y,Y=L>>>26,L&=67108863,this.words[I]=L}if(Y!==0)this.words[I]=Y,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var J;if(this.length>1)J=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;J=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-J|0;return J},A.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},A.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var J=this.length-1;J>=0;J--){var Z=this.words[J]|0,Y=U.words[J]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},A.prototype.gtn=function(U){return this.cmpn(U)===1},A.prototype.gt=function(U){return this.cmp(U)===1},A.prototype.gten=function(U){return this.cmpn(U)>=0},A.prototype.gte=function(U){return this.cmp(U)>=0},A.prototype.ltn=function(U){return this.cmpn(U)===-1},A.prototype.lt=function(U){return this.cmp(U)===-1},A.prototype.lten=function(U){return this.cmpn(U)<=0},A.prototype.lte=function(U){return this.cmp(U)<=0},A.prototype.eqn=function(U){return this.cmpn(U)===0},A.prototype.eq=function(U){return this.cmp(U)===0},A.red=function(U){return new u(U)},A.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(U){return this.red=U,this},A.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},A.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},A.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},A.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},A.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},A.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},A.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},A.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new A(X,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new A(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,J;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),J=X.bitLength();while(J>this.n);var Z=J<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D(d,w),d.prototype.split=function(U,X){var J=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&J;for(Y=10;Y<U.length;Y++){var L=U.words[Y]|0;U.words[Y-10]=(L&J)<<4|I>>>22,I=L}if(I>>>=22,U.words[Y-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var J=0;J<U.length;J++){var Z=U.words[J]|0;X+=Z*977,U.words[J]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(Y0,w);function J0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(J0,w);function $0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D($0,w),$0.prototype.imulK=function(U){var X=0;for(var J=0;J<U.length;J++){var Z=(U.words[J]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[J]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},A._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new J0;else if(U==="p25519")X=new $0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=A._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var J=U.add(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var J=U.iadd(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J},u.prototype.sub=function(U,X){this._verify2(U,X);var J=U.sub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var J=U.isub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var J=this.m.add(new A(1)).iushrn(2);return this.pow(U,J)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);C(!Z.isZero());var I=new A(1).toRed(this),L=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new A(2*O*O).toRed(this);while(this.pow(O,G).cmp(L)!==0)O.redIAdd(L);var E=this.pow(O,Z),T=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),v=Y;while(S.cmp(I)!==0){var g=S;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new A(1).iushln(v-p-1));T=T.redMul(n),E=n.redSqr(),S=S.redMul(E),v=p}return T},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new A(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var J=4,Z=Array(1<<J);Z[0]=new A(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var I=Z[0],L=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var E=X.words[Y];for(var T=O-1;T>=0;T--){var S=E>>T&1;if(I!==Z[0])I=this.sqr(I);if(S===0&&L===0){G=0;continue}if(L<<=1,L|=S,G++,G!==J&&(Y!==0||T!==0))continue;I=this.mul(I,Z[L]),G=0,L=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},A.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(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)}D(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var J=U.imul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new A(0)._forceRed(this);var J=U.mul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof $>"u"||$,Q)}),iJ=A0((Q,$)=>{var V=aJ(),W=eJ();$.exports=function(z){return new D(z)};var C={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}};C.p224=C.secp224r1,C.p256=C.secp256r1=C.prime256v1,C.p192=C.secp192r1=C.prime192v1,C.p384=C.secp384r1,C.p521=C.secp521r1;function D(z){if(this.curveType=C[z],!this.curveType)this.curveType={name:z};this.curve=new V.ec(this.curveType.name),this.keys=void 0}D.prototype.generateKeys=function(z,M){return this.keys=this.curve.genKeyPair(),this.getPublicKey(z,M)},D.prototype.computeSecret=function(z,M,F){if(M=M||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,M);var R=this.curve.keyFromPublic(z).getPublic(),K=R.mul(this.keys.getPrivate()).getX();return A(K,F,this.curveType.byteLength)},D.prototype.getPublicKey=function(z,M){var F=this.keys.getPublic(M==="compressed",!0);if(M==="hybrid")if(F[F.length-1]%2)F[0]=7;else F[0]=6;return A(F,z)},D.prototype.getPrivateKey=function(z){return A(this.keys.getPrivate(),z)},D.prototype.setPublicKey=function(z,M){if(M=M||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,M);return this.keys._importPublic(z),this},D.prototype.setPrivateKey=function(z,M){if(M=M||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,M);var F=new W(z);return F=F.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(F),this};function A(z,M,F){if(!Array.isArray(z))z=z.toArray();var R=new Buffer(z);if(F&&R.length<F){var K=new Buffer(F-R.length);K.fill(0),R=Buffer.concat([K,R])}if(!M)return R;else return R.toString(M)}}),UG=A0((Q,$)=>{var V=(jU(),h0(vU)).createECDH;$.exports=V||iJ()}),OG=A0((Q,$)=>{(function(V,W){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function D(U,X){U.super_=X;var J=function(){};J.prototype=X.prototype,U.prototype=new J,U.prototype.constructor=U}function A(U,X,J){if(A.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")J=X,X=10;this._init(U||0,X||10,J||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(U){}A.isBN=function(U){if(U instanceof A)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===A.wordSize&&Array.isArray(U.words)},A.max=function(U,X){if(U.cmp(X)>0)return U;return X},A.min=function(U,X){if(U.cmp(X)<0)return U;return X},A.prototype._init=function(U,X,J){if(typeof U==="number")return this._initNumber(U,X,J);if(typeof U==="object")return this._initArray(U,X,J);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,J);else if(this._parseBase(U,X,Z),J==="le")this._initArray(this.toArray(),X,J)}},A.prototype._initNumber=function(U,X,J){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(J!=="le")return;this._initArray(this.toArray(),X,J)},A.prototype._initArray=function(U,X,J){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,I,L=0;if(J==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=I<<L&67108863,this.words[Y+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,Y++}else if(J==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=I<<L&67108863,this.words[Y+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,Y++}return this.strip()};function M(U,X){var J=U.charCodeAt(X);if(J>=65&&J<=70)return J-55;else if(J>=97&&J<=102)return J-87;else return J-48&15}function F(U,X,J){var Z=M(U,J);if(J-1>=X)Z|=M(U,J-1)<<4;return Z}A.prototype._parseHex=function(U,X,J){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,I=0,L;if(J==="be")for(Z=U.length-1;Z>=X;Z-=2)if(L=F(U,X,Z)<<Y,this.words[I]|=L&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=L>>>26;else Y+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(L=F(U,X,Z)<<Y,this.words[I]|=L&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=L>>>26;else Y+=8}this.strip()};function R(U,X,J,Z){var Y=0,I=Math.min(U.length,J);for(var L=X;L<I;L++){var G=U.charCodeAt(L)-48;if(Y*=Z,G>=49)Y+=G-49+10;else if(G>=17)Y+=G-17+10;else Y+=G}return Y}A.prototype._parseBase=function(U,X,J){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var I=U.length-J,L=I%Z,G=Math.min(I,I-L)+J,O=0;for(var E=J;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(L!==0){var T=1;O=R(U,E,U.length,X);for(E=0;E<L;E++)T*=X;if(this.imuln(T),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},A.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},A.prototype.clone=function(){var U=new A(null);return this.copy(U),U},A.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},A.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},A.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var K=["","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"],H=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(U,X){U=U||10,X=X|0||1;var J;if(U===16||U==="hex"){J="";var Z=0,Y=0;for(var I=0;I<this.length;I++){var L=this.words[I],G=((L<<Z|Y)&16777215).toString(16);if(Y=L>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if(Y!==0||I!==this.length-1)J=K[6-G.length]+G+J;else J=G+J}if(Y!==0)J=Y.toString(16)+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}if(U===(U|0)&&U>=2&&U<=36){var O=H[U],E=q[U];J="";var T=this.clone();T.negative=0;while(!T.isZero()){var S=T.modn(E).toString(U);if(T=T.idivn(E),!T.isZero())J=K[O-S.length]+S+J;else J=S+J}if(this.isZero())J="0"+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},A.prototype.toJSON=function(){return this.toString(16)},A.prototype.toBuffer=function(U,X){return C(typeof z<"u"),this.toArrayLike(z,U,X)},A.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},A.prototype.toArrayLike=function(U,X,J){var Z=this.byteLength(),Y=J||Math.max(1,Z);C(Z<=Y,"byte array longer than desired length"),C(Y>0,"Requested array length <= 0"),this.strip();var I=X==="le",L=new U(Y),G,O,E=this.clone();if(!I){for(O=0;O<Y-Z;O++)L[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[Y-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[O]=G;for(;O<Y;O++)L[O]=0}return L},Math.clz32)A.prototype._countBits=function(U){return 32-Math.clz32(U)};else A.prototype._countBits=function(U){var X=U,J=0;if(X>=4096)J+=13,X>>>=13;if(X>=64)J+=7,X>>>=7;if(X>=8)J+=4,X>>>=4;if(X>=2)J+=2,X>>>=2;return J+X};A.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,J=0;if((X&8191)===0)J+=13,X>>>=13;if((X&127)===0)J+=7,X>>>=7;if((X&15)===0)J+=4,X>>>=4;if((X&3)===0)J+=2,X>>>=2;if((X&1)===0)J++;return J},A.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var J=0;J<X.length;J++){var Z=J/26|0,Y=J%26;X[J]=(U.words[Z]&1<<Y)>>>Y}return X}A.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var J=this._zeroBits(this.words[X]);if(U+=J,J!==26)break}return U},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},A.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},A.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},A.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},A.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},A.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var J=0;J<X.length;J++)this.words[J]=this.words[J]&U.words[J];return this.length=X.length,this.strip()},A.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},A.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},A.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},A.prototype.iuxor=function(U){var X,J;if(this.length>U.length)X=this,J=U;else X=U,J=this;for(var Z=0;Z<J.length;Z++)this.words[Z]=X.words[Z]^J.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},A.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},A.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},A.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},A.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,J=U%26;if(this._expand(X),J>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(J>0)this.words[Z]=~this.words[Z]&67108863>>26-J;return this.strip()},A.prototype.notn=function(U){return this.clone().inotn(U)},A.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var J=U/26|0,Z=U%26;if(this._expand(J+1),X)this.words[J]=this.words[J]|1<<Z;else this.words[J]=this.words[J]&~(1<<Z);return this.strip()},A.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var J,Z;if(this.length>U.length)J=this,Z=U;else J=U,Z=this;var Y=0;for(var I=0;I<Z.length;I++)X=(J.words[I]|0)+(Z.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;for(;Y!==0&&I<J.length;I++)X=(J.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;if(this.length=J.length,Y!==0)this.words[this.length]=Y,this.length++;else if(J!==this)for(;I<J.length;I++)this.words[I]=J.words[I];return this},A.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},A.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var J=this.cmp(U);if(J===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if(J>0)Z=this,Y=U;else Z=U,Y=this;var I=0;for(var L=0;L<Y.length;L++)X=(Z.words[L]|0)-(Y.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;for(;I!==0&&L<Z.length;L++)X=(Z.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;if(I===0&&L<Z.length&&Z!==this)for(;L<Z.length;L++)this.words[L]=Z.words[L];if(this.length=Math.max(this.length,L),Z!==this)this.negative=1;return this.strip()},A.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,J){J.negative=X.negative^U.negative;var Z=U.length+X.length|0;J.length=Z,Z=Z-1|0;var Y=U.words[0]|0,I=X.words[0]|0,L=Y*I,G=L&67108863,O=L/67108864|0;J.words[0]=G;for(var E=1;E<Z;E++){var T=O>>>26,S=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;Y=U.words[p]|0,I=X.words[g]|0,L=Y*I+S,T+=L/67108864|0,S=L&67108863}J.words[E]=S|0,O=T|0}if(O!==0)J.words[E]=O|0;else J.length--;return J.strip()}var k=function(U,X,J){var Z=U.words,Y=X.words,I=J.words,L=0,G,O,E,T=Z[0]|0,S=T&8191,v=T>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,s=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,t=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,L0=w0>>>13,t0=Z[9]|0,E0=t0&8191,K0=t0>>>13,e0=Y[0]|0,S0=e0&8191,H0=e0>>>13,FU=Y[1]|0,R0=FU&8191,k0=FU>>>13,RU=Y[2]|0,_0=RU&8191,T0=RU>>>13,SU=Y[3]|0,v0=SU&8191,z0=SU>>>13,CU=Y[4]|0,j0=CU&8191,B0=CU>>>13,LU=Y[5]|0,M0=LU&8191,N=LU>>>13,b=Y[6]|0,a=b&8191,U0=b>>>13,f0=Y[7]|0,I0=f0&8191,W0=f0>>>13,s0=Y[8]|0,q0=s0&8191,x0=s0>>>13,DU=Y[9]|0,P0=DU&8191,D0=DU>>>13;J.negative=U.negative^X.negative,J.length=19,G=Math.imul(S,S0),O=Math.imul(S,H0),O=O+Math.imul(v,S0)|0,E=Math.imul(v,H0);var r0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,S0),O=Math.imul(p,H0),O=O+Math.imul(n,S0)|0,E=Math.imul(n,H0),G=G+Math.imul(S,R0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,S0),O=Math.imul(r,H0),O=O+Math.imul(l,S0)|0,E=Math.imul(l,H0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(S,_0)|0,O=O+Math.imul(S,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,S0),O=Math.imul(m,H0),O=O+Math.imul(i,S0)|0,E=Math.imul(i,H0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(S,v0)|0,O=O+Math.imul(S,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,S0),O=Math.imul(y,H0),O=O+Math.imul(h,S0)|0,E=Math.imul(h,H0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(S,j0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(s,S0),O=Math.imul(s,H0),O=O+Math.imul(e,S0)|0,E=Math.imul(e,H0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(S,M0)|0,O=O+Math.imul(S,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,S0),O=Math.imul(c,H0),O=O+Math.imul(o,S0)|0,E=Math.imul(o,H0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(S,a)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(t,S0),O=Math.imul(t,H0),O=O+Math.imul(Z0,S0)|0,E=Math.imul(Z0,H0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(S,I0)|0,O=O+Math.imul(S,W0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,W0)|0;var OU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,S0),O=Math.imul(C0,H0),O=O+Math.imul(L0,S0)|0,E=Math.imul(L0,H0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,W0)|0,G=G+Math.imul(S,q0)|0,O=O+Math.imul(S,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,S0),O=Math.imul(E0,H0),O=O+Math.imul(K0,S0)|0,E=Math.imul(K0,H0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(L0,R0)|0,E=E+Math.imul(L0,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,W0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(S,P0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,D0)|0;var XU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(K0,R0)|0,E=Math.imul(K0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(L0,_0)|0,E=E+Math.imul(L0,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,W0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,D0)|0;var QU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(K0,_0)|0,E=Math.imul(K0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(L0,v0)|0,E=E+Math.imul(L0,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,W0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,D0)|0;var YU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(K0,v0)|0,E=Math.imul(K0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(L0,j0)|0,E=E+Math.imul(L0,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,W0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,D0)|0;var $U=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(K0,j0)|0,E=Math.imul(K0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(L0,M0)|0,E=E+Math.imul(L0,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,W0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,D0)|0;var AU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(K0,M0)|0,E=Math.imul(K0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(L0,a)|0,E=E+Math.imul(L0,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,W0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,D0)|0;var JU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(K0,a)|0,E=Math.imul(K0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,W0)|0,O=O+Math.imul(L0,I0)|0,E=E+Math.imul(L0,W0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,D0)|0;var GU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,W0),O=O+Math.imul(K0,I0)|0,E=Math.imul(K0,W0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(L0,q0)|0,E=E+Math.imul(L0,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,D0)|0;var VU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(K0,q0)|0,E=Math.imul(K0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,D0)|0,O=O+Math.imul(L0,P0)|0,E=E+Math.imul(L0,D0)|0;var EU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,D0),O=O+Math.imul(K0,P0)|0,E=Math.imul(K0,D0);var IU=(L+G|0)+((O&8191)<<13)|0;if(L=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=$U,I[13]=AU,I[14]=JU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,L!==0)I[19]=L,J.length++;return J};if(!Math.imul)k=_;function B(U,X,J){J.negative=X.negative^U.negative,J.length=U.length+X.length;var Z=0,Y=0;for(var I=0;I<J.length-1;I++){var L=Y;Y=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var T=I-E,S=U.words[T]|0,v=X.words[E]|0,g=S*v,p=g&67108863;L=L+(g/67108864|0)|0,p=p+G|0,G=p&67108863,L=L+(p>>>26)|0,Y+=L>>>26,L&=67108863}J.words[I]=G,Z=L,L=Y}if(Z!==0)J.words[I]=Z;else J.length--;return J.strip()}function j(U,X,J){var Z=new x;return Z.mulp(U,X,J)}A.prototype.mulTo=function(U,X){var J,Z=this.length+U.length;if(this.length===10&&U.length===10)J=k(this,U,X);else if(Z<63)J=_(this,U,X);else if(Z<1024)J=B(this,U,X);else J=j(this,U,X);return J};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),J=A.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,J,U);return X},x.prototype.revBin=function(U,X,J){if(U===0||U===J-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},x.prototype.permute=function(U,X,J,Z,Y,I){for(var L=0;L<I;L++)Z[L]=X[U[L]],Y[L]=J[U[L]]},x.prototype.transform=function(U,X,J,Z,Y,I){this.permute(I,U,X,J,Z,Y);for(var L=1;L<Y;L<<=1){var G=L<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var T=0;T<Y;T+=G){var S=O,v=E;for(var g=0;g<L;g++){var p=J[T+g],n=Z[T+g],V0=J[T+g+L],r=Z[T+g+L],l=S*V0-v*r;if(r=S*r+v*V0,V0=l,J[T+g]=p+V0,Z[T+g]=n+r,J[T+g+L]=p-V0,Z[T+g+L]=n-r,g!==G)l=O*S-E*v,v=O*v+E*S,S=l}}}},x.prototype.guessLen13b=function(U,X){var J=Math.max(X,U)|1,Z=J&1,Y=0;for(J=J/2|0;J;J=J>>>1)Y++;return 1<<Y+1+Z},x.prototype.conjugate=function(U,X,J){if(J<=1)return;for(var Z=0;Z<J/2;Z++){var Y=U[Z];U[Z]=U[J-Z-1],U[J-Z-1]=Y,Y=X[Z],X[Z]=-X[J-Z-1],X[J-Z-1]=-Y}},x.prototype.normalize13b=function(U,X){var J=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+J;if(U[Z]=Y&67108863,Y<67108864)J=0;else J=Y/67108864|0}return U},x.prototype.convert13b=function(U,X,J,Z){var Y=0;for(var I=0;I<X;I++)Y=Y+(U[I]|0),J[2*I]=Y&8191,Y=Y>>>13,J[2*I+1]=Y&8191,Y=Y>>>13;for(I=2*X;I<Z;++I)J[I]=0;C(Y===0),C((Y&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var J=0;J<U;J++)X[J]=0;return X},x.prototype.mulp=function(U,X,J){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),I=this.stub(Z),L=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),T=Array(Z),S=Array(Z),v=J.words;v.length=Z,this.convert13b(U.words,U.length,L,Z),this.convert13b(X.words,X.length,E,Z),this.transform(L,I,G,O,Z,Y),this.transform(E,I,T,S,Z,Y);for(var g=0;g<Z;g++){var p=G[g]*T[g]-O[g]*S[g];O[g]=G[g]*S[g]+O[g]*T[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,Y),this.conjugate(v,I,Z),this.normalize13b(v,Z),J.negative=U.negative^X.negative,J.length=U.length+X.length,J.strip()},A.prototype.mul=function(U){var X=new A(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},A.prototype.mulf=function(U){var X=new A(null);return X.words=Array(this.length+U.length),j(this,U,X)},A.prototype.imul=function(U){return this.clone().mulTo(U,this)},A.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var J=0;J<this.length;J++){var Z=(this.words[J]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[J]=Y&67108863}if(X!==0)this.words[J]=X,this.length++;return this.length=U===0?1:this.length,this},A.prototype.muln=function(U){return this.clone().imuln(U)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(U){var X=P(U);if(X.length===0)return new A(1);var J=this;for(var Z=0;Z<X.length;Z++,J=J.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=J.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;J=J.mul(Y)}return J},A.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var I=0;for(Y=0;Y<this.length;Y++){var L=this.words[Y]&Z,G=(this.words[Y]|0)-L<<X;this.words[Y]=G|I,I=L>>>26-X}if(I)this.words[Y]=I,this.length++}if(J!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+J]=this.words[Y];for(Y=0;Y<J;Y++)this.words[Y]=0;this.length+=J}return this.strip()},A.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},A.prototype.iushrn=function(U,X,J){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,I=Math.min((U-Y)/26,this.length),L=67108863^67108863>>>Y<<Y,G=J;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var T=this.words[O]|0;this.words[O]=E<<26-Y|T>>>Y,E=T&L}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},A.prototype.ishrn=function(U,X,J){return C(this.negative===0),this.iushrn(U,X,J)},A.prototype.shln=function(U){return this.clone().ishln(U)},A.prototype.ushln=function(U){return this.clone().iushln(U)},A.prototype.shrn=function(U){return this.clone().ishrn(U)},A.prototype.ushrn=function(U){return this.clone().iushrn(U)},A.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return!1;var Y=this.words[J];return!!(Y&Z)},A.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=J)return this;if(X!==0)J++;if(this.length=Math.min(J,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},A.prototype.maskn=function(U){return this.clone().imaskn(U)},A.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},A.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},A.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},A.prototype.addn=function(U){return this.clone().iaddn(U)},A.prototype.subn=function(U){return this.clone().isubn(U)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(U,X,J){var Z=U.length+J,Y;this._expand(Z);var I,L=0;for(Y=0;Y<U.length;Y++){I=(this.words[Y+J]|0)+L;var G=(U.words[Y]|0)*X;I-=G&67108863,L=(I>>26)-(G/67108864|0),this.words[Y+J]=I&67108863}for(;Y<this.length-J;Y++)I=(this.words[Y+J]|0)+L,L=I>>26,this.words[Y+J]=I&67108863;if(L===0)return this.strip();C(L===-1),L=0;for(Y=0;Y<this.length;Y++)I=-(this.words[Y]|0)+L,L=I>>26,this.words[Y]=I&67108863;return this.negative=1,this.strip()},A.prototype._wordDiv=function(U,X){var J=this.length-U.length,Z=this.clone(),Y=U,I=Y.words[Y.length-1]|0,L=this._countBits(I);if(J=26-L,J!==0)Y=Y.ushln(J),Z.iushln(J),I=Y.words[Y.length-1]|0;var G=Z.length-Y.length,O;if(X!=="mod"){O=new A(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var T=Z.clone()._ishlnsubmul(Y,1,G);if(T.negative===0){if(Z=T,O)O.words[G]=1}for(var S=G-1;S>=0;S--){var v=(Z.words[Y.length+S]|0)*67108864+(Z.words[Y.length+S-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul(Y,v,S);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul(Y,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&J!==0)Z.iushrn(J);return{div:O||null,mod:Z}},A.prototype.divmod=function(U,X,J){if(C(!U.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var Z,Y,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.isub(U)}return{div:I.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new A(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new A(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new A(this.modn(U.words[0]))}}return this._wordDiv(U,X)},A.prototype.div=function(U){return this.divmod(U,"div",!1).div},A.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},A.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},A.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var J=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),I=J.cmp(Z);if(I<0||Y===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},A.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,J=0;for(var Z=this.length-1;Z>=0;Z--)J=(X*J+(this.words[Z]|0))%U;return J},A.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var J=this.length-1;J>=0;J--){var Z=(this.words[J]|0)+X*67108864;this.words[J]=Z/U|0,X=Z%U}return this.strip()},A.prototype.divn=function(U){return this.clone().idivn(U)},A.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=new A(0),L=new A(1),G=0;while(X.isEven()&&J.isEven())X.iushrn(1),J.iushrn(1),++G;var O=J.clone(),E=X.clone();while(!X.isZero()){for(var T=0,S=1;(X.words[0]&S)===0&&T<26;++T,S<<=1);if(T>0){X.iushrn(T);while(T-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(E);Z.iushrn(1),Y.iushrn(1)}}for(var v=0,g=1;(J.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){J.iushrn(v);while(v-- >0){if(I.isOdd()||L.isOdd())I.iadd(O),L.isub(E);I.iushrn(1),L.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(I),Y.isub(L);else J.isub(X),I.isub(Z),L.isub(Y)}return{a:I,b:L,gcd:J.iushln(G)}},A.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=J.clone();while(X.cmpn(1)>0&&J.cmpn(1)>0){for(var L=0,G=1;(X.words[0]&G)===0&&L<26;++L,G<<=1);if(L>0){X.iushrn(L);while(L-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(J.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){J.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(I);Y.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(Y);else J.isub(X),Y.isub(Z)}var T;if(X.cmpn(1)===0)T=Z;else T=Y;if(T.cmpn(0)<0)T.iadd(U);return T},A.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),J=U.clone();X.negative=0,J.negative=0;for(var Z=0;X.isEven()&&J.isEven();Z++)X.iushrn(1),J.iushrn(1);do{while(X.isEven())X.iushrn(1);while(J.isEven())J.iushrn(1);var Y=X.cmp(J);if(Y<0){var I=X;X=J,J=I}else if(Y===0||J.cmpn(1)===0)break;X.isub(J)}while(!0);return J.iushln(Z)},A.prototype.invm=function(U){return this.egcd(U).a.umod(U)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(U){return this.words[0]&U},A.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return this._expand(J+1),this.words[J]|=Z,this;var Y=Z;for(var I=J;Y!==0&&I<this.length;I++){var L=this.words[I]|0;L+=Y,Y=L>>>26,L&=67108863,this.words[I]=L}if(Y!==0)this.words[I]=Y,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var J;if(this.length>1)J=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;J=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-J|0;return J},A.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},A.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var J=this.length-1;J>=0;J--){var Z=this.words[J]|0,Y=U.words[J]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},A.prototype.gtn=function(U){return this.cmpn(U)===1},A.prototype.gt=function(U){return this.cmp(U)===1},A.prototype.gten=function(U){return this.cmpn(U)>=0},A.prototype.gte=function(U){return this.cmp(U)>=0},A.prototype.ltn=function(U){return this.cmpn(U)===-1},A.prototype.lt=function(U){return this.cmp(U)===-1},A.prototype.lten=function(U){return this.cmpn(U)<=0},A.prototype.lte=function(U){return this.cmp(U)<=0},A.prototype.eqn=function(U){return this.cmpn(U)===0},A.prototype.eq=function(U){return this.cmp(U)===0},A.red=function(U){return new u(U)},A.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(U){return this.red=U,this},A.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},A.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},A.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},A.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},A.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},A.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},A.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},A.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new A(X,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new A(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,J;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),J=X.bitLength();while(J>this.n);var Z=J<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D(d,w),d.prototype.split=function(U,X){var J=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&J;for(Y=10;Y<U.length;Y++){var L=U.words[Y]|0;U.words[Y-10]=(L&J)<<4|I>>>22,I=L}if(I>>>=22,U.words[Y-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var J=0;J<U.length;J++){var Z=U.words[J]|0;X+=Z*977,U.words[J]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(Y0,w);function J0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(J0,w);function $0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D($0,w),$0.prototype.imulK=function(U){var X=0;for(var J=0;J<U.length;J++){var Z=(U.words[J]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[J]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},A._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new J0;else if(U==="p25519")X=new $0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=A._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var J=U.add(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var J=U.iadd(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J},u.prototype.sub=function(U,X){this._verify2(U,X);var J=U.sub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var J=U.isub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var J=this.m.add(new A(1)).iushrn(2);return this.pow(U,J)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);C(!Z.isZero());var I=new A(1).toRed(this),L=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new A(2*O*O).toRed(this);while(this.pow(O,G).cmp(L)!==0)O.redIAdd(L);var E=this.pow(O,Z),T=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),v=Y;while(S.cmp(I)!==0){var g=S;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new A(1).iushln(v-p-1));T=T.redMul(n),E=n.redSqr(),S=S.redMul(E),v=p}return T},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new A(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var J=4,Z=Array(1<<J);Z[0]=new A(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var I=Z[0],L=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var E=X.words[Y];for(var T=O-1;T>=0;T--){var S=E>>T&1;if(I!==Z[0])I=this.sqr(I);if(S===0&&L===0){G=0;continue}if(L<<=1,L|=S,G++,G!==J&&(Y!==0||T!==0))continue;I=this.mul(I,Z[L]),G=0,L=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},A.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(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)}D(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var J=U.imul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new A(0)._forceRed(this);var J=U.mul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof $>"u"||$,Q)}),ZG=A0((Q)=>{var $=NO(),V=xU(),W=Q;W.define=function(D,A){return new C(D,A)};function C(D,A){this.name=D,this.body=A,this.decoders={},this.encoders={}}C.prototype._createNamed=function(D){var A;try{A=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
12
+ `)+" "+V[1];return V[0]+Y+" "+Q.join(", ")+" "+V[1]}function yQ(Q){return Array.isArray(Q)}function rZ(Q){return typeof Q==="boolean"}function eO(Q){return Q===null}function bJ(Q){return Q==null}function cQ(Q){return typeof Q==="number"}function iO(Q){return typeof Q==="string"}function lJ(Q){return typeof Q==="symbol"}function CO(Q){return Q===void 0}function sO(Q){return LO(Q)&&aZ(Q)==="[object RegExp]"}function LO(Q){return typeof Q==="object"&&Q!==null}function sZ(Q){return LO(Q)&&aZ(Q)==="[object Date]"}function tO(Q){return LO(Q)&&(aZ(Q)==="[object Error]"||Q instanceof Error)}function rO(Q){return typeof Q==="function"}function dJ(Q){return Q===null||typeof Q==="boolean"||typeof Q==="number"||typeof Q==="string"||typeof Q==="symbol"||typeof Q>"u"}function oJ(Q){return Q instanceof Buffer}function aZ(Q){return Object.prototype.toString.call(Q)}function nZ(Q){return Q<10?"0"+Q.toString(10):Q.toString(10)}function mJ(){var Q=new Date,Y=[nZ(Q.getHours()),nZ(Q.getMinutes()),nZ(Q.getSeconds())].join(":");return[Q.getDate(),nJ[Q.getMonth()],Y].join(" ")}function pQ(...Q){console.log("%s - %s",mJ(),tZ.apply(null,Q))}function hQ(Q,Y){if(Y)Q.super_=Y,Q.prototype=Object.create(Y.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})}function eZ(Q,Y){if(!Y||!LO(Y))return Q;var V=Object.keys(Y),H=V.length;while(H--)Q[V[H]]=Y[V[H]];return Q}function uQ(Q,Y){return Object.prototype.hasOwnProperty.call(Q,Y)}function iZ(Q,Y){if(!Q){var V=Error("Promise was rejected with a falsy value");V.reason=Q,Q=V}return Y(Q)}function lQ(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');function Y(...V){var H=V.pop();if(typeof H!=="function")throw TypeError("The last argument must be of type Function");var C=this,D=function(...J){return H.apply(C,...J)};Q.apply(this,V).then(function(J){process.nextTick(D.bind(null,null,J))},function(J){process.nextTick(iZ.bind(null,J,D))})}return Object.setPrototypeOf(Y,Object.getPrototypeOf(Q)),Object.defineProperties(Y,Object.getOwnPropertyDescriptors(Q)),Y}var xJ,gJ,AO,uJ=()=>{},nJ,bQ,dQ,oQ,sJ;var mQ=WO(()=>{xJ=/%[sdj%]/g;gJ=((Q={},Y={},V)=>((V=typeof process<"u"&&!1)&&(V=V.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),Y=new RegExp("^"+V+"$","i"),(H)=>{if(H=H.toUpperCase(),!Q[H])if(Y.test(H))Q[H]=function(...C){console.error("%s: %s",H,pid,tZ.apply(null,...C))};else Q[H]=function(){};return Q[H]}))(),AO=((Q)=>(Q.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Q.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Q.custom=Symbol.for("nodejs.util.inspect.custom"),Q))(function(Q,Y,...V){var H={seen:[],stylize:wJ};if(V.length>=1)H.depth=V[0];if(V.length>=2)H.colors=V[1];if(rZ(Y))H.showHidden=Y;else if(Y)eZ(H,Y);if(CO(H.showHidden))H.showHidden=!1;if(CO(H.depth))H.depth=2;if(CO(H.colors))H.colors=!1;if(H.colors)H.stylize=fJ;return aO(H,Q,H.depth)});nJ=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];bQ=((Q)=>(Q.custom=Symbol.for("nodejs.util.promisify.custom"),Q))(function(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&Q[kCustomPromisifiedSymbol]){var Y=Q[kCustomPromisifiedSymbol];if(typeof Y!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(Y,kCustomPromisifiedSymbol,{value:Y,enumerable:!1,writable:!1,configurable:!0}),Y}function Y(...V){var H,C,D=new Promise(function(J,T){H=J,C=T});V.push(function(J,T){if(J)C(J);else H(T)});try{Q.apply(this,V)}catch(J){C(J)}return D}if(Object.setPrototypeOf(Y,Object.getPrototypeOf(Q)),kCustomPromisifiedSymbol)Object.defineProperty(Y,kCustomPromisifiedSymbol,{value:Y,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(Y,Object.getOwnPropertyDescriptors(Q))});({TextEncoder:dQ,TextDecoder:oQ}=globalThis),sJ={TextEncoder:dQ,TextDecoder:oQ,promisify:bQ,log:pQ,inherits:hQ,_extend:eZ,callbackifyOnRejected:iZ,callbackify:lQ}});var vU={};HO(vU,{webcrypto:()=>RV,rng:()=>NG,randomUUID:()=>SV,randomFillSync:()=>CV,randomFill:()=>IV,randomBytes:()=>gG,publicEncrypt:()=>AV,publicDecrypt:()=>VV,pseudoRandomBytes:()=>xG,prng:()=>BG,privateEncrypt:()=>GV,privateDecrypt:()=>EV,pbkdf2Sync:()=>uG,pbkdf2:()=>hG,listCiphers:()=>aG,getRandomValues:()=>WV,getHashes:()=>pG,getDiffieHellman:()=>UV,getCurves:()=>FV,getCiphers:()=>rG,default:()=>TV,createVerify:()=>YV,createSign:()=>XV,createHmac:()=>cG,createHash:()=>wG,createECDH:()=>JV,createDiffieHellmanGroup:()=>iG,createDiffieHellman:()=>OV,createDecipheriv:()=>tG,createDecipher:()=>mG,createCredentials:()=>LV,createCipheriv:()=>oG,createCipher:()=>lG,constants:()=>KV,Verify:()=>$V,Sign:()=>QV,Hmac:()=>yG,Hash:()=>fG,DiffieHellmanGroup:()=>eG,DiffieHellman:()=>ZV,Decipheriv:()=>sG,Decipher:()=>nG,DEFAULT_ENCODING:()=>HV,Cipheriv:()=>dG,Cipher:()=>bG});function FV(){return DV}var tJ,rJ,sQ,aJ,eJ,iJ=(Q,Y,V)=>{V=Q!=null?tJ(rJ(Q)):{};let H=Y||!Q||!Q.__esModule?sQ(V,"default",{value:Q,enumerable:!0}):V;for(let C of aJ(Q))if(!eJ.call(H,C))sQ(H,C,{get:()=>Q[C],enumerable:!0});return H},J0=(Q,Y)=>()=>(Y||Q((Y={exports:{}}).exports,Y),Y.exports),UZ,OZ,rQ,UA,OX,ZX,MU,OA,vO,aQ,ZA,XA,QA,YA,eQ,$A,JA,AA,GA,VA,EA,IA,CA,LA,KA,jO,ZZ,iQ,HA,UY,OY,WA,BO,XX,QX,SA,ZY,YX,DA,XY,FA,QY,YY,RA,TA,zA,MA,qA,PA,kA,_A,vA,jA,BA,xA,NA,gA,$X,$Y,fA,JY,wA,yA,cA,pA,sU,OO,AY,yU,GY,XZ,hA,xU,uA,bA,lA,VY,dU,xO,EY,dA,IY,oA,CY,nA,mA,sA,tA,JX,rA,AX,aA,eA,iA,UG,OG,ZG,XG,QG,YG,$G,JG,AG,GG,VG,tQ,EG,_O,IG,LY,KY,CG,LG,HY,KG,HG,NO,WG,SG,DG,FG,RG,TG,WY,zG,SY,DY,FY,GX,RY,MG,TY,qG,PG,UX,kG,_G,vG,jG,p0,BG,xG,NG,gG,fG,wG,yG,cG,pG,hG,uG,bG,lG,dG,oG,nG,mG,sG,tG,rG,aG,eG,iG,UV,OV,ZV,XV,QV,YV,$V,JV,AV,GV,VV,EV,IV,CV,LV,KV,HV="buffer",WV=(Q)=>{return crypto.getRandomValues(Q)},SV=()=>{return crypto.randomUUID()},DV,RV,TV;var jU=WO(()=>{tJ=Object.create,{getPrototypeOf:rJ,defineProperty:sQ,getOwnPropertyNames:aJ}=Object,eJ=Object.prototype.hasOwnProperty,UZ=J0((Q,Y)=>{Y.exports=(jU(),h0(vU)).randomBytes}),OZ=J0((Q,Y)=>{Y.exports=(jU(),h0(vU)).createHash}),rQ=J0((Q,Y)=>{Y.exports=(jU(),h0(vU)).createHmac}),UA=J0((Q,Y)=>{Y.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"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:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"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:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),OX=J0((Q,Y)=>{var V=isFinite,H=Math.pow(2,30)-1;Y.exports=function(C,D){if(typeof C!=="number")throw TypeError("Iterations not a number");if(C<0||!V(C))throw TypeError("Bad iterations");if(typeof D!=="number")throw TypeError("Key length not a number");if(D<0||D>H||D!==D)throw TypeError("Bad key length")}}),ZX=J0((Q,Y)=>{var V;if(globalThis.process&&globalThis.process.browser)V="utf-8";else if(globalThis.process&&globalThis.process.version)H=parseInt(process.version.split(".")[0].slice(1),10),V=H>=6?"utf-8":"binary";else V="utf-8";var H;Y.exports=V}),MU=J0((Q,Y)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=(WU(),h0(HU)),H=V.Buffer;function C(J,T){for(var M in J)T[M]=J[M]}if(H.from&&H.alloc&&H.allocUnsafe&&H.allocUnsafeSlow)Y.exports=V;else C(V,Q),Q.Buffer=D;function D(J,T,M){return H(J,T,M)}D.prototype=Object.create(H.prototype),C(H,D),D.from=function(J,T,M){if(typeof J==="number")throw TypeError("Argument must not be a number");return H(J,T,M)},D.alloc=function(J,T,M){if(typeof J!=="number")throw TypeError("Argument must be a number");var F=H(J);if(T!==void 0)if(typeof M==="string")F.fill(T,M);else F.fill(T);else F.fill(0);return F},D.allocUnsafe=function(J){if(typeof J!=="number")throw TypeError("Argument must be a number");return H(J)},D.allocUnsafeSlow=function(J){if(typeof J!=="number")throw TypeError("Argument must be a number");return V.SlowBuffer(J)}}),OA=J0((Q,Y)=>{var V={}.toString;Y.exports=Array.isArray||function(H){return V.call(H)=="[object Array]"}}),vO=J0((Q,Y)=>{Y.exports=TypeError}),aQ=J0((Q,Y)=>{Y.exports=Object}),ZA=J0((Q,Y)=>{Y.exports=Error}),XA=J0((Q,Y)=>{Y.exports=EvalError}),QA=J0((Q,Y)=>{Y.exports=RangeError}),YA=J0((Q,Y)=>{Y.exports=ReferenceError}),eQ=J0((Q,Y)=>{Y.exports=SyntaxError}),$A=J0((Q,Y)=>{Y.exports=URIError}),JA=J0((Q,Y)=>{Y.exports=Math.abs}),AA=J0((Q,Y)=>{Y.exports=Math.floor}),GA=J0((Q,Y)=>{Y.exports=Math.max}),VA=J0((Q,Y)=>{Y.exports=Math.min}),EA=J0((Q,Y)=>{Y.exports=Math.pow}),IA=J0((Q,Y)=>{Y.exports=Math.round}),CA=J0((Q,Y)=>{Y.exports=Number.isNaN||function(V){return V!==V}}),LA=J0((Q,Y)=>{var V=CA();Y.exports=function(H){if(V(H)||H===0)return H;return H<0?-1:1}}),KA=J0((Q,Y)=>{Y.exports=Object.getOwnPropertyDescriptor}),jO=J0((Q,Y)=>{var V=KA();if(V)try{V([],"length")}catch(H){V=null}Y.exports=V}),ZZ=J0((Q,Y)=>{var V=Object.defineProperty||!1;if(V)try{V({},"a",{value:1})}catch(H){V=!1}Y.exports=V}),iQ=J0((Q,Y)=>{Y.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var V={},H=Symbol("test"),C=Object(H);if(typeof H==="string")return!1;if(Object.prototype.toString.call(H)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(C)!=="[object Symbol]")return!1;var D=42;V[H]=D;for(var J in V)return!1;if(typeof Object.keys==="function"&&Object.keys(V).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(V).length!==0)return!1;var T=Object.getOwnPropertySymbols(V);if(T.length!==1||T[0]!==H)return!1;if(!Object.prototype.propertyIsEnumerable.call(V,H))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var M=Object.getOwnPropertyDescriptor(V,H);if(M.value!==D||M.enumerable!==!0)return!1}return!0}}),HA=J0((Q,Y)=>{var V=typeof Symbol<"u"&&Symbol,H=iQ();Y.exports=function(){if(typeof V!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof V("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return H()}}),UY=J0((Q,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),OY=J0((Q,Y)=>{var V=aQ();Y.exports=V.getPrototypeOf||null}),WA=J0((Q,Y)=>{var V="Function.prototype.bind called on incompatible ",H=Object.prototype.toString,C=Math.max,D="[object Function]",J=function(F,R){var K=[];for(var W=0;W<F.length;W+=1)K[W]=F[W];for(var q=0;q<R.length;q+=1)K[q+F.length]=R[q];return K},T=function(F,R){var K=[];for(var W=R||0,q=0;W<F.length;W+=1,q+=1)K[q]=F[W];return K},M=function(F,R){var K="";for(var W=0;W<F.length;W+=1)if(K+=F[W],W+1<F.length)K+=R;return K};Y.exports=function(F){var R=this;if(typeof R!=="function"||H.apply(R)!==D)throw TypeError(V+R);var K=T(arguments,1),W,q=function(){if(this instanceof W){var j=R.apply(this,J(K,arguments));if(Object(j)===j)return j;return this}return R.apply(F,J(K,arguments))},P=C(0,R.length-K.length),_=[];for(var k=0;k<P;k++)_[k]="$"+k;if(W=Function("binder","return function ("+M(_,",")+"){ return binder.apply(this,arguments); }")(q),R.prototype){var B=function(){};B.prototype=R.prototype,W.prototype=new B,B.prototype=null}return W}}),BO=J0((Q,Y)=>{var V=WA();Y.exports=Function.prototype.bind||V}),XX=J0((Q,Y)=>{Y.exports=Function.prototype.call}),QX=J0((Q,Y)=>{Y.exports=Function.prototype.apply}),SA=J0((Q,Y)=>{Y.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),ZY=J0((Q,Y)=>{var V=BO(),H=QX(),C=XX(),D=SA();Y.exports=D||V.call(C,H)}),YX=J0((Q,Y)=>{var V=BO(),H=vO(),C=XX(),D=ZY();Y.exports=function(J){if(J.length<1||typeof J[0]!=="function")throw new H("a function is required");return D(V,C,J)}}),DA=J0((Q,Y)=>{var V=YX(),H=jO(),C;try{C=[].__proto__===Array.prototype}catch(M){if(!M||typeof M!=="object"||!("code"in M)||M.code!=="ERR_PROTO_ACCESS")throw M}var D=!!C&&H&&H(Object.prototype,"__proto__"),J=Object,T=J.getPrototypeOf;Y.exports=D&&typeof D.get==="function"?V([D.get]):typeof T==="function"?function(M){return T(M==null?M:J(M))}:!1}),XY=J0((Q,Y)=>{var V=UY(),H=OY(),C=DA();Y.exports=V?function(D){return V(D)}:H?function(D){if(!D||typeof D!=="object"&&typeof D!=="function")throw TypeError("getProto: not an object");return H(D)}:C?function(D){return C(D)}:null}),FA=J0((Q,Y)=>{var V=Function.prototype.call,H=Object.prototype.hasOwnProperty,C=BO();Y.exports=C.call(V,H)}),QY=J0((Q,Y)=>{var V,H=aQ(),C=ZA(),D=XA(),J=QA(),T=YA(),M=eQ(),F=vO(),R=$A(),K=JA(),W=AA(),q=GA(),P=VA(),_=EA(),k=IA(),B=LA(),j=Function,x=function(X0){try{return j('"use strict"; return ('+X0+").constructor;")()}catch(m){}},f=jO(),w=ZZ(),d=function(){throw new F},Y0=f?function(){try{return arguments.callee,d}catch(X0){try{return f(arguments,"callee").get}catch(m){return d}}}():d,A0=HA()(),$0=XY(),u=OY(),O0=UY(),U=QX(),X=XX(),A={},Z=typeof Uint8Array>"u"||!$0?V:$0(Uint8Array),$={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?V:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?V:ArrayBuffer,"%ArrayIteratorPrototype%":A0&&$0?$0([][Symbol.iterator]()):V,"%AsyncFromSyncIteratorPrototype%":V,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>"u"?V:Atomics,"%BigInt%":typeof BigInt>"u"?V:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?V:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?V:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?V:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":C,"%eval%":eval,"%EvalError%":D,"%Float16Array%":typeof Float16Array>"u"?V:Float16Array,"%Float32Array%":typeof Float32Array>"u"?V:Float32Array,"%Float64Array%":typeof Float64Array>"u"?V:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?V:FinalizationRegistry,"%Function%":j,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>"u"?V:Int8Array,"%Int16Array%":typeof Int16Array>"u"?V:Int16Array,"%Int32Array%":typeof Int32Array>"u"?V:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A0&&$0?$0($0([][Symbol.iterator]())):V,"%JSON%":typeof JSON==="object"?JSON:V,"%Map%":typeof Map>"u"?V:Map,"%MapIteratorPrototype%":typeof Map>"u"||!A0||!$0?V:$0(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":H,"%Object.getOwnPropertyDescriptor%":f,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?V:Promise,"%Proxy%":typeof Proxy>"u"?V:Proxy,"%RangeError%":J,"%ReferenceError%":T,"%Reflect%":typeof Reflect>"u"?V:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?V:Set,"%SetIteratorPrototype%":typeof Set>"u"||!A0||!$0?V:$0(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?V:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A0&&$0?$0(""[Symbol.iterator]()):V,"%Symbol%":A0?Symbol:V,"%SyntaxError%":M,"%ThrowTypeError%":Y0,"%TypedArray%":Z,"%TypeError%":F,"%Uint8Array%":typeof Uint8Array>"u"?V:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?V:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?V:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?V:Uint32Array,"%URIError%":R,"%WeakMap%":typeof WeakMap>"u"?V:WeakMap,"%WeakRef%":typeof WeakRef>"u"?V:WeakRef,"%WeakSet%":typeof WeakSet>"u"?V:WeakSet,"%Function.prototype.call%":X,"%Function.prototype.apply%":U,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":u,"%Math.abs%":K,"%Math.floor%":W,"%Math.max%":q,"%Math.min%":P,"%Math.pow%":_,"%Math.round%":k,"%Math.sign%":B,"%Reflect.getPrototypeOf%":O0};if($0)try{null.error}catch(X0){I=$0($0(X0)),$["%Error.prototype%"]=I}var I,L=function X0(m){var i;if(m==="%AsyncFunction%")i=x("async function () {}");else if(m==="%GeneratorFunction%")i=x("function* () {}");else if(m==="%AsyncGeneratorFunction%")i=x("async function* () {}");else if(m==="%AsyncGenerator%"){var g0=X0("%AsyncGeneratorFunction%");if(g0)i=g0.prototype}else if(m==="%AsyncIteratorPrototype%"){var y=X0("%AsyncGenerator%");if(y&&$0)i=$0(y.prototype)}return $[m]=i,i},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=BO(),E=FA(),z=O.call(X,Array.prototype.concat),S=O.call(U,Array.prototype.splice),v=O.call(X,String.prototype.replace),g=O.call(X,String.prototype.slice),p=O.call(X,RegExp.prototype.exec),n=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V0=/\\(\\)?/g,r=function(X0){var m=g(X0,0,1),i=g(X0,-1);if(m==="%"&&i!=="%")throw new M("invalid intrinsic syntax, expected closing `%`");else if(i==="%"&&m!=="%")throw new M("invalid intrinsic syntax, expected opening `%`");var g0=[];return v(X0,n,function(y,h,Q0,t){g0[g0.length]=Q0?v(t,V0,"$1"):h||y}),g0},l=function(X0,m){var i=X0,g0;if(E(G,i))g0=G[i],i="%"+g0[0]+"%";if(E($,i)){var y=$[i];if(y===A)y=L(i);if(typeof y>"u"&&!m)throw new F("intrinsic "+X0+" exists, but is not available. Please file an issue!");return{alias:g0,name:i,value:y}}throw new M("intrinsic "+X0+" does not exist!")};Y.exports=function(X0,m){if(typeof X0!=="string"||X0.length===0)throw new F("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof m!=="boolean")throw new F('"allowMissing" argument must be a boolean');if(p(/^%?[^%]*%?$/,X0)===null)throw new M("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=r(X0),g0=i.length>0?i[0]:"",y=l("%"+g0+"%",m),h=y.name,Q0=y.value,t=!1,e=y.alias;if(e)g0=e[0],S(i,z([0,1],e));for(var F0=1,c=!0;F0<i.length;F0+=1){var o=i[F0],N0=g(o,0,1),s=g(o,-1);if((N0==='"'||N0==="'"||N0==="`"||(s==='"'||s==="'"||s==="`"))&&N0!==s)throw new M("property names with quotes must have matching quotes");if(o==="constructor"||!c)t=!0;if(g0+="."+o,h="%"+g0+"%",E($,h))Q0=$[h];else if(Q0!=null){if(!(o in Q0)){if(!m)throw new F("base intrinsic for "+X0+" exists, but the property is not available.");return}if(f&&F0+1>=i.length){var Z0=f(Q0,o);if(c=!!Z0,c&&"get"in Z0&&!("originalValue"in Z0.get))Q0=Z0.get;else Q0=Q0[o]}else c=E(Q0,o),Q0=Q0[o];if(c&&!t)$[h]=Q0}}return Q0}}),YY=J0((Q,Y)=>{var V=QY(),H=YX(),C=H([V("%String.prototype.indexOf%")]);Y.exports=function(D,J){var T=V(D,!!J);if(typeof T==="function"&&C(D,".prototype.")>-1)return H([T]);return T}}),RA=J0((Q,Y)=>{var V=Function.prototype.toString,H=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,C,D;if(typeof H==="function"&&typeof Object.defineProperty==="function")try{C=Object.defineProperty({},"length",{get:function(){throw D}}),D={},H(function(){throw 42},null,C)}catch(f){if(f!==D)H=null}else H=null;var J=/^\s*class\b/,T=function(f){try{var w=V.call(f);return J.test(w)}catch(d){return!1}},M=function(f){try{if(T(f))return!1;return V.call(f),!0}catch(w){return!1}},F=Object.prototype.toString,R="[object Object]",K="[object Function]",W="[object GeneratorFunction]",q="[object HTMLAllCollection]",P="[object HTML document.all class]",_="[object HTMLCollection]",k=typeof Symbol==="function"&&!!Symbol.toStringTag,B=!(0 in[,]),j=function(){return!1};if(typeof document==="object"){if(x=document.all,F.call(x)===F.call(document.all))j=function(f){if((B||!f)&&(typeof f>"u"||typeof f==="object"))try{var w=F.call(f);return(w===q||w===P||w===_||w===R)&&f("")==null}catch(d){}return!1}}var x;Y.exports=H?function(f){if(j(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;try{H(f,null,C)}catch(w){if(w!==D)return!1}return!T(f)&&M(f)}:function(f){if(j(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;if(k)return M(f);if(T(f))return!1;var w=F.call(f);if(w!==K&&w!==W&&!/^\[object HTML/.test(w))return!1;return M(f)}}),TA=J0((Q,Y)=>{var V=RA(),H=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=function(F,R,K){for(var W=0,q=F.length;W<q;W++)if(C.call(F,W))if(K==null)R(F[W],W,F);else R.call(K,F[W],W,F)},J=function(F,R,K){for(var W=0,q=F.length;W<q;W++)if(K==null)R(F.charAt(W),W,F);else R.call(K,F.charAt(W),W,F)},T=function(F,R,K){for(var W in F)if(C.call(F,W))if(K==null)R(F[W],W,F);else R.call(K,F[W],W,F)};function M(F){return H.call(F)==="[object Array]"}Y.exports=function(F,R,K){if(!V(R))throw TypeError("iterator must be a function");var W;if(arguments.length>=3)W=K;if(M(F))D(F,R,W);else if(typeof F==="string")J(F,R,W);else T(F,R,W)}}),zA=J0((Q,Y)=>{Y.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),MA=J0((Q,Y)=>{var V=zA(),H=typeof globalThis>"u"?globalThis:globalThis;Y.exports=function(){var C=[];for(var D=0;D<V.length;D++)if(typeof H[V[D]]==="function")C[C.length]=V[D];return C}}),qA=J0((Q,Y)=>{var V=ZZ(),H=eQ(),C=vO(),D=jO();Y.exports=function(J,T,M){if(!J||typeof J!=="object"&&typeof J!=="function")throw new C("`obj` must be an object or a function`");if(typeof T!=="string"&&typeof T!=="symbol")throw new C("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new C("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new C("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new C("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new C("`loose`, if provided, must be a boolean");var F=arguments.length>3?arguments[3]:null,R=arguments.length>4?arguments[4]:null,K=arguments.length>5?arguments[5]:null,W=arguments.length>6?arguments[6]:!1,q=!!D&&D(J,T);if(V)V(J,T,{configurable:K===null&&q?q.configurable:!K,enumerable:F===null&&q?q.enumerable:!F,value:M,writable:R===null&&q?q.writable:!R});else if(W||!F&&!R&&!K)J[T]=M;else throw new H("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),PA=J0((Q,Y)=>{var V=ZZ(),H=function(){return!!V};H.hasArrayLengthDefineBug=function(){if(!V)return null;try{return V([],"length",{value:1}).length!==1}catch(C){return!0}},Y.exports=H}),kA=J0((Q,Y)=>{var V=QY(),H=qA(),C=PA()(),D=jO(),J=vO(),T=V("%Math.floor%");Y.exports=function(M,F){if(typeof M!=="function")throw new J("`fn` is not a function");if(typeof F!=="number"||F<0||F>4294967295||T(F)!==F)throw new J("`length` must be a positive 32-bit integer");var R=arguments.length>2&&!!arguments[2],K=!0,W=!0;if("length"in M&&D){var q=D(M,"length");if(q&&!q.configurable)K=!1;if(q&&!q.writable)W=!1}if(K||W||!R)if(C)H(M,"length",F,!0,!0);else H(M,"length",F);return M}}),_A=J0((Q,Y)=>{var V=BO(),H=QX(),C=ZY();Y.exports=function(){return C(V,H,arguments)}}),vA=J0((Q,Y)=>{var V=kA(),H=ZZ(),C=YX(),D=_A();if(Y.exports=function(J){var T=C(arguments),M=J.length-(arguments.length-1);return V(T,1+(M>0?M:0),!0)},H)H(Y.exports,"apply",{value:D});else Y.exports.apply=D}),jA=J0((Q,Y)=>{var V=iQ();Y.exports=function(){return V()&&!!Symbol.toStringTag}}),BA=J0((Q,Y)=>{var V=TA(),H=MA(),C=vA(),D=YY(),J=jO(),T=XY(),M=D("Object.prototype.toString"),F=jA()(),R=typeof globalThis>"u"?globalThis:globalThis,K=H(),W=D("String.prototype.slice"),q=D("Array.prototype.indexOf",!0)||function(B,j){for(var x=0;x<B.length;x+=1)if(B[x]===j)return x;return-1},P={__proto__:null};if(F&&J&&T)V(K,function(B){var j=new R[B];if(Symbol.toStringTag in j&&T){var x=T(j),f=J(x,Symbol.toStringTag);if(!f&&x){var w=T(x);f=J(w,Symbol.toStringTag)}P["$"+B]=C(f.get)}});else V(K,function(B){var j=new R[B],x=j.slice||j.set;if(x)P["$"+B]=C(x)});var _=function(B){var j=!1;return V(P,function(x,f){if(!j)try{if("$"+x(B)===f)j=W(f,1)}catch(w){}}),j},k=function(B){var j=!1;return V(P,function(x,f){if(!j)try{x(B),j=W(f,1)}catch(w){}}),j};Y.exports=function(B){if(!B||typeof B!=="object")return!1;if(!F){var j=W(M(B),8,-1);if(q(K,j)>-1)return j;if(j!=="Object")return!1;return k(B)}if(!J)return null;return _(B)}}),xA=J0((Q,Y)=>{var V=BA();Y.exports=function(H){return!!V(H)}}),NA=J0((Q,Y)=>{var V=vO(),H=YY(),C=H("TypedArray.prototype.buffer",!0),D=xA();Y.exports=C||function(J){if(!D(J))throw new V("Not a Typed Array");return J.buffer}}),gA=J0((Q,Y)=>{var V=MU().Buffer,H=OA(),C=NA(),D=ArrayBuffer.isView||function(F){try{return C(F),!0}catch(R){return!1}},J=typeof Uint8Array<"u",T=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",M=T&&(V.prototype instanceof Uint8Array||V.TYPED_ARRAY_SUPPORT);Y.exports=function(F,R){if(V.isBuffer(F)){if(F.constructor&&!("isBuffer"in F))return V.from(F);return F}if(typeof F==="string")return V.from(F,R);if(T&&D(F)){if(F.byteLength===0)return V.alloc(0);if(M){var K=V.from(F.buffer,F.byteOffset,F.byteLength);if(K.byteLength===F.byteLength)return K}var W=F instanceof Uint8Array?F:new Uint8Array(F.buffer,F.byteOffset,F.byteLength),q=V.from(W);if(q.length===F.byteLength)return q}if(J&&F instanceof Uint8Array)return V.from(F);var P=H(F);if(P)for(var _=0;_<F.length;_+=1){var k=F[_];if(typeof k!=="number"||k<0||k>255||~~k!==k)throw RangeError("Array items must be numbers in the range 0-255.")}if(P||V.isBuffer(F)&&F.constructor&&typeof F.constructor.isBuffer==="function"&&F.constructor.isBuffer(F))return V.from(F);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),$X=J0((Q,Y)=>{var V=MU().Buffer,H=gA(),C=typeof Uint8Array<"u",D=C&&typeof ArrayBuffer<"u",J=D&&ArrayBuffer.isView;Y.exports=function(T,M,F){if(typeof T==="string"||V.isBuffer(T)||C&&T instanceof Uint8Array||J&&J(T))return H(T,M);throw TypeError(F+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),$Y=J0((Q,Y)=>{var V={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},H={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},C=rQ(),D=MU().Buffer,J=OX(),T=ZX(),M=$X();function F(R,K,W,q,P){J(W,q),R=M(R,T,"Password"),K=M(K,T,"Salt");var _=(P||"sha1").toLowerCase(),k=H[_]||_,B=V[k];if(typeof B!=="number"||!B)throw TypeError("Digest algorithm not supported: "+P);var j=D.allocUnsafe(q),x=D.allocUnsafe(K.length+4);K.copy(x,0,0,K.length);var f=0,w=B,d=Math.ceil(q/w);for(var Y0=1;Y0<=d;Y0++){x.writeUInt32BE(Y0,K.length);var A0=C(k,R).update(x).digest(),$0=A0;for(var u=1;u<W;u++){$0=C(k,R).update($0).digest();for(var O0=0;O0<w;O0++)A0[O0]^=$0[O0]}A0.copy(j,f),f+=w}return j}Y.exports=F}),fA=J0((Q,Y)=>{var V=MU().Buffer,H=OX(),C=ZX(),D=$Y(),J=$X(),T,M=globalThis.crypto&&globalThis.crypto.subtle,F={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"},R=[],K;function W(){if(K)return K;if(globalThis.process&&globalThis.process.nextTick)K=globalThis.process.nextTick;else if(globalThis.queueMicrotask)K=globalThis.queueMicrotask;else if(globalThis.setImmediate)K=globalThis.setImmediate;else K=globalThis.setTimeout;return K}function q(k,B,j,x,f){return M.importKey("raw",k,{name:"PBKDF2"},!1,["deriveBits"]).then(function(w){return M.deriveBits({name:"PBKDF2",salt:B,iterations:j,hash:{name:f}},w,x<<3)}).then(function(w){return V.from(w)})}function P(k){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!M||!M.importKey||!M.deriveBits)return Promise.resolve(!1);if(R[k]!==void 0)return R[k];T=T||V.alloc(8);var B=q(T,T,10,128,k).then(function(){return!0},function(){return!1});return R[k]=B,B}function _(k,B){k.then(function(j){W()(function(){B(null,j)})},function(j){W()(function(){B(j)})})}Y.exports=function(k,B,j,x,f,w){if(typeof f==="function")w=f,f=void 0;if(H(j,x),k=J(k,C,"Password"),B=J(B,C,"Salt"),typeof w!=="function")throw Error("No callback provided to pbkdf2");f=f||"sha1";var d=F[f.toLowerCase()];if(!d||typeof globalThis.Promise!=="function"){W()(function(){var Y0;try{Y0=D(k,B,j,x,f)}catch(A0){w(A0);return}w(null,Y0)});return}_(P(d).then(function(Y0){if(Y0)return q(k,B,j,x,d);return D(k,B,j,x,f)}),w)}}),JY=J0((Q)=>{var Y=(jU(),h0(vU)),V=OX(),H=ZX(),C=$X();function D(T,M,F,R,K,W){if(V(F,R),T=C(T,H,"Password"),M=C(M,H,"Salt"),typeof K==="function")W=K,K="sha1";if(typeof W!=="function")throw Error("No callback provided to pbkdf2");return Y.pbkdf2(T,M,F,R,K,W)}function J(T,M,F,R,K){return V(F,R),T=C(T,H,"Password"),M=C(M,H,"Salt"),K=K||"sha1",Y.pbkdf2Sync(T,M,F,R,K)}if(!Y.pbkdf2Sync||Y.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)Q.pbkdf2Sync=$Y(),Q.pbkdf2=fA();else Q.pbkdf2Sync=J,Q.pbkdf2=D}),wA=J0((Q)=>{var Y=(jU(),h0(vU));Q.createCipher=Q.Cipher=Y.createCipher,Q.createCipheriv=Q.Cipheriv=Y.createCipheriv,Q.createDecipher=Q.Decipher=Y.createDecipher,Q.createDecipheriv=Q.Decipheriv=Y.createDecipheriv,Q.listCiphers=Q.getCiphers=Y.getCiphers}),yA=J0((Q)=>{var Y=(jU(),h0(vU));Q.DiffieHellmanGroup=Y.DiffieHellmanGroup,Q.createDiffieHellmanGroup=Y.createDiffieHellmanGroup,Q.getDiffieHellman=Y.getDiffieHellman,Q.createDiffieHellman=Y.createDiffieHellman,Q.DiffieHellman=Y.DiffieHellman}),cA=J0((Q)=>{var Y=(jU(),h0(vU));Q.createSign=Y.createSign,Q.Sign=Y.Sign,Q.createVerify=Y.createVerify,Q.Verify=Y.Verify}),pA=J0((Q,Y)=>{Y.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{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/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{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"},dependencies:{"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"}}}),sU=J0((Q,Y)=>{(function(V,H){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function D(U,X){U.super_=X;var A=function(){};A.prototype=X.prototype,U.prototype=new A,U.prototype.constructor=U}function J(U,X,A){if(J.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")A=X,X=10;this._init(U||0,X||10,A||"be")}}if(typeof V==="object")V.exports=J;else H.BN=J;J.BN=J,J.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(WU(),h0(HU)).Buffer}catch(U){}J.isBN=function(U){if(U instanceof J)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===J.wordSize&&Array.isArray(U.words)},J.max=function(U,X){if(U.cmp(X)>0)return U;return X},J.min=function(U,X){if(U.cmp(X)<0)return U;return X},J.prototype._init=function(U,X,A){if(typeof U==="number")return this._initNumber(U,X,A);if(typeof U==="object")return this._initArray(U,X,A);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,A);else if(this._parseBase(U,X,Z),A==="le")this._initArray(this.toArray(),X,A)}},J.prototype._initNumber=function(U,X,A){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(A!=="le")return;this._initArray(this.toArray(),X,A)},J.prototype._initArray=function(U,X,A){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var $,I,L=0;if(A==="be"){for(Z=U.length-1,$=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[$]|=I<<L&67108863,this.words[$+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,$++}else if(A==="le"){for(Z=0,$=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[$]|=I<<L&67108863,this.words[$+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,$++}return this.strip()};function M(U,X){var A=U.charCodeAt(X);if(A>=65&&A<=70)return A-55;else if(A>=97&&A<=102)return A-87;else return A-48&15}function F(U,X,A){var Z=M(U,A);if(A-1>=X)Z|=M(U,A-1)<<4;return Z}J.prototype._parseHex=function(U,X,A){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var $=0,I=0,L;if(A==="be")for(Z=U.length-1;Z>=X;Z-=2)if(L=F(U,X,Z)<<$,this.words[I]|=L&67108863,$>=18)$-=18,I+=1,this.words[I]|=L>>>26;else $+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(L=F(U,X,Z)<<$,this.words[I]|=L&67108863,$>=18)$-=18,I+=1,this.words[I]|=L>>>26;else $+=8}this.strip()};function R(U,X,A,Z){var $=0,I=Math.min(U.length,A);for(var L=X;L<I;L++){var G=U.charCodeAt(L)-48;if($*=Z,G>=49)$+=G-49+10;else if(G>=17)$+=G-17+10;else $+=G}return $}J.prototype._parseBase=function(U,X,A){this.words=[0],this.length=1;for(var Z=0,$=1;$<=67108863;$*=X)Z++;Z--,$=$/X|0;var I=U.length-A,L=I%Z,G=Math.min(I,I-L)+A,O=0;for(var E=A;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln($),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(L!==0){var z=1;O=R(U,E,U.length,X);for(E=0;E<L;E++)z*=X;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},J.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},J.prototype.clone=function(){var U=new J(null);return this.copy(U),U},J.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},J.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},J.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var K=["","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"],W=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(U,X){U=U||10,X=X|0||1;var A;if(U===16||U==="hex"){A="";var Z=0,$=0;for(var I=0;I<this.length;I++){var L=this.words[I],G=((L<<Z|$)&16777215).toString(16);if($=L>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if($!==0||I!==this.length-1)A=K[6-G.length]+G+A;else A=G+A}if($!==0)A=$.toString(16)+A;while(A.length%X!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}if(U===(U|0)&&U>=2&&U<=36){var O=W[U],E=q[U];A="";var z=this.clone();z.negative=0;while(!z.isZero()){var S=z.modn(E).toString(U);if(z=z.idivn(E),!z.isZero())A=K[O-S.length]+S+A;else A=S+A}if(this.isZero())A="0"+A;while(A.length%X!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}C(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},J.prototype.toJSON=function(){return this.toString(16)},J.prototype.toBuffer=function(U,X){return C(typeof T<"u"),this.toArrayLike(T,U,X)},J.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},J.prototype.toArrayLike=function(U,X,A){var Z=this.byteLength(),$=A||Math.max(1,Z);C(Z<=$,"byte array longer than desired length"),C($>0,"Requested array length <= 0"),this.strip();var I=X==="le",L=new U($),G,O,E=this.clone();if(!I){for(O=0;O<$-Z;O++)L[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[$-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[O]=G;for(;O<$;O++)L[O]=0}return L},Math.clz32)J.prototype._countBits=function(U){return 32-Math.clz32(U)};else J.prototype._countBits=function(U){var X=U,A=0;if(X>=4096)A+=13,X>>>=13;if(X>=64)A+=7,X>>>=7;if(X>=8)A+=4,X>>>=4;if(X>=2)A+=2,X>>>=2;return A+X};J.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,A=0;if((X&8191)===0)A+=13,X>>>=13;if((X&127)===0)A+=7,X>>>=7;if((X&15)===0)A+=4,X>>>=4;if((X&3)===0)A+=2,X>>>=2;if((X&1)===0)A++;return A},J.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var A=0;A<X.length;A++){var Z=A/26|0,$=A%26;X[A]=(U.words[Z]&1<<$)>>>$}return X}J.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var A=this._zeroBits(this.words[X]);if(U+=A,A!==26)break}return U},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},J.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},J.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},J.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},J.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},J.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var A=0;A<X.length;A++)this.words[A]=this.words[A]&U.words[A];return this.length=X.length,this.strip()},J.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},J.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},J.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},J.prototype.iuxor=function(U){var X,A;if(this.length>U.length)X=this,A=U;else X=U,A=this;for(var Z=0;Z<A.length;Z++)this.words[Z]=X.words[Z]^A.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},J.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},J.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},J.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},J.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,A=U%26;if(this._expand(X),A>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(A>0)this.words[Z]=~this.words[Z]&67108863>>26-A;return this.strip()},J.prototype.notn=function(U){return this.clone().inotn(U)},J.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var A=U/26|0,Z=U%26;if(this._expand(A+1),X)this.words[A]=this.words[A]|1<<Z;else this.words[A]=this.words[A]&~(1<<Z);return this.strip()},J.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var A,Z;if(this.length>U.length)A=this,Z=U;else A=U,Z=this;var $=0;for(var I=0;I<Z.length;I++)X=(A.words[I]|0)+(Z.words[I]|0)+$,this.words[I]=X&67108863,$=X>>>26;for(;$!==0&&I<A.length;I++)X=(A.words[I]|0)+$,this.words[I]=X&67108863,$=X>>>26;if(this.length=A.length,$!==0)this.words[this.length]=$,this.length++;else if(A!==this)for(;I<A.length;I++)this.words[I]=A.words[I];return this},J.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},J.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var A=this.cmp(U);if(A===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,$;if(A>0)Z=this,$=U;else Z=U,$=this;var I=0;for(var L=0;L<$.length;L++)X=(Z.words[L]|0)-($.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;for(;I!==0&&L<Z.length;L++)X=(Z.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;if(I===0&&L<Z.length&&Z!==this)for(;L<Z.length;L++)this.words[L]=Z.words[L];if(this.length=Math.max(this.length,L),Z!==this)this.negative=1;return this.strip()},J.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,A){A.negative=X.negative^U.negative;var Z=U.length+X.length|0;A.length=Z,Z=Z-1|0;var $=U.words[0]|0,I=X.words[0]|0,L=$*I,G=L&67108863,O=L/67108864|0;A.words[0]=G;for(var E=1;E<Z;E++){var z=O>>>26,S=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;$=U.words[p]|0,I=X.words[g]|0,L=$*I+S,z+=L/67108864|0,S=L&67108863}A.words[E]=S|0,O=z|0}if(O!==0)A.words[E]=O|0;else A.length--;return A.strip()}var k=function(U,X,A){var Z=U.words,$=X.words,I=A.words,L=0,G,O,E,z=Z[0]|0,S=z&8191,v=z>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,t=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,s=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,L0=w0>>>13,s0=Z[9]|0,E0=s0&8191,K0=s0>>>13,e0=$[0]|0,S0=e0&8191,W0=e0>>>13,FU=$[1]|0,R0=FU&8191,k0=FU>>>13,RU=$[2]|0,_0=RU&8191,T0=RU>>>13,SU=$[3]|0,v0=SU&8191,z0=SU>>>13,CU=$[4]|0,j0=CU&8191,B0=CU>>>13,LU=$[5]|0,M0=LU&8191,N=LU>>>13,b=$[6]|0,a=b&8191,U0=b>>>13,f0=$[7]|0,I0=f0&8191,H0=f0>>>13,t0=$[8]|0,q0=t0&8191,x0=t0>>>13,DU=$[9]|0,P0=DU&8191,D0=DU>>>13;A.negative=U.negative^X.negative,A.length=19,G=Math.imul(S,S0),O=Math.imul(S,W0),O=O+Math.imul(v,S0)|0,E=Math.imul(v,W0);var r0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,S0),O=Math.imul(p,W0),O=O+Math.imul(n,S0)|0,E=Math.imul(n,W0),G=G+Math.imul(S,R0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,S0),O=Math.imul(r,W0),O=O+Math.imul(l,S0)|0,E=Math.imul(l,W0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(S,_0)|0,O=O+Math.imul(S,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,S0),O=Math.imul(m,W0),O=O+Math.imul(i,S0)|0,E=Math.imul(i,W0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(S,v0)|0,O=O+Math.imul(S,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,S0),O=Math.imul(y,W0),O=O+Math.imul(h,S0)|0,E=Math.imul(h,W0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(S,j0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(t,S0),O=Math.imul(t,W0),O=O+Math.imul(e,S0)|0,E=Math.imul(e,W0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(S,M0)|0,O=O+Math.imul(S,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,S0),O=Math.imul(c,W0),O=O+Math.imul(o,S0)|0,E=Math.imul(o,W0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(S,a)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,S0),O=Math.imul(s,W0),O=O+Math.imul(Z0,S0)|0,E=Math.imul(Z0,W0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(S,I0)|0,O=O+Math.imul(S,H0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,H0)|0;var OU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,S0),O=Math.imul(C0,W0),O=O+Math.imul(L0,S0)|0,E=Math.imul(L0,W0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,H0)|0,G=G+Math.imul(S,q0)|0,O=O+Math.imul(S,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,S0),O=Math.imul(E0,W0),O=O+Math.imul(K0,S0)|0,E=Math.imul(K0,W0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(L0,R0)|0,E=E+Math.imul(L0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,H0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(S,P0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,D0)|0;var XU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(K0,R0)|0,E=Math.imul(K0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(L0,_0)|0,E=E+Math.imul(L0,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,H0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,D0)|0;var QU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(K0,_0)|0,E=Math.imul(K0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(L0,v0)|0,E=E+Math.imul(L0,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,H0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,D0)|0;var YU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(K0,v0)|0,E=Math.imul(K0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(L0,j0)|0,E=E+Math.imul(L0,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,H0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,D0)|0;var $U=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(K0,j0)|0,E=Math.imul(K0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(L0,M0)|0,E=E+Math.imul(L0,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,H0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,D0)|0;var JU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(K0,M0)|0,E=Math.imul(K0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(L0,a)|0,E=E+Math.imul(L0,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,H0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,D0)|0;var AU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(K0,a)|0,E=Math.imul(K0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,H0)|0,O=O+Math.imul(L0,I0)|0,E=E+Math.imul(L0,H0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,D0)|0;var GU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,H0),O=O+Math.imul(K0,I0)|0,E=Math.imul(K0,H0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(L0,q0)|0,E=E+Math.imul(L0,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,D0)|0;var VU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(K0,q0)|0,E=Math.imul(K0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,D0)|0,O=O+Math.imul(L0,P0)|0,E=E+Math.imul(L0,D0)|0;var EU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,D0),O=O+Math.imul(K0,P0)|0,E=Math.imul(K0,D0);var IU=(L+G|0)+((O&8191)<<13)|0;if(L=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=$U,I[13]=JU,I[14]=AU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,L!==0)I[19]=L,A.length++;return A};if(!Math.imul)k=_;function B(U,X,A){A.negative=X.negative^U.negative,A.length=U.length+X.length;var Z=0,$=0;for(var I=0;I<A.length-1;I++){var L=$;$=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var z=I-E,S=U.words[z]|0,v=X.words[E]|0,g=S*v,p=g&67108863;L=L+(g/67108864|0)|0,p=p+G|0,G=p&67108863,L=L+(p>>>26)|0,$+=L>>>26,L&=67108863}A.words[I]=G,Z=L,L=$}if(Z!==0)A.words[I]=Z;else A.length--;return A.strip()}function j(U,X,A){var Z=new x;return Z.mulp(U,X,A)}J.prototype.mulTo=function(U,X){var A,Z=this.length+U.length;if(this.length===10&&U.length===10)A=k(this,U,X);else if(Z<63)A=_(this,U,X);else if(Z<1024)A=B(this,U,X);else A=j(this,U,X);return A};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),A=J.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,A,U);return X},x.prototype.revBin=function(U,X,A){if(U===0||U===A-1)return U;var Z=0;for(var $=0;$<X;$++)Z|=(U&1)<<X-$-1,U>>=1;return Z},x.prototype.permute=function(U,X,A,Z,$,I){for(var L=0;L<I;L++)Z[L]=X[U[L]],$[L]=A[U[L]]},x.prototype.transform=function(U,X,A,Z,$,I){this.permute(I,U,X,A,Z,$);for(var L=1;L<$;L<<=1){var G=L<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var z=0;z<$;z+=G){var S=O,v=E;for(var g=0;g<L;g++){var p=A[z+g],n=Z[z+g],V0=A[z+g+L],r=Z[z+g+L],l=S*V0-v*r;if(r=S*r+v*V0,V0=l,A[z+g]=p+V0,Z[z+g]=n+r,A[z+g+L]=p-V0,Z[z+g+L]=n-r,g!==G)l=O*S-E*v,v=O*v+E*S,S=l}}}},x.prototype.guessLen13b=function(U,X){var A=Math.max(X,U)|1,Z=A&1,$=0;for(A=A/2|0;A;A=A>>>1)$++;return 1<<$+1+Z},x.prototype.conjugate=function(U,X,A){if(A<=1)return;for(var Z=0;Z<A/2;Z++){var $=U[Z];U[Z]=U[A-Z-1],U[A-Z-1]=$,$=X[Z],X[Z]=-X[A-Z-1],X[A-Z-1]=-$}},x.prototype.normalize13b=function(U,X){var A=0;for(var Z=0;Z<X/2;Z++){var $=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+A;if(U[Z]=$&67108863,$<67108864)A=0;else A=$/67108864|0}return U},x.prototype.convert13b=function(U,X,A,Z){var $=0;for(var I=0;I<X;I++)$=$+(U[I]|0),A[2*I]=$&8191,$=$>>>13,A[2*I+1]=$&8191,$=$>>>13;for(I=2*X;I<Z;++I)A[I]=0;C($===0),C(($&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var A=0;A<U;A++)X[A]=0;return X},x.prototype.mulp=function(U,X,A){var Z=2*this.guessLen13b(U.length,X.length),$=this.makeRBT(Z),I=this.stub(Z),L=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),z=Array(Z),S=Array(Z),v=A.words;v.length=Z,this.convert13b(U.words,U.length,L,Z),this.convert13b(X.words,X.length,E,Z),this.transform(L,I,G,O,Z,$),this.transform(E,I,z,S,Z,$);for(var g=0;g<Z;g++){var p=G[g]*z[g]-O[g]*S[g];O[g]=G[g]*S[g]+O[g]*z[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,$),this.conjugate(v,I,Z),this.normalize13b(v,Z),A.negative=U.negative^X.negative,A.length=U.length+X.length,A.strip()},J.prototype.mul=function(U){var X=new J(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},J.prototype.mulf=function(U){var X=new J(null);return X.words=Array(this.length+U.length),j(this,U,X)},J.prototype.imul=function(U){return this.clone().mulTo(U,this)},J.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var A=0;A<this.length;A++){var Z=(this.words[A]|0)*U,$=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=$>>>26,this.words[A]=$&67108863}if(X!==0)this.words[A]=X,this.length++;return this.length=U===0?1:this.length,this},J.prototype.muln=function(U){return this.clone().imuln(U)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(U){var X=P(U);if(X.length===0)return new J(1);var A=this;for(var Z=0;Z<X.length;Z++,A=A.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var $=A.sqr();Z<X.length;Z++,$=$.sqr()){if(X[Z]===0)continue;A=A.mul($)}return A},J.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26,Z=67108863>>>26-X<<26-X,$;if(X!==0){var I=0;for($=0;$<this.length;$++){var L=this.words[$]&Z,G=(this.words[$]|0)-L<<X;this.words[$]=G|I,I=L>>>26-X}if(I)this.words[$]=I,this.length++}if(A!==0){for($=this.length-1;$>=0;$--)this.words[$+A]=this.words[$];for($=0;$<A;$++)this.words[$]=0;this.length+=A}return this.strip()},J.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},J.prototype.iushrn=function(U,X,A){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var $=U%26,I=Math.min((U-$)/26,this.length),L=67108863^67108863>>>$<<$,G=A;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=E<<26-$|z>>>$,E=z&L}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},J.prototype.ishrn=function(U,X,A){return C(this.negative===0),this.iushrn(U,X,A)},J.prototype.shln=function(U){return this.clone().ishln(U)},J.prototype.ushln=function(U){return this.clone().iushln(U)},J.prototype.shrn=function(U){return this.clone().ishrn(U)},J.prototype.ushrn=function(U){return this.clone().iushrn(U)},J.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26,Z=1<<X;if(this.length<=A)return!1;var $=this.words[A];return!!($&Z)},J.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=A)return this;if(X!==0)A++;if(this.length=Math.min(A,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},J.prototype.maskn=function(U){return this.clone().imaskn(U)},J.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},J.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},J.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},J.prototype.addn=function(U){return this.clone().iaddn(U)},J.prototype.subn=function(U){return this.clone().isubn(U)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(U,X,A){var Z=U.length+A,$;this._expand(Z);var I,L=0;for($=0;$<U.length;$++){I=(this.words[$+A]|0)+L;var G=(U.words[$]|0)*X;I-=G&67108863,L=(I>>26)-(G/67108864|0),this.words[$+A]=I&67108863}for(;$<this.length-A;$++)I=(this.words[$+A]|0)+L,L=I>>26,this.words[$+A]=I&67108863;if(L===0)return this.strip();C(L===-1),L=0;for($=0;$<this.length;$++)I=-(this.words[$]|0)+L,L=I>>26,this.words[$]=I&67108863;return this.negative=1,this.strip()},J.prototype._wordDiv=function(U,X){var A=this.length-U.length,Z=this.clone(),$=U,I=$.words[$.length-1]|0,L=this._countBits(I);if(A=26-L,A!==0)$=$.ushln(A),Z.iushln(A),I=$.words[$.length-1]|0;var G=Z.length-$.length,O;if(X!=="mod"){O=new J(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var z=Z.clone()._ishlnsubmul($,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var S=G-1;S>=0;S--){var v=(Z.words[$.length+S]|0)*67108864+(Z.words[$.length+S-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul($,v,S);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul($,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&A!==0)Z.iushrn(A);return{div:O||null,mod:Z}},J.prototype.divmod=function(U,X,A){if(C(!U.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var Z,$,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if($=I.mod.neg(),A&&$.negative!==0)$.iadd(U)}return{div:Z,mod:$}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if($=I.mod.neg(),A&&$.negative!==0)$.isub(U)}return{div:I.div,mod:$}}if(U.length>this.length||this.cmp(U)<0)return{div:new J(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new J(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new J(this.modn(U.words[0]))}}return this._wordDiv(U,X)},J.prototype.div=function(U){return this.divmod(U,"div",!1).div},J.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},J.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},J.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var A=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),$=U.andln(1),I=A.cmp(Z);if(I<0||$===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},J.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,A=0;for(var Z=this.length-1;Z>=0;Z--)A=(X*A+(this.words[Z]|0))%U;return A},J.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var A=this.length-1;A>=0;A--){var Z=(this.words[A]|0)+X*67108864;this.words[A]=Z/U|0,X=Z%U}return this.strip()},J.prototype.divn=function(U){return this.clone().idivn(U)},J.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,A=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),$=new J(0),I=new J(0),L=new J(1),G=0;while(X.isEven()&&A.isEven())X.iushrn(1),A.iushrn(1),++G;var O=A.clone(),E=X.clone();while(!X.isZero()){for(var z=0,S=1;(X.words[0]&S)===0&&z<26;++z,S<<=1);if(z>0){X.iushrn(z);while(z-- >0){if(Z.isOdd()||$.isOdd())Z.iadd(O),$.isub(E);Z.iushrn(1),$.iushrn(1)}}for(var v=0,g=1;(A.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){A.iushrn(v);while(v-- >0){if(I.isOdd()||L.isOdd())I.iadd(O),L.isub(E);I.iushrn(1),L.iushrn(1)}}if(X.cmp(A)>=0)X.isub(A),Z.isub(I),$.isub(L);else A.isub(X),I.isub(Z),L.isub($)}return{a:I,b:L,gcd:A.iushln(G)}},J.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,A=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),$=new J(0),I=A.clone();while(X.cmpn(1)>0&&A.cmpn(1)>0){for(var L=0,G=1;(X.words[0]&G)===0&&L<26;++L,G<<=1);if(L>0){X.iushrn(L);while(L-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(A.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){A.iushrn(O);while(O-- >0){if($.isOdd())$.iadd(I);$.iushrn(1)}}if(X.cmp(A)>=0)X.isub(A),Z.isub($);else A.isub(X),$.isub(Z)}var z;if(X.cmpn(1)===0)z=Z;else z=$;if(z.cmpn(0)<0)z.iadd(U);return z},J.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),A=U.clone();X.negative=0,A.negative=0;for(var Z=0;X.isEven()&&A.isEven();Z++)X.iushrn(1),A.iushrn(1);do{while(X.isEven())X.iushrn(1);while(A.isEven())A.iushrn(1);var $=X.cmp(A);if($<0){var I=X;X=A,A=I}else if($===0||A.cmpn(1)===0)break;X.isub(A)}while(!0);return A.iushln(Z)},J.prototype.invm=function(U){return this.egcd(U).a.umod(U)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(U){return this.words[0]&U},J.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,A=(U-X)/26,Z=1<<X;if(this.length<=A)return this._expand(A+1),this.words[A]|=Z,this;var $=Z;for(var I=A;$!==0&&I<this.length;I++){var L=this.words[I]|0;L+=$,$=L>>>26,L&=67108863,this.words[I]=L}if($!==0)this.words[I]=$,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var A;if(this.length>1)A=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;A=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-A|0;return A},J.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},J.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var A=this.length-1;A>=0;A--){var Z=this.words[A]|0,$=U.words[A]|0;if(Z===$)continue;if(Z<$)X=-1;else if(Z>$)X=1;break}return X},J.prototype.gtn=function(U){return this.cmpn(U)===1},J.prototype.gt=function(U){return this.cmp(U)===1},J.prototype.gten=function(U){return this.cmpn(U)>=0},J.prototype.gte=function(U){return this.cmp(U)>=0},J.prototype.ltn=function(U){return this.cmpn(U)===-1},J.prototype.lt=function(U){return this.cmp(U)===-1},J.prototype.lten=function(U){return this.cmpn(U)<=0},J.prototype.lte=function(U){return this.cmp(U)<=0},J.prototype.eqn=function(U){return this.cmpn(U)===0},J.prototype.eq=function(U){return this.cmp(U)===0},J.red=function(U){return new u(U)},J.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},J.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(U){return this.red=U,this},J.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},J.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},J.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},J.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},J.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},J.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},J.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},J.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},J.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new J(X,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new J(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,A;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),A=X.bitLength();while(A>this.n);var Z=A<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D(d,w),d.prototype.split=function(U,X){var A=4194303,Z=Math.min(U.length,9);for(var $=0;$<Z;$++)X.words[$]=U.words[$];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&A;for($=10;$<U.length;$++){var L=U.words[$]|0;U.words[$-10]=(L&A)<<4|I>>>22,I=L}if(I>>>=22,U.words[$-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var A=0;A<U.length;A++){var Z=U.words[A]|0;X+=Z*977,U.words[A]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(Y0,w);function A0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(A0,w);function $0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D($0,w),$0.prototype.imulK=function(U){var X=0;for(var A=0;A<U.length;A++){var Z=(U.words[A]|0)*19+X,$=Z&67108863;Z>>>=26,U.words[A]=$,X=Z}if(X!==0)U.words[U.length++]=X;return U},J._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new A0;else if(U==="p25519")X=new $0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=J._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var A=U.add(X);if(A.cmp(this.m)>=0)A.isub(this.m);return A._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var A=U.iadd(X);if(A.cmp(this.m)>=0)A.isub(this.m);return A},u.prototype.sub=function(U,X){this._verify2(U,X);var A=U.sub(X);if(A.cmpn(0)<0)A.iadd(this.m);return A._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var A=U.isub(X);if(A.cmpn(0)<0)A.iadd(this.m);return A},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var A=this.m.add(new J(1)).iushrn(2);return this.pow(U,A)}var Z=this.m.subn(1),$=0;while(!Z.isZero()&&Z.andln(1)===0)$++,Z.iushrn(1);C(!Z.isZero());var I=new J(1).toRed(this),L=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new J(2*O*O).toRed(this);while(this.pow(O,G).cmp(L)!==0)O.redIAdd(L);var E=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),v=$;while(S.cmp(I)!==0){var g=S;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new J(1).iushln(v-p-1));z=z.redMul(n),E=n.redSqr(),S=S.redMul(E),v=p}return z},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new J(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var A=4,Z=Array(1<<A);Z[0]=new J(1).toRed(this),Z[1]=U;for(var $=2;$<Z.length;$++)Z[$]=this.mul(Z[$-1],U);var I=Z[0],L=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for($=X.length-1;$>=0;$--){var E=X.words[$];for(var z=O-1;z>=0;z--){var S=E>>z&1;if(I!==Z[0])I=this.sqr(I);if(S===0&&L===0){G=0;continue}if(L<<=1,L|=S,G++,G!==A&&($!==0||z!==0))continue;I=this.mul(I,Z[L]),G=0,L=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},J.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}D(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var A=U.imul(X),Z=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=A.isub(Z).iushrn(this.shift),I=$;if($.cmp(this.m)>=0)I=$.isub(this.m);else if($.cmpn(0)<0)I=$.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new J(0)._forceRed(this);var A=U.mul(X),Z=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=A.isub(Z).iushrn(this.shift),I=$;if($.cmp(this.m)>=0)I=$.isub(this.m);else if($.cmpn(0)<0)I=$.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof Y>"u"||Y,Q)}),OO=J0((Q,Y)=>{Y.exports=V;function V(H,C){if(!H)throw Error(C||"Assertion failed")}V.equal=function(H,C,D){if(H!=C)throw Error(D||"Assertion failed: "+H+" != "+C)}}),AY=J0((Q)=>{var Y=Q;function V(D,J){if(Array.isArray(D))return D.slice();if(!D)return[];var T=[];if(typeof D!=="string"){for(var M=0;M<D.length;M++)T[M]=D[M]|0;return T}if(J==="hex"){if(D=D.replace(/[^a-z0-9]+/ig,""),D.length%2!==0)D="0"+D;for(var M=0;M<D.length;M+=2)T.push(parseInt(D[M]+D[M+1],16))}else for(var M=0;M<D.length;M++){var F=D.charCodeAt(M),R=F>>8,K=F&255;if(R)T.push(R,K);else T.push(K)}return T}Y.toArray=V;function H(D){if(D.length===1)return"0"+D;else return D}Y.zero2=H;function C(D){var J="";for(var T=0;T<D.length;T++)J+=H(D[T].toString(16));return J}Y.toHex=C,Y.encode=function(D,J){if(J==="hex")return C(D);else return D}}),yU=J0((Q)=>{var Y=Q,V=sU(),H=OO(),C=AY();Y.assert=H,Y.toArray=C.toArray,Y.zero2=C.zero2,Y.toHex=C.toHex,Y.encode=C.encode;function D(R,K,W){var q=Array(Math.max(R.bitLength(),W)+1),P;for(P=0;P<q.length;P+=1)q[P]=0;var _=1<<K+1,k=R.clone();for(P=0;P<q.length;P++){var B,j=k.andln(_-1);if(k.isOdd()){if(j>(_>>1)-1)B=(_>>1)-j;else B=j;k.isubn(B)}else B=0;q[P]=B,k.iushrn(1)}return q}Y.getNAF=D;function J(R,K){var W=[[],[]];R=R.clone(),K=K.clone();var q=0,P=0,_;while(R.cmpn(-q)>0||K.cmpn(-P)>0){var k=R.andln(3)+q&3,B=K.andln(3)+P&3;if(k===3)k=-1;if(B===3)B=-1;var j;if((k&1)===0)j=0;else if(_=R.andln(7)+q&7,(_===3||_===5)&&B===2)j=-k;else j=k;W[0].push(j);var x;if((B&1)===0)x=0;else if(_=K.andln(7)+P&7,(_===3||_===5)&&k===2)x=-B;else x=B;if(W[1].push(x),2*q===j+1)q=1-q;if(2*P===x+1)P=1-P;R.iushrn(1),K.iushrn(1)}return W}Y.getJSF=J;function T(R,K,W){var q="_"+K;R.prototype[K]=function(){return this[q]!==void 0?this[q]:this[q]=W.call(this)}}Y.cachedProperty=T;function M(R){return typeof R==="string"?Y.toArray(R,"hex"):R}Y.parseBytes=M;function F(R){return new V(R,"hex","le")}Y.intFromLE=F}),GY=J0((Q,Y)=>{var V;Y.exports=function(D){if(!V)V=new H(null);return V.generate(D)};function H(D){this.rand=D}if(Y.exports.Rand=H,H.prototype.generate=function(D){return this._rand(D)},H.prototype._rand=function(D){if(this.rand.getBytes)return this.rand.getBytes(D);var J=new Uint8Array(D);for(var T=0;T<J.length;T++)J[T]=this.rand.getByte();return J},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)H.prototype._rand=function(D){var J=new Uint8Array(D);return self.crypto.getRandomValues(J),J};else if(self.msCrypto&&self.msCrypto.getRandomValues)H.prototype._rand=function(D){var J=new Uint8Array(D);return self.msCrypto.getRandomValues(J),J};else if(typeof window==="object")H.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(C=(jU(),h0(vU)),typeof C.randomBytes!=="function")throw Error("Not supported");H.prototype._rand=function(D){return C.randomBytes(D)}}catch(D){}var C}),XZ=J0((Q,Y)=>{var V=sU(),H=yU(),C=H.getNAF,D=H.getJSF,J=H.assert;function T(F,R){this.type=F,this.p=new V(R.p,16),this.red=R.prime?V.red(R.prime):V.mont(this.p),this.zero=new V(0).toRed(this.red),this.one=new V(1).toRed(this.red),this.two=new V(2).toRed(this.red),this.n=R.n&&new V(R.n,16),this.g=R.g&&this.pointFromJSON(R.g,R.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var K=this.n&&this.p.div(this.n);if(!K||K.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}Y.exports=T,T.prototype.point=function(){throw Error("Not implemented")},T.prototype.validate=function(){throw Error("Not implemented")},T.prototype._fixedNafMul=function(F,R){J(F.precomputed);var K=F._getDoubles(),W=C(R,1,this._bitLength),q=(1<<K.step+1)-(K.step%2===0?2:1);q/=3;var P=[],_,k;for(_=0;_<W.length;_+=K.step){k=0;for(var B=_+K.step-1;B>=_;B--)k=(k<<1)+W[B];P.push(k)}var j=this.jpoint(null,null,null),x=this.jpoint(null,null,null);for(var f=q;f>0;f--){for(_=0;_<P.length;_++)if(k=P[_],k===f)x=x.mixedAdd(K.points[_]);else if(k===-f)x=x.mixedAdd(K.points[_].neg());j=j.add(x)}return j.toP()},T.prototype._wnafMul=function(F,R){var K=4,W=F._getNAFPoints(K);K=W.wnd;var q=W.points,P=C(R,K,this._bitLength),_=this.jpoint(null,null,null);for(var k=P.length-1;k>=0;k--){for(var B=0;k>=0&&P[k]===0;k--)B++;if(k>=0)B++;if(_=_.dblp(B),k<0)break;var j=P[k];if(J(j!==0),F.type==="affine")if(j>0)_=_.mixedAdd(q[j-1>>1]);else _=_.mixedAdd(q[-j-1>>1].neg());else if(j>0)_=_.add(q[j-1>>1]);else _=_.add(q[-j-1>>1].neg())}return F.type==="affine"?_.toP():_},T.prototype._wnafMulAdd=function(F,R,K,W,q){var P=this._wnafT1,_=this._wnafT2,k=this._wnafT3,B=0,j,x,f;for(j=0;j<W;j++){f=R[j];var w=f._getNAFPoints(F);P[j]=w.wnd,_[j]=w.points}for(j=W-1;j>=1;j-=2){var d=j-1,Y0=j;if(P[d]!==1||P[Y0]!==1){k[d]=C(K[d],P[d],this._bitLength),k[Y0]=C(K[Y0],P[Y0],this._bitLength),B=Math.max(k[d].length,B),B=Math.max(k[Y0].length,B);continue}var A0=[R[d],null,null,R[Y0]];if(R[d].y.cmp(R[Y0].y)===0)A0[1]=R[d].add(R[Y0]),A0[2]=R[d].toJ().mixedAdd(R[Y0].neg());else if(R[d].y.cmp(R[Y0].y.redNeg())===0)A0[1]=R[d].toJ().mixedAdd(R[Y0]),A0[2]=R[d].add(R[Y0].neg());else A0[1]=R[d].toJ().mixedAdd(R[Y0]),A0[2]=R[d].toJ().mixedAdd(R[Y0].neg());var $0=[-3,-1,-5,-7,0,7,5,1,3],u=D(K[d],K[Y0]);B=Math.max(u[0].length,B),k[d]=Array(B),k[Y0]=Array(B);for(x=0;x<B;x++){var O0=u[0][x]|0,U=u[1][x]|0;k[d][x]=$0[(O0+1)*3+(U+1)],k[Y0][x]=0,_[d]=A0}}var X=this.jpoint(null,null,null),A=this._wnafT4;for(j=B;j>=0;j--){var Z=0;while(j>=0){var $=!0;for(x=0;x<W;x++)if(A[x]=k[x][j]|0,A[x]!==0)$=!1;if(!$)break;Z++,j--}if(j>=0)Z++;if(X=X.dblp(Z),j<0)break;for(x=0;x<W;x++){var I=A[x];if(I===0)continue;else if(I>0)f=_[x][I-1>>1];else if(I<0)f=_[x][-I-1>>1].neg();if(f.type==="affine")X=X.mixedAdd(f);else X=X.add(f)}}for(j=0;j<W;j++)_[j]=null;if(q)return X;else return X.toP()};function M(F,R){this.curve=F,this.type=R,this.precomputed=null}T.BasePoint=M,M.prototype.eq=function(){throw Error("Not implemented")},M.prototype.validate=function(){return this.curve.validate(this)},T.prototype.decodePoint=function(F,R){F=H.toArray(F,R);var K=this.p.byteLength();if((F[0]===4||F[0]===6||F[0]===7)&&F.length-1===2*K){if(F[0]===6)J(F[F.length-1]%2===0);else if(F[0]===7)J(F[F.length-1]%2===1);var W=this.point(F.slice(1,1+K),F.slice(1+K,1+2*K));return W}else if((F[0]===2||F[0]===3)&&F.length-1===K)return this.pointFromX(F.slice(1,1+K),F[0]===3);throw Error("Unknown point format")},M.prototype.encodeCompressed=function(F){return this.encode(F,!0)},M.prototype._encode=function(F){var R=this.curve.p.byteLength(),K=this.getX().toArray("be",R);if(F)return[this.getY().isEven()?2:3].concat(K);return[4].concat(K,this.getY().toArray("be",R))},M.prototype.encode=function(F,R){return H.encode(this._encode(R),F)},M.prototype.precompute=function(F){if(this.precomputed)return this;var R={doubles:null,naf:null,beta:null};return R.naf=this._getNAFPoints(8),R.doubles=this._getDoubles(4,F),R.beta=this._getBeta(),this.precomputed=R,this},M.prototype._hasDoubles=function(F){if(!this.precomputed)return!1;var R=this.precomputed.doubles;if(!R)return!1;return R.points.length>=Math.ceil((F.bitLength()+1)/R.step)},M.prototype._getDoubles=function(F,R){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var K=[this],W=this;for(var q=0;q<R;q+=F){for(var P=0;P<F;P++)W=W.dbl();K.push(W)}return{step:F,points:K}},M.prototype._getNAFPoints=function(F){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var R=[this],K=(1<<F)-1,W=K===1?null:this.dbl();for(var q=1;q<K;q++)R[q]=R[q-1].add(W);return{wnd:F,points:R}},M.prototype._getBeta=function(){return null},M.prototype.dblp=function(F){var R=this;for(var K=0;K<F;K++)R=R.dbl();return R}}),hA=J0((Q,Y)=>{if(typeof Object.create==="function")Y.exports=function(V,H){if(H)V.super_=H,V.prototype=Object.create(H.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}})};else Y.exports=function(V,H){if(H){V.super_=H;var C=function(){};C.prototype=H.prototype,V.prototype=new C,V.prototype.constructor=V}}}),xU=J0((Q,Y)=>{try{if(V=(mQ(),h0(nQ)),typeof V.inherits!=="function")throw"";Y.exports=V.inherits}catch(H){Y.exports=hA()}var V}),uA=J0((Q,Y)=>{var V=yU(),H=sU(),C=xU(),D=XZ(),J=V.assert;function T(R){D.call(this,"short",R),this.a=new H(R.a,16).toRed(this.red),this.b=new H(R.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(R),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}C(T,D),Y.exports=T,T.prototype._getEndomorphism=function(R){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var K,W;if(R.beta)K=new H(R.beta,16).toRed(this.red);else{var q=this._getEndoRoots(this.p);K=q[0].cmp(q[1])<0?q[0]:q[1],K=K.toRed(this.red)}if(R.lambda)W=new H(R.lambda,16);else{var P=this._getEndoRoots(this.n);if(this.g.mul(P[0]).x.cmp(this.g.x.redMul(K))===0)W=P[0];else W=P[1],J(this.g.mul(W).x.cmp(this.g.x.redMul(K))===0)}var _;if(R.basis)_=R.basis.map(function(k){return{a:new H(k.a,16),b:new H(k.b,16)}});else _=this._getEndoBasis(W);return{beta:K,lambda:W,basis:_}},T.prototype._getEndoRoots=function(R){var K=R===this.p?this.red:H.mont(R),W=new H(2).toRed(K).redInvm(),q=W.redNeg(),P=new H(3).toRed(K).redNeg().redSqrt().redMul(W),_=q.redAdd(P).fromRed(),k=q.redSub(P).fromRed();return[_,k]},T.prototype._getEndoBasis=function(R){var K=this.n.ushrn(Math.floor(this.n.bitLength()/2)),W=R,q=this.n.clone(),P=new H(1),_=new H(0),k=new H(0),B=new H(1),j,x,f,w,d,Y0,A0,$0=0,u,O0;while(W.cmpn(0)!==0){var U=q.div(W);u=q.sub(U.mul(W)),O0=k.sub(U.mul(P));var X=B.sub(U.mul(_));if(!f&&u.cmp(K)<0)j=A0.neg(),x=P,f=u.neg(),w=O0;else if(f&&++$0===2)break;A0=u,q=W,W=u,k=P,P=O0,B=_,_=X}d=u.neg(),Y0=O0;var A=f.sqr().add(w.sqr()),Z=d.sqr().add(Y0.sqr());if(Z.cmp(A)>=0)d=j,Y0=x;if(f.negative)f=f.neg(),w=w.neg();if(d.negative)d=d.neg(),Y0=Y0.neg();return[{a:f,b:w},{a:d,b:Y0}]},T.prototype._endoSplit=function(R){var K=this.endo.basis,W=K[0],q=K[1],P=q.b.mul(R).divRound(this.n),_=W.b.neg().mul(R).divRound(this.n),k=P.mul(W.a),B=_.mul(q.a),j=P.mul(W.b),x=_.mul(q.b),f=R.sub(k).sub(B),w=j.add(x).neg();return{k1:f,k2:w}},T.prototype.pointFromX=function(R,K){if(R=new H(R,16),!R.red)R=R.toRed(this.red);var W=R.redSqr().redMul(R).redIAdd(R.redMul(this.a)).redIAdd(this.b),q=W.redSqrt();if(q.redSqr().redSub(W).cmp(this.zero)!==0)throw Error("invalid point");var P=q.fromRed().isOdd();if(K&&!P||!K&&P)q=q.redNeg();return this.point(R,q)},T.prototype.validate=function(R){if(R.inf)return!0;var{x:K,y:W}=R,q=this.a.redMul(K),P=K.redSqr().redMul(K).redIAdd(q).redIAdd(this.b);return W.redSqr().redISub(P).cmpn(0)===0},T.prototype._endoWnafMulAdd=function(R,K,W){var q=this._endoWnafT1,P=this._endoWnafT2;for(var _=0;_<R.length;_++){var k=this._endoSplit(K[_]),B=R[_],j=B._getBeta();if(k.k1.negative)k.k1.ineg(),B=B.neg(!0);if(k.k2.negative)k.k2.ineg(),j=j.neg(!0);q[_*2]=B,q[_*2+1]=j,P[_*2]=k.k1,P[_*2+1]=k.k2}var x=this._wnafMulAdd(1,q,P,_*2,W);for(var f=0;f<_*2;f++)q[f]=null,P[f]=null;return x};function M(R,K,W,q){if(D.BasePoint.call(this,R,"affine"),K===null&&W===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new H(K,16),this.y=new H(W,16),q)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}C(M,D.BasePoint),T.prototype.point=function(R,K,W){return new M(this,R,K,W)},T.prototype.pointFromJSON=function(R,K){return M.fromJSON(this,R,K)},M.prototype._getBeta=function(){if(!this.curve.endo)return;var R=this.precomputed;if(R&&R.beta)return R.beta;var K=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(R){var W=this.curve,q=function(P){return W.point(P.x.redMul(W.endo.beta),P.y)};R.beta=K,K.precomputed={beta:null,naf:R.naf&&{wnd:R.naf.wnd,points:R.naf.points.map(q)},doubles:R.doubles&&{step:R.doubles.step,points:R.doubles.points.map(q)}}}return K},M.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[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)}}]},M.fromJSON=function(R,K,W){if(typeof K==="string")K=JSON.parse(K);var q=R.point(K[0],K[1],W);if(!K[2])return q;function P(k){return R.point(k[0],k[1],W)}var _=K[2];return q.precomputed={beta:null,doubles:_.doubles&&{step:_.doubles.step,points:[q].concat(_.doubles.points.map(P))},naf:_.naf&&{wnd:_.naf.wnd,points:[q].concat(_.naf.points.map(P))}},q},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.inf},M.prototype.add=function(R){if(this.inf)return R;if(R.inf)return this;if(this.eq(R))return this.dbl();if(this.neg().eq(R))return this.curve.point(null,null);if(this.x.cmp(R.x)===0)return this.curve.point(null,null);var K=this.y.redSub(R.y);if(K.cmpn(0)!==0)K=K.redMul(this.x.redSub(R.x).redInvm());var W=K.redSqr().redISub(this.x).redISub(R.x),q=K.redMul(this.x.redSub(W)).redISub(this.y);return this.curve.point(W,q)},M.prototype.dbl=function(){if(this.inf)return this;var R=this.y.redAdd(this.y);if(R.cmpn(0)===0)return this.curve.point(null,null);var K=this.curve.a,W=this.x.redSqr(),q=R.redInvm(),P=W.redAdd(W).redIAdd(W).redIAdd(K).redMul(q),_=P.redSqr().redISub(this.x.redAdd(this.x)),k=P.redMul(this.x.redSub(_)).redISub(this.y);return this.curve.point(_,k)},M.prototype.getX=function(){return this.x.fromRed()},M.prototype.getY=function(){return this.y.fromRed()},M.prototype.mul=function(R){if(R=new H(R,16),this.isInfinity())return this;else if(this._hasDoubles(R))return this.curve._fixedNafMul(this,R);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[R]);else return this.curve._wnafMul(this,R)},M.prototype.mulAdd=function(R,K,W){var q=[this,K],P=[R,W];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P);else return this.curve._wnafMulAdd(1,q,P,2)},M.prototype.jmulAdd=function(R,K,W){var q=[this,K],P=[R,W];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P,!0);else return this.curve._wnafMulAdd(1,q,P,2,!0)},M.prototype.eq=function(R){return this===R||this.inf===R.inf&&(this.inf||this.x.cmp(R.x)===0&&this.y.cmp(R.y)===0)},M.prototype.neg=function(R){if(this.inf)return this;var K=this.curve.point(this.x,this.y.redNeg());if(R&&this.precomputed){var W=this.precomputed,q=function(P){return P.neg()};K.precomputed={naf:W.naf&&{wnd:W.naf.wnd,points:W.naf.points.map(q)},doubles:W.doubles&&{step:W.doubles.step,points:W.doubles.points.map(q)}}}return K},M.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var R=this.curve.jpoint(this.x,this.y,this.curve.one);return R};function F(R,K,W,q){if(D.BasePoint.call(this,R,"jacobian"),K===null&&W===null&&q===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new H(0);else this.x=new H(K,16),this.y=new H(W,16),this.z=new H(q,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}C(F,D.BasePoint),T.prototype.jpoint=function(R,K,W){return new F(this,R,K,W)},F.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var R=this.z.redInvm(),K=R.redSqr(),W=this.x.redMul(K),q=this.y.redMul(K).redMul(R);return this.curve.point(W,q)},F.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},F.prototype.add=function(R){if(this.isInfinity())return R;if(R.isInfinity())return this;var K=R.z.redSqr(),W=this.z.redSqr(),q=this.x.redMul(K),P=R.x.redMul(W),_=this.y.redMul(K.redMul(R.z)),k=R.y.redMul(W.redMul(this.z)),B=q.redSub(P),j=_.redSub(k);if(B.cmpn(0)===0)if(j.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var x=B.redSqr(),f=x.redMul(B),w=q.redMul(x),d=j.redSqr().redIAdd(f).redISub(w).redISub(w),Y0=j.redMul(w.redISub(d)).redISub(_.redMul(f)),A0=this.z.redMul(R.z).redMul(B);return this.curve.jpoint(d,Y0,A0)},F.prototype.mixedAdd=function(R){if(this.isInfinity())return R.toJ();if(R.isInfinity())return this;var K=this.z.redSqr(),W=this.x,q=R.x.redMul(K),P=this.y,_=R.y.redMul(K).redMul(this.z),k=W.redSub(q),B=P.redSub(_);if(k.cmpn(0)===0)if(B.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var j=k.redSqr(),x=j.redMul(k),f=W.redMul(j),w=B.redSqr().redIAdd(x).redISub(f).redISub(f),d=B.redMul(f.redISub(w)).redISub(P.redMul(x)),Y0=this.z.redMul(k);return this.curve.jpoint(w,d,Y0)},F.prototype.dblp=function(R){if(R===0)return this;if(this.isInfinity())return this;if(!R)return this.dbl();var K;if(this.curve.zeroA||this.curve.threeA){var W=this;for(K=0;K<R;K++)W=W.dbl();return W}var q=this.curve.a,P=this.curve.tinv,_=this.x,k=this.y,B=this.z,j=B.redSqr().redSqr(),x=k.redAdd(k);for(K=0;K<R;K++){var f=_.redSqr(),w=x.redSqr(),d=w.redSqr(),Y0=f.redAdd(f).redIAdd(f).redIAdd(q.redMul(j)),A0=_.redMul(w),$0=Y0.redSqr().redISub(A0.redAdd(A0)),u=A0.redISub($0),O0=Y0.redMul(u);O0=O0.redIAdd(O0).redISub(d);var U=x.redMul(B);if(K+1<R)j=j.redMul(d);_=$0,B=U,x=O0}return this.curve.jpoint(_,x.redMul(P),B)},F.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},F.prototype._zeroDbl=function(){var R,K,W;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q),j=B.redSqr().redISub(k).redISub(k),x=_.redIAdd(_);x=x.redIAdd(x),x=x.redIAdd(x),R=j,K=B.redMul(k.redISub(j)).redISub(x),W=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),w=this.y.redSqr(),d=w.redSqr(),Y0=this.x.redAdd(w).redSqr().redISub(f).redISub(d);Y0=Y0.redIAdd(Y0);var A0=f.redAdd(f).redIAdd(f),$0=A0.redSqr(),u=d.redIAdd(d);u=u.redIAdd(u),u=u.redIAdd(u),R=$0.redISub(Y0).redISub(Y0),K=A0.redMul(Y0.redISub(R)).redISub(u),W=this.y.redMul(this.z),W=W.redIAdd(W)}return this.curve.jpoint(R,K,W)},F.prototype._threeDbl=function(){var R,K,W;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q).redIAdd(this.curve.a),j=B.redSqr().redISub(k).redISub(k);R=j;var x=_.redIAdd(_);x=x.redIAdd(x),x=x.redIAdd(x),K=B.redMul(k.redISub(j)).redISub(x),W=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),w=this.y.redSqr(),d=this.x.redMul(w),Y0=this.x.redSub(f).redMul(this.x.redAdd(f));Y0=Y0.redAdd(Y0).redIAdd(Y0);var A0=d.redIAdd(d);A0=A0.redIAdd(A0);var $0=A0.redAdd(A0);R=Y0.redSqr().redISub($0),W=this.y.redAdd(this.z).redSqr().redISub(w).redISub(f);var u=w.redSqr();u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u),K=Y0.redMul(A0.redISub(R)).redISub(u)}return this.curve.jpoint(R,K,W)},F.prototype._dbl=function(){var R=this.curve.a,K=this.x,W=this.y,q=this.z,P=q.redSqr().redSqr(),_=K.redSqr(),k=W.redSqr(),B=_.redAdd(_).redIAdd(_).redIAdd(R.redMul(P)),j=K.redAdd(K);j=j.redIAdd(j);var x=j.redMul(k),f=B.redSqr().redISub(x.redAdd(x)),w=x.redISub(f),d=k.redSqr();d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var Y0=B.redMul(w).redISub(d),A0=W.redAdd(W).redMul(q);return this.curve.jpoint(f,Y0,A0)},F.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var R=this.x.redSqr(),K=this.y.redSqr(),W=this.z.redSqr(),q=K.redSqr(),P=R.redAdd(R).redIAdd(R),_=P.redSqr(),k=this.x.redAdd(K).redSqr().redISub(R).redISub(q);k=k.redIAdd(k),k=k.redAdd(k).redIAdd(k),k=k.redISub(_);var B=k.redSqr(),j=q.redIAdd(q);j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var x=P.redIAdd(k).redSqr().redISub(_).redISub(B).redISub(j),f=K.redMul(x);f=f.redIAdd(f),f=f.redIAdd(f);var w=this.x.redMul(B).redISub(f);w=w.redIAdd(w),w=w.redIAdd(w);var d=this.y.redMul(x.redMul(j.redISub(x)).redISub(k.redMul(B)));d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var Y0=this.z.redAdd(k).redSqr().redISub(W).redISub(B);return this.curve.jpoint(w,d,Y0)},F.prototype.mul=function(R,K){return R=new H(R,K),this.curve._wnafMul(this,R)},F.prototype.eq=function(R){if(R.type==="affine")return this.eq(R.toJ());if(this===R)return!0;var K=this.z.redSqr(),W=R.z.redSqr();if(this.x.redMul(W).redISub(R.x.redMul(K)).cmpn(0)!==0)return!1;var q=K.redMul(this.z),P=W.redMul(R.z);return this.y.redMul(P).redISub(R.y.redMul(q)).cmpn(0)===0},F.prototype.eqXToP=function(R){var K=this.z.redSqr(),W=R.toRed(this.curve.red).redMul(K);if(this.x.cmp(W)===0)return!0;var q=R.clone(),P=this.curve.redN.redMul(K);for(;;){if(q.iadd(this.curve.n),q.cmp(this.curve.p)>=0)return!1;if(W.redIAdd(P),this.x.cmp(W)===0)return!0}},F.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},F.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),bA=J0((Q,Y)=>{var V=sU(),H=xU(),C=XZ(),D=yU();function J(M){C.call(this,"mont",M),this.a=new V(M.a,16).toRed(this.red),this.b=new V(M.b,16).toRed(this.red),this.i4=new V(4).toRed(this.red).redInvm(),this.two=new V(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}H(J,C),Y.exports=J,J.prototype.validate=function(M){var F=M.normalize().x,R=F.redSqr(),K=R.redMul(F).redAdd(R.redMul(this.a)).redAdd(F),W=K.redSqrt();return W.redSqr().cmp(K)===0};function T(M,F,R){if(C.BasePoint.call(this,M,"projective"),F===null&&R===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new V(F,16),this.z=new V(R,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}H(T,C.BasePoint),J.prototype.decodePoint=function(M,F){return this.point(D.toArray(M,F),1)},J.prototype.point=function(M,F){return new T(this,M,F)},J.prototype.pointFromJSON=function(M){return T.fromJSON(this,M)},T.prototype.precompute=function(){},T.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},T.fromJSON=function(M,F){return new T(M,F[0],F[1]||M.one)},T.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},T.prototype.isInfinity=function(){return this.z.cmpn(0)===0},T.prototype.dbl=function(){var M=this.x.redAdd(this.z),F=M.redSqr(),R=this.x.redSub(this.z),K=R.redSqr(),W=F.redSub(K),q=F.redMul(K),P=W.redMul(K.redAdd(this.curve.a24.redMul(W)));return this.curve.point(q,P)},T.prototype.add=function(){throw Error("Not supported on Montgomery curve")},T.prototype.diffAdd=function(M,F){var R=this.x.redAdd(this.z),K=this.x.redSub(this.z),W=M.x.redAdd(M.z),q=M.x.redSub(M.z),P=q.redMul(R),_=W.redMul(K),k=F.z.redMul(P.redAdd(_).redSqr()),B=F.x.redMul(P.redISub(_).redSqr());return this.curve.point(k,B)},T.prototype.mul=function(M){var F=M.clone(),R=this,K=this.curve.point(null,null),W=this;for(var q=[];F.cmpn(0)!==0;F.iushrn(1))q.push(F.andln(1));for(var P=q.length-1;P>=0;P--)if(q[P]===0)R=R.diffAdd(K,W),K=K.dbl();else K=R.diffAdd(K,W),R=R.dbl();return K},T.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},T.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},T.prototype.eq=function(M){return this.getX().cmp(M.getX())===0},T.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},T.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),lA=J0((Q,Y)=>{var V=yU(),H=sU(),C=xU(),D=XZ(),J=V.assert;function T(F){this.twisted=(F.a|0)!==1,this.mOneA=this.twisted&&(F.a|0)===-1,this.extended=this.mOneA,D.call(this,"edwards",F),this.a=new H(F.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new H(F.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new H(F.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),J(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(F.c|0)===1}C(T,D),Y.exports=T,T.prototype._mulA=function(F){if(this.mOneA)return F.redNeg();else return this.a.redMul(F)},T.prototype._mulC=function(F){if(this.oneC)return F;else return this.c.redMul(F)},T.prototype.jpoint=function(F,R,K,W){return this.point(F,R,K,W)},T.prototype.pointFromX=function(F,R){if(F=new H(F,16),!F.red)F=F.toRed(this.red);var K=F.redSqr(),W=this.c2.redSub(this.a.redMul(K)),q=this.one.redSub(this.c2.redMul(this.d).redMul(K)),P=W.redMul(q.redInvm()),_=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");var k=_.fromRed().isOdd();if(R&&!k||!R&&k)_=_.redNeg();return this.point(F,_)},T.prototype.pointFromY=function(F,R){if(F=new H(F,16),!F.red)F=F.toRed(this.red);var K=F.redSqr(),W=K.redSub(this.c2),q=K.redMul(this.d).redMul(this.c2).redSub(this.a),P=W.redMul(q.redInvm());if(P.cmp(this.zero)===0)if(R)throw Error("invalid point");else return this.point(this.zero,F);var _=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");if(_.fromRed().isOdd()!==R)_=_.redNeg();return this.point(_,F)},T.prototype.validate=function(F){if(F.isInfinity())return!0;F.normalize();var R=F.x.redSqr(),K=F.y.redSqr(),W=R.redMul(this.a).redAdd(K),q=this.c2.redMul(this.one.redAdd(this.d.redMul(R).redMul(K)));return W.cmp(q)===0};function M(F,R,K,W,q){if(D.BasePoint.call(this,F,"projective"),R===null&&K===null&&W===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new H(R,16),this.y=new H(K,16),this.z=W?new H(W,16):this.curve.one,this.t=q&&new H(q,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}C(M,D.BasePoint),T.prototype.pointFromJSON=function(F){return M.fromJSON(this,F)},T.prototype.point=function(F,R,K,W){return new M(this,F,R,K,W)},M.fromJSON=function(F,R){return new M(F,R[0],R[1],R[2])},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},M.prototype._extDbl=function(){var F=this.x.redSqr(),R=this.y.redSqr(),K=this.z.redSqr();K=K.redIAdd(K);var W=this.curve._mulA(F),q=this.x.redAdd(this.y).redSqr().redISub(F).redISub(R),P=W.redAdd(R),_=P.redSub(K),k=W.redSub(R),B=q.redMul(_),j=P.redMul(k),x=q.redMul(k),f=_.redMul(P);return this.curve.point(B,j,f,x)},M.prototype._projDbl=function(){var F=this.x.redAdd(this.y).redSqr(),R=this.x.redSqr(),K=this.y.redSqr(),W,q,P,_,k,B;if(this.curve.twisted){_=this.curve._mulA(R);var j=_.redAdd(K);if(this.zOne)W=F.redSub(R).redSub(K).redMul(j.redSub(this.curve.two)),q=j.redMul(_.redSub(K)),P=j.redSqr().redSub(j).redSub(j);else k=this.z.redSqr(),B=j.redSub(k).redISub(k),W=F.redSub(R).redISub(K).redMul(B),q=j.redMul(_.redSub(K)),P=j.redMul(B)}else _=R.redAdd(K),k=this.curve._mulC(this.z).redSqr(),B=_.redSub(k).redSub(k),W=this.curve._mulC(F.redISub(_)).redMul(B),q=this.curve._mulC(_).redMul(R.redISub(K)),P=_.redMul(B);return this.curve.point(W,q,P)},M.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},M.prototype._extAdd=function(F){var R=this.y.redSub(this.x).redMul(F.y.redSub(F.x)),K=this.y.redAdd(this.x).redMul(F.y.redAdd(F.x)),W=this.t.redMul(this.curve.dd).redMul(F.t),q=this.z.redMul(F.z.redAdd(F.z)),P=K.redSub(R),_=q.redSub(W),k=q.redAdd(W),B=K.redAdd(R),j=P.redMul(_),x=k.redMul(B),f=P.redMul(B),w=_.redMul(k);return this.curve.point(j,x,w,f)},M.prototype._projAdd=function(F){var R=this.z.redMul(F.z),K=R.redSqr(),W=this.x.redMul(F.x),q=this.y.redMul(F.y),P=this.curve.d.redMul(W).redMul(q),_=K.redSub(P),k=K.redAdd(P),B=this.x.redAdd(this.y).redMul(F.x.redAdd(F.y)).redISub(W).redISub(q),j=R.redMul(_).redMul(B),x,f;if(this.curve.twisted)x=R.redMul(k).redMul(q.redSub(this.curve._mulA(W))),f=_.redMul(k);else x=R.redMul(k).redMul(q.redSub(W)),f=this.curve._mulC(_).redMul(k);return this.curve.point(j,x,f)},M.prototype.add=function(F){if(this.isInfinity())return F;if(F.isInfinity())return this;if(this.curve.extended)return this._extAdd(F);else return this._projAdd(F)},M.prototype.mul=function(F){if(this._hasDoubles(F))return this.curve._fixedNafMul(this,F);else return this.curve._wnafMul(this,F)},M.prototype.mulAdd=function(F,R,K){return this.curve._wnafMulAdd(1,[this,R],[F,K],2,!1)},M.prototype.jmulAdd=function(F,R,K){return this.curve._wnafMulAdd(1,[this,R],[F,K],2,!0)},M.prototype.normalize=function(){if(this.zOne)return this;var F=this.z.redInvm();if(this.x=this.x.redMul(F),this.y=this.y.redMul(F),this.t)this.t=this.t.redMul(F);return this.z=this.curve.one,this.zOne=!0,this},M.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},M.prototype.getX=function(){return this.normalize(),this.x.fromRed()},M.prototype.getY=function(){return this.normalize(),this.y.fromRed()},M.prototype.eq=function(F){return this===F||this.getX().cmp(F.getX())===0&&this.getY().cmp(F.getY())===0},M.prototype.eqXToP=function(F){var R=F.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(R)===0)return!0;var K=F.clone(),W=this.curve.redN.redMul(this.z);for(;;){if(K.iadd(this.curve.n),K.cmp(this.curve.p)>=0)return!1;if(R.redIAdd(W),this.x.cmp(R)===0)return!0}},M.prototype.toP=M.prototype.normalize,M.prototype.mixedAdd=M.prototype.add}),VY=J0((Q)=>{var Y=Q;Y.base=XZ(),Y.short=uA(),Y.mont=bA(),Y.edwards=lA()}),dU=J0((Q)=>{var Y=OO(),V=xU();Q.inherits=V;function H(X,A){if((X.charCodeAt(A)&64512)!==55296)return!1;if(A<0||A+1>=X.length)return!1;return(X.charCodeAt(A+1)&64512)===56320}function C(X,A){if(Array.isArray(X))return X.slice();if(!X)return[];var Z=[];if(typeof X==="string"){if(!A){var $=0;for(var I=0;I<X.length;I++){var L=X.charCodeAt(I);if(L<128)Z[$++]=L;else if(L<2048)Z[$++]=L>>6|192,Z[$++]=L&63|128;else if(H(X,I))L=65536+((L&1023)<<10)+(X.charCodeAt(++I)&1023),Z[$++]=L>>18|240,Z[$++]=L>>12&63|128,Z[$++]=L>>6&63|128,Z[$++]=L&63|128;else Z[$++]=L>>12|224,Z[$++]=L>>6&63|128,Z[$++]=L&63|128}}else if(A==="hex"){if(X=X.replace(/[^a-z0-9]+/ig,""),X.length%2!==0)X="0"+X;for(I=0;I<X.length;I+=2)Z.push(parseInt(X[I]+X[I+1],16))}}else for(I=0;I<X.length;I++)Z[I]=X[I]|0;return Z}Q.toArray=C;function D(X){var A="";for(var Z=0;Z<X.length;Z++)A+=M(X[Z].toString(16));return A}Q.toHex=D;function J(X){var A=X>>>24|X>>>8&65280|X<<8&16711680|(X&255)<<24;return A>>>0}Q.htonl=J;function T(X,A){var Z="";for(var $=0;$<X.length;$++){var I=X[$];if(A==="little")I=J(I);Z+=F(I.toString(16))}return Z}Q.toHex32=T;function M(X){if(X.length===1)return"0"+X;else return X}Q.zero2=M;function F(X){if(X.length===7)return"0"+X;else if(X.length===6)return"00"+X;else if(X.length===5)return"000"+X;else if(X.length===4)return"0000"+X;else if(X.length===3)return"00000"+X;else if(X.length===2)return"000000"+X;else if(X.length===1)return"0000000"+X;else return X}Q.zero8=F;function R(X,A,Z,$){var I=Z-A;Y(I%4===0);var L=Array(I/4);for(var G=0,O=A;G<L.length;G++,O+=4){var E;if($==="big")E=X[O]<<24|X[O+1]<<16|X[O+2]<<8|X[O+3];else E=X[O+3]<<24|X[O+2]<<16|X[O+1]<<8|X[O];L[G]=E>>>0}return L}Q.join32=R;function K(X,A){var Z=Array(X.length*4);for(var $=0,I=0;$<X.length;$++,I+=4){var L=X[$];if(A==="big")Z[I]=L>>>24,Z[I+1]=L>>>16&255,Z[I+2]=L>>>8&255,Z[I+3]=L&255;else Z[I+3]=L>>>24,Z[I+2]=L>>>16&255,Z[I+1]=L>>>8&255,Z[I]=L&255}return Z}Q.split32=K;function W(X,A){return X>>>A|X<<32-A}Q.rotr32=W;function q(X,A){return X<<A|X>>>32-A}Q.rotl32=q;function P(X,A){return X+A>>>0}Q.sum32=P;function _(X,A,Z){return X+A+Z>>>0}Q.sum32_3=_;function k(X,A,Z,$){return X+A+Z+$>>>0}Q.sum32_4=k;function B(X,A,Z,$,I){return X+A+Z+$+I>>>0}Q.sum32_5=B;function j(X,A,Z,$){var I=X[A],L=X[A+1],G=$+L>>>0,O=(G<$?1:0)+Z+I;X[A]=O>>>0,X[A+1]=G}Q.sum64=j;function x(X,A,Z,$){var I=A+$>>>0,L=(I<A?1:0)+X+Z;return L>>>0}Q.sum64_hi=x;function f(X,A,Z,$){var I=A+$;return I>>>0}Q.sum64_lo=f;function w(X,A,Z,$,I,L,G,O){var E=0,z=A;z=z+$>>>0,E+=z<A?1:0,z=z+L>>>0,E+=z<L?1:0,z=z+O>>>0,E+=z<O?1:0;var S=X+Z+I+G+E;return S>>>0}Q.sum64_4_hi=w;function d(X,A,Z,$,I,L,G,O){var E=A+$+L+O;return E>>>0}Q.sum64_4_lo=d;function Y0(X,A,Z,$,I,L,G,O,E,z){var S=0,v=A;v=v+$>>>0,S+=v<A?1:0,v=v+L>>>0,S+=v<L?1:0,v=v+O>>>0,S+=v<O?1:0,v=v+z>>>0,S+=v<z?1:0;var g=X+Z+I+G+E+S;return g>>>0}Q.sum64_5_hi=Y0;function A0(X,A,Z,$,I,L,G,O,E,z){var S=A+$+L+O+z;return S>>>0}Q.sum64_5_lo=A0;function $0(X,A,Z){var $=A<<32-Z|X>>>Z;return $>>>0}Q.rotr64_hi=$0;function u(X,A,Z){var $=X<<32-Z|A>>>Z;return $>>>0}Q.rotr64_lo=u;function O0(X,A,Z){return X>>>Z}Q.shr64_hi=O0;function U(X,A,Z){var $=X<<32-Z|A>>>Z;return $>>>0}Q.shr64_lo=U}),xO=J0((Q)=>{var Y=dU(),V=OO();function H(){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}Q.BlockHash=H,H.prototype.update=function(C,D){if(C=Y.toArray(C,D),!this.pending)this.pending=C;else this.pending=this.pending.concat(C);if(this.pendingTotal+=C.length,this.pending.length>=this._delta8){C=this.pending;var J=C.length%this._delta8;if(this.pending=C.slice(C.length-J,C.length),this.pending.length===0)this.pending=null;C=Y.join32(C,0,C.length-J,this.endian);for(var T=0;T<C.length;T+=this._delta32)this._update(C,T,T+this._delta32)}return this},H.prototype.digest=function(C){return this.update(this._pad()),V(this.pending===null),this._digest(C)},H.prototype._pad=function(){var C=this.pendingTotal,D=this._delta8,J=D-(C+this.padLength)%D,T=Array(J+this.padLength);T[0]=128;for(var M=1;M<J;M++)T[M]=0;if(C<<=3,this.endian==="big"){for(var F=8;F<this.padLength;F++)T[M++]=0;T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=C>>>24&255,T[M++]=C>>>16&255,T[M++]=C>>>8&255,T[M++]=C&255}else{T[M++]=C&255,T[M++]=C>>>8&255,T[M++]=C>>>16&255,T[M++]=C>>>24&255,T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=0;for(F=8;F<this.padLength;F++)T[M++]=0}return T}}),EY=J0((Q)=>{var Y=dU(),V=Y.rotr32;function H(K,W,q,P){if(K===0)return C(W,q,P);if(K===1||K===3)return J(W,q,P);if(K===2)return D(W,q,P)}Q.ft_1=H;function C(K,W,q){return K&W^~K&q}Q.ch32=C;function D(K,W,q){return K&W^K&q^W&q}Q.maj32=D;function J(K,W,q){return K^W^q}Q.p32=J;function T(K){return V(K,2)^V(K,13)^V(K,22)}Q.s0_256=T;function M(K){return V(K,6)^V(K,11)^V(K,25)}Q.s1_256=M;function F(K){return V(K,7)^V(K,18)^K>>>3}Q.g0_256=F;function R(K){return V(K,17)^V(K,19)^K>>>10}Q.g1_256=R}),dA=J0((Q,Y)=>{var V=dU(),H=xO(),C=EY(),D=V.rotl32,J=V.sum32,T=V.sum32_5,M=C.ft_1,F=H.BlockHash,R=[1518500249,1859775393,2400959708,3395469782];function K(){if(!(this instanceof K))return new K;F.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}V.inherits(K,F),Y.exports=K,K.blockSize=512,K.outSize=160,K.hmacStrength=80,K.padLength=64,K.prototype._update=function(W,q){var P=this.W;for(var _=0;_<16;_++)P[_]=W[q+_];for(;_<P.length;_++)P[_]=D(P[_-3]^P[_-8]^P[_-14]^P[_-16],1);var k=this.h[0],B=this.h[1],j=this.h[2],x=this.h[3],f=this.h[4];for(_=0;_<P.length;_++){var w=~~(_/20),d=T(D(k,5),M(w,B,j,x),f,P[_],R[w]);f=x,x=j,j=D(B,30),B=k,k=d}this.h[0]=J(this.h[0],k),this.h[1]=J(this.h[1],B),this.h[2]=J(this.h[2],j),this.h[3]=J(this.h[3],x),this.h[4]=J(this.h[4],f)},K.prototype._digest=function(W){if(W==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")}}),IY=J0((Q,Y)=>{var V=dU(),H=xO(),C=EY(),D=OO(),J=V.sum32,T=V.sum32_4,M=V.sum32_5,F=C.ch32,R=C.maj32,K=C.s0_256,W=C.s1_256,q=C.g0_256,P=C.g1_256,_=H.BlockHash,k=[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 B(){if(!(this instanceof B))return new B;_.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=k,this.W=Array(64)}V.inherits(B,_),Y.exports=B,B.blockSize=512,B.outSize=256,B.hmacStrength=192,B.padLength=64,B.prototype._update=function(j,x){var f=this.W;for(var w=0;w<16;w++)f[w]=j[x+w];for(;w<f.length;w++)f[w]=T(P(f[w-2]),f[w-7],q(f[w-15]),f[w-16]);var d=this.h[0],Y0=this.h[1],A0=this.h[2],$0=this.h[3],u=this.h[4],O0=this.h[5],U=this.h[6],X=this.h[7];D(this.k.length===f.length);for(w=0;w<f.length;w++){var A=M(X,W(u),F(u,O0,U),this.k[w],f[w]),Z=J(K(d),R(d,Y0,A0));X=U,U=O0,O0=u,u=J($0,A),$0=A0,A0=Y0,Y0=d,d=J(A,Z)}this.h[0]=J(this.h[0],d),this.h[1]=J(this.h[1],Y0),this.h[2]=J(this.h[2],A0),this.h[3]=J(this.h[3],$0),this.h[4]=J(this.h[4],u),this.h[5]=J(this.h[5],O0),this.h[6]=J(this.h[6],U),this.h[7]=J(this.h[7],X)},B.prototype._digest=function(j){if(j==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")}}),oA=J0((Q,Y)=>{var V=dU(),H=IY();function C(){if(!(this instanceof C))return new C;H.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}V.inherits(C,H),Y.exports=C,C.blockSize=512,C.outSize=224,C.hmacStrength=192,C.padLength=64,C.prototype._digest=function(D){if(D==="hex")return V.toHex32(this.h.slice(0,7),"big");else return V.split32(this.h.slice(0,7),"big")}}),CY=J0((Q,Y)=>{var V=dU(),H=xO(),C=OO(),D=V.rotr64_hi,J=V.rotr64_lo,T=V.shr64_hi,M=V.shr64_lo,F=V.sum64,R=V.sum64_hi,K=V.sum64_lo,W=V.sum64_4_hi,q=V.sum64_4_lo,P=V.sum64_5_hi,_=V.sum64_5_lo,k=H.BlockHash,B=[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 j(){if(!(this instanceof j))return new j;k.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=B,this.W=Array(160)}V.inherits(j,k),Y.exports=j,j.blockSize=1024,j.outSize=512,j.hmacStrength=192,j.padLength=128,j.prototype._prepareBlock=function(Z,$){var I=this.W;for(var L=0;L<32;L++)I[L]=Z[$+L];for(;L<I.length;L+=2){var G=X(I[L-4],I[L-3]),O=A(I[L-4],I[L-3]),E=I[L-14],z=I[L-13],S=O0(I[L-30],I[L-29]),v=U(I[L-30],I[L-29]),g=I[L-32],p=I[L-31];I[L]=W(G,O,E,z,S,v,g,p),I[L+1]=q(G,O,E,z,S,v,g,p)}},j.prototype._update=function(Z,$){this._prepareBlock(Z,$);var I=this.W,L=this.h[0],G=this.h[1],O=this.h[2],E=this.h[3],z=this.h[4],S=this.h[5],v=this.h[6],g=this.h[7],p=this.h[8],n=this.h[9],V0=this.h[10],r=this.h[11],l=this.h[12],X0=this.h[13],m=this.h[14],i=this.h[15];C(this.k.length===I.length);for(var g0=0;g0<I.length;g0+=2){var y=m,h=i,Q0=$0(p,n),t=u(p,n),e=x(p,n,V0,r,l,X0),F0=f(p,n,V0,r,l,X0),c=this.k[g0],o=this.k[g0+1],N0=I[g0],s=I[g0+1],Z0=P(y,h,Q0,t,e,F0,c,o,N0,s),w0=_(y,h,Q0,t,e,F0,c,o,N0,s);y=Y0(L,G),h=A0(L,G),Q0=w(L,G,O,E,z,S),t=d(L,G,O,E,z,S);var C0=R(y,h,Q0,t),L0=K(y,h,Q0,t);m=l,i=X0,l=V0,X0=r,V0=p,r=n,p=R(v,g,Z0,w0),n=K(g,g,Z0,w0),v=z,g=S,z=O,S=E,O=L,E=G,L=R(Z0,w0,C0,L0),G=K(Z0,w0,C0,L0)}F(this.h,0,L,G),F(this.h,2,O,E),F(this.h,4,z,S),F(this.h,6,v,g),F(this.h,8,p,n),F(this.h,10,V0,r),F(this.h,12,l,X0),F(this.h,14,m,i)},j.prototype._digest=function(Z){if(Z==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")};function x(Z,$,I,L,G){var O=Z&I^~Z&G;if(O<0)O+=4294967296;return O}function f(Z,$,I,L,G,O){var E=$&L^~$&O;if(E<0)E+=4294967296;return E}function w(Z,$,I,L,G){var O=Z&I^Z&G^I&G;if(O<0)O+=4294967296;return O}function d(Z,$,I,L,G,O){var E=$&L^$&O^L&O;if(E<0)E+=4294967296;return E}function Y0(Z,$){var I=D(Z,$,28),L=D($,Z,2),G=D($,Z,7),O=I^L^G;if(O<0)O+=4294967296;return O}function A0(Z,$){var I=J(Z,$,28),L=J($,Z,2),G=J($,Z,7),O=I^L^G;if(O<0)O+=4294967296;return O}function $0(Z,$){var I=D(Z,$,14),L=D(Z,$,18),G=D($,Z,9),O=I^L^G;if(O<0)O+=4294967296;return O}function u(Z,$){var I=J(Z,$,14),L=J(Z,$,18),G=J($,Z,9),O=I^L^G;if(O<0)O+=4294967296;return O}function O0(Z,$){var I=D(Z,$,1),L=D(Z,$,8),G=T(Z,$,7),O=I^L^G;if(O<0)O+=4294967296;return O}function U(Z,$){var I=J(Z,$,1),L=J(Z,$,8),G=M(Z,$,7),O=I^L^G;if(O<0)O+=4294967296;return O}function X(Z,$){var I=D(Z,$,19),L=D($,Z,29),G=T(Z,$,6),O=I^L^G;if(O<0)O+=4294967296;return O}function A(Z,$){var I=J(Z,$,19),L=J($,Z,29),G=M(Z,$,6),O=I^L^G;if(O<0)O+=4294967296;return O}}),nA=J0((Q,Y)=>{var V=dU(),H=CY();function C(){if(!(this instanceof C))return new C;H.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}V.inherits(C,H),Y.exports=C,C.blockSize=1024,C.outSize=384,C.hmacStrength=192,C.padLength=128,C.prototype._digest=function(D){if(D==="hex")return V.toHex32(this.h.slice(0,12),"big");else return V.split32(this.h.slice(0,12),"big")}}),mA=J0((Q)=>{Q.sha1=dA(),Q.sha224=oA(),Q.sha256=IY(),Q.sha384=nA(),Q.sha512=CY()}),sA=J0((Q)=>{var Y=dU(),V=xO(),H=Y.rotl32,C=Y.sum32,D=Y.sum32_3,J=Y.sum32_4,T=V.BlockHash;function M(){if(!(this instanceof M))return new M;T.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Y.inherits(M,T),Q.ripemd160=M,M.blockSize=512,M.outSize=160,M.hmacStrength=192,M.padLength=64,M.prototype._update=function(k,B){var j=this.h[0],x=this.h[1],f=this.h[2],w=this.h[3],d=this.h[4],Y0=j,A0=x,$0=f,u=w,O0=d;for(var U=0;U<80;U++){var X=C(H(J(j,F(U,x,f,w),k[W[U]+B],R(U)),P[U]),d);j=d,d=w,w=H(f,10),f=x,x=X,X=C(H(J(Y0,F(79-U,A0,$0,u),k[q[U]+B],K(U)),_[U]),O0),Y0=O0,O0=u,u=H($0,10),$0=A0,A0=X}X=D(this.h[1],f,u),this.h[1]=D(this.h[2],w,O0),this.h[2]=D(this.h[3],d,Y0),this.h[3]=D(this.h[4],j,A0),this.h[4]=D(this.h[0],x,$0),this.h[0]=X},M.prototype._digest=function(k){if(k==="hex")return Y.toHex32(this.h,"little");else return Y.split32(this.h,"little")};function F(k,B,j,x){if(k<=15)return B^j^x;else if(k<=31)return B&j|~B&x;else if(k<=47)return(B|~j)^x;else if(k<=63)return B&x|j&~x;else return B^(j|~x)}function R(k){if(k<=15)return 0;else if(k<=31)return 1518500249;else if(k<=47)return 1859775393;else if(k<=63)return 2400959708;else return 2840853838}function K(k){if(k<=15)return 1352829926;else if(k<=31)return 1548603684;else if(k<=47)return 1836072691;else if(k<=63)return 2053994217;else return 0}var W=[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],q=[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],P=[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],_=[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]}),tA=J0((Q,Y)=>{var V=dU(),H=OO();function C(D,J,T){if(!(this instanceof C))return new C(D,J,T);this.Hash=D,this.blockSize=D.blockSize/8,this.outSize=D.outSize/8,this.inner=null,this.outer=null,this._init(V.toArray(J,T))}Y.exports=C,C.prototype._init=function(D){if(D.length>this.blockSize)D=new this.Hash().update(D).digest();H(D.length<=this.blockSize);for(var J=D.length;J<this.blockSize;J++)D.push(0);for(J=0;J<D.length;J++)D[J]^=54;this.inner=new this.Hash().update(D);for(J=0;J<D.length;J++)D[J]^=106;this.outer=new this.Hash().update(D)},C.prototype.update=function(D,J){return this.inner.update(D,J),this},C.prototype.digest=function(D){return this.outer.update(this.inner.digest()),this.outer.digest(D)}}),JX=J0((Q)=>{var Y=Q;Y.utils=dU(),Y.common=xO(),Y.sha=mA(),Y.ripemd=sA(),Y.hmac=tA(),Y.sha1=Y.sha.sha1,Y.sha256=Y.sha.sha256,Y.sha224=Y.sha.sha224,Y.sha384=Y.sha.sha384,Y.sha512=Y.sha.sha512,Y.ripemd160=Y.ripemd.ripemd160}),rA=J0((Q,Y)=>{Y.exports={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"]]}}}),AX=J0((Q)=>{var Y=Q,V=JX(),H=VY(),C=yU(),D=C.assert;function J(F){if(F.type==="short")this.curve=new H.short(F);else if(F.type==="edwards")this.curve=new H.edwards(F);else this.curve=new H.mont(F);this.g=this.curve.g,this.n=this.curve.n,this.hash=F.hash,D(this.g.validate(),"Invalid curve"),D(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}Y.PresetCurve=J;function T(F,R){Object.defineProperty(Y,F,{configurable:!0,enumerable:!0,get:function(){var K=new J(R);return Object.defineProperty(Y,F,{configurable:!0,enumerable:!0,value:K}),K}})}T("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:V.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),T("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:V.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),T("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:V.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),T("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:V.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"]}),T("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:V.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"]}),T("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:V.sha256,gRed:!1,g:["9"]}),T("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:V.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var M;try{M=rA()}catch(F){M=void 0}T("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:V.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",M]})}),aA=J0((Q,Y)=>{var V=JX(),H=AY(),C=OO();function D(J){if(!(this instanceof D))return new D(J);this.hash=J.hash,this.predResist=!!J.predResist,this.outLen=this.hash.outSize,this.minEntropy=J.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var T=H.toArray(J.entropy,J.entropyEnc||"hex"),M=H.toArray(J.nonce,J.nonceEnc||"hex"),F=H.toArray(J.pers,J.persEnc||"hex");C(T.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(T,M,F)}Y.exports=D,D.prototype._init=function(J,T,M){var F=J.concat(T).concat(M);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var R=0;R<this.V.length;R++)this.K[R]=0,this.V[R]=1;this._update(F),this._reseed=1,this.reseedInterval=281474976710656},D.prototype._hmac=function(){return new V.hmac(this.hash,this.K)},D.prototype._update=function(J){var T=this._hmac().update(this.V).update([0]);if(J)T=T.update(J);if(this.K=T.digest(),this.V=this._hmac().update(this.V).digest(),!J)return;this.K=this._hmac().update(this.V).update([1]).update(J).digest(),this.V=this._hmac().update(this.V).digest()},D.prototype.reseed=function(J,T,M,F){if(typeof T!=="string")F=M,M=T,T=null;J=H.toArray(J,T),M=H.toArray(M,F),C(J.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(J.concat(M||[])),this._reseed=1},D.prototype.generate=function(J,T,M,F){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof T!=="string")F=M,M=T,T=null;if(M)M=H.toArray(M,F||"hex"),this._update(M);var R=[];while(R.length<J)this.V=this._hmac().update(this.V).digest(),R=R.concat(this.V);var K=R.slice(0,J);return this._update(M),this._reseed++,H.encode(K,T)}}),eA=J0((Q,Y)=>{var V=sU(),H=yU(),C=H.assert;function D(J,T){if(this.ec=J,this.priv=null,this.pub=null,T.priv)this._importPrivate(T.priv,T.privEnc);if(T.pub)this._importPublic(T.pub,T.pubEnc)}Y.exports=D,D.fromPublic=function(J,T,M){if(T instanceof D)return T;return new D(J,{pub:T,pubEnc:M})},D.fromPrivate=function(J,T,M){if(T instanceof D)return T;return new D(J,{priv:T,privEnc:M})},D.prototype.validate=function(){var J=this.getPublic();if(J.isInfinity())return{result:!1,reason:"Invalid public key"};if(!J.validate())return{result:!1,reason:"Public key is not a point"};if(!J.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},D.prototype.getPublic=function(J,T){if(typeof J==="string")T=J,J=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!T)return this.pub;return this.pub.encode(T,J)},D.prototype.getPrivate=function(J){if(J==="hex")return this.priv.toString(16,2);else return this.priv},D.prototype._importPrivate=function(J,T){this.priv=new V(J,T||16),this.priv=this.priv.umod(this.ec.curve.n)},D.prototype._importPublic=function(J,T){if(J.x||J.y){if(this.ec.curve.type==="mont")C(J.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")C(J.x&&J.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(J.x,J.y);return}this.pub=this.ec.curve.decodePoint(J,T)},D.prototype.derive=function(J){if(!J.validate())C(J.validate(),"public point not validated");return J.mul(this.priv).getX()},D.prototype.sign=function(J,T,M){return this.ec.sign(J,this,T,M)},D.prototype.verify=function(J,T,M){return this.ec.verify(J,T,this,void 0,M)},D.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),iA=J0((Q,Y)=>{var V=sU(),H=yU(),C=H.assert;function D(R,K){if(R instanceof D)return R;if(this._importDER(R,K))return;if(C(R.r&&R.s,"Signature without r or s"),this.r=new V(R.r,16),this.s=new V(R.s,16),R.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=R.recoveryParam}Y.exports=D;function J(){this.place=0}function T(R,K){var W=R[K.place++];if(!(W&128))return W;var q=W&15;if(q===0||q>4)return!1;if(R[K.place]===0)return!1;var P=0;for(var _=0,k=K.place;_<q;_++,k++)P<<=8,P|=R[k],P>>>=0;if(P<=127)return!1;return K.place=k,P}function M(R){var K=0,W=R.length-1;while(!R[K]&&!(R[K+1]&128)&&K<W)K++;if(K===0)return R;return R.slice(K)}D.prototype._importDER=function(R,K){R=H.toArray(R,K);var W=new J;if(R[W.place++]!==48)return!1;var q=T(R,W);if(q===!1)return!1;if(q+W.place!==R.length)return!1;if(R[W.place++]!==2)return!1;var P=T(R,W);if(P===!1)return!1;if((R[W.place]&128)!==0)return!1;var _=R.slice(W.place,P+W.place);if(W.place+=P,R[W.place++]!==2)return!1;var k=T(R,W);if(k===!1)return!1;if(R.length!==k+W.place)return!1;if((R[W.place]&128)!==0)return!1;var B=R.slice(W.place,k+W.place);if(_[0]===0)if(_[1]&128)_=_.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new V(_),this.s=new V(B),this.recoveryParam=null,!0};function F(R,K){if(K<128){R.push(K);return}var W=1+(Math.log(K)/Math.LN2>>>3);R.push(W|128);while(--W)R.push(K>>>(W<<3)&255);R.push(K)}D.prototype.toDER=function(R){var K=this.r.toArray(),W=this.s.toArray();if(K[0]&128)K=[0].concat(K);if(W[0]&128)W=[0].concat(W);K=M(K),W=M(W);while(!W[0]&&!(W[1]&128))W=W.slice(1);var q=[2];F(q,K.length),q=q.concat(K),q.push(2),F(q,W.length);var P=q.concat(W),_=[48];return F(_,P.length),_=_.concat(P),H.encode(_,R)}}),UG=J0((Q,Y)=>{var V=sU(),H=aA(),C=yU(),D=AX(),J=GY(),T=C.assert,M=eA(),F=iA();function R(K){if(!(this instanceof R))return new R(K);if(typeof K==="string")T(Object.prototype.hasOwnProperty.call(D,K),"Unknown curve "+K),K=D[K];if(K instanceof D.PresetCurve)K={curve:K};this.curve=K.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=K.curve.g,this.g.precompute(K.curve.n.bitLength()+1),this.hash=K.hash||K.curve.hash}Y.exports=R,R.prototype.keyPair=function(K){return new M(this,K)},R.prototype.keyFromPrivate=function(K,W){return M.fromPrivate(this,K,W)},R.prototype.keyFromPublic=function(K,W){return M.fromPublic(this,K,W)},R.prototype.genKeyPair=function(K){if(!K)K={};var W=new H({hash:this.hash,pers:K.pers,persEnc:K.persEnc||"utf8",entropy:K.entropy||J(this.hash.hmacStrength),entropyEnc:K.entropy&&K.entropyEnc||"utf8",nonce:this.n.toArray()}),q=this.n.byteLength(),P=this.n.sub(new V(2));for(;;){var _=new V(W.generate(q));if(_.cmp(P)>0)continue;return _.iaddn(1),this.keyFromPrivate(_)}},R.prototype._truncateToN=function(K,W,q){var P;if(V.isBN(K)||typeof K==="number")K=new V(K,16),P=K.byteLength();else if(typeof K==="object")P=K.length,K=new V(K,16);else{var _=K.toString();P=_.length+1>>>1,K=new V(_,16)}if(typeof q!=="number")q=P*8;var k=q-this.n.bitLength();if(k>0)K=K.ushrn(k);if(!W&&K.cmp(this.n)>=0)return K.sub(this.n);else return K},R.prototype.sign=function(K,W,q,P){if(typeof q==="object")P=q,q=null;if(!P)P={};if(typeof K!=="string"&&typeof K!=="number"&&!V.isBN(K)){T(typeof K==="object"&&K&&typeof K.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),T(K.length>>>0===K.length);for(var _=0;_<K.length;_++)T((K[_]&255)===K[_])}W=this.keyFromPrivate(W,q),K=this._truncateToN(K,!1,P.msgBitLength),T(!K.isNeg(),"Can not sign a negative message");var k=this.n.byteLength(),B=W.getPrivate().toArray("be",k),j=K.toArray("be",k);T(new V(j).eq(K),"Can not sign message");var x=new H({hash:this.hash,entropy:B,nonce:j,pers:P.pers,persEnc:P.persEnc||"utf8"}),f=this.n.sub(new V(1));for(var w=0;;w++){var d=P.k?P.k(w):new V(x.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),d.cmpn(1)<=0||d.cmp(f)>=0)continue;var Y0=this.g.mul(d);if(Y0.isInfinity())continue;var A0=Y0.getX(),$0=A0.umod(this.n);if($0.cmpn(0)===0)continue;var u=d.invm(this.n).mul($0.mul(W.getPrivate()).iadd(K));if(u=u.umod(this.n),u.cmpn(0)===0)continue;var O0=(Y0.getY().isOdd()?1:0)|(A0.cmp($0)!==0?2:0);if(P.canonical&&u.cmp(this.nh)>0)u=this.n.sub(u),O0^=1;return new F({r:$0,s:u,recoveryParam:O0})}},R.prototype.verify=function(K,W,q,P,_){if(!_)_={};K=this._truncateToN(K,!1,_.msgBitLength),q=this.keyFromPublic(q,P),W=new F(W,"hex");var{r:k,s:B}=W;if(k.cmpn(1)<0||k.cmp(this.n)>=0)return!1;if(B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var j=B.invm(this.n),x=j.mul(K).umod(this.n),f=j.mul(k).umod(this.n),w;if(!this.curve._maxwellTrick){if(w=this.g.mulAdd(x,q.getPublic(),f),w.isInfinity())return!1;return w.getX().umod(this.n).cmp(k)===0}if(w=this.g.jmulAdd(x,q.getPublic(),f),w.isInfinity())return!1;return w.eqXToP(k)},R.prototype.recoverPubKey=function(K,W,q,P){T((3&q)===q,"The recovery param is more than two bits"),W=new F(W,P);var _=this.n,k=new V(K),B=W.r,j=W.s,x=q&1,f=q>>1;if(B.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");if(f)B=this.curve.pointFromX(B.add(this.curve.n),x);else B=this.curve.pointFromX(B,x);var w=W.r.invm(_),d=_.sub(k).mul(w).umod(_),Y0=j.mul(w).umod(_);return this.g.mulAdd(d,B,Y0)},R.prototype.getKeyRecoveryParam=function(K,W,q,P){if(W=new F(W,P),W.recoveryParam!==null)return W.recoveryParam;for(var _=0;_<4;_++){var k;try{k=this.recoverPubKey(K,W,_)}catch(B){continue}if(k.eq(q))return _}throw Error("Unable to find valid recovery factor")}}),OG=J0((Q,Y)=>{var V=yU(),H=V.assert,C=V.parseBytes,D=V.cachedProperty;function J(T,M){if(this.eddsa=T,this._secret=C(M.secret),T.isPoint(M.pub))this._pub=M.pub;else this._pubBytes=C(M.pub)}J.fromPublic=function(T,M){if(M instanceof J)return M;return new J(T,{pub:M})},J.fromSecret=function(T,M){if(M instanceof J)return M;return new J(T,{secret:M})},J.prototype.secret=function(){return this._secret},D(J,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),D(J,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),D(J,"privBytes",function(){var T=this.eddsa,M=this.hash(),F=T.encodingLength-1,R=M.slice(0,T.encodingLength);return R[0]&=248,R[F]&=127,R[F]|=64,R}),D(J,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),D(J,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),D(J,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),J.prototype.sign=function(T){return H(this._secret,"KeyPair can only verify"),this.eddsa.sign(T,this)},J.prototype.verify=function(T,M){return this.eddsa.verify(T,M,this)},J.prototype.getSecret=function(T){return H(this._secret,"KeyPair is public only"),V.encode(this.secret(),T)},J.prototype.getPublic=function(T){return V.encode(this.pubBytes(),T)},Y.exports=J}),ZG=J0((Q,Y)=>{var V=sU(),H=yU(),C=H.assert,D=H.cachedProperty,J=H.parseBytes;function T(M,F){if(this.eddsa=M,typeof F!=="object")F=J(F);if(Array.isArray(F))C(F.length===M.encodingLength*2,"Signature has invalid size"),F={R:F.slice(0,M.encodingLength),S:F.slice(M.encodingLength)};if(C(F.R&&F.S,"Signature without R or S"),M.isPoint(F.R))this._R=F.R;if(F.S instanceof V)this._S=F.S;this._Rencoded=Array.isArray(F.R)?F.R:F.Rencoded,this._Sencoded=Array.isArray(F.S)?F.S:F.Sencoded}D(T,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),D(T,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),D(T,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),D(T,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),T.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},T.prototype.toHex=function(){return H.encode(this.toBytes(),"hex").toUpperCase()},Y.exports=T}),XG=J0((Q,Y)=>{var V=JX(),H=AX(),C=yU(),D=C.assert,J=C.parseBytes,T=OG(),M=ZG();function F(R){if(D(R==="ed25519","only tested with ed25519 so far"),!(this instanceof F))return new F(R);R=H[R].curve,this.curve=R,this.g=R.g,this.g.precompute(R.n.bitLength()+1),this.pointClass=R.point().constructor,this.encodingLength=Math.ceil(R.n.bitLength()/8),this.hash=V.sha512}Y.exports=F,F.prototype.sign=function(R,K){R=J(R);var W=this.keyFromSecret(K),q=this.hashInt(W.messagePrefix(),R),P=this.g.mul(q),_=this.encodePoint(P),k=this.hashInt(_,W.pubBytes(),R).mul(W.priv()),B=q.add(k).umod(this.curve.n);return this.makeSignature({R:P,S:B,Rencoded:_})},F.prototype.verify=function(R,K,W){if(R=J(R),K=this.makeSignature(K),K.S().gte(K.eddsa.curve.n)||K.S().isNeg())return!1;var q=this.keyFromPublic(W),P=this.hashInt(K.Rencoded(),q.pubBytes(),R),_=this.g.mul(K.S()),k=K.R().add(q.pub().mul(P));return k.eq(_)},F.prototype.hashInt=function(){var R=this.hash();for(var K=0;K<arguments.length;K++)R.update(arguments[K]);return C.intFromLE(R.digest()).umod(this.curve.n)},F.prototype.keyFromPublic=function(R){return T.fromPublic(this,R)},F.prototype.keyFromSecret=function(R){return T.fromSecret(this,R)},F.prototype.makeSignature=function(R){if(R instanceof M)return R;return new M(this,R)},F.prototype.encodePoint=function(R){var K=R.getY().toArray("le",this.encodingLength);return K[this.encodingLength-1]|=R.getX().isOdd()?128:0,K},F.prototype.decodePoint=function(R){R=C.parseBytes(R);var K=R.length-1,W=R.slice(0,K).concat(R[K]&-129),q=(R[K]&128)!==0,P=C.intFromLE(W);return this.curve.pointFromY(P,q)},F.prototype.encodeInt=function(R){return R.toArray("le",this.encodingLength)},F.prototype.decodeInt=function(R){return C.intFromLE(R)},F.prototype.isPoint=function(R){return R instanceof this.pointClass}}),QG=J0((Q)=>{var Y=Q;Y.version=pA().version,Y.utils=yU(),Y.rand=GY(),Y.curve=VY(),Y.curves=AX(),Y.ec=UG(),Y.eddsa=XG()}),YG=J0((Q,Y)=>{(function(V,H){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function D(U,X){U.super_=X;var A=function(){};A.prototype=X.prototype,U.prototype=new A,U.prototype.constructor=U}function J(U,X,A){if(J.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")A=X,X=10;this._init(U||0,X||10,A||"be")}}if(typeof V==="object")V.exports=J;else H.BN=J;J.BN=J,J.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(WU(),h0(HU)).Buffer}catch(U){}J.isBN=function(U){if(U instanceof J)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===J.wordSize&&Array.isArray(U.words)},J.max=function(U,X){if(U.cmp(X)>0)return U;return X},J.min=function(U,X){if(U.cmp(X)<0)return U;return X},J.prototype._init=function(U,X,A){if(typeof U==="number")return this._initNumber(U,X,A);if(typeof U==="object")return this._initArray(U,X,A);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,A);else if(this._parseBase(U,X,Z),A==="le")this._initArray(this.toArray(),X,A)}},J.prototype._initNumber=function(U,X,A){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(A!=="le")return;this._initArray(this.toArray(),X,A)},J.prototype._initArray=function(U,X,A){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var $,I,L=0;if(A==="be"){for(Z=U.length-1,$=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[$]|=I<<L&67108863,this.words[$+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,$++}else if(A==="le"){for(Z=0,$=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[$]|=I<<L&67108863,this.words[$+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,$++}return this.strip()};function M(U,X){var A=U.charCodeAt(X);if(A>=65&&A<=70)return A-55;else if(A>=97&&A<=102)return A-87;else return A-48&15}function F(U,X,A){var Z=M(U,A);if(A-1>=X)Z|=M(U,A-1)<<4;return Z}J.prototype._parseHex=function(U,X,A){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var $=0,I=0,L;if(A==="be")for(Z=U.length-1;Z>=X;Z-=2)if(L=F(U,X,Z)<<$,this.words[I]|=L&67108863,$>=18)$-=18,I+=1,this.words[I]|=L>>>26;else $+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(L=F(U,X,Z)<<$,this.words[I]|=L&67108863,$>=18)$-=18,I+=1,this.words[I]|=L>>>26;else $+=8}this.strip()};function R(U,X,A,Z){var $=0,I=Math.min(U.length,A);for(var L=X;L<I;L++){var G=U.charCodeAt(L)-48;if($*=Z,G>=49)$+=G-49+10;else if(G>=17)$+=G-17+10;else $+=G}return $}J.prototype._parseBase=function(U,X,A){this.words=[0],this.length=1;for(var Z=0,$=1;$<=67108863;$*=X)Z++;Z--,$=$/X|0;var I=U.length-A,L=I%Z,G=Math.min(I,I-L)+A,O=0;for(var E=A;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln($),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(L!==0){var z=1;O=R(U,E,U.length,X);for(E=0;E<L;E++)z*=X;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},J.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},J.prototype.clone=function(){var U=new J(null);return this.copy(U),U},J.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},J.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},J.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var K=["","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"],W=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(U,X){U=U||10,X=X|0||1;var A;if(U===16||U==="hex"){A="";var Z=0,$=0;for(var I=0;I<this.length;I++){var L=this.words[I],G=((L<<Z|$)&16777215).toString(16);if($=L>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if($!==0||I!==this.length-1)A=K[6-G.length]+G+A;else A=G+A}if($!==0)A=$.toString(16)+A;while(A.length%X!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}if(U===(U|0)&&U>=2&&U<=36){var O=W[U],E=q[U];A="";var z=this.clone();z.negative=0;while(!z.isZero()){var S=z.modn(E).toString(U);if(z=z.idivn(E),!z.isZero())A=K[O-S.length]+S+A;else A=S+A}if(this.isZero())A="0"+A;while(A.length%X!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}C(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},J.prototype.toJSON=function(){return this.toString(16)},J.prototype.toBuffer=function(U,X){return C(typeof T<"u"),this.toArrayLike(T,U,X)},J.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},J.prototype.toArrayLike=function(U,X,A){var Z=this.byteLength(),$=A||Math.max(1,Z);C(Z<=$,"byte array longer than desired length"),C($>0,"Requested array length <= 0"),this.strip();var I=X==="le",L=new U($),G,O,E=this.clone();if(!I){for(O=0;O<$-Z;O++)L[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[$-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[O]=G;for(;O<$;O++)L[O]=0}return L},Math.clz32)J.prototype._countBits=function(U){return 32-Math.clz32(U)};else J.prototype._countBits=function(U){var X=U,A=0;if(X>=4096)A+=13,X>>>=13;if(X>=64)A+=7,X>>>=7;if(X>=8)A+=4,X>>>=4;if(X>=2)A+=2,X>>>=2;return A+X};J.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,A=0;if((X&8191)===0)A+=13,X>>>=13;if((X&127)===0)A+=7,X>>>=7;if((X&15)===0)A+=4,X>>>=4;if((X&3)===0)A+=2,X>>>=2;if((X&1)===0)A++;return A},J.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var A=0;A<X.length;A++){var Z=A/26|0,$=A%26;X[A]=(U.words[Z]&1<<$)>>>$}return X}J.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var A=this._zeroBits(this.words[X]);if(U+=A,A!==26)break}return U},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},J.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},J.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},J.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},J.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},J.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var A=0;A<X.length;A++)this.words[A]=this.words[A]&U.words[A];return this.length=X.length,this.strip()},J.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},J.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},J.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},J.prototype.iuxor=function(U){var X,A;if(this.length>U.length)X=this,A=U;else X=U,A=this;for(var Z=0;Z<A.length;Z++)this.words[Z]=X.words[Z]^A.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},J.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},J.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},J.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},J.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,A=U%26;if(this._expand(X),A>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(A>0)this.words[Z]=~this.words[Z]&67108863>>26-A;return this.strip()},J.prototype.notn=function(U){return this.clone().inotn(U)},J.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var A=U/26|0,Z=U%26;if(this._expand(A+1),X)this.words[A]=this.words[A]|1<<Z;else this.words[A]=this.words[A]&~(1<<Z);return this.strip()},J.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var A,Z;if(this.length>U.length)A=this,Z=U;else A=U,Z=this;var $=0;for(var I=0;I<Z.length;I++)X=(A.words[I]|0)+(Z.words[I]|0)+$,this.words[I]=X&67108863,$=X>>>26;for(;$!==0&&I<A.length;I++)X=(A.words[I]|0)+$,this.words[I]=X&67108863,$=X>>>26;if(this.length=A.length,$!==0)this.words[this.length]=$,this.length++;else if(A!==this)for(;I<A.length;I++)this.words[I]=A.words[I];return this},J.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},J.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var A=this.cmp(U);if(A===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,$;if(A>0)Z=this,$=U;else Z=U,$=this;var I=0;for(var L=0;L<$.length;L++)X=(Z.words[L]|0)-($.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;for(;I!==0&&L<Z.length;L++)X=(Z.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;if(I===0&&L<Z.length&&Z!==this)for(;L<Z.length;L++)this.words[L]=Z.words[L];if(this.length=Math.max(this.length,L),Z!==this)this.negative=1;return this.strip()},J.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,A){A.negative=X.negative^U.negative;var Z=U.length+X.length|0;A.length=Z,Z=Z-1|0;var $=U.words[0]|0,I=X.words[0]|0,L=$*I,G=L&67108863,O=L/67108864|0;A.words[0]=G;for(var E=1;E<Z;E++){var z=O>>>26,S=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;$=U.words[p]|0,I=X.words[g]|0,L=$*I+S,z+=L/67108864|0,S=L&67108863}A.words[E]=S|0,O=z|0}if(O!==0)A.words[E]=O|0;else A.length--;return A.strip()}var k=function(U,X,A){var Z=U.words,$=X.words,I=A.words,L=0,G,O,E,z=Z[0]|0,S=z&8191,v=z>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,t=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,s=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,L0=w0>>>13,s0=Z[9]|0,E0=s0&8191,K0=s0>>>13,e0=$[0]|0,S0=e0&8191,W0=e0>>>13,FU=$[1]|0,R0=FU&8191,k0=FU>>>13,RU=$[2]|0,_0=RU&8191,T0=RU>>>13,SU=$[3]|0,v0=SU&8191,z0=SU>>>13,CU=$[4]|0,j0=CU&8191,B0=CU>>>13,LU=$[5]|0,M0=LU&8191,N=LU>>>13,b=$[6]|0,a=b&8191,U0=b>>>13,f0=$[7]|0,I0=f0&8191,H0=f0>>>13,t0=$[8]|0,q0=t0&8191,x0=t0>>>13,DU=$[9]|0,P0=DU&8191,D0=DU>>>13;A.negative=U.negative^X.negative,A.length=19,G=Math.imul(S,S0),O=Math.imul(S,W0),O=O+Math.imul(v,S0)|0,E=Math.imul(v,W0);var r0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,S0),O=Math.imul(p,W0),O=O+Math.imul(n,S0)|0,E=Math.imul(n,W0),G=G+Math.imul(S,R0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,S0),O=Math.imul(r,W0),O=O+Math.imul(l,S0)|0,E=Math.imul(l,W0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(S,_0)|0,O=O+Math.imul(S,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,S0),O=Math.imul(m,W0),O=O+Math.imul(i,S0)|0,E=Math.imul(i,W0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(S,v0)|0,O=O+Math.imul(S,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,S0),O=Math.imul(y,W0),O=O+Math.imul(h,S0)|0,E=Math.imul(h,W0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(S,j0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(t,S0),O=Math.imul(t,W0),O=O+Math.imul(e,S0)|0,E=Math.imul(e,W0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(S,M0)|0,O=O+Math.imul(S,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,S0),O=Math.imul(c,W0),O=O+Math.imul(o,S0)|0,E=Math.imul(o,W0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(S,a)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,S0),O=Math.imul(s,W0),O=O+Math.imul(Z0,S0)|0,E=Math.imul(Z0,W0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(S,I0)|0,O=O+Math.imul(S,H0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,H0)|0;var OU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,S0),O=Math.imul(C0,W0),O=O+Math.imul(L0,S0)|0,E=Math.imul(L0,W0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,H0)|0,G=G+Math.imul(S,q0)|0,O=O+Math.imul(S,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,S0),O=Math.imul(E0,W0),O=O+Math.imul(K0,S0)|0,E=Math.imul(K0,W0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(L0,R0)|0,E=E+Math.imul(L0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,H0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(S,P0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,D0)|0;var XU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(K0,R0)|0,E=Math.imul(K0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(L0,_0)|0,E=E+Math.imul(L0,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,H0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,D0)|0;var QU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(K0,_0)|0,E=Math.imul(K0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(L0,v0)|0,E=E+Math.imul(L0,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,H0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,D0)|0;var YU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(K0,v0)|0,E=Math.imul(K0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(L0,j0)|0,E=E+Math.imul(L0,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,H0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,D0)|0;var $U=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(K0,j0)|0,E=Math.imul(K0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(L0,M0)|0,E=E+Math.imul(L0,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,H0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,D0)|0;var JU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(K0,M0)|0,E=Math.imul(K0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(L0,a)|0,E=E+Math.imul(L0,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,H0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,D0)|0;var AU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(K0,a)|0,E=Math.imul(K0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,H0)|0,O=O+Math.imul(L0,I0)|0,E=E+Math.imul(L0,H0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,D0)|0;var GU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,H0),O=O+Math.imul(K0,I0)|0,E=Math.imul(K0,H0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(L0,q0)|0,E=E+Math.imul(L0,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,D0)|0;var VU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(K0,q0)|0,E=Math.imul(K0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,D0)|0,O=O+Math.imul(L0,P0)|0,E=E+Math.imul(L0,D0)|0;var EU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,D0),O=O+Math.imul(K0,P0)|0,E=Math.imul(K0,D0);var IU=(L+G|0)+((O&8191)<<13)|0;if(L=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=$U,I[13]=JU,I[14]=AU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,L!==0)I[19]=L,A.length++;return A};if(!Math.imul)k=_;function B(U,X,A){A.negative=X.negative^U.negative,A.length=U.length+X.length;var Z=0,$=0;for(var I=0;I<A.length-1;I++){var L=$;$=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var z=I-E,S=U.words[z]|0,v=X.words[E]|0,g=S*v,p=g&67108863;L=L+(g/67108864|0)|0,p=p+G|0,G=p&67108863,L=L+(p>>>26)|0,$+=L>>>26,L&=67108863}A.words[I]=G,Z=L,L=$}if(Z!==0)A.words[I]=Z;else A.length--;return A.strip()}function j(U,X,A){var Z=new x;return Z.mulp(U,X,A)}J.prototype.mulTo=function(U,X){var A,Z=this.length+U.length;if(this.length===10&&U.length===10)A=k(this,U,X);else if(Z<63)A=_(this,U,X);else if(Z<1024)A=B(this,U,X);else A=j(this,U,X);return A};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),A=J.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,A,U);return X},x.prototype.revBin=function(U,X,A){if(U===0||U===A-1)return U;var Z=0;for(var $=0;$<X;$++)Z|=(U&1)<<X-$-1,U>>=1;return Z},x.prototype.permute=function(U,X,A,Z,$,I){for(var L=0;L<I;L++)Z[L]=X[U[L]],$[L]=A[U[L]]},x.prototype.transform=function(U,X,A,Z,$,I){this.permute(I,U,X,A,Z,$);for(var L=1;L<$;L<<=1){var G=L<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var z=0;z<$;z+=G){var S=O,v=E;for(var g=0;g<L;g++){var p=A[z+g],n=Z[z+g],V0=A[z+g+L],r=Z[z+g+L],l=S*V0-v*r;if(r=S*r+v*V0,V0=l,A[z+g]=p+V0,Z[z+g]=n+r,A[z+g+L]=p-V0,Z[z+g+L]=n-r,g!==G)l=O*S-E*v,v=O*v+E*S,S=l}}}},x.prototype.guessLen13b=function(U,X){var A=Math.max(X,U)|1,Z=A&1,$=0;for(A=A/2|0;A;A=A>>>1)$++;return 1<<$+1+Z},x.prototype.conjugate=function(U,X,A){if(A<=1)return;for(var Z=0;Z<A/2;Z++){var $=U[Z];U[Z]=U[A-Z-1],U[A-Z-1]=$,$=X[Z],X[Z]=-X[A-Z-1],X[A-Z-1]=-$}},x.prototype.normalize13b=function(U,X){var A=0;for(var Z=0;Z<X/2;Z++){var $=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+A;if(U[Z]=$&67108863,$<67108864)A=0;else A=$/67108864|0}return U},x.prototype.convert13b=function(U,X,A,Z){var $=0;for(var I=0;I<X;I++)$=$+(U[I]|0),A[2*I]=$&8191,$=$>>>13,A[2*I+1]=$&8191,$=$>>>13;for(I=2*X;I<Z;++I)A[I]=0;C($===0),C(($&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var A=0;A<U;A++)X[A]=0;return X},x.prototype.mulp=function(U,X,A){var Z=2*this.guessLen13b(U.length,X.length),$=this.makeRBT(Z),I=this.stub(Z),L=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),z=Array(Z),S=Array(Z),v=A.words;v.length=Z,this.convert13b(U.words,U.length,L,Z),this.convert13b(X.words,X.length,E,Z),this.transform(L,I,G,O,Z,$),this.transform(E,I,z,S,Z,$);for(var g=0;g<Z;g++){var p=G[g]*z[g]-O[g]*S[g];O[g]=G[g]*S[g]+O[g]*z[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,$),this.conjugate(v,I,Z),this.normalize13b(v,Z),A.negative=U.negative^X.negative,A.length=U.length+X.length,A.strip()},J.prototype.mul=function(U){var X=new J(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},J.prototype.mulf=function(U){var X=new J(null);return X.words=Array(this.length+U.length),j(this,U,X)},J.prototype.imul=function(U){return this.clone().mulTo(U,this)},J.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var A=0;A<this.length;A++){var Z=(this.words[A]|0)*U,$=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=$>>>26,this.words[A]=$&67108863}if(X!==0)this.words[A]=X,this.length++;return this.length=U===0?1:this.length,this},J.prototype.muln=function(U){return this.clone().imuln(U)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(U){var X=P(U);if(X.length===0)return new J(1);var A=this;for(var Z=0;Z<X.length;Z++,A=A.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var $=A.sqr();Z<X.length;Z++,$=$.sqr()){if(X[Z]===0)continue;A=A.mul($)}return A},J.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26,Z=67108863>>>26-X<<26-X,$;if(X!==0){var I=0;for($=0;$<this.length;$++){var L=this.words[$]&Z,G=(this.words[$]|0)-L<<X;this.words[$]=G|I,I=L>>>26-X}if(I)this.words[$]=I,this.length++}if(A!==0){for($=this.length-1;$>=0;$--)this.words[$+A]=this.words[$];for($=0;$<A;$++)this.words[$]=0;this.length+=A}return this.strip()},J.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},J.prototype.iushrn=function(U,X,A){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var $=U%26,I=Math.min((U-$)/26,this.length),L=67108863^67108863>>>$<<$,G=A;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=E<<26-$|z>>>$,E=z&L}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},J.prototype.ishrn=function(U,X,A){return C(this.negative===0),this.iushrn(U,X,A)},J.prototype.shln=function(U){return this.clone().ishln(U)},J.prototype.ushln=function(U){return this.clone().iushln(U)},J.prototype.shrn=function(U){return this.clone().ishrn(U)},J.prototype.ushrn=function(U){return this.clone().iushrn(U)},J.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26,Z=1<<X;if(this.length<=A)return!1;var $=this.words[A];return!!($&Z)},J.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=A)return this;if(X!==0)A++;if(this.length=Math.min(A,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},J.prototype.maskn=function(U){return this.clone().imaskn(U)},J.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},J.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},J.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},J.prototype.addn=function(U){return this.clone().iaddn(U)},J.prototype.subn=function(U){return this.clone().isubn(U)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(U,X,A){var Z=U.length+A,$;this._expand(Z);var I,L=0;for($=0;$<U.length;$++){I=(this.words[$+A]|0)+L;var G=(U.words[$]|0)*X;I-=G&67108863,L=(I>>26)-(G/67108864|0),this.words[$+A]=I&67108863}for(;$<this.length-A;$++)I=(this.words[$+A]|0)+L,L=I>>26,this.words[$+A]=I&67108863;if(L===0)return this.strip();C(L===-1),L=0;for($=0;$<this.length;$++)I=-(this.words[$]|0)+L,L=I>>26,this.words[$]=I&67108863;return this.negative=1,this.strip()},J.prototype._wordDiv=function(U,X){var A=this.length-U.length,Z=this.clone(),$=U,I=$.words[$.length-1]|0,L=this._countBits(I);if(A=26-L,A!==0)$=$.ushln(A),Z.iushln(A),I=$.words[$.length-1]|0;var G=Z.length-$.length,O;if(X!=="mod"){O=new J(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var z=Z.clone()._ishlnsubmul($,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var S=G-1;S>=0;S--){var v=(Z.words[$.length+S]|0)*67108864+(Z.words[$.length+S-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul($,v,S);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul($,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&A!==0)Z.iushrn(A);return{div:O||null,mod:Z}},J.prototype.divmod=function(U,X,A){if(C(!U.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var Z,$,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if($=I.mod.neg(),A&&$.negative!==0)$.iadd(U)}return{div:Z,mod:$}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if($=I.mod.neg(),A&&$.negative!==0)$.isub(U)}return{div:I.div,mod:$}}if(U.length>this.length||this.cmp(U)<0)return{div:new J(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new J(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new J(this.modn(U.words[0]))}}return this._wordDiv(U,X)},J.prototype.div=function(U){return this.divmod(U,"div",!1).div},J.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},J.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},J.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var A=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),$=U.andln(1),I=A.cmp(Z);if(I<0||$===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},J.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,A=0;for(var Z=this.length-1;Z>=0;Z--)A=(X*A+(this.words[Z]|0))%U;return A},J.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var A=this.length-1;A>=0;A--){var Z=(this.words[A]|0)+X*67108864;this.words[A]=Z/U|0,X=Z%U}return this.strip()},J.prototype.divn=function(U){return this.clone().idivn(U)},J.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,A=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),$=new J(0),I=new J(0),L=new J(1),G=0;while(X.isEven()&&A.isEven())X.iushrn(1),A.iushrn(1),++G;var O=A.clone(),E=X.clone();while(!X.isZero()){for(var z=0,S=1;(X.words[0]&S)===0&&z<26;++z,S<<=1);if(z>0){X.iushrn(z);while(z-- >0){if(Z.isOdd()||$.isOdd())Z.iadd(O),$.isub(E);Z.iushrn(1),$.iushrn(1)}}for(var v=0,g=1;(A.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){A.iushrn(v);while(v-- >0){if(I.isOdd()||L.isOdd())I.iadd(O),L.isub(E);I.iushrn(1),L.iushrn(1)}}if(X.cmp(A)>=0)X.isub(A),Z.isub(I),$.isub(L);else A.isub(X),I.isub(Z),L.isub($)}return{a:I,b:L,gcd:A.iushln(G)}},J.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,A=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),$=new J(0),I=A.clone();while(X.cmpn(1)>0&&A.cmpn(1)>0){for(var L=0,G=1;(X.words[0]&G)===0&&L<26;++L,G<<=1);if(L>0){X.iushrn(L);while(L-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(A.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){A.iushrn(O);while(O-- >0){if($.isOdd())$.iadd(I);$.iushrn(1)}}if(X.cmp(A)>=0)X.isub(A),Z.isub($);else A.isub(X),$.isub(Z)}var z;if(X.cmpn(1)===0)z=Z;else z=$;if(z.cmpn(0)<0)z.iadd(U);return z},J.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),A=U.clone();X.negative=0,A.negative=0;for(var Z=0;X.isEven()&&A.isEven();Z++)X.iushrn(1),A.iushrn(1);do{while(X.isEven())X.iushrn(1);while(A.isEven())A.iushrn(1);var $=X.cmp(A);if($<0){var I=X;X=A,A=I}else if($===0||A.cmpn(1)===0)break;X.isub(A)}while(!0);return A.iushln(Z)},J.prototype.invm=function(U){return this.egcd(U).a.umod(U)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(U){return this.words[0]&U},J.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,A=(U-X)/26,Z=1<<X;if(this.length<=A)return this._expand(A+1),this.words[A]|=Z,this;var $=Z;for(var I=A;$!==0&&I<this.length;I++){var L=this.words[I]|0;L+=$,$=L>>>26,L&=67108863,this.words[I]=L}if($!==0)this.words[I]=$,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var A;if(this.length>1)A=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;A=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-A|0;return A},J.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},J.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var A=this.length-1;A>=0;A--){var Z=this.words[A]|0,$=U.words[A]|0;if(Z===$)continue;if(Z<$)X=-1;else if(Z>$)X=1;break}return X},J.prototype.gtn=function(U){return this.cmpn(U)===1},J.prototype.gt=function(U){return this.cmp(U)===1},J.prototype.gten=function(U){return this.cmpn(U)>=0},J.prototype.gte=function(U){return this.cmp(U)>=0},J.prototype.ltn=function(U){return this.cmpn(U)===-1},J.prototype.lt=function(U){return this.cmp(U)===-1},J.prototype.lten=function(U){return this.cmpn(U)<=0},J.prototype.lte=function(U){return this.cmp(U)<=0},J.prototype.eqn=function(U){return this.cmpn(U)===0},J.prototype.eq=function(U){return this.cmp(U)===0},J.red=function(U){return new u(U)},J.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},J.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(U){return this.red=U,this},J.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},J.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},J.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},J.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},J.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},J.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},J.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},J.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},J.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new J(X,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new J(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,A;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),A=X.bitLength();while(A>this.n);var Z=A<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D(d,w),d.prototype.split=function(U,X){var A=4194303,Z=Math.min(U.length,9);for(var $=0;$<Z;$++)X.words[$]=U.words[$];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&A;for($=10;$<U.length;$++){var L=U.words[$]|0;U.words[$-10]=(L&A)<<4|I>>>22,I=L}if(I>>>=22,U.words[$-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var A=0;A<U.length;A++){var Z=U.words[A]|0;X+=Z*977,U.words[A]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(Y0,w);function A0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(A0,w);function $0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D($0,w),$0.prototype.imulK=function(U){var X=0;for(var A=0;A<U.length;A++){var Z=(U.words[A]|0)*19+X,$=Z&67108863;Z>>>=26,U.words[A]=$,X=Z}if(X!==0)U.words[U.length++]=X;return U},J._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new A0;else if(U==="p25519")X=new $0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=J._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var A=U.add(X);if(A.cmp(this.m)>=0)A.isub(this.m);return A._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var A=U.iadd(X);if(A.cmp(this.m)>=0)A.isub(this.m);return A},u.prototype.sub=function(U,X){this._verify2(U,X);var A=U.sub(X);if(A.cmpn(0)<0)A.iadd(this.m);return A._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var A=U.isub(X);if(A.cmpn(0)<0)A.iadd(this.m);return A},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var A=this.m.add(new J(1)).iushrn(2);return this.pow(U,A)}var Z=this.m.subn(1),$=0;while(!Z.isZero()&&Z.andln(1)===0)$++,Z.iushrn(1);C(!Z.isZero());var I=new J(1).toRed(this),L=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new J(2*O*O).toRed(this);while(this.pow(O,G).cmp(L)!==0)O.redIAdd(L);var E=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),v=$;while(S.cmp(I)!==0){var g=S;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new J(1).iushln(v-p-1));z=z.redMul(n),E=n.redSqr(),S=S.redMul(E),v=p}return z},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new J(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var A=4,Z=Array(1<<A);Z[0]=new J(1).toRed(this),Z[1]=U;for(var $=2;$<Z.length;$++)Z[$]=this.mul(Z[$-1],U);var I=Z[0],L=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for($=X.length-1;$>=0;$--){var E=X.words[$];for(var z=O-1;z>=0;z--){var S=E>>z&1;if(I!==Z[0])I=this.sqr(I);if(S===0&&L===0){G=0;continue}if(L<<=1,L|=S,G++,G!==A&&($!==0||z!==0))continue;I=this.mul(I,Z[L]),G=0,L=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},J.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}D(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var A=U.imul(X),Z=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=A.isub(Z).iushrn(this.shift),I=$;if($.cmp(this.m)>=0)I=$.isub(this.m);else if($.cmpn(0)<0)I=$.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new J(0)._forceRed(this);var A=U.mul(X),Z=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=A.isub(Z).iushrn(this.shift),I=$;if($.cmp(this.m)>=0)I=$.isub(this.m);else if($.cmpn(0)<0)I=$.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof Y>"u"||Y,Q)}),$G=J0((Q,Y)=>{var V=QG(),H=YG();Y.exports=function(T){return new D(T)};var C={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}};C.p224=C.secp224r1,C.p256=C.secp256r1=C.prime256v1,C.p192=C.secp192r1=C.prime192v1,C.p384=C.secp384r1,C.p521=C.secp521r1;function D(T){if(this.curveType=C[T],!this.curveType)this.curveType={name:T};this.curve=new V.ec(this.curveType.name),this.keys=void 0}D.prototype.generateKeys=function(T,M){return this.keys=this.curve.genKeyPair(),this.getPublicKey(T,M)},D.prototype.computeSecret=function(T,M,F){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);var R=this.curve.keyFromPublic(T).getPublic(),K=R.mul(this.keys.getPrivate()).getX();return J(K,F,this.curveType.byteLength)},D.prototype.getPublicKey=function(T,M){var F=this.keys.getPublic(M==="compressed",!0);if(M==="hybrid")if(F[F.length-1]%2)F[0]=7;else F[0]=6;return J(F,T)},D.prototype.getPrivateKey=function(T){return J(this.keys.getPrivate(),T)},D.prototype.setPublicKey=function(T,M){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);return this.keys._importPublic(T),this},D.prototype.setPrivateKey=function(T,M){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);var F=new H(T);return F=F.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(F),this};function J(T,M,F){if(!Array.isArray(T))T=T.toArray();var R=new Buffer(T);if(F&&R.length<F){var K=new Buffer(F-R.length);K.fill(0),R=Buffer.concat([K,R])}if(!M)return R;else return R.toString(M)}}),JG=J0((Q,Y)=>{var V=(jU(),h0(vU)).createECDH;Y.exports=V||$G()}),AG=J0((Q,Y)=>{(function(V,H){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function D(U,X){U.super_=X;var A=function(){};A.prototype=X.prototype,U.prototype=new A,U.prototype.constructor=U}function J(U,X,A){if(J.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")A=X,X=10;this._init(U||0,X||10,A||"be")}}if(typeof V==="object")V.exports=J;else H.BN=J;J.BN=J,J.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(WU(),h0(HU)).Buffer}catch(U){}J.isBN=function(U){if(U instanceof J)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===J.wordSize&&Array.isArray(U.words)},J.max=function(U,X){if(U.cmp(X)>0)return U;return X},J.min=function(U,X){if(U.cmp(X)<0)return U;return X},J.prototype._init=function(U,X,A){if(typeof U==="number")return this._initNumber(U,X,A);if(typeof U==="object")return this._initArray(U,X,A);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,A);else if(this._parseBase(U,X,Z),A==="le")this._initArray(this.toArray(),X,A)}},J.prototype._initNumber=function(U,X,A){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(A!=="le")return;this._initArray(this.toArray(),X,A)},J.prototype._initArray=function(U,X,A){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var $,I,L=0;if(A==="be"){for(Z=U.length-1,$=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[$]|=I<<L&67108863,this.words[$+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,$++}else if(A==="le"){for(Z=0,$=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[$]|=I<<L&67108863,this.words[$+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,$++}return this.strip()};function M(U,X){var A=U.charCodeAt(X);if(A>=65&&A<=70)return A-55;else if(A>=97&&A<=102)return A-87;else return A-48&15}function F(U,X,A){var Z=M(U,A);if(A-1>=X)Z|=M(U,A-1)<<4;return Z}J.prototype._parseHex=function(U,X,A){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var $=0,I=0,L;if(A==="be")for(Z=U.length-1;Z>=X;Z-=2)if(L=F(U,X,Z)<<$,this.words[I]|=L&67108863,$>=18)$-=18,I+=1,this.words[I]|=L>>>26;else $+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(L=F(U,X,Z)<<$,this.words[I]|=L&67108863,$>=18)$-=18,I+=1,this.words[I]|=L>>>26;else $+=8}this.strip()};function R(U,X,A,Z){var $=0,I=Math.min(U.length,A);for(var L=X;L<I;L++){var G=U.charCodeAt(L)-48;if($*=Z,G>=49)$+=G-49+10;else if(G>=17)$+=G-17+10;else $+=G}return $}J.prototype._parseBase=function(U,X,A){this.words=[0],this.length=1;for(var Z=0,$=1;$<=67108863;$*=X)Z++;Z--,$=$/X|0;var I=U.length-A,L=I%Z,G=Math.min(I,I-L)+A,O=0;for(var E=A;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln($),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(L!==0){var z=1;O=R(U,E,U.length,X);for(E=0;E<L;E++)z*=X;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},J.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},J.prototype.clone=function(){var U=new J(null);return this.copy(U),U},J.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},J.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},J.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var K=["","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"],W=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(U,X){U=U||10,X=X|0||1;var A;if(U===16||U==="hex"){A="";var Z=0,$=0;for(var I=0;I<this.length;I++){var L=this.words[I],G=((L<<Z|$)&16777215).toString(16);if($=L>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if($!==0||I!==this.length-1)A=K[6-G.length]+G+A;else A=G+A}if($!==0)A=$.toString(16)+A;while(A.length%X!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}if(U===(U|0)&&U>=2&&U<=36){var O=W[U],E=q[U];A="";var z=this.clone();z.negative=0;while(!z.isZero()){var S=z.modn(E).toString(U);if(z=z.idivn(E),!z.isZero())A=K[O-S.length]+S+A;else A=S+A}if(this.isZero())A="0"+A;while(A.length%X!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}C(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},J.prototype.toJSON=function(){return this.toString(16)},J.prototype.toBuffer=function(U,X){return C(typeof T<"u"),this.toArrayLike(T,U,X)},J.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},J.prototype.toArrayLike=function(U,X,A){var Z=this.byteLength(),$=A||Math.max(1,Z);C(Z<=$,"byte array longer than desired length"),C($>0,"Requested array length <= 0"),this.strip();var I=X==="le",L=new U($),G,O,E=this.clone();if(!I){for(O=0;O<$-Z;O++)L[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[$-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[O]=G;for(;O<$;O++)L[O]=0}return L},Math.clz32)J.prototype._countBits=function(U){return 32-Math.clz32(U)};else J.prototype._countBits=function(U){var X=U,A=0;if(X>=4096)A+=13,X>>>=13;if(X>=64)A+=7,X>>>=7;if(X>=8)A+=4,X>>>=4;if(X>=2)A+=2,X>>>=2;return A+X};J.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,A=0;if((X&8191)===0)A+=13,X>>>=13;if((X&127)===0)A+=7,X>>>=7;if((X&15)===0)A+=4,X>>>=4;if((X&3)===0)A+=2,X>>>=2;if((X&1)===0)A++;return A},J.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var A=0;A<X.length;A++){var Z=A/26|0,$=A%26;X[A]=(U.words[Z]&1<<$)>>>$}return X}J.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var A=this._zeroBits(this.words[X]);if(U+=A,A!==26)break}return U},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},J.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},J.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},J.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},J.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},J.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var A=0;A<X.length;A++)this.words[A]=this.words[A]&U.words[A];return this.length=X.length,this.strip()},J.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},J.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},J.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},J.prototype.iuxor=function(U){var X,A;if(this.length>U.length)X=this,A=U;else X=U,A=this;for(var Z=0;Z<A.length;Z++)this.words[Z]=X.words[Z]^A.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},J.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},J.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},J.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},J.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,A=U%26;if(this._expand(X),A>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(A>0)this.words[Z]=~this.words[Z]&67108863>>26-A;return this.strip()},J.prototype.notn=function(U){return this.clone().inotn(U)},J.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var A=U/26|0,Z=U%26;if(this._expand(A+1),X)this.words[A]=this.words[A]|1<<Z;else this.words[A]=this.words[A]&~(1<<Z);return this.strip()},J.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var A,Z;if(this.length>U.length)A=this,Z=U;else A=U,Z=this;var $=0;for(var I=0;I<Z.length;I++)X=(A.words[I]|0)+(Z.words[I]|0)+$,this.words[I]=X&67108863,$=X>>>26;for(;$!==0&&I<A.length;I++)X=(A.words[I]|0)+$,this.words[I]=X&67108863,$=X>>>26;if(this.length=A.length,$!==0)this.words[this.length]=$,this.length++;else if(A!==this)for(;I<A.length;I++)this.words[I]=A.words[I];return this},J.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},J.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var A=this.cmp(U);if(A===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,$;if(A>0)Z=this,$=U;else Z=U,$=this;var I=0;for(var L=0;L<$.length;L++)X=(Z.words[L]|0)-($.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;for(;I!==0&&L<Z.length;L++)X=(Z.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;if(I===0&&L<Z.length&&Z!==this)for(;L<Z.length;L++)this.words[L]=Z.words[L];if(this.length=Math.max(this.length,L),Z!==this)this.negative=1;return this.strip()},J.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,A){A.negative=X.negative^U.negative;var Z=U.length+X.length|0;A.length=Z,Z=Z-1|0;var $=U.words[0]|0,I=X.words[0]|0,L=$*I,G=L&67108863,O=L/67108864|0;A.words[0]=G;for(var E=1;E<Z;E++){var z=O>>>26,S=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;$=U.words[p]|0,I=X.words[g]|0,L=$*I+S,z+=L/67108864|0,S=L&67108863}A.words[E]=S|0,O=z|0}if(O!==0)A.words[E]=O|0;else A.length--;return A.strip()}var k=function(U,X,A){var Z=U.words,$=X.words,I=A.words,L=0,G,O,E,z=Z[0]|0,S=z&8191,v=z>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,t=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,s=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,L0=w0>>>13,s0=Z[9]|0,E0=s0&8191,K0=s0>>>13,e0=$[0]|0,S0=e0&8191,W0=e0>>>13,FU=$[1]|0,R0=FU&8191,k0=FU>>>13,RU=$[2]|0,_0=RU&8191,T0=RU>>>13,SU=$[3]|0,v0=SU&8191,z0=SU>>>13,CU=$[4]|0,j0=CU&8191,B0=CU>>>13,LU=$[5]|0,M0=LU&8191,N=LU>>>13,b=$[6]|0,a=b&8191,U0=b>>>13,f0=$[7]|0,I0=f0&8191,H0=f0>>>13,t0=$[8]|0,q0=t0&8191,x0=t0>>>13,DU=$[9]|0,P0=DU&8191,D0=DU>>>13;A.negative=U.negative^X.negative,A.length=19,G=Math.imul(S,S0),O=Math.imul(S,W0),O=O+Math.imul(v,S0)|0,E=Math.imul(v,W0);var r0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,S0),O=Math.imul(p,W0),O=O+Math.imul(n,S0)|0,E=Math.imul(n,W0),G=G+Math.imul(S,R0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,S0),O=Math.imul(r,W0),O=O+Math.imul(l,S0)|0,E=Math.imul(l,W0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(S,_0)|0,O=O+Math.imul(S,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,S0),O=Math.imul(m,W0),O=O+Math.imul(i,S0)|0,E=Math.imul(i,W0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(S,v0)|0,O=O+Math.imul(S,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,S0),O=Math.imul(y,W0),O=O+Math.imul(h,S0)|0,E=Math.imul(h,W0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(S,j0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(t,S0),O=Math.imul(t,W0),O=O+Math.imul(e,S0)|0,E=Math.imul(e,W0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(S,M0)|0,O=O+Math.imul(S,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,S0),O=Math.imul(c,W0),O=O+Math.imul(o,S0)|0,E=Math.imul(o,W0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(S,a)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,S0),O=Math.imul(s,W0),O=O+Math.imul(Z0,S0)|0,E=Math.imul(Z0,W0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(S,I0)|0,O=O+Math.imul(S,H0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,H0)|0;var OU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,S0),O=Math.imul(C0,W0),O=O+Math.imul(L0,S0)|0,E=Math.imul(L0,W0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,H0)|0,G=G+Math.imul(S,q0)|0,O=O+Math.imul(S,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,S0),O=Math.imul(E0,W0),O=O+Math.imul(K0,S0)|0,E=Math.imul(K0,W0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(L0,R0)|0,E=E+Math.imul(L0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,H0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(S,P0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,D0)|0;var XU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(K0,R0)|0,E=Math.imul(K0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(L0,_0)|0,E=E+Math.imul(L0,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,H0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,D0)|0;var QU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(K0,_0)|0,E=Math.imul(K0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(L0,v0)|0,E=E+Math.imul(L0,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,H0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,D0)|0;var YU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(K0,v0)|0,E=Math.imul(K0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(L0,j0)|0,E=E+Math.imul(L0,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,H0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,D0)|0;var $U=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(K0,j0)|0,E=Math.imul(K0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(L0,M0)|0,E=E+Math.imul(L0,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,H0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,D0)|0;var JU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(K0,M0)|0,E=Math.imul(K0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(L0,a)|0,E=E+Math.imul(L0,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,H0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,D0)|0;var AU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(K0,a)|0,E=Math.imul(K0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,H0)|0,O=O+Math.imul(L0,I0)|0,E=E+Math.imul(L0,H0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,D0)|0;var GU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,H0),O=O+Math.imul(K0,I0)|0,E=Math.imul(K0,H0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(L0,q0)|0,E=E+Math.imul(L0,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,D0)|0;var VU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(K0,q0)|0,E=Math.imul(K0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,D0)|0,O=O+Math.imul(L0,P0)|0,E=E+Math.imul(L0,D0)|0;var EU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,D0),O=O+Math.imul(K0,P0)|0,E=Math.imul(K0,D0);var IU=(L+G|0)+((O&8191)<<13)|0;if(L=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=$U,I[13]=JU,I[14]=AU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,L!==0)I[19]=L,A.length++;return A};if(!Math.imul)k=_;function B(U,X,A){A.negative=X.negative^U.negative,A.length=U.length+X.length;var Z=0,$=0;for(var I=0;I<A.length-1;I++){var L=$;$=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var z=I-E,S=U.words[z]|0,v=X.words[E]|0,g=S*v,p=g&67108863;L=L+(g/67108864|0)|0,p=p+G|0,G=p&67108863,L=L+(p>>>26)|0,$+=L>>>26,L&=67108863}A.words[I]=G,Z=L,L=$}if(Z!==0)A.words[I]=Z;else A.length--;return A.strip()}function j(U,X,A){var Z=new x;return Z.mulp(U,X,A)}J.prototype.mulTo=function(U,X){var A,Z=this.length+U.length;if(this.length===10&&U.length===10)A=k(this,U,X);else if(Z<63)A=_(this,U,X);else if(Z<1024)A=B(this,U,X);else A=j(this,U,X);return A};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),A=J.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,A,U);return X},x.prototype.revBin=function(U,X,A){if(U===0||U===A-1)return U;var Z=0;for(var $=0;$<X;$++)Z|=(U&1)<<X-$-1,U>>=1;return Z},x.prototype.permute=function(U,X,A,Z,$,I){for(var L=0;L<I;L++)Z[L]=X[U[L]],$[L]=A[U[L]]},x.prototype.transform=function(U,X,A,Z,$,I){this.permute(I,U,X,A,Z,$);for(var L=1;L<$;L<<=1){var G=L<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var z=0;z<$;z+=G){var S=O,v=E;for(var g=0;g<L;g++){var p=A[z+g],n=Z[z+g],V0=A[z+g+L],r=Z[z+g+L],l=S*V0-v*r;if(r=S*r+v*V0,V0=l,A[z+g]=p+V0,Z[z+g]=n+r,A[z+g+L]=p-V0,Z[z+g+L]=n-r,g!==G)l=O*S-E*v,v=O*v+E*S,S=l}}}},x.prototype.guessLen13b=function(U,X){var A=Math.max(X,U)|1,Z=A&1,$=0;for(A=A/2|0;A;A=A>>>1)$++;return 1<<$+1+Z},x.prototype.conjugate=function(U,X,A){if(A<=1)return;for(var Z=0;Z<A/2;Z++){var $=U[Z];U[Z]=U[A-Z-1],U[A-Z-1]=$,$=X[Z],X[Z]=-X[A-Z-1],X[A-Z-1]=-$}},x.prototype.normalize13b=function(U,X){var A=0;for(var Z=0;Z<X/2;Z++){var $=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+A;if(U[Z]=$&67108863,$<67108864)A=0;else A=$/67108864|0}return U},x.prototype.convert13b=function(U,X,A,Z){var $=0;for(var I=0;I<X;I++)$=$+(U[I]|0),A[2*I]=$&8191,$=$>>>13,A[2*I+1]=$&8191,$=$>>>13;for(I=2*X;I<Z;++I)A[I]=0;C($===0),C(($&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var A=0;A<U;A++)X[A]=0;return X},x.prototype.mulp=function(U,X,A){var Z=2*this.guessLen13b(U.length,X.length),$=this.makeRBT(Z),I=this.stub(Z),L=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),z=Array(Z),S=Array(Z),v=A.words;v.length=Z,this.convert13b(U.words,U.length,L,Z),this.convert13b(X.words,X.length,E,Z),this.transform(L,I,G,O,Z,$),this.transform(E,I,z,S,Z,$);for(var g=0;g<Z;g++){var p=G[g]*z[g]-O[g]*S[g];O[g]=G[g]*S[g]+O[g]*z[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,$),this.conjugate(v,I,Z),this.normalize13b(v,Z),A.negative=U.negative^X.negative,A.length=U.length+X.length,A.strip()},J.prototype.mul=function(U){var X=new J(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},J.prototype.mulf=function(U){var X=new J(null);return X.words=Array(this.length+U.length),j(this,U,X)},J.prototype.imul=function(U){return this.clone().mulTo(U,this)},J.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var A=0;A<this.length;A++){var Z=(this.words[A]|0)*U,$=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=$>>>26,this.words[A]=$&67108863}if(X!==0)this.words[A]=X,this.length++;return this.length=U===0?1:this.length,this},J.prototype.muln=function(U){return this.clone().imuln(U)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(U){var X=P(U);if(X.length===0)return new J(1);var A=this;for(var Z=0;Z<X.length;Z++,A=A.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var $=A.sqr();Z<X.length;Z++,$=$.sqr()){if(X[Z]===0)continue;A=A.mul($)}return A},J.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26,Z=67108863>>>26-X<<26-X,$;if(X!==0){var I=0;for($=0;$<this.length;$++){var L=this.words[$]&Z,G=(this.words[$]|0)-L<<X;this.words[$]=G|I,I=L>>>26-X}if(I)this.words[$]=I,this.length++}if(A!==0){for($=this.length-1;$>=0;$--)this.words[$+A]=this.words[$];for($=0;$<A;$++)this.words[$]=0;this.length+=A}return this.strip()},J.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},J.prototype.iushrn=function(U,X,A){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var $=U%26,I=Math.min((U-$)/26,this.length),L=67108863^67108863>>>$<<$,G=A;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=E<<26-$|z>>>$,E=z&L}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},J.prototype.ishrn=function(U,X,A){return C(this.negative===0),this.iushrn(U,X,A)},J.prototype.shln=function(U){return this.clone().ishln(U)},J.prototype.ushln=function(U){return this.clone().iushln(U)},J.prototype.shrn=function(U){return this.clone().ishrn(U)},J.prototype.ushrn=function(U){return this.clone().iushrn(U)},J.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26,Z=1<<X;if(this.length<=A)return!1;var $=this.words[A];return!!($&Z)},J.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=A)return this;if(X!==0)A++;if(this.length=Math.min(A,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},J.prototype.maskn=function(U){return this.clone().imaskn(U)},J.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},J.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},J.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},J.prototype.addn=function(U){return this.clone().iaddn(U)},J.prototype.subn=function(U){return this.clone().isubn(U)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(U,X,A){var Z=U.length+A,$;this._expand(Z);var I,L=0;for($=0;$<U.length;$++){I=(this.words[$+A]|0)+L;var G=(U.words[$]|0)*X;I-=G&67108863,L=(I>>26)-(G/67108864|0),this.words[$+A]=I&67108863}for(;$<this.length-A;$++)I=(this.words[$+A]|0)+L,L=I>>26,this.words[$+A]=I&67108863;if(L===0)return this.strip();C(L===-1),L=0;for($=0;$<this.length;$++)I=-(this.words[$]|0)+L,L=I>>26,this.words[$]=I&67108863;return this.negative=1,this.strip()},J.prototype._wordDiv=function(U,X){var A=this.length-U.length,Z=this.clone(),$=U,I=$.words[$.length-1]|0,L=this._countBits(I);if(A=26-L,A!==0)$=$.ushln(A),Z.iushln(A),I=$.words[$.length-1]|0;var G=Z.length-$.length,O;if(X!=="mod"){O=new J(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var z=Z.clone()._ishlnsubmul($,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var S=G-1;S>=0;S--){var v=(Z.words[$.length+S]|0)*67108864+(Z.words[$.length+S-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul($,v,S);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul($,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&A!==0)Z.iushrn(A);return{div:O||null,mod:Z}},J.prototype.divmod=function(U,X,A){if(C(!U.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var Z,$,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if($=I.mod.neg(),A&&$.negative!==0)$.iadd(U)}return{div:Z,mod:$}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if($=I.mod.neg(),A&&$.negative!==0)$.isub(U)}return{div:I.div,mod:$}}if(U.length>this.length||this.cmp(U)<0)return{div:new J(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new J(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new J(this.modn(U.words[0]))}}return this._wordDiv(U,X)},J.prototype.div=function(U){return this.divmod(U,"div",!1).div},J.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},J.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},J.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var A=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),$=U.andln(1),I=A.cmp(Z);if(I<0||$===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},J.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,A=0;for(var Z=this.length-1;Z>=0;Z--)A=(X*A+(this.words[Z]|0))%U;return A},J.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var A=this.length-1;A>=0;A--){var Z=(this.words[A]|0)+X*67108864;this.words[A]=Z/U|0,X=Z%U}return this.strip()},J.prototype.divn=function(U){return this.clone().idivn(U)},J.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,A=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),$=new J(0),I=new J(0),L=new J(1),G=0;while(X.isEven()&&A.isEven())X.iushrn(1),A.iushrn(1),++G;var O=A.clone(),E=X.clone();while(!X.isZero()){for(var z=0,S=1;(X.words[0]&S)===0&&z<26;++z,S<<=1);if(z>0){X.iushrn(z);while(z-- >0){if(Z.isOdd()||$.isOdd())Z.iadd(O),$.isub(E);Z.iushrn(1),$.iushrn(1)}}for(var v=0,g=1;(A.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){A.iushrn(v);while(v-- >0){if(I.isOdd()||L.isOdd())I.iadd(O),L.isub(E);I.iushrn(1),L.iushrn(1)}}if(X.cmp(A)>=0)X.isub(A),Z.isub(I),$.isub(L);else A.isub(X),I.isub(Z),L.isub($)}return{a:I,b:L,gcd:A.iushln(G)}},J.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,A=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),$=new J(0),I=A.clone();while(X.cmpn(1)>0&&A.cmpn(1)>0){for(var L=0,G=1;(X.words[0]&G)===0&&L<26;++L,G<<=1);if(L>0){X.iushrn(L);while(L-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(A.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){A.iushrn(O);while(O-- >0){if($.isOdd())$.iadd(I);$.iushrn(1)}}if(X.cmp(A)>=0)X.isub(A),Z.isub($);else A.isub(X),$.isub(Z)}var z;if(X.cmpn(1)===0)z=Z;else z=$;if(z.cmpn(0)<0)z.iadd(U);return z},J.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),A=U.clone();X.negative=0,A.negative=0;for(var Z=0;X.isEven()&&A.isEven();Z++)X.iushrn(1),A.iushrn(1);do{while(X.isEven())X.iushrn(1);while(A.isEven())A.iushrn(1);var $=X.cmp(A);if($<0){var I=X;X=A,A=I}else if($===0||A.cmpn(1)===0)break;X.isub(A)}while(!0);return A.iushln(Z)},J.prototype.invm=function(U){return this.egcd(U).a.umod(U)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(U){return this.words[0]&U},J.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,A=(U-X)/26,Z=1<<X;if(this.length<=A)return this._expand(A+1),this.words[A]|=Z,this;var $=Z;for(var I=A;$!==0&&I<this.length;I++){var L=this.words[I]|0;L+=$,$=L>>>26,L&=67108863,this.words[I]=L}if($!==0)this.words[I]=$,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var A;if(this.length>1)A=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;A=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-A|0;return A},J.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},J.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var A=this.length-1;A>=0;A--){var Z=this.words[A]|0,$=U.words[A]|0;if(Z===$)continue;if(Z<$)X=-1;else if(Z>$)X=1;break}return X},J.prototype.gtn=function(U){return this.cmpn(U)===1},J.prototype.gt=function(U){return this.cmp(U)===1},J.prototype.gten=function(U){return this.cmpn(U)>=0},J.prototype.gte=function(U){return this.cmp(U)>=0},J.prototype.ltn=function(U){return this.cmpn(U)===-1},J.prototype.lt=function(U){return this.cmp(U)===-1},J.prototype.lten=function(U){return this.cmpn(U)<=0},J.prototype.lte=function(U){return this.cmp(U)<=0},J.prototype.eqn=function(U){return this.cmpn(U)===0},J.prototype.eq=function(U){return this.cmp(U)===0},J.red=function(U){return new u(U)},J.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},J.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(U){return this.red=U,this},J.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},J.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},J.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},J.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},J.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},J.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},J.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},J.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},J.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new J(X,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new J(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,A;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),A=X.bitLength();while(A>this.n);var Z=A<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D(d,w),d.prototype.split=function(U,X){var A=4194303,Z=Math.min(U.length,9);for(var $=0;$<Z;$++)X.words[$]=U.words[$];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&A;for($=10;$<U.length;$++){var L=U.words[$]|0;U.words[$-10]=(L&A)<<4|I>>>22,I=L}if(I>>>=22,U.words[$-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var A=0;A<U.length;A++){var Z=U.words[A]|0;X+=Z*977,U.words[A]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(Y0,w);function A0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(A0,w);function $0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D($0,w),$0.prototype.imulK=function(U){var X=0;for(var A=0;A<U.length;A++){var Z=(U.words[A]|0)*19+X,$=Z&67108863;Z>>>=26,U.words[A]=$,X=Z}if(X!==0)U.words[U.length++]=X;return U},J._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new A0;else if(U==="p25519")X=new $0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=J._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var A=U.add(X);if(A.cmp(this.m)>=0)A.isub(this.m);return A._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var A=U.iadd(X);if(A.cmp(this.m)>=0)A.isub(this.m);return A},u.prototype.sub=function(U,X){this._verify2(U,X);var A=U.sub(X);if(A.cmpn(0)<0)A.iadd(this.m);return A._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var A=U.isub(X);if(A.cmpn(0)<0)A.iadd(this.m);return A},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var A=this.m.add(new J(1)).iushrn(2);return this.pow(U,A)}var Z=this.m.subn(1),$=0;while(!Z.isZero()&&Z.andln(1)===0)$++,Z.iushrn(1);C(!Z.isZero());var I=new J(1).toRed(this),L=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new J(2*O*O).toRed(this);while(this.pow(O,G).cmp(L)!==0)O.redIAdd(L);var E=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),v=$;while(S.cmp(I)!==0){var g=S;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new J(1).iushln(v-p-1));z=z.redMul(n),E=n.redSqr(),S=S.redMul(E),v=p}return z},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new J(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var A=4,Z=Array(1<<A);Z[0]=new J(1).toRed(this),Z[1]=U;for(var $=2;$<Z.length;$++)Z[$]=this.mul(Z[$-1],U);var I=Z[0],L=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for($=X.length-1;$>=0;$--){var E=X.words[$];for(var z=O-1;z>=0;z--){var S=E>>z&1;if(I!==Z[0])I=this.sqr(I);if(S===0&&L===0){G=0;continue}if(L<<=1,L|=S,G++,G!==A&&($!==0||z!==0))continue;I=this.mul(I,Z[L]),G=0,L=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},J.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}D(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var A=U.imul(X),Z=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=A.isub(Z).iushrn(this.shift),I=$;if($.cmp(this.m)>=0)I=$.isub(this.m);else if($.cmpn(0)<0)I=$.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new J(0)._forceRed(this);var A=U.mul(X),Z=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=A.isub(Z).iushrn(this.shift),I=$;if($.cmp(this.m)>=0)I=$.isub(this.m);else if($.cmpn(0)<0)I=$.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof Y>"u"||Y,Q)}),GG=J0((Q)=>{var Y=NO(),V=xU(),H=Q;H.define=function(D,J){return new C(D,J)};function C(D,J){this.name=D,this.body=J,this.decoders={},this.encoders={}}C.prototype._createNamed=function(D){var J;try{J=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
13
13
  this._initNamed(entity);
14
- })`)}catch(z){A=function(M){this._initNamed(M)}}return V(A,D),A.prototype._initNamed=function(z){D.call(this,z)},new A(this)},C.prototype._getDecoder=function(D){if(D=D||"der",!this.decoders.hasOwnProperty(D))this.decoders[D]=this._createNamed($.decoders[D]);return this.decoders[D]},C.prototype.decode=function(D,A,z){return this._getDecoder(A).decode(D,z)},C.prototype._getEncoder=function(D){if(D=D||"der",!this.encoders.hasOwnProperty(D))this.encoders[D]=this._createNamed($.encoders[D]);return this.encoders[D]},C.prototype.encode=function(D,A,z){return this._getEncoder(A).encode(D,z)}}),XG=A0((Q)=>{var $=xU();function V(C){this._reporterState={obj:null,path:[],options:C||{},errors:[]}}Q.Reporter=V,V.prototype.isError=function(C){return C instanceof W},V.prototype.save=function(){var C=this._reporterState;return{obj:C.obj,pathLen:C.path.length}},V.prototype.restore=function(C){var D=this._reporterState;D.obj=C.obj,D.path=D.path.slice(0,C.pathLen)},V.prototype.enterKey=function(C){return this._reporterState.path.push(C)},V.prototype.exitKey=function(C){var D=this._reporterState;D.path=D.path.slice(0,C-1)},V.prototype.leaveKey=function(C,D,A){var z=this._reporterState;if(this.exitKey(C),z.obj!==null)z.obj[D]=A},V.prototype.path=function(){return this._reporterState.path.join("/")},V.prototype.enterObject=function(){var C=this._reporterState,D=C.obj;return C.obj={},D},V.prototype.leaveObject=function(C){var D=this._reporterState,A=D.obj;return D.obj=C,A},V.prototype.error=function(C){var D,A=this._reporterState,z=C instanceof W;if(z)D=C;else D=new W(A.path.map(function(M){return"["+JSON.stringify(M)+"]"}).join(""),C.message||C,C.stack);if(!A.options.partial)throw D;if(!z)A.errors.push(D);return D},V.prototype.wrapResult=function(C){var D=this._reporterState;if(!D.options.partial)return C;return{result:this.isError(C)?null:C,errors:D.errors}};function W(C,D){this.path=C,this.rethrow(D)}$(W,Error),W.prototype.rethrow=function(C){if(this.message=C+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,W);if(!this.stack)try{throw Error(this.message)}catch(D){this.stack=D.stack}return this}}),tQ=A0((Q)=>{var $=xU(),V=_O().Reporter,W=(HU(),h0(WU)).Buffer;function C(A,z){if(V.call(this,z),!W.isBuffer(A)){this.error("Input not Buffer");return}this.base=A,this.offset=0,this.length=A.length}$(C,V),Q.DecoderBuffer=C,C.prototype.save=function(){return{offset:this.offset,reporter:V.prototype.save.call(this)}},C.prototype.restore=function(A){var z=new C(this.base);return z.offset=A.offset,z.length=this.offset,this.offset=A.offset,V.prototype.restore.call(this,A.reporter),z},C.prototype.isEmpty=function(){return this.offset===this.length},C.prototype.readUInt8=function(A){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(A||"DecoderBuffer overrun")},C.prototype.skip=function(A,z){if(!(this.offset+A<=this.length))return this.error(z||"DecoderBuffer overrun");var M=new C(this.base);return M._reporterState=this._reporterState,M.offset=this.offset,M.length=this.offset+A,this.offset+=A,M},C.prototype.raw=function(A){return this.base.slice(A?A.offset:this.offset,this.length)};function D(A,z){if(Array.isArray(A))this.length=0,this.value=A.map(function(M){if(!(M instanceof D))M=new D(M,z);return this.length+=M.length,M},this);else if(typeof A==="number"){if(!(0<=A&&A<=255))return z.error("non-byte EncoderBuffer value");this.value=A,this.length=1}else if(typeof A==="string")this.value=A,this.length=W.byteLength(A);else if(W.isBuffer(A))this.value=A,this.length=A.length;else return z.error("Unsupported type: "+typeof A)}Q.EncoderBuffer=D,D.prototype.join=function(A,z){if(!A)A=new W(this.length);if(!z)z=0;if(this.length===0)return A;if(Array.isArray(this.value))this.value.forEach(function(M){M.join(A,z),z+=M.length});else{if(typeof this.value==="number")A[z]=this.value;else if(typeof this.value==="string")A.write(this.value,z);else if(W.isBuffer(this.value))this.value.copy(A,z);z+=this.length}return A}}),QG=A0((Q,$)=>{var V=_O().Reporter,W=_O().EncoderBuffer,C=_O().DecoderBuffer,D=OO(),A=["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"],z=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(A),M=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function F(K,H){var q={};if(this._baseState=q,q.enc=K,q.parent=H||null,q.children=null,q.tag=null,q.args=null,q.reverseArgs=null,q.choice=null,q.optional=!1,q.any=!1,q.obj=!1,q.use=null,q.useDecoder=null,q.key=null,q.default=null,q.explicit=null,q.implicit=null,q.contains=null,!q.parent)q.children=[],this._wrap()}$.exports=F;var R=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];F.prototype.clone=function(){var K=this._baseState,H={};R.forEach(function(P){H[P]=K[P]});var q=new this.constructor(H.parent);return q._baseState=H,q},F.prototype._wrap=function(){var K=this._baseState;z.forEach(function(H){this[H]=function(){var q=new this.constructor(this);return K.children.push(q),q[H].apply(q,arguments)}},this)},F.prototype._init=function(K){var H=this._baseState;D(H.parent===null),K.call(this),H.children=H.children.filter(function(q){return q._baseState.parent===this},this),D.equal(H.children.length,1,"Root node can have only one child")},F.prototype._useArgs=function(K){var H=this._baseState,q=K.filter(function(P){return P instanceof this.constructor},this);if(K=K.filter(function(P){return!(P instanceof this.constructor)},this),q.length!==0)D(H.children===null),H.children=q,q.forEach(function(P){P._baseState.parent=this},this);if(K.length!==0)D(H.args===null),H.args=K,H.reverseArgs=K.map(function(P){if(typeof P!=="object"||P.constructor!==Object)return P;var _={};return Object.keys(P).forEach(function(k){if(k==(k|0))k|=0;var B=P[k];_[B]=k}),_})},M.forEach(function(K){F.prototype[K]=function(){var H=this._baseState;throw Error(K+" not implemented for encoding: "+H.enc)}}),A.forEach(function(K){F.prototype[K]=function(){var H=this._baseState,q=Array.prototype.slice.call(arguments);return D(H.tag===null),H.tag=K,this._useArgs(q),this}}),F.prototype.use=function(K){D(K);var H=this._baseState;return D(H.use===null),H.use=K,this},F.prototype.optional=function(){var K=this._baseState;return K.optional=!0,this},F.prototype.def=function(K){var H=this._baseState;return D(H.default===null),H.default=K,H.optional=!0,this},F.prototype.explicit=function(K){var H=this._baseState;return D(H.explicit===null&&H.implicit===null),H.explicit=K,this},F.prototype.implicit=function(K){var H=this._baseState;return D(H.explicit===null&&H.implicit===null),H.implicit=K,this},F.prototype.obj=function(){var K=this._baseState,H=Array.prototype.slice.call(arguments);if(K.obj=!0,H.length!==0)this._useArgs(H);return this},F.prototype.key=function(K){var H=this._baseState;return D(H.key===null),H.key=K,this},F.prototype.any=function(){var K=this._baseState;return K.any=!0,this},F.prototype.choice=function(K){var H=this._baseState;return D(H.choice===null),H.choice=K,this._useArgs(Object.keys(K).map(function(q){return K[q]})),this},F.prototype.contains=function(K){var H=this._baseState;return D(H.use===null),H.contains=K,this},F.prototype._decode=function(K,H){var q=this._baseState;if(q.parent===null)return K.wrapResult(q.children[0]._decode(K,H));var P=q.default,_=!0,k=null;if(q.key!==null)k=K.enterKey(q.key);if(q.optional){var B=null;if(q.explicit!==null)B=q.explicit;else if(q.implicit!==null)B=q.implicit;else if(q.tag!==null)B=q.tag;if(B===null&&!q.any){var j=K.save();try{if(q.choice===null)this._decodeGeneric(q.tag,K,H);else this._decodeChoice(K,H);_=!0}catch(J0){_=!1}K.restore(j)}else if(_=this._peekTag(K,B,q.any),K.isError(_))return _}var x;if(q.obj&&_)x=K.enterObject();if(_){if(q.explicit!==null){var f=this._decodeTag(K,q.explicit);if(K.isError(f))return f;K=f}var w=K.offset;if(q.use===null&&q.choice===null){if(q.any)var j=K.save();var d=this._decodeTag(K,q.implicit!==null?q.implicit:q.tag,q.any);if(K.isError(d))return d;if(q.any)P=K.raw(j);else K=d}if(H&&H.track&&q.tag!==null)H.track(K.path(),w,K.length,"tagged");if(H&&H.track&&q.tag!==null)H.track(K.path(),K.offset,K.length,"content");if(q.any)P=P;else if(q.choice===null)P=this._decodeGeneric(q.tag,K,H);else P=this._decodeChoice(K,H);if(K.isError(P))return P;if(!q.any&&q.choice===null&&q.children!==null)q.children.forEach(function(J0){J0._decode(K,H)});if(q.contains&&(q.tag==="octstr"||q.tag==="bitstr")){var Y0=new C(P);P=this._getUse(q.contains,K._reporterState.obj)._decode(Y0,H)}}if(q.obj&&_)P=K.leaveObject(x);if(q.key!==null&&(P!==null||_===!0))K.leaveKey(k,q.key,P);else if(k!==null)K.exitKey(k);return P},F.prototype._decodeGeneric=function(K,H,q){var P=this._baseState;if(K==="seq"||K==="set")return null;if(K==="seqof"||K==="setof")return this._decodeList(H,K,P.args[0],q);else if(/str$/.test(K))return this._decodeStr(H,K,q);else if(K==="objid"&&P.args)return this._decodeObjid(H,P.args[0],P.args[1],q);else if(K==="objid")return this._decodeObjid(H,null,null,q);else if(K==="gentime"||K==="utctime")return this._decodeTime(H,K,q);else if(K==="null_")return this._decodeNull(H,q);else if(K==="bool")return this._decodeBool(H,q);else if(K==="objDesc")return this._decodeStr(H,K,q);else if(K==="int"||K==="enum")return this._decodeInt(H,P.args&&P.args[0],q);if(P.use!==null)return this._getUse(P.use,H._reporterState.obj)._decode(H,q);else return H.error("unknown tag: "+K)},F.prototype._getUse=function(K,H){var q=this._baseState;if(q.useDecoder=this._use(K,H),D(q.useDecoder._baseState.parent===null),q.useDecoder=q.useDecoder._baseState.children[0],q.implicit!==q.useDecoder._baseState.implicit)q.useDecoder=q.useDecoder.clone(),q.useDecoder._baseState.implicit=q.implicit;return q.useDecoder},F.prototype._decodeChoice=function(K,H){var q=this._baseState,P=null,_=!1;if(Object.keys(q.choice).some(function(k){var B=K.save(),j=q.choice[k];try{var x=j._decode(K,H);if(K.isError(x))return!1;P={type:k,value:x},_=!0}catch(f){return K.restore(B),!1}return!0},this),!_)return K.error("Choice not matched");return P},F.prototype._createEncoderBuffer=function(K){return new W(K,this.reporter)},F.prototype._encode=function(K,H,q){var P=this._baseState;if(P.default!==null&&P.default===K)return;var _=this._encodeValue(K,H,q);if(_===void 0)return;if(this._skipDefault(_,H,q))return;return _},F.prototype._encodeValue=function(K,H,q){var P=this._baseState;if(P.parent===null)return P.children[0]._encode(K,H||new V);var j=null;if(this.reporter=H,P.optional&&K===void 0)if(P.default!==null)K=P.default;else return;var _=null,k=!1;if(P.any)j=this._createEncoderBuffer(K);else if(P.choice)j=this._encodeChoice(K,H);else if(P.contains)_=this._getUse(P.contains,q)._encode(K,H),k=!0;else if(P.children)_=P.children.map(function(w){if(w._baseState.tag==="null_")return w._encode(null,H,K);if(w._baseState.key===null)return H.error("Child should have a key");var d=H.enterKey(w._baseState.key);if(typeof K!=="object")return H.error("Child expected, but input is not object");var Y0=w._encode(K[w._baseState.key],H,K);return H.leaveKey(d),Y0},this).filter(function(w){return w}),_=this._createEncoderBuffer(_);else if(P.tag==="seqof"||P.tag==="setof"){if(!(P.args&&P.args.length===1))return H.error("Too many args for : "+P.tag);if(!Array.isArray(K))return H.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,_=this._createEncoderBuffer(K.map(function(w){var d=this._baseState;return this._getUse(d.args[0],K)._encode(w,H)},B))}else if(P.use!==null)j=this._getUse(P.use,q)._encode(K,H);else _=this._encodePrimitive(P.tag,K),k=!0;var j;if(!P.any&&P.choice===null){var x=P.implicit!==null?P.implicit:P.tag,f=P.implicit===null?"universal":"context";if(x===null){if(P.use===null)H.error("Tag could be omitted only for .use()")}else if(P.use===null)j=this._encodeComposite(x,k,f,_)}if(P.explicit!==null)j=this._encodeComposite(P.explicit,!1,"context",j);return j},F.prototype._encodeChoice=function(K,H){var q=this._baseState,P=q.choice[K.type];if(!P)D(!1,K.type+" not found in "+JSON.stringify(Object.keys(q.choice)));return P._encode(K.value,H)},F.prototype._encodePrimitive=function(K,H){var q=this._baseState;if(/str$/.test(K))return this._encodeStr(H,K);else if(K==="objid"&&q.args)return this._encodeObjid(H,q.reverseArgs[0],q.args[1]);else if(K==="objid")return this._encodeObjid(H,null,null);else if(K==="gentime"||K==="utctime")return this._encodeTime(H,K);else if(K==="null_")return this._encodeNull();else if(K==="int"||K==="enum")return this._encodeInt(H,q.args&&q.reverseArgs[0]);else if(K==="bool")return this._encodeBool(H);else if(K==="objDesc")return this._encodeStr(H,K);else throw Error("Unsupported tag: "+K)},F.prototype._isNumstr=function(K){return/^[0-9 ]*$/.test(K)},F.prototype._isPrintstr=function(K){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(K)}}),_O=A0((Q)=>{var $=Q;$.Reporter=XG().Reporter,$.DecoderBuffer=tQ().DecoderBuffer,$.EncoderBuffer=tQ().EncoderBuffer,$.Node=QG()}),YG=A0((Q)=>{var $=CY();Q.tagClass={0:"universal",1:"application",2:"context",3:"private"},Q.tagClassByName=$._reverse(Q.tagClass),Q.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"},Q.tagByName=$._reverse(Q.tag)}),CY=A0((Q)=>{var $=Q;$._reverse=function(V){var W={};return Object.keys(V).forEach(function(C){if((C|0)==C)C=C|0;var D=V[C];W[D]=C}),W},$.der=YG()}),LY=A0((Q,$)=>{var V=xU(),W=NO(),C=W.base,D=W.bignum,A=W.constants.der;function z(K){this.enc="der",this.name=K.name,this.entity=K,this.tree=new M,this.tree._init(K.body)}$.exports=z,z.prototype.decode=function(K,H){if(!(K instanceof C.DecoderBuffer))K=new C.DecoderBuffer(K,H);return this.tree._decode(K,H)};function M(K){C.Node.call(this,"der",K)}V(M,C.Node),M.prototype._peekTag=function(K,H,q){if(K.isEmpty())return!1;var P=K.save(),_=F(K,'Failed to peek tag: "'+H+'"');if(K.isError(_))return _;return K.restore(P),_.tag===H||_.tagStr===H||_.tagStr+"of"===H||q},M.prototype._decodeTag=function(K,H,q){var P=F(K,'Failed to decode tag of "'+H+'"');if(K.isError(P))return P;var _=R(K,P.primitive,'Failed to get length of "'+H+'"');if(K.isError(_))return _;if(!q&&P.tag!==H&&P.tagStr!==H&&P.tagStr+"of"!==H)return K.error('Failed to match tag: "'+H+'"');if(P.primitive||_!==null)return K.skip(_,'Failed to match body of: "'+H+'"');var k=K.save(),B=this._skipUntilEnd(K,'Failed to skip indefinite length body: "'+this.tag+'"');if(K.isError(B))return B;return _=K.offset-k.offset,K.restore(k),K.skip(_,'Failed to match body of: "'+H+'"')},M.prototype._skipUntilEnd=function(K,H){while(!0){var q=F(K,H);if(K.isError(q))return q;var P=R(K,q.primitive,H);if(K.isError(P))return P;var _;if(q.primitive||P!==null)_=K.skip(P);else _=this._skipUntilEnd(K,H);if(K.isError(_))return _;if(q.tagStr==="end")break}},M.prototype._decodeList=function(K,H,q,P){var _=[];while(!K.isEmpty()){var k=this._peekTag(K,"end");if(K.isError(k))return k;var B=q.decode(K,"der",P);if(K.isError(B)&&k)break;_.push(B)}return _},M.prototype._decodeStr=function(K,H){if(H==="bitstr"){var q=K.readUInt8();if(K.isError(q))return q;return{unused:q,data:K.raw()}}else if(H==="bmpstr"){var P=K.raw();if(P.length%2===1)return K.error("Decoding of string type: bmpstr length mismatch");var _="";for(var k=0;k<P.length/2;k++)_+=String.fromCharCode(P.readUInt16BE(k*2));return _}else if(H==="numstr"){var B=K.raw().toString("ascii");if(!this._isNumstr(B))return K.error("Decoding of string type: numstr unsupported characters");return B}else if(H==="octstr")return K.raw();else if(H==="objDesc")return K.raw();else if(H==="printstr"){var j=K.raw().toString("ascii");if(!this._isPrintstr(j))return K.error("Decoding of string type: printstr unsupported characters");return j}else if(/str$/.test(H))return K.raw().toString();else return K.error("Decoding of string type: "+H+" unsupported")},M.prototype._decodeObjid=function(K,H,q){var P,_=[],k=0;while(!K.isEmpty()){var B=K.readUInt8();if(k<<=7,k|=B&127,(B&128)===0)_.push(k),k=0}if(B&128)_.push(k);var j=_[0]/40|0,x=_[0]%40;if(q)P=_;else P=[j,x].concat(_.slice(1));if(H){var f=H[P.join(" ")];if(f===void 0)f=H[P.join(".")];if(f!==void 0)P=f}return P},M.prototype._decodeTime=function(K,H){var q=K.raw().toString();if(H==="gentime")var P=q.slice(0,4)|0,_=q.slice(4,6)|0,k=q.slice(6,8)|0,B=q.slice(8,10)|0,j=q.slice(10,12)|0,x=q.slice(12,14)|0;else if(H==="utctime"){var P=q.slice(0,2)|0,_=q.slice(2,4)|0,k=q.slice(4,6)|0,B=q.slice(6,8)|0,j=q.slice(8,10)|0,x=q.slice(10,12)|0;if(P<70)P=2000+P;else P=1900+P}else return K.error("Decoding "+H+" time is not supported yet");return Date.UTC(P,_-1,k,B,j,x,0)},M.prototype._decodeNull=function(K){return null},M.prototype._decodeBool=function(K){var H=K.readUInt8();if(K.isError(H))return H;else return H!==0},M.prototype._decodeInt=function(K,H){var q=K.raw(),P=new D(q);if(H)P=H[P.toString(10)]||P;return P},M.prototype._use=function(K,H){if(typeof K==="function")K=K(H);return K._getDecoder("der").tree};function F(K,H){var q=K.readUInt8(H);if(K.isError(q))return q;var P=A.tagClass[q>>6],_=(q&32)===0;if((q&31)===31){var k=q;q=0;while((k&128)===128){if(k=K.readUInt8(H),K.isError(k))return k;q<<=7,q|=k&127}}else q&=31;var B=A.tag[q];return{cls:P,primitive:_,tag:q,tagStr:B}}function R(K,H,q){var P=K.readUInt8(q);if(K.isError(P))return P;if(!H&&P===128)return null;if((P&128)===0)return P;var _=P&127;if(_>4)return K.error("length octect is too long");P=0;for(var k=0;k<_;k++){P<<=8;var B=K.readUInt8(q);if(K.isError(B))return B;P|=B}return P}}),$G=A0((Q,$)=>{var V=xU(),W=(HU(),h0(WU)).Buffer,C=LY();function D(A){C.call(this,A),this.enc="pem"}V(D,C),$.exports=D,D.prototype.decode=function(A,z){var M=A.toString().split(/[\r\n]+/g),F=z.label.toUpperCase(),R=/^-----(BEGIN|END) ([^-]+)-----$/,K=-1,H=-1;for(var q=0;q<M.length;q++){var P=M[q].match(R);if(P===null)continue;if(P[2]!==F)continue;if(K===-1){if(P[1]!=="BEGIN")break;K=q}else{if(P[1]!=="END")break;H=q;break}}if(K===-1||H===-1)throw Error("PEM section not found for: "+F);var _=M.slice(K+1,H).join("");_.replace(/[^a-z0-9\+\/=]+/gi,"");var k=new W(_,"base64");return C.prototype.decode.call(this,k,z)}}),AG=A0((Q)=>{var $=Q;$.der=LY(),$.pem=$G()}),KY=A0((Q,$)=>{var V=xU(),W=(HU(),h0(WU)).Buffer,C=NO(),D=C.base,A=C.constants.der;function z(K){this.enc="der",this.name=K.name,this.entity=K,this.tree=new M,this.tree._init(K.body)}$.exports=z,z.prototype.encode=function(K,H){return this.tree._encode(K,H).join()};function M(K){D.Node.call(this,"der",K)}V(M,D.Node),M.prototype._encodeComposite=function(K,H,q,P){var _=R(K,H,q,this.reporter);if(P.length<128){var j=new W(2);return j[0]=_,j[1]=P.length,this._createEncoderBuffer([j,P])}var k=1;for(var B=P.length;B>=256;B>>=8)k++;var j=new W(2+k);j[0]=_,j[1]=128|k;for(var B=1+k,x=P.length;x>0;B--,x>>=8)j[B]=x&255;return this._createEncoderBuffer([j,P])},M.prototype._encodeStr=function(K,H){if(H==="bitstr")return this._createEncoderBuffer([K.unused|0,K.data]);else if(H==="bmpstr"){var q=new W(K.length*2);for(var P=0;P<K.length;P++)q.writeUInt16BE(K.charCodeAt(P),P*2);return this._createEncoderBuffer(q)}else if(H==="numstr"){if(!this._isNumstr(K))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(K)}else if(H==="printstr"){if(!this._isPrintstr(K))return 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");return this._createEncoderBuffer(K)}else if(/str$/.test(H))return this._createEncoderBuffer(K);else if(H==="objDesc")return this._createEncoderBuffer(K);else return this.reporter.error("Encoding of string type: "+H+" unsupported")},M.prototype._encodeObjid=function(K,H,q){if(typeof K==="string"){if(!H)return this.reporter.error("string objid given, but no values map found");if(!H.hasOwnProperty(K))return this.reporter.error("objid not found in values map");K=H[K].split(/[\s\.]+/g);for(var P=0;P<K.length;P++)K[P]|=0}else if(Array.isArray(K)){K=K.slice();for(var P=0;P<K.length;P++)K[P]|=0}if(!Array.isArray(K))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(K));if(!q){if(K[1]>=40)return this.reporter.error("Second objid identifier OOB");K.splice(0,2,K[0]*40+K[1])}var _=0;for(var P=0;P<K.length;P++){var k=K[P];for(_++;k>=128;k>>=7)_++}var B=new W(_),j=B.length-1;for(var P=K.length-1;P>=0;P--){var k=K[P];B[j--]=k&127;while((k>>=7)>0)B[j--]=128|k&127}return this._createEncoderBuffer(B)};function F(K){if(K<10)return"0"+K;else return K}M.prototype._encodeTime=function(K,H){var q,P=new Date(K);if(H==="gentime")q=[F(P.getFullYear()),F(P.getUTCMonth()+1),F(P.getUTCDate()),F(P.getUTCHours()),F(P.getUTCMinutes()),F(P.getUTCSeconds()),"Z"].join("");else if(H==="utctime")q=[F(P.getFullYear()%100),F(P.getUTCMonth()+1),F(P.getUTCDate()),F(P.getUTCHours()),F(P.getUTCMinutes()),F(P.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+H+" time is not supported yet");return this._encodeStr(q,"octstr")},M.prototype._encodeNull=function(){return this._createEncoderBuffer("")},M.prototype._encodeInt=function(K,H){if(typeof K==="string"){if(!H)return this.reporter.error("String int or enum given, but no values map");if(!H.hasOwnProperty(K))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(K));K=H[K]}if(typeof K!=="number"&&!W.isBuffer(K)){var q=K.toArray();if(!K.sign&&q[0]&128)q.unshift(0);K=new W(q)}if(W.isBuffer(K)){var P=K.length;if(K.length===0)P++;var k=new W(P);if(K.copy(k),K.length===0)k[0]=0;return this._createEncoderBuffer(k)}if(K<128)return this._createEncoderBuffer(K);if(K<256)return this._createEncoderBuffer([0,K]);var P=1;for(var _=K;_>=256;_>>=8)P++;var k=Array(P);for(var _=k.length-1;_>=0;_--)k[_]=K&255,K>>=8;if(k[0]&128)k.unshift(0);return this._createEncoderBuffer(new W(k))},M.prototype._encodeBool=function(K){return this._createEncoderBuffer(K?255:0)},M.prototype._use=function(K,H){if(typeof K==="function")K=K(H);return K._getEncoder("der").tree},M.prototype._skipDefault=function(K,H,q){var P=this._baseState,_;if(P.default===null)return!1;var k=K.join();if(P.defaultBuffer===void 0)P.defaultBuffer=this._encodeValue(P.default,H,q).join();if(k.length!==P.defaultBuffer.length)return!1;for(_=0;_<k.length;_++)if(k[_]!==P.defaultBuffer[_])return!1;return!0};function R(K,H,q,P){var _;if(K==="seqof")K="seq";else if(K==="setof")K="set";if(A.tagByName.hasOwnProperty(K))_=A.tagByName[K];else if(typeof K==="number"&&(K|0)===K)_=K;else return P.error("Unknown tag: "+K);if(_>=31)return P.error("Multi-octet tag encoding unsupported");if(!H)_|=32;return _|=A.tagClassByName[q||"universal"]<<6,_}}),JG=A0((Q,$)=>{var V=xU(),W=KY();function C(D){W.call(this,D),this.enc="pem"}V(C,W),$.exports=C,C.prototype.encode=function(D,A){var z=W.prototype.encode.call(this,D),M=z.toString("base64"),F=["-----BEGIN "+A.label+"-----"];for(var R=0;R<M.length;R+=64)F.push(M.slice(R,R+64));return F.push("-----END "+A.label+"-----"),F.join(`
15
- `)}}),GG=A0((Q)=>{var $=Q;$.der=KY(),$.pem=JG()}),NO=A0((Q)=>{var $=Q;$.bignum=OG(),$.define=ZG().define,$.base=_O(),$.constants=CY(),$.decoders=AG(),$.encoders=GG()}),VG=A0((Q,$)=>{var V=NO(),W=V.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),C=V.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),D=V.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),A=V.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(D),this.key("subjectPublicKey").bitstr())}),z=V.define("RelativeDistinguishedName",function(){this.setof(C)}),M=V.define("RDNSequence",function(){this.seqof(z)}),F=V.define("Name",function(){this.choice({rdnSequence:this.use(M)})}),R=V.define("Validity",function(){this.seq().obj(this.key("notBefore").use(W),this.key("notAfter").use(W))}),K=V.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),H=V.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(D),this.key("issuer").use(F),this.key("validity").use(R),this.key("subject").use(F),this.key("subjectPublicKeyInfo").use(A),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(K).optional())}),q=V.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(H),this.key("signatureAlgorithm").use(D),this.key("signatureValue").bitstr())});$.exports=q}),EG=A0((Q)=>{var $=NO();Q.certificate=VG();var V=$.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())});Q.RSAPrivateKey=V;var W=$.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});Q.RSAPublicKey=W;var C=$.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())}),D=$.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(C),this.key("subjectPublicKey").bitstr())});Q.PublicKey=D;var A=$.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(C),this.key("subjectPrivateKey").octstr())});Q.PrivateKey=A;var z=$.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())});Q.EncryptedPrivateKey=z;var M=$.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())});Q.DSAPrivateKey=M,Q.DSAparam=$.define("DSAparam",function(){this.int()});var F=$.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),R=$.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(F),this.key("publicKey").optional().explicit(1).bitstr())});Q.ECPrivateKey=R,Q.signature=$.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),IG=A0((Q,$)=>{$.exports={"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"}}),CG=A0((Q,$)=>{var V=MU().Buffer,W=dO().Transform,C=xU();function D(F){W.call(this),this._block=V.allocUnsafe(F),this._blockSize=F,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}C(D,W),D.prototype._transform=function(F,R,K){var H=null;try{this.update(F,R)}catch(q){H=q}K(H)},D.prototype._flush=function(F){var R=null;try{this.push(this.digest())}catch(K){R=K}F(R)};var A=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(V.prototype instanceof Uint8Array||V.TYPED_ARRAY_SUPPORT);function M(F,R){if(F instanceof V)return F;if(typeof F==="string")return V.from(F,R);if(z&&ArrayBuffer.isView(F)){if(F.byteLength===0)return V.alloc(0);var K=V.from(F.buffer,F.byteOffset,F.byteLength);if(K.byteLength===F.byteLength)return K}if(A&&F instanceof Uint8Array)return V.from(F);if(V.isBuffer(F)&&F.constructor&&typeof F.constructor.isBuffer==="function"&&F.constructor.isBuffer(F))return V.from(F);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}D.prototype.update=function(F,R){if(this._finalized)throw Error("Digest already called");F=M(F,R);var K=this._block,H=0;while(this._blockOffset+F.length-H>=this._blockSize){for(var q=this._blockOffset;q<this._blockSize;)K[q++]=F[H++];this._update(),this._blockOffset=0}while(H<F.length)K[this._blockOffset++]=F[H++];for(var P=0,_=F.length*8;_>0;++P)if(this._length[P]+=_,_=this._length[P]/4294967296|0,_>0)this._length[P]-=4294967296*_;return this},D.prototype._update=function(){throw Error("_update is not implemented")},D.prototype.digest=function(F){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var R=this._digest();if(F!==void 0)R=R.toString(F);this._block.fill(0),this._blockOffset=0;for(var K=0;K<4;++K)this._length[K]=0;return R},D.prototype._digest=function(){throw Error("_digest is not implemented")},$.exports=D}),LG=A0((Q,$)=>{var V=xU(),W=CG(),C=MU().Buffer,D=Array(16);function A(){W.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}V(A,W),A.prototype._update=function(){var H=D;for(var q=0;q<16;++q)H[q]=this._block.readInt32LE(q*4);var P=this._a,_=this._b,k=this._c,B=this._d;P=M(P,_,k,B,H[0],3614090360,7),B=M(B,P,_,k,H[1],3905402710,12),k=M(k,B,P,_,H[2],606105819,17),_=M(_,k,B,P,H[3],3250441966,22),P=M(P,_,k,B,H[4],4118548399,7),B=M(B,P,_,k,H[5],1200080426,12),k=M(k,B,P,_,H[6],2821735955,17),_=M(_,k,B,P,H[7],4249261313,22),P=M(P,_,k,B,H[8],1770035416,7),B=M(B,P,_,k,H[9],2336552879,12),k=M(k,B,P,_,H[10],4294925233,17),_=M(_,k,B,P,H[11],2304563134,22),P=M(P,_,k,B,H[12],1804603682,7),B=M(B,P,_,k,H[13],4254626195,12),k=M(k,B,P,_,H[14],2792965006,17),_=M(_,k,B,P,H[15],1236535329,22),P=F(P,_,k,B,H[1],4129170786,5),B=F(B,P,_,k,H[6],3225465664,9),k=F(k,B,P,_,H[11],643717713,14),_=F(_,k,B,P,H[0],3921069994,20),P=F(P,_,k,B,H[5],3593408605,5),B=F(B,P,_,k,H[10],38016083,9),k=F(k,B,P,_,H[15],3634488961,14),_=F(_,k,B,P,H[4],3889429448,20),P=F(P,_,k,B,H[9],568446438,5),B=F(B,P,_,k,H[14],3275163606,9),k=F(k,B,P,_,H[3],4107603335,14),_=F(_,k,B,P,H[8],1163531501,20),P=F(P,_,k,B,H[13],2850285829,5),B=F(B,P,_,k,H[2],4243563512,9),k=F(k,B,P,_,H[7],1735328473,14),_=F(_,k,B,P,H[12],2368359562,20),P=R(P,_,k,B,H[5],4294588738,4),B=R(B,P,_,k,H[8],2272392833,11),k=R(k,B,P,_,H[11],1839030562,16),_=R(_,k,B,P,H[14],4259657740,23),P=R(P,_,k,B,H[1],2763975236,4),B=R(B,P,_,k,H[4],1272893353,11),k=R(k,B,P,_,H[7],4139469664,16),_=R(_,k,B,P,H[10],3200236656,23),P=R(P,_,k,B,H[13],681279174,4),B=R(B,P,_,k,H[0],3936430074,11),k=R(k,B,P,_,H[3],3572445317,16),_=R(_,k,B,P,H[6],76029189,23),P=R(P,_,k,B,H[9],3654602809,4),B=R(B,P,_,k,H[12],3873151461,11),k=R(k,B,P,_,H[15],530742520,16),_=R(_,k,B,P,H[2],3299628645,23),P=K(P,_,k,B,H[0],4096336452,6),B=K(B,P,_,k,H[7],1126891415,10),k=K(k,B,P,_,H[14],2878612391,15),_=K(_,k,B,P,H[5],4237533241,21),P=K(P,_,k,B,H[12],1700485571,6),B=K(B,P,_,k,H[3],2399980690,10),k=K(k,B,P,_,H[10],4293915773,15),_=K(_,k,B,P,H[1],2240044497,21),P=K(P,_,k,B,H[8],1873313359,6),B=K(B,P,_,k,H[15],4264355552,10),k=K(k,B,P,_,H[6],2734768916,15),_=K(_,k,B,P,H[13],1309151649,21),P=K(P,_,k,B,H[4],4149444226,6),B=K(B,P,_,k,H[11],3174756917,10),k=K(k,B,P,_,H[2],718787259,15),_=K(_,k,B,P,H[9],3951481745,21),this._a=this._a+P|0,this._b=this._b+_|0,this._c=this._c+k|0,this._d=this._d+B|0},A.prototype._digest=function(){if(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=C.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 z(H,q){return H<<q|H>>>32-q}function M(H,q,P,_,k,B,j){return z(H+(q&P|~q&_)+k+B|0,j)+q|0}function F(H,q,P,_,k,B,j){return z(H+(q&_|P&~_)+k+B|0,j)+q|0}function R(H,q,P,_,k,B,j){return z(H+(q^P^_)+k+B|0,j)+q|0}function K(H,q,P,_,k,B,j){return z(H+(P^(q|~_))+k+B|0,j)+q|0}$.exports=A}),KG=A0((Q,$)=>{var V=MU().Buffer,W=LG();function C(D,A,z,M){if(!V.isBuffer(D))D=V.from(D,"binary");if(A){if(!V.isBuffer(A))A=V.from(A,"binary");if(A.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var F=z/8,R=V.alloc(F),K=V.alloc(M||0),H=V.alloc(0);while(F>0||M>0){var q=new W;if(q.update(H),q.update(D),A)q.update(A);H=q.digest();var P=0;if(F>0){var _=R.length-F;P=Math.min(F,H.length),H.copy(R,_,0,P),F-=P}if(P<H.length&&M>0){var k=K.length-M,B=Math.min(M,H.length-P);H.copy(K,k,P,P+B),M-=B}}return H.fill(0),{key:R,iv:K}}$.exports=C}),WY=A0((Q)=>{var $=(jU(),h0(vU));Q.createCipher=Q.Cipher=$.createCipher,Q.createCipheriv=Q.Cipheriv=$.createCipheriv,Q.createDecipher=Q.Decipher=$.createDecipher,Q.createDecipheriv=Q.Decipheriv=$.createDecipheriv,Q.listCiphers=Q.getCiphers=$.getCiphers}),WG=A0((Q,$)=>{var V=/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,W=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,C=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,D=KG(),A=WY(),z=MU().Buffer;$.exports=function(M,F){var R=M.toString(),K=R.match(V),H;if(!K){var q=R.match(C);H=z.from(q[2].replace(/[\r\n]/g,""),"base64")}else{var P="aes"+K[1],_=z.from(K[2],"hex"),k=z.from(K[3].replace(/[\r\n]/g,""),"base64"),B=D(F,_.slice(0,8),parseInt(K[1],10)).key,j=[],x=A.createDecipheriv(P,B,_);j.push(x.update(k)),j.push(x.final()),H=z.concat(j)}var f=R.match(W)[1];return{tag:f,data:H}}}),HY=A0((Q,$)=>{var V=EG(),W=IG(),C=WG(),D=WY(),A=$Y().pbkdf2Sync,z=MU().Buffer;function M(R,K){var H=R.algorithm.decrypt.kde.kdeparams.salt,q=parseInt(R.algorithm.decrypt.kde.kdeparams.iters.toString(),10),P=W[R.algorithm.decrypt.cipher.algo.join(".")],_=R.algorithm.decrypt.cipher.iv,k=R.subjectPrivateKey,B=parseInt(P.split("-")[1],10)/8,j=A(K,H,q,B,"sha1"),x=D.createDecipheriv(P,j,_),f=[];return f.push(x.update(k)),f.push(x.final()),z.concat(f)}function F(R){var K;if(typeof R==="object"&&!z.isBuffer(R))K=R.passphrase,R=R.key;if(typeof R==="string")R=z.from(R);var H=C(R,K),q=H.tag,P=H.data,_,k;switch(q){case"CERTIFICATE":k=V.certificate.decode(P,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!k)k=V.PublicKey.decode(P,"der");switch(_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return V.RSAPublicKey.decode(k.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return k.subjectPrivateKey=k.subjectPublicKey,{type:"ec",data:k};case"1.2.840.10040.4.1":return k.algorithm.params.pub_key=V.DSAparam.decode(k.subjectPublicKey.data,"der"),{type:"dsa",data:k.algorithm.params};default:throw Error("unknown key id "+_)}case"ENCRYPTED PRIVATE KEY":P=V.EncryptedPrivateKey.decode(P,"der"),P=M(P,K);case"PRIVATE KEY":switch(k=V.PrivateKey.decode(P,"der"),_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return V.RSAPrivateKey.decode(k.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:k.algorithm.curve,privateKey:V.ECPrivateKey.decode(k.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return k.algorithm.params.priv_key=V.DSAparam.decode(k.subjectPrivateKey,"der"),{type:"dsa",params:k.algorithm.params};default:throw Error("unknown key id "+_)}case"RSA PUBLIC KEY":return V.RSAPublicKey.decode(P,"der");case"RSA PRIVATE KEY":return V.RSAPrivateKey.decode(P,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:V.DSAPrivateKey.decode(P,"der")};case"EC PRIVATE KEY":return P=V.ECPrivateKey.decode(P,"der"),{curve:P.parameters.value,privateKey:P.privateKey};default:throw Error("unknown key type "+q)}}F.signature=V.signature,$.exports=F}),SY=A0((Q,$)=>{var V=OZ(),W=MU().Buffer;$.exports=function(D,A){var z=W.alloc(0),M=0,F;while(z.length<A)F=C(M++),z=W.concat([z,V("sha1").update(D).update(F).digest()]);return z.slice(0,A)};function C(D){var A=W.allocUnsafe(4);return A.writeUInt32BE(D,0),A}}),DY=A0((Q,$)=>{$.exports=function(V,W){var C=V.length,D=-1;while(++D<C)V[D]^=W[D];return V}}),GX=A0((Q,$)=>{(function(V,W){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function D(U,X){U.super_=X;var J=function(){};J.prototype=X.prototype,U.prototype=new J,U.prototype.constructor=U}function A(U,X,J){if(A.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")J=X,X=10;this._init(U||0,X||10,J||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(U){}A.isBN=function(U){if(U instanceof A)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===A.wordSize&&Array.isArray(U.words)},A.max=function(U,X){if(U.cmp(X)>0)return U;return X},A.min=function(U,X){if(U.cmp(X)<0)return U;return X},A.prototype._init=function(U,X,J){if(typeof U==="number")return this._initNumber(U,X,J);if(typeof U==="object")return this._initArray(U,X,J);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,J);else if(this._parseBase(U,X,Z),J==="le")this._initArray(this.toArray(),X,J)}},A.prototype._initNumber=function(U,X,J){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(J!=="le")return;this._initArray(this.toArray(),X,J)},A.prototype._initArray=function(U,X,J){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,I,L=0;if(J==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=I<<L&67108863,this.words[Y+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,Y++}else if(J==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=I<<L&67108863,this.words[Y+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,Y++}return this.strip()};function M(U,X){var J=U.charCodeAt(X);if(J>=65&&J<=70)return J-55;else if(J>=97&&J<=102)return J-87;else return J-48&15}function F(U,X,J){var Z=M(U,J);if(J-1>=X)Z|=M(U,J-1)<<4;return Z}A.prototype._parseHex=function(U,X,J){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,I=0,L;if(J==="be")for(Z=U.length-1;Z>=X;Z-=2)if(L=F(U,X,Z)<<Y,this.words[I]|=L&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=L>>>26;else Y+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(L=F(U,X,Z)<<Y,this.words[I]|=L&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=L>>>26;else Y+=8}this.strip()};function R(U,X,J,Z){var Y=0,I=Math.min(U.length,J);for(var L=X;L<I;L++){var G=U.charCodeAt(L)-48;if(Y*=Z,G>=49)Y+=G-49+10;else if(G>=17)Y+=G-17+10;else Y+=G}return Y}A.prototype._parseBase=function(U,X,J){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var I=U.length-J,L=I%Z,G=Math.min(I,I-L)+J,O=0;for(var E=J;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(L!==0){var T=1;O=R(U,E,U.length,X);for(E=0;E<L;E++)T*=X;if(this.imuln(T),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},A.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},A.prototype.clone=function(){var U=new A(null);return this.copy(U),U},A.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},A.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},A.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var K=["","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"],H=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(U,X){U=U||10,X=X|0||1;var J;if(U===16||U==="hex"){J="";var Z=0,Y=0;for(var I=0;I<this.length;I++){var L=this.words[I],G=((L<<Z|Y)&16777215).toString(16);if(Y=L>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if(Y!==0||I!==this.length-1)J=K[6-G.length]+G+J;else J=G+J}if(Y!==0)J=Y.toString(16)+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}if(U===(U|0)&&U>=2&&U<=36){var O=H[U],E=q[U];J="";var T=this.clone();T.negative=0;while(!T.isZero()){var S=T.modn(E).toString(U);if(T=T.idivn(E),!T.isZero())J=K[O-S.length]+S+J;else J=S+J}if(this.isZero())J="0"+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},A.prototype.toJSON=function(){return this.toString(16)},A.prototype.toBuffer=function(U,X){return C(typeof z<"u"),this.toArrayLike(z,U,X)},A.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},A.prototype.toArrayLike=function(U,X,J){var Z=this.byteLength(),Y=J||Math.max(1,Z);C(Z<=Y,"byte array longer than desired length"),C(Y>0,"Requested array length <= 0"),this.strip();var I=X==="le",L=new U(Y),G,O,E=this.clone();if(!I){for(O=0;O<Y-Z;O++)L[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[Y-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[O]=G;for(;O<Y;O++)L[O]=0}return L},Math.clz32)A.prototype._countBits=function(U){return 32-Math.clz32(U)};else A.prototype._countBits=function(U){var X=U,J=0;if(X>=4096)J+=13,X>>>=13;if(X>=64)J+=7,X>>>=7;if(X>=8)J+=4,X>>>=4;if(X>=2)J+=2,X>>>=2;return J+X};A.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,J=0;if((X&8191)===0)J+=13,X>>>=13;if((X&127)===0)J+=7,X>>>=7;if((X&15)===0)J+=4,X>>>=4;if((X&3)===0)J+=2,X>>>=2;if((X&1)===0)J++;return J},A.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var J=0;J<X.length;J++){var Z=J/26|0,Y=J%26;X[J]=(U.words[Z]&1<<Y)>>>Y}return X}A.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var J=this._zeroBits(this.words[X]);if(U+=J,J!==26)break}return U},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},A.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},A.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},A.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},A.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},A.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var J=0;J<X.length;J++)this.words[J]=this.words[J]&U.words[J];return this.length=X.length,this.strip()},A.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},A.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},A.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},A.prototype.iuxor=function(U){var X,J;if(this.length>U.length)X=this,J=U;else X=U,J=this;for(var Z=0;Z<J.length;Z++)this.words[Z]=X.words[Z]^J.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},A.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},A.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},A.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},A.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,J=U%26;if(this._expand(X),J>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(J>0)this.words[Z]=~this.words[Z]&67108863>>26-J;return this.strip()},A.prototype.notn=function(U){return this.clone().inotn(U)},A.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var J=U/26|0,Z=U%26;if(this._expand(J+1),X)this.words[J]=this.words[J]|1<<Z;else this.words[J]=this.words[J]&~(1<<Z);return this.strip()},A.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var J,Z;if(this.length>U.length)J=this,Z=U;else J=U,Z=this;var Y=0;for(var I=0;I<Z.length;I++)X=(J.words[I]|0)+(Z.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;for(;Y!==0&&I<J.length;I++)X=(J.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;if(this.length=J.length,Y!==0)this.words[this.length]=Y,this.length++;else if(J!==this)for(;I<J.length;I++)this.words[I]=J.words[I];return this},A.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},A.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var J=this.cmp(U);if(J===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if(J>0)Z=this,Y=U;else Z=U,Y=this;var I=0;for(var L=0;L<Y.length;L++)X=(Z.words[L]|0)-(Y.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;for(;I!==0&&L<Z.length;L++)X=(Z.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;if(I===0&&L<Z.length&&Z!==this)for(;L<Z.length;L++)this.words[L]=Z.words[L];if(this.length=Math.max(this.length,L),Z!==this)this.negative=1;return this.strip()},A.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,J){J.negative=X.negative^U.negative;var Z=U.length+X.length|0;J.length=Z,Z=Z-1|0;var Y=U.words[0]|0,I=X.words[0]|0,L=Y*I,G=L&67108863,O=L/67108864|0;J.words[0]=G;for(var E=1;E<Z;E++){var T=O>>>26,S=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;Y=U.words[p]|0,I=X.words[g]|0,L=Y*I+S,T+=L/67108864|0,S=L&67108863}J.words[E]=S|0,O=T|0}if(O!==0)J.words[E]=O|0;else J.length--;return J.strip()}var k=function(U,X,J){var Z=U.words,Y=X.words,I=J.words,L=0,G,O,E,T=Z[0]|0,S=T&8191,v=T>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,s=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,t=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,L0=w0>>>13,t0=Z[9]|0,E0=t0&8191,K0=t0>>>13,e0=Y[0]|0,S0=e0&8191,H0=e0>>>13,FU=Y[1]|0,R0=FU&8191,k0=FU>>>13,RU=Y[2]|0,_0=RU&8191,T0=RU>>>13,SU=Y[3]|0,v0=SU&8191,z0=SU>>>13,CU=Y[4]|0,j0=CU&8191,B0=CU>>>13,LU=Y[5]|0,M0=LU&8191,N=LU>>>13,b=Y[6]|0,a=b&8191,U0=b>>>13,f0=Y[7]|0,I0=f0&8191,W0=f0>>>13,s0=Y[8]|0,q0=s0&8191,x0=s0>>>13,DU=Y[9]|0,P0=DU&8191,D0=DU>>>13;J.negative=U.negative^X.negative,J.length=19,G=Math.imul(S,S0),O=Math.imul(S,H0),O=O+Math.imul(v,S0)|0,E=Math.imul(v,H0);var r0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,S0),O=Math.imul(p,H0),O=O+Math.imul(n,S0)|0,E=Math.imul(n,H0),G=G+Math.imul(S,R0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,S0),O=Math.imul(r,H0),O=O+Math.imul(l,S0)|0,E=Math.imul(l,H0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(S,_0)|0,O=O+Math.imul(S,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,S0),O=Math.imul(m,H0),O=O+Math.imul(i,S0)|0,E=Math.imul(i,H0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(S,v0)|0,O=O+Math.imul(S,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,S0),O=Math.imul(y,H0),O=O+Math.imul(h,S0)|0,E=Math.imul(h,H0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(S,j0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(s,S0),O=Math.imul(s,H0),O=O+Math.imul(e,S0)|0,E=Math.imul(e,H0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(S,M0)|0,O=O+Math.imul(S,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,S0),O=Math.imul(c,H0),O=O+Math.imul(o,S0)|0,E=Math.imul(o,H0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(S,a)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(t,S0),O=Math.imul(t,H0),O=O+Math.imul(Z0,S0)|0,E=Math.imul(Z0,H0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(S,I0)|0,O=O+Math.imul(S,W0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,W0)|0;var OU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,S0),O=Math.imul(C0,H0),O=O+Math.imul(L0,S0)|0,E=Math.imul(L0,H0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,W0)|0,G=G+Math.imul(S,q0)|0,O=O+Math.imul(S,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,S0),O=Math.imul(E0,H0),O=O+Math.imul(K0,S0)|0,E=Math.imul(K0,H0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(L0,R0)|0,E=E+Math.imul(L0,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,W0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(S,P0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,D0)|0;var XU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(K0,R0)|0,E=Math.imul(K0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(L0,_0)|0,E=E+Math.imul(L0,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,W0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,D0)|0;var QU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(K0,_0)|0,E=Math.imul(K0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(L0,v0)|0,E=E+Math.imul(L0,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,W0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,D0)|0;var YU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(K0,v0)|0,E=Math.imul(K0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(L0,j0)|0,E=E+Math.imul(L0,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,W0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,D0)|0;var $U=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(K0,j0)|0,E=Math.imul(K0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(L0,M0)|0,E=E+Math.imul(L0,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,W0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,D0)|0;var AU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(K0,M0)|0,E=Math.imul(K0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(L0,a)|0,E=E+Math.imul(L0,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,W0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,D0)|0;var JU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(K0,a)|0,E=Math.imul(K0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,W0)|0,O=O+Math.imul(L0,I0)|0,E=E+Math.imul(L0,W0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,D0)|0;var GU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,W0),O=O+Math.imul(K0,I0)|0,E=Math.imul(K0,W0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(L0,q0)|0,E=E+Math.imul(L0,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,D0)|0;var VU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(K0,q0)|0,E=Math.imul(K0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,D0)|0,O=O+Math.imul(L0,P0)|0,E=E+Math.imul(L0,D0)|0;var EU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,D0),O=O+Math.imul(K0,P0)|0,E=Math.imul(K0,D0);var IU=(L+G|0)+((O&8191)<<13)|0;if(L=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=$U,I[13]=AU,I[14]=JU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,L!==0)I[19]=L,J.length++;return J};if(!Math.imul)k=_;function B(U,X,J){J.negative=X.negative^U.negative,J.length=U.length+X.length;var Z=0,Y=0;for(var I=0;I<J.length-1;I++){var L=Y;Y=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var T=I-E,S=U.words[T]|0,v=X.words[E]|0,g=S*v,p=g&67108863;L=L+(g/67108864|0)|0,p=p+G|0,G=p&67108863,L=L+(p>>>26)|0,Y+=L>>>26,L&=67108863}J.words[I]=G,Z=L,L=Y}if(Z!==0)J.words[I]=Z;else J.length--;return J.strip()}function j(U,X,J){var Z=new x;return Z.mulp(U,X,J)}A.prototype.mulTo=function(U,X){var J,Z=this.length+U.length;if(this.length===10&&U.length===10)J=k(this,U,X);else if(Z<63)J=_(this,U,X);else if(Z<1024)J=B(this,U,X);else J=j(this,U,X);return J};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),J=A.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,J,U);return X},x.prototype.revBin=function(U,X,J){if(U===0||U===J-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},x.prototype.permute=function(U,X,J,Z,Y,I){for(var L=0;L<I;L++)Z[L]=X[U[L]],Y[L]=J[U[L]]},x.prototype.transform=function(U,X,J,Z,Y,I){this.permute(I,U,X,J,Z,Y);for(var L=1;L<Y;L<<=1){var G=L<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var T=0;T<Y;T+=G){var S=O,v=E;for(var g=0;g<L;g++){var p=J[T+g],n=Z[T+g],V0=J[T+g+L],r=Z[T+g+L],l=S*V0-v*r;if(r=S*r+v*V0,V0=l,J[T+g]=p+V0,Z[T+g]=n+r,J[T+g+L]=p-V0,Z[T+g+L]=n-r,g!==G)l=O*S-E*v,v=O*v+E*S,S=l}}}},x.prototype.guessLen13b=function(U,X){var J=Math.max(X,U)|1,Z=J&1,Y=0;for(J=J/2|0;J;J=J>>>1)Y++;return 1<<Y+1+Z},x.prototype.conjugate=function(U,X,J){if(J<=1)return;for(var Z=0;Z<J/2;Z++){var Y=U[Z];U[Z]=U[J-Z-1],U[J-Z-1]=Y,Y=X[Z],X[Z]=-X[J-Z-1],X[J-Z-1]=-Y}},x.prototype.normalize13b=function(U,X){var J=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+J;if(U[Z]=Y&67108863,Y<67108864)J=0;else J=Y/67108864|0}return U},x.prototype.convert13b=function(U,X,J,Z){var Y=0;for(var I=0;I<X;I++)Y=Y+(U[I]|0),J[2*I]=Y&8191,Y=Y>>>13,J[2*I+1]=Y&8191,Y=Y>>>13;for(I=2*X;I<Z;++I)J[I]=0;C(Y===0),C((Y&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var J=0;J<U;J++)X[J]=0;return X},x.prototype.mulp=function(U,X,J){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),I=this.stub(Z),L=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),T=Array(Z),S=Array(Z),v=J.words;v.length=Z,this.convert13b(U.words,U.length,L,Z),this.convert13b(X.words,X.length,E,Z),this.transform(L,I,G,O,Z,Y),this.transform(E,I,T,S,Z,Y);for(var g=0;g<Z;g++){var p=G[g]*T[g]-O[g]*S[g];O[g]=G[g]*S[g]+O[g]*T[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,Y),this.conjugate(v,I,Z),this.normalize13b(v,Z),J.negative=U.negative^X.negative,J.length=U.length+X.length,J.strip()},A.prototype.mul=function(U){var X=new A(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},A.prototype.mulf=function(U){var X=new A(null);return X.words=Array(this.length+U.length),j(this,U,X)},A.prototype.imul=function(U){return this.clone().mulTo(U,this)},A.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var J=0;J<this.length;J++){var Z=(this.words[J]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[J]=Y&67108863}if(X!==0)this.words[J]=X,this.length++;return this.length=U===0?1:this.length,this},A.prototype.muln=function(U){return this.clone().imuln(U)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(U){var X=P(U);if(X.length===0)return new A(1);var J=this;for(var Z=0;Z<X.length;Z++,J=J.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=J.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;J=J.mul(Y)}return J},A.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var I=0;for(Y=0;Y<this.length;Y++){var L=this.words[Y]&Z,G=(this.words[Y]|0)-L<<X;this.words[Y]=G|I,I=L>>>26-X}if(I)this.words[Y]=I,this.length++}if(J!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+J]=this.words[Y];for(Y=0;Y<J;Y++)this.words[Y]=0;this.length+=J}return this.strip()},A.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},A.prototype.iushrn=function(U,X,J){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,I=Math.min((U-Y)/26,this.length),L=67108863^67108863>>>Y<<Y,G=J;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var T=this.words[O]|0;this.words[O]=E<<26-Y|T>>>Y,E=T&L}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},A.prototype.ishrn=function(U,X,J){return C(this.negative===0),this.iushrn(U,X,J)},A.prototype.shln=function(U){return this.clone().ishln(U)},A.prototype.ushln=function(U){return this.clone().iushln(U)},A.prototype.shrn=function(U){return this.clone().ishrn(U)},A.prototype.ushrn=function(U){return this.clone().iushrn(U)},A.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return!1;var Y=this.words[J];return!!(Y&Z)},A.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=J)return this;if(X!==0)J++;if(this.length=Math.min(J,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},A.prototype.maskn=function(U){return this.clone().imaskn(U)},A.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},A.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},A.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},A.prototype.addn=function(U){return this.clone().iaddn(U)},A.prototype.subn=function(U){return this.clone().isubn(U)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(U,X,J){var Z=U.length+J,Y;this._expand(Z);var I,L=0;for(Y=0;Y<U.length;Y++){I=(this.words[Y+J]|0)+L;var G=(U.words[Y]|0)*X;I-=G&67108863,L=(I>>26)-(G/67108864|0),this.words[Y+J]=I&67108863}for(;Y<this.length-J;Y++)I=(this.words[Y+J]|0)+L,L=I>>26,this.words[Y+J]=I&67108863;if(L===0)return this.strip();C(L===-1),L=0;for(Y=0;Y<this.length;Y++)I=-(this.words[Y]|0)+L,L=I>>26,this.words[Y]=I&67108863;return this.negative=1,this.strip()},A.prototype._wordDiv=function(U,X){var J=this.length-U.length,Z=this.clone(),Y=U,I=Y.words[Y.length-1]|0,L=this._countBits(I);if(J=26-L,J!==0)Y=Y.ushln(J),Z.iushln(J),I=Y.words[Y.length-1]|0;var G=Z.length-Y.length,O;if(X!=="mod"){O=new A(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var T=Z.clone()._ishlnsubmul(Y,1,G);if(T.negative===0){if(Z=T,O)O.words[G]=1}for(var S=G-1;S>=0;S--){var v=(Z.words[Y.length+S]|0)*67108864+(Z.words[Y.length+S-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul(Y,v,S);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul(Y,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&J!==0)Z.iushrn(J);return{div:O||null,mod:Z}},A.prototype.divmod=function(U,X,J){if(C(!U.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var Z,Y,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.isub(U)}return{div:I.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new A(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new A(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new A(this.modn(U.words[0]))}}return this._wordDiv(U,X)},A.prototype.div=function(U){return this.divmod(U,"div",!1).div},A.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},A.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},A.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var J=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),I=J.cmp(Z);if(I<0||Y===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},A.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,J=0;for(var Z=this.length-1;Z>=0;Z--)J=(X*J+(this.words[Z]|0))%U;return J},A.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var J=this.length-1;J>=0;J--){var Z=(this.words[J]|0)+X*67108864;this.words[J]=Z/U|0,X=Z%U}return this.strip()},A.prototype.divn=function(U){return this.clone().idivn(U)},A.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=new A(0),L=new A(1),G=0;while(X.isEven()&&J.isEven())X.iushrn(1),J.iushrn(1),++G;var O=J.clone(),E=X.clone();while(!X.isZero()){for(var T=0,S=1;(X.words[0]&S)===0&&T<26;++T,S<<=1);if(T>0){X.iushrn(T);while(T-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(E);Z.iushrn(1),Y.iushrn(1)}}for(var v=0,g=1;(J.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){J.iushrn(v);while(v-- >0){if(I.isOdd()||L.isOdd())I.iadd(O),L.isub(E);I.iushrn(1),L.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(I),Y.isub(L);else J.isub(X),I.isub(Z),L.isub(Y)}return{a:I,b:L,gcd:J.iushln(G)}},A.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=J.clone();while(X.cmpn(1)>0&&J.cmpn(1)>0){for(var L=0,G=1;(X.words[0]&G)===0&&L<26;++L,G<<=1);if(L>0){X.iushrn(L);while(L-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(J.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){J.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(I);Y.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(Y);else J.isub(X),Y.isub(Z)}var T;if(X.cmpn(1)===0)T=Z;else T=Y;if(T.cmpn(0)<0)T.iadd(U);return T},A.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),J=U.clone();X.negative=0,J.negative=0;for(var Z=0;X.isEven()&&J.isEven();Z++)X.iushrn(1),J.iushrn(1);do{while(X.isEven())X.iushrn(1);while(J.isEven())J.iushrn(1);var Y=X.cmp(J);if(Y<0){var I=X;X=J,J=I}else if(Y===0||J.cmpn(1)===0)break;X.isub(J)}while(!0);return J.iushln(Z)},A.prototype.invm=function(U){return this.egcd(U).a.umod(U)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(U){return this.words[0]&U},A.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return this._expand(J+1),this.words[J]|=Z,this;var Y=Z;for(var I=J;Y!==0&&I<this.length;I++){var L=this.words[I]|0;L+=Y,Y=L>>>26,L&=67108863,this.words[I]=L}if(Y!==0)this.words[I]=Y,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var J;if(this.length>1)J=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;J=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-J|0;return J},A.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},A.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var J=this.length-1;J>=0;J--){var Z=this.words[J]|0,Y=U.words[J]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},A.prototype.gtn=function(U){return this.cmpn(U)===1},A.prototype.gt=function(U){return this.cmp(U)===1},A.prototype.gten=function(U){return this.cmpn(U)>=0},A.prototype.gte=function(U){return this.cmp(U)>=0},A.prototype.ltn=function(U){return this.cmpn(U)===-1},A.prototype.lt=function(U){return this.cmp(U)===-1},A.prototype.lten=function(U){return this.cmpn(U)<=0},A.prototype.lte=function(U){return this.cmp(U)<=0},A.prototype.eqn=function(U){return this.cmpn(U)===0},A.prototype.eq=function(U){return this.cmp(U)===0},A.red=function(U){return new u(U)},A.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(U){return this.red=U,this},A.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},A.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},A.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},A.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},A.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},A.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},A.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},A.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new A(X,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new A(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,J;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),J=X.bitLength();while(J>this.n);var Z=J<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D(d,w),d.prototype.split=function(U,X){var J=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&J;for(Y=10;Y<U.length;Y++){var L=U.words[Y]|0;U.words[Y-10]=(L&J)<<4|I>>>22,I=L}if(I>>>=22,U.words[Y-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var J=0;J<U.length;J++){var Z=U.words[J]|0;X+=Z*977,U.words[J]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(Y0,w);function J0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(J0,w);function $0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D($0,w),$0.prototype.imulK=function(U){var X=0;for(var J=0;J<U.length;J++){var Z=(U.words[J]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[J]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},A._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new J0;else if(U==="p25519")X=new $0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=A._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var J=U.add(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var J=U.iadd(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J},u.prototype.sub=function(U,X){this._verify2(U,X);var J=U.sub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var J=U.isub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var J=this.m.add(new A(1)).iushrn(2);return this.pow(U,J)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);C(!Z.isZero());var I=new A(1).toRed(this),L=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new A(2*O*O).toRed(this);while(this.pow(O,G).cmp(L)!==0)O.redIAdd(L);var E=this.pow(O,Z),T=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),v=Y;while(S.cmp(I)!==0){var g=S;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new A(1).iushln(v-p-1));T=T.redMul(n),E=n.redSqr(),S=S.redMul(E),v=p}return T},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new A(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var J=4,Z=Array(1<<J);Z[0]=new A(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var I=Z[0],L=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var E=X.words[Y];for(var T=O-1;T>=0;T--){var S=E>>T&1;if(I!==Z[0])I=this.sqr(I);if(S===0&&L===0){G=0;continue}if(L<<=1,L|=S,G++,G!==J&&(Y!==0||T!==0))continue;I=this.mul(I,Z[L]),G=0,L=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},A.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(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)}D(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var J=U.imul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new A(0)._forceRed(this);var J=U.mul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof $>"u"||$,Q)}),FY=A0((Q,$)=>{var V=GX(),W=MU().Buffer;function C(D,A){return W.from(D.toRed(V.mont(A.modulus)).redPow(new V(A.publicExponent)).fromRed().toArray())}$.exports=C}),HG=A0((Q,$)=>{(function(V,W){function C(Z,Y){if(!Z)throw Error(Y||"Assertion failed")}function D(Z,Y){Z.super_=Y;var I=function(){};I.prototype=Y.prototype,Z.prototype=new I,Z.prototype.constructor=Z}function A(Z,Y,I){if(A.isBN(Z))return Z;if(this.negative=0,this.words=null,this.length=0,this.red=null,Z!==null){if(Y==="le"||Y==="be")I=Y,Y=10;this._init(Z||0,Y||10,I||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(Z){}A.isBN=function(Z){if(Z instanceof A)return!0;return Z!==null&&typeof Z==="object"&&Z.constructor.wordSize===A.wordSize&&Array.isArray(Z.words)},A.max=function(Z,Y){if(Z.cmp(Y)>0)return Z;return Y},A.min=function(Z,Y){if(Z.cmp(Y)<0)return Z;return Y},A.prototype._init=function(Z,Y,I){if(typeof Z==="number")return this._initNumber(Z,Y,I);if(typeof Z==="object")return this._initArray(Z,Y,I);if(Y==="hex")Y=16;C(Y===(Y|0)&&Y>=2&&Y<=36),Z=Z.toString().replace(/\s+/g,"");var L=0;if(Z[0]==="-")L++,this.negative=1;if(L<Z.length){if(Y===16)this._parseHex(Z,L,I);else if(this._parseBase(Z,Y,L),I==="le")this._initArray(this.toArray(),Y,I)}},A.prototype._initNumber=function(Z,Y,I){if(Z<0)this.negative=1,Z=-Z;if(Z<67108864)this.words=[Z&67108863],this.length=1;else if(Z<4503599627370496)this.words=[Z&67108863,Z/67108864&67108863],this.length=2;else C(Z<9007199254740992),this.words=[Z&67108863,Z/67108864&67108863,1],this.length=3;if(I!=="le")return;this._initArray(this.toArray(),Y,I)},A.prototype._initArray=function(Z,Y,I){if(C(typeof Z.length==="number"),Z.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Z.length/3),this.words=Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var G,O,E=0;if(I==="be"){for(L=Z.length-1,G=0;L>=0;L-=3)if(O=Z[L]|Z[L-1]<<8|Z[L-2]<<16,this.words[G]|=O<<E&67108863,this.words[G+1]=O>>>26-E&67108863,E+=24,E>=26)E-=26,G++}else if(I==="le"){for(L=0,G=0;L<Z.length;L+=3)if(O=Z[L]|Z[L+1]<<8|Z[L+2]<<16,this.words[G]|=O<<E&67108863,this.words[G+1]=O>>>26-E&67108863,E+=24,E>=26)E-=26,G++}return this._strip()};function M(Z,Y){var I=Z.charCodeAt(Y);if(I>=48&&I<=57)return I-48;else if(I>=65&&I<=70)return I-55;else if(I>=97&&I<=102)return I-87;else C(!1,"Invalid character in "+Z)}function F(Z,Y,I){var L=M(Z,I);if(I-1>=Y)L|=M(Z,I-1)<<4;return L}A.prototype._parseHex=function(Z,Y,I){this.length=Math.ceil((Z.length-Y)/6),this.words=Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var G=0,O=0,E;if(I==="be")for(L=Z.length-1;L>=Y;L-=2)if(E=F(Z,Y,L)<<G,this.words[O]|=E&67108863,G>=18)G-=18,O+=1,this.words[O]|=E>>>26;else G+=8;else{var T=Z.length-Y;for(L=T%2===0?Y+1:Y;L<Z.length;L+=2)if(E=F(Z,Y,L)<<G,this.words[O]|=E&67108863,G>=18)G-=18,O+=1,this.words[O]|=E>>>26;else G+=8}this._strip()};function R(Z,Y,I,L){var G=0,O=0,E=Math.min(Z.length,I);for(var T=Y;T<E;T++){var S=Z.charCodeAt(T)-48;if(G*=L,S>=49)O=S-49+10;else if(S>=17)O=S-17+10;else O=S;C(S>=0&&O<L,"Invalid character"),G+=O}return G}A.prototype._parseBase=function(Z,Y,I){this.words=[0],this.length=1;for(var L=0,G=1;G<=67108863;G*=Y)L++;L--,G=G/Y|0;var O=Z.length-I,E=O%L,T=Math.min(O,O-E)+I,S=0;for(var v=I;v<T;v+=L)if(S=R(Z,v,v+L,Y),this.imuln(G),this.words[0]+S<67108864)this.words[0]+=S;else this._iaddn(S);if(E!==0){var g=1;S=R(Z,v,Z.length,Y);for(v=0;v<E;v++)g*=Y;if(this.imuln(g),this.words[0]+S<67108864)this.words[0]+=S;else this._iaddn(S)}this._strip()},A.prototype.copy=function(Z){Z.words=Array(this.length);for(var Y=0;Y<this.length;Y++)Z.words[Y]=this.words[Y];Z.length=this.length,Z.negative=this.negative,Z.red=this.red};function K(Z,Y){Z.words=Y.words,Z.length=Y.length,Z.negative=Y.negative,Z.red=Y.red}if(A.prototype._move=function(Z){K(Z,this)},A.prototype.clone=function(){var Z=new A(null);return this.copy(Z),Z},A.prototype._expand=function(Z){while(this.length<Z)this.words[this.length++]=0;return this},A.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{A.prototype[Symbol.for("nodejs.util.inspect.custom")]=H}catch(Z){A.prototype.inspect=H}else A.prototype.inspect=H;function H(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var q=["","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"],P=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(Z,Y){Z=Z||10,Y=Y|0||1;var I;if(Z===16||Z==="hex"){I="";var L=0,G=0;for(var O=0;O<this.length;O++){var E=this.words[O],T=((E<<L|G)&16777215).toString(16);if(G=E>>>24-L&16777215,L+=2,L>=26)L-=26,O--;if(G!==0||O!==this.length-1)I=q[6-T.length]+T+I;else I=T+I}if(G!==0)I=G.toString(16)+I;while(I.length%Y!==0)I="0"+I;if(this.negative!==0)I="-"+I;return I}if(Z===(Z|0)&&Z>=2&&Z<=36){var S=P[Z],v=_[Z];I="";var g=this.clone();g.negative=0;while(!g.isZero()){var p=g.modrn(v).toString(Z);if(g=g.idivn(v),!g.isZero())I=q[S-p.length]+p+I;else I=p+I}if(this.isZero())I="0"+I;while(I.length%Y!==0)I="0"+I;if(this.negative!==0)I="-"+I;return I}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var Z=this.words[0];if(this.length===2)Z+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Z+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Z:Z},A.prototype.toJSON=function(){return this.toString(16,2)},z)A.prototype.toBuffer=function(Z,Y){return this.toArrayLike(z,Z,Y)};A.prototype.toArray=function(Z,Y){return this.toArrayLike(Array,Z,Y)};var k=function(Z,Y){if(Z.allocUnsafe)return Z.allocUnsafe(Y);return new Z(Y)};if(A.prototype.toArrayLike=function(Z,Y,I){this._strip();var L=this.byteLength(),G=I||Math.max(1,L);C(L<=G,"byte array longer than desired length"),C(G>0,"Requested array length <= 0");var O=k(Z,G),E=Y==="le"?"LE":"BE";return this["_toArrayLike"+E](O,L),O},A.prototype._toArrayLikeLE=function(Z,Y){var I=0,L=0;for(var G=0,O=0;G<this.length;G++){var E=this.words[G]<<O|L;if(Z[I++]=E&255,I<Z.length)Z[I++]=E>>8&255;if(I<Z.length)Z[I++]=E>>16&255;if(O===6){if(I<Z.length)Z[I++]=E>>24&255;L=0,O=0}else L=E>>>24,O+=2}if(I<Z.length){Z[I++]=L;while(I<Z.length)Z[I++]=0}},A.prototype._toArrayLikeBE=function(Z,Y){var I=Z.length-1,L=0;for(var G=0,O=0;G<this.length;G++){var E=this.words[G]<<O|L;if(Z[I--]=E&255,I>=0)Z[I--]=E>>8&255;if(I>=0)Z[I--]=E>>16&255;if(O===6){if(I>=0)Z[I--]=E>>24&255;L=0,O=0}else L=E>>>24,O+=2}if(I>=0){Z[I--]=L;while(I>=0)Z[I--]=0}},Math.clz32)A.prototype._countBits=function(Z){return 32-Math.clz32(Z)};else A.prototype._countBits=function(Z){var Y=Z,I=0;if(Y>=4096)I+=13,Y>>>=13;if(Y>=64)I+=7,Y>>>=7;if(Y>=8)I+=4,Y>>>=4;if(Y>=2)I+=2,Y>>>=2;return I+Y};A.prototype._zeroBits=function(Z){if(Z===0)return 26;var Y=Z,I=0;if((Y&8191)===0)I+=13,Y>>>=13;if((Y&127)===0)I+=7,Y>>>=7;if((Y&15)===0)I+=4,Y>>>=4;if((Y&3)===0)I+=2,Y>>>=2;if((Y&1)===0)I++;return I},A.prototype.bitLength=function(){var Z=this.words[this.length-1],Y=this._countBits(Z);return(this.length-1)*26+Y};function B(Z){var Y=Array(Z.bitLength());for(var I=0;I<Y.length;I++){var L=I/26|0,G=I%26;Y[I]=Z.words[L]>>>G&1}return Y}A.prototype.zeroBits=function(){if(this.isZero())return 0;var Z=0;for(var Y=0;Y<this.length;Y++){var I=this._zeroBits(this.words[Y]);if(Z+=I,I!==26)break}return Z},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(Z){if(this.negative!==0)return this.abs().inotn(Z).iaddn(1);return this.clone()},A.prototype.fromTwos=function(Z){if(this.testn(Z-1))return this.notn(Z).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(Z){while(this.length<Z.length)this.words[this.length++]=0;for(var Y=0;Y<Z.length;Y++)this.words[Y]=this.words[Y]|Z.words[Y];return this._strip()},A.prototype.ior=function(Z){return C((this.negative|Z.negative)===0),this.iuor(Z)},A.prototype.or=function(Z){if(this.length>Z.length)return this.clone().ior(Z);return Z.clone().ior(this)},A.prototype.uor=function(Z){if(this.length>Z.length)return this.clone().iuor(Z);return Z.clone().iuor(this)},A.prototype.iuand=function(Z){var Y;if(this.length>Z.length)Y=Z;else Y=this;for(var I=0;I<Y.length;I++)this.words[I]=this.words[I]&Z.words[I];return this.length=Y.length,this._strip()},A.prototype.iand=function(Z){return C((this.negative|Z.negative)===0),this.iuand(Z)},A.prototype.and=function(Z){if(this.length>Z.length)return this.clone().iand(Z);return Z.clone().iand(this)},A.prototype.uand=function(Z){if(this.length>Z.length)return this.clone().iuand(Z);return Z.clone().iuand(this)},A.prototype.iuxor=function(Z){var Y,I;if(this.length>Z.length)Y=this,I=Z;else Y=Z,I=this;for(var L=0;L<I.length;L++)this.words[L]=Y.words[L]^I.words[L];if(this!==Y)for(;L<Y.length;L++)this.words[L]=Y.words[L];return this.length=Y.length,this._strip()},A.prototype.ixor=function(Z){return C((this.negative|Z.negative)===0),this.iuxor(Z)},A.prototype.xor=function(Z){if(this.length>Z.length)return this.clone().ixor(Z);return Z.clone().ixor(this)},A.prototype.uxor=function(Z){if(this.length>Z.length)return this.clone().iuxor(Z);return Z.clone().iuxor(this)},A.prototype.inotn=function(Z){C(typeof Z==="number"&&Z>=0);var Y=Math.ceil(Z/26)|0,I=Z%26;if(this._expand(Y),I>0)Y--;for(var L=0;L<Y;L++)this.words[L]=~this.words[L]&67108863;if(I>0)this.words[L]=~this.words[L]&67108863>>26-I;return this._strip()},A.prototype.notn=function(Z){return this.clone().inotn(Z)},A.prototype.setn=function(Z,Y){C(typeof Z==="number"&&Z>=0);var I=Z/26|0,L=Z%26;if(this._expand(I+1),Y)this.words[I]=this.words[I]|1<<L;else this.words[I]=this.words[I]&~(1<<L);return this._strip()},A.prototype.iadd=function(Z){var Y;if(this.negative!==0&&Z.negative===0)return this.negative=0,Y=this.isub(Z),this.negative^=1,this._normSign();else if(this.negative===0&&Z.negative!==0)return Z.negative=0,Y=this.isub(Z),Z.negative=1,Y._normSign();var I,L;if(this.length>Z.length)I=this,L=Z;else I=Z,L=this;var G=0;for(var O=0;O<L.length;O++)Y=(I.words[O]|0)+(L.words[O]|0)+G,this.words[O]=Y&67108863,G=Y>>>26;for(;G!==0&&O<I.length;O++)Y=(I.words[O]|0)+G,this.words[O]=Y&67108863,G=Y>>>26;if(this.length=I.length,G!==0)this.words[this.length]=G,this.length++;else if(I!==this)for(;O<I.length;O++)this.words[O]=I.words[O];return this},A.prototype.add=function(Z){var Y;if(Z.negative!==0&&this.negative===0)return Z.negative=0,Y=this.sub(Z),Z.negative^=1,Y;else if(Z.negative===0&&this.negative!==0)return this.negative=0,Y=Z.sub(this),this.negative=1,Y;if(this.length>Z.length)return this.clone().iadd(Z);return Z.clone().iadd(this)},A.prototype.isub=function(Z){if(Z.negative!==0){Z.negative=0;var Y=this.iadd(Z);return Z.negative=1,Y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Z),this.negative=1,this._normSign();var I=this.cmp(Z);if(I===0)return this.negative=0,this.length=1,this.words[0]=0,this;var L,G;if(I>0)L=this,G=Z;else L=Z,G=this;var O=0;for(var E=0;E<G.length;E++)Y=(L.words[E]|0)-(G.words[E]|0)+O,O=Y>>26,this.words[E]=Y&67108863;for(;O!==0&&E<L.length;E++)Y=(L.words[E]|0)+O,O=Y>>26,this.words[E]=Y&67108863;if(O===0&&E<L.length&&L!==this)for(;E<L.length;E++)this.words[E]=L.words[E];if(this.length=Math.max(this.length,E),L!==this)this.negative=1;return this._strip()},A.prototype.sub=function(Z){return this.clone().isub(Z)};function j(Z,Y,I){I.negative=Y.negative^Z.negative;var L=Z.length+Y.length|0;I.length=L,L=L-1|0;var G=Z.words[0]|0,O=Y.words[0]|0,E=G*O,T=E&67108863,S=E/67108864|0;I.words[0]=T;for(var v=1;v<L;v++){var g=S>>>26,p=S&67108863,n=Math.min(v,Y.length-1);for(var V0=Math.max(0,v-Z.length+1);V0<=n;V0++){var r=v-V0|0;G=Z.words[r]|0,O=Y.words[V0]|0,E=G*O+p,g+=E/67108864|0,p=E&67108863}I.words[v]=p|0,S=g|0}if(S!==0)I.words[v]=S|0;else I.length--;return I._strip()}var x=function(Z,Y,I){var L=Z.words,G=Y.words,O=I.words,E=0,T,S,v,g=L[0]|0,p=g&8191,n=g>>>13,V0=L[1]|0,r=V0&8191,l=V0>>>13,X0=L[2]|0,m=X0&8191,i=X0>>>13,g0=L[3]|0,y=g0&8191,h=g0>>>13,Q0=L[4]|0,s=Q0&8191,e=Q0>>>13,F0=L[5]|0,c=F0&8191,o=F0>>>13,N0=L[6]|0,t=N0&8191,Z0=N0>>>13,w0=L[7]|0,C0=w0&8191,L0=w0>>>13,t0=L[8]|0,E0=t0&8191,K0=t0>>>13,e0=L[9]|0,S0=e0&8191,H0=e0>>>13,FU=G[0]|0,R0=FU&8191,k0=FU>>>13,RU=G[1]|0,_0=RU&8191,T0=RU>>>13,SU=G[2]|0,v0=SU&8191,z0=SU>>>13,CU=G[3]|0,j0=CU&8191,B0=CU>>>13,LU=G[4]|0,M0=LU&8191,N=LU>>>13,b=G[5]|0,a=b&8191,U0=b>>>13,f0=G[6]|0,I0=f0&8191,W0=f0>>>13,s0=G[7]|0,q0=s0&8191,x0=s0>>>13,DU=G[8]|0,P0=DU&8191,D0=DU>>>13,r0=G[9]|0,c0=r0&8191,y0=r0>>>13;I.negative=Z.negative^Y.negative,I.length=19,T=Math.imul(p,R0),S=Math.imul(p,k0),S=S+Math.imul(n,R0)|0,v=Math.imul(n,k0);var d0=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(d0>>>26)|0,d0&=67108863,T=Math.imul(r,R0),S=Math.imul(r,k0),S=S+Math.imul(l,R0)|0,v=Math.imul(l,k0),T=T+Math.imul(p,_0)|0,S=S+Math.imul(p,T0)|0,S=S+Math.imul(n,_0)|0,v=v+Math.imul(n,T0)|0;var l0=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(l0>>>26)|0,l0&=67108863,T=Math.imul(m,R0),S=Math.imul(m,k0),S=S+Math.imul(i,R0)|0,v=Math.imul(i,k0),T=T+Math.imul(r,_0)|0,S=S+Math.imul(r,T0)|0,S=S+Math.imul(l,_0)|0,v=v+Math.imul(l,T0)|0,T=T+Math.imul(p,v0)|0,S=S+Math.imul(p,z0)|0,S=S+Math.imul(n,v0)|0,v=v+Math.imul(n,z0)|0;var i0=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(i0>>>26)|0,i0&=67108863,T=Math.imul(y,R0),S=Math.imul(y,k0),S=S+Math.imul(h,R0)|0,v=Math.imul(h,k0),T=T+Math.imul(m,_0)|0,S=S+Math.imul(m,T0)|0,S=S+Math.imul(i,_0)|0,v=v+Math.imul(i,T0)|0,T=T+Math.imul(r,v0)|0,S=S+Math.imul(r,z0)|0,S=S+Math.imul(l,v0)|0,v=v+Math.imul(l,z0)|0,T=T+Math.imul(p,j0)|0,S=S+Math.imul(p,B0)|0,S=S+Math.imul(n,j0)|0,v=v+Math.imul(n,B0)|0;var UU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(UU>>>26)|0,UU&=67108863,T=Math.imul(s,R0),S=Math.imul(s,k0),S=S+Math.imul(e,R0)|0,v=Math.imul(e,k0),T=T+Math.imul(y,_0)|0,S=S+Math.imul(y,T0)|0,S=S+Math.imul(h,_0)|0,v=v+Math.imul(h,T0)|0,T=T+Math.imul(m,v0)|0,S=S+Math.imul(m,z0)|0,S=S+Math.imul(i,v0)|0,v=v+Math.imul(i,z0)|0,T=T+Math.imul(r,j0)|0,S=S+Math.imul(r,B0)|0,S=S+Math.imul(l,j0)|0,v=v+Math.imul(l,B0)|0,T=T+Math.imul(p,M0)|0,S=S+Math.imul(p,N)|0,S=S+Math.imul(n,M0)|0,v=v+Math.imul(n,N)|0;var OU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(OU>>>26)|0,OU&=67108863,T=Math.imul(c,R0),S=Math.imul(c,k0),S=S+Math.imul(o,R0)|0,v=Math.imul(o,k0),T=T+Math.imul(s,_0)|0,S=S+Math.imul(s,T0)|0,S=S+Math.imul(e,_0)|0,v=v+Math.imul(e,T0)|0,T=T+Math.imul(y,v0)|0,S=S+Math.imul(y,z0)|0,S=S+Math.imul(h,v0)|0,v=v+Math.imul(h,z0)|0,T=T+Math.imul(m,j0)|0,S=S+Math.imul(m,B0)|0,S=S+Math.imul(i,j0)|0,v=v+Math.imul(i,B0)|0,T=T+Math.imul(r,M0)|0,S=S+Math.imul(r,N)|0,S=S+Math.imul(l,M0)|0,v=v+Math.imul(l,N)|0,T=T+Math.imul(p,a)|0,S=S+Math.imul(p,U0)|0,S=S+Math.imul(n,a)|0,v=v+Math.imul(n,U0)|0;var ZU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,T=Math.imul(t,R0),S=Math.imul(t,k0),S=S+Math.imul(Z0,R0)|0,v=Math.imul(Z0,k0),T=T+Math.imul(c,_0)|0,S=S+Math.imul(c,T0)|0,S=S+Math.imul(o,_0)|0,v=v+Math.imul(o,T0)|0,T=T+Math.imul(s,v0)|0,S=S+Math.imul(s,z0)|0,S=S+Math.imul(e,v0)|0,v=v+Math.imul(e,z0)|0,T=T+Math.imul(y,j0)|0,S=S+Math.imul(y,B0)|0,S=S+Math.imul(h,j0)|0,v=v+Math.imul(h,B0)|0,T=T+Math.imul(m,M0)|0,S=S+Math.imul(m,N)|0,S=S+Math.imul(i,M0)|0,v=v+Math.imul(i,N)|0,T=T+Math.imul(r,a)|0,S=S+Math.imul(r,U0)|0,S=S+Math.imul(l,a)|0,v=v+Math.imul(l,U0)|0,T=T+Math.imul(p,I0)|0,S=S+Math.imul(p,W0)|0,S=S+Math.imul(n,I0)|0,v=v+Math.imul(n,W0)|0;var XU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(XU>>>26)|0,XU&=67108863,T=Math.imul(C0,R0),S=Math.imul(C0,k0),S=S+Math.imul(L0,R0)|0,v=Math.imul(L0,k0),T=T+Math.imul(t,_0)|0,S=S+Math.imul(t,T0)|0,S=S+Math.imul(Z0,_0)|0,v=v+Math.imul(Z0,T0)|0,T=T+Math.imul(c,v0)|0,S=S+Math.imul(c,z0)|0,S=S+Math.imul(o,v0)|0,v=v+Math.imul(o,z0)|0,T=T+Math.imul(s,j0)|0,S=S+Math.imul(s,B0)|0,S=S+Math.imul(e,j0)|0,v=v+Math.imul(e,B0)|0,T=T+Math.imul(y,M0)|0,S=S+Math.imul(y,N)|0,S=S+Math.imul(h,M0)|0,v=v+Math.imul(h,N)|0,T=T+Math.imul(m,a)|0,S=S+Math.imul(m,U0)|0,S=S+Math.imul(i,a)|0,v=v+Math.imul(i,U0)|0,T=T+Math.imul(r,I0)|0,S=S+Math.imul(r,W0)|0,S=S+Math.imul(l,I0)|0,v=v+Math.imul(l,W0)|0,T=T+Math.imul(p,q0)|0,S=S+Math.imul(p,x0)|0,S=S+Math.imul(n,q0)|0,v=v+Math.imul(n,x0)|0;var QU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(QU>>>26)|0,QU&=67108863,T=Math.imul(E0,R0),S=Math.imul(E0,k0),S=S+Math.imul(K0,R0)|0,v=Math.imul(K0,k0),T=T+Math.imul(C0,_0)|0,S=S+Math.imul(C0,T0)|0,S=S+Math.imul(L0,_0)|0,v=v+Math.imul(L0,T0)|0,T=T+Math.imul(t,v0)|0,S=S+Math.imul(t,z0)|0,S=S+Math.imul(Z0,v0)|0,v=v+Math.imul(Z0,z0)|0,T=T+Math.imul(c,j0)|0,S=S+Math.imul(c,B0)|0,S=S+Math.imul(o,j0)|0,v=v+Math.imul(o,B0)|0,T=T+Math.imul(s,M0)|0,S=S+Math.imul(s,N)|0,S=S+Math.imul(e,M0)|0,v=v+Math.imul(e,N)|0,T=T+Math.imul(y,a)|0,S=S+Math.imul(y,U0)|0,S=S+Math.imul(h,a)|0,v=v+Math.imul(h,U0)|0,T=T+Math.imul(m,I0)|0,S=S+Math.imul(m,W0)|0,S=S+Math.imul(i,I0)|0,v=v+Math.imul(i,W0)|0,T=T+Math.imul(r,q0)|0,S=S+Math.imul(r,x0)|0,S=S+Math.imul(l,q0)|0,v=v+Math.imul(l,x0)|0,T=T+Math.imul(p,P0)|0,S=S+Math.imul(p,D0)|0,S=S+Math.imul(n,P0)|0,v=v+Math.imul(n,D0)|0;var YU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(YU>>>26)|0,YU&=67108863,T=Math.imul(S0,R0),S=Math.imul(S0,k0),S=S+Math.imul(H0,R0)|0,v=Math.imul(H0,k0),T=T+Math.imul(E0,_0)|0,S=S+Math.imul(E0,T0)|0,S=S+Math.imul(K0,_0)|0,v=v+Math.imul(K0,T0)|0,T=T+Math.imul(C0,v0)|0,S=S+Math.imul(C0,z0)|0,S=S+Math.imul(L0,v0)|0,v=v+Math.imul(L0,z0)|0,T=T+Math.imul(t,j0)|0,S=S+Math.imul(t,B0)|0,S=S+Math.imul(Z0,j0)|0,v=v+Math.imul(Z0,B0)|0,T=T+Math.imul(c,M0)|0,S=S+Math.imul(c,N)|0,S=S+Math.imul(o,M0)|0,v=v+Math.imul(o,N)|0,T=T+Math.imul(s,a)|0,S=S+Math.imul(s,U0)|0,S=S+Math.imul(e,a)|0,v=v+Math.imul(e,U0)|0,T=T+Math.imul(y,I0)|0,S=S+Math.imul(y,W0)|0,S=S+Math.imul(h,I0)|0,v=v+Math.imul(h,W0)|0,T=T+Math.imul(m,q0)|0,S=S+Math.imul(m,x0)|0,S=S+Math.imul(i,q0)|0,v=v+Math.imul(i,x0)|0,T=T+Math.imul(r,P0)|0,S=S+Math.imul(r,D0)|0,S=S+Math.imul(l,P0)|0,v=v+Math.imul(l,D0)|0,T=T+Math.imul(p,c0)|0,S=S+Math.imul(p,y0)|0,S=S+Math.imul(n,c0)|0,v=v+Math.imul(n,y0)|0;var $U=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+($U>>>26)|0,$U&=67108863,T=Math.imul(S0,_0),S=Math.imul(S0,T0),S=S+Math.imul(H0,_0)|0,v=Math.imul(H0,T0),T=T+Math.imul(E0,v0)|0,S=S+Math.imul(E0,z0)|0,S=S+Math.imul(K0,v0)|0,v=v+Math.imul(K0,z0)|0,T=T+Math.imul(C0,j0)|0,S=S+Math.imul(C0,B0)|0,S=S+Math.imul(L0,j0)|0,v=v+Math.imul(L0,B0)|0,T=T+Math.imul(t,M0)|0,S=S+Math.imul(t,N)|0,S=S+Math.imul(Z0,M0)|0,v=v+Math.imul(Z0,N)|0,T=T+Math.imul(c,a)|0,S=S+Math.imul(c,U0)|0,S=S+Math.imul(o,a)|0,v=v+Math.imul(o,U0)|0,T=T+Math.imul(s,I0)|0,S=S+Math.imul(s,W0)|0,S=S+Math.imul(e,I0)|0,v=v+Math.imul(e,W0)|0,T=T+Math.imul(y,q0)|0,S=S+Math.imul(y,x0)|0,S=S+Math.imul(h,q0)|0,v=v+Math.imul(h,x0)|0,T=T+Math.imul(m,P0)|0,S=S+Math.imul(m,D0)|0,S=S+Math.imul(i,P0)|0,v=v+Math.imul(i,D0)|0,T=T+Math.imul(r,c0)|0,S=S+Math.imul(r,y0)|0,S=S+Math.imul(l,c0)|0,v=v+Math.imul(l,y0)|0;var AU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(AU>>>26)|0,AU&=67108863,T=Math.imul(S0,v0),S=Math.imul(S0,z0),S=S+Math.imul(H0,v0)|0,v=Math.imul(H0,z0),T=T+Math.imul(E0,j0)|0,S=S+Math.imul(E0,B0)|0,S=S+Math.imul(K0,j0)|0,v=v+Math.imul(K0,B0)|0,T=T+Math.imul(C0,M0)|0,S=S+Math.imul(C0,N)|0,S=S+Math.imul(L0,M0)|0,v=v+Math.imul(L0,N)|0,T=T+Math.imul(t,a)|0,S=S+Math.imul(t,U0)|0,S=S+Math.imul(Z0,a)|0,v=v+Math.imul(Z0,U0)|0,T=T+Math.imul(c,I0)|0,S=S+Math.imul(c,W0)|0,S=S+Math.imul(o,I0)|0,v=v+Math.imul(o,W0)|0,T=T+Math.imul(s,q0)|0,S=S+Math.imul(s,x0)|0,S=S+Math.imul(e,q0)|0,v=v+Math.imul(e,x0)|0,T=T+Math.imul(y,P0)|0,S=S+Math.imul(y,D0)|0,S=S+Math.imul(h,P0)|0,v=v+Math.imul(h,D0)|0,T=T+Math.imul(m,c0)|0,S=S+Math.imul(m,y0)|0,S=S+Math.imul(i,c0)|0,v=v+Math.imul(i,y0)|0;var JU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(JU>>>26)|0,JU&=67108863,T=Math.imul(S0,j0),S=Math.imul(S0,B0),S=S+Math.imul(H0,j0)|0,v=Math.imul(H0,B0),T=T+Math.imul(E0,M0)|0,S=S+Math.imul(E0,N)|0,S=S+Math.imul(K0,M0)|0,v=v+Math.imul(K0,N)|0,T=T+Math.imul(C0,a)|0,S=S+Math.imul(C0,U0)|0,S=S+Math.imul(L0,a)|0,v=v+Math.imul(L0,U0)|0,T=T+Math.imul(t,I0)|0,S=S+Math.imul(t,W0)|0,S=S+Math.imul(Z0,I0)|0,v=v+Math.imul(Z0,W0)|0,T=T+Math.imul(c,q0)|0,S=S+Math.imul(c,x0)|0,S=S+Math.imul(o,q0)|0,v=v+Math.imul(o,x0)|0,T=T+Math.imul(s,P0)|0,S=S+Math.imul(s,D0)|0,S=S+Math.imul(e,P0)|0,v=v+Math.imul(e,D0)|0,T=T+Math.imul(y,c0)|0,S=S+Math.imul(y,y0)|0,S=S+Math.imul(h,c0)|0,v=v+Math.imul(h,y0)|0;var GU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(GU>>>26)|0,GU&=67108863,T=Math.imul(S0,M0),S=Math.imul(S0,N),S=S+Math.imul(H0,M0)|0,v=Math.imul(H0,N),T=T+Math.imul(E0,a)|0,S=S+Math.imul(E0,U0)|0,S=S+Math.imul(K0,a)|0,v=v+Math.imul(K0,U0)|0,T=T+Math.imul(C0,I0)|0,S=S+Math.imul(C0,W0)|0,S=S+Math.imul(L0,I0)|0,v=v+Math.imul(L0,W0)|0,T=T+Math.imul(t,q0)|0,S=S+Math.imul(t,x0)|0,S=S+Math.imul(Z0,q0)|0,v=v+Math.imul(Z0,x0)|0,T=T+Math.imul(c,P0)|0,S=S+Math.imul(c,D0)|0,S=S+Math.imul(o,P0)|0,v=v+Math.imul(o,D0)|0,T=T+Math.imul(s,c0)|0,S=S+Math.imul(s,y0)|0,S=S+Math.imul(e,c0)|0,v=v+Math.imul(e,y0)|0;var VU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(VU>>>26)|0,VU&=67108863,T=Math.imul(S0,a),S=Math.imul(S0,U0),S=S+Math.imul(H0,a)|0,v=Math.imul(H0,U0),T=T+Math.imul(E0,I0)|0,S=S+Math.imul(E0,W0)|0,S=S+Math.imul(K0,I0)|0,v=v+Math.imul(K0,W0)|0,T=T+Math.imul(C0,q0)|0,S=S+Math.imul(C0,x0)|0,S=S+Math.imul(L0,q0)|0,v=v+Math.imul(L0,x0)|0,T=T+Math.imul(t,P0)|0,S=S+Math.imul(t,D0)|0,S=S+Math.imul(Z0,P0)|0,v=v+Math.imul(Z0,D0)|0,T=T+Math.imul(c,c0)|0,S=S+Math.imul(c,y0)|0,S=S+Math.imul(o,c0)|0,v=v+Math.imul(o,y0)|0;var EU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(EU>>>26)|0,EU&=67108863,T=Math.imul(S0,I0),S=Math.imul(S0,W0),S=S+Math.imul(H0,I0)|0,v=Math.imul(H0,W0),T=T+Math.imul(E0,q0)|0,S=S+Math.imul(E0,x0)|0,S=S+Math.imul(K0,q0)|0,v=v+Math.imul(K0,x0)|0,T=T+Math.imul(C0,P0)|0,S=S+Math.imul(C0,D0)|0,S=S+Math.imul(L0,P0)|0,v=v+Math.imul(L0,D0)|0,T=T+Math.imul(t,c0)|0,S=S+Math.imul(t,y0)|0,S=S+Math.imul(Z0,c0)|0,v=v+Math.imul(Z0,y0)|0;var IU=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(IU>>>26)|0,IU&=67108863,T=Math.imul(S0,q0),S=Math.imul(S0,x0),S=S+Math.imul(H0,q0)|0,v=Math.imul(H0,x0),T=T+Math.imul(E0,P0)|0,S=S+Math.imul(E0,D0)|0,S=S+Math.imul(K0,P0)|0,v=v+Math.imul(K0,D0)|0,T=T+Math.imul(C0,c0)|0,S=S+Math.imul(C0,y0)|0,S=S+Math.imul(L0,c0)|0,v=v+Math.imul(L0,y0)|0;var GZ=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(GZ>>>26)|0,GZ&=67108863,T=Math.imul(S0,P0),S=Math.imul(S0,D0),S=S+Math.imul(H0,P0)|0,v=Math.imul(H0,D0),T=T+Math.imul(E0,c0)|0,S=S+Math.imul(E0,y0)|0,S=S+Math.imul(K0,c0)|0,v=v+Math.imul(K0,y0)|0;var VZ=(E+T|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(VZ>>>26)|0,VZ&=67108863,T=Math.imul(S0,c0),S=Math.imul(S0,y0),S=S+Math.imul(H0,c0)|0,v=Math.imul(H0,y0);var EZ=(E+T|0)+((S&8191)<<13)|0;if(E=(v+(S>>>13)|0)+(EZ>>>26)|0,EZ&=67108863,O[0]=d0,O[1]=l0,O[2]=i0,O[3]=UU,O[4]=OU,O[5]=ZU,O[6]=XU,O[7]=QU,O[8]=YU,O[9]=$U,O[10]=AU,O[11]=JU,O[12]=GU,O[13]=VU,O[14]=EU,O[15]=IU,O[16]=GZ,O[17]=VZ,O[18]=EZ,E!==0)O[19]=E,I.length++;return I};if(!Math.imul)x=j;function f(Z,Y,I){I.negative=Y.negative^Z.negative,I.length=Z.length+Y.length;var L=0,G=0;for(var O=0;O<I.length-1;O++){var E=G;G=0;var T=L&67108863,S=Math.min(O,Y.length-1);for(var v=Math.max(0,O-Z.length+1);v<=S;v++){var g=O-v,p=Z.words[g]|0,n=Y.words[v]|0,V0=p*n,r=V0&67108863;E=E+(V0/67108864|0)|0,r=r+T|0,T=r&67108863,E=E+(r>>>26)|0,G+=E>>>26,E&=67108863}I.words[O]=T,L=E,E=G}if(L!==0)I.words[O]=L;else I.length--;return I._strip()}function w(Z,Y,I){return f(Z,Y,I)}A.prototype.mulTo=function(Z,Y){var I,L=this.length+Z.length;if(this.length===10&&Z.length===10)I=x(this,Z,Y);else if(L<63)I=j(this,Z,Y);else if(L<1024)I=f(this,Z,Y);else I=w(this,Z,Y);return I};function d(Z,Y){this.x=Z,this.y=Y}d.prototype.makeRBT=function(Z){var Y=Array(Z),I=A.prototype._countBits(Z)-1;for(var L=0;L<Z;L++)Y[L]=this.revBin(L,I,Z);return Y},d.prototype.revBin=function(Z,Y,I){if(Z===0||Z===I-1)return Z;var L=0;for(var G=0;G<Y;G++)L|=(Z&1)<<Y-G-1,Z>>=1;return L},d.prototype.permute=function(Z,Y,I,L,G,O){for(var E=0;E<O;E++)L[E]=Y[Z[E]],G[E]=I[Z[E]]},d.prototype.transform=function(Z,Y,I,L,G,O){this.permute(O,Z,Y,I,L,G);for(var E=1;E<G;E<<=1){var T=E<<1,S=Math.cos(2*Math.PI/T),v=Math.sin(2*Math.PI/T);for(var g=0;g<G;g+=T){var p=S,n=v;for(var V0=0;V0<E;V0++){var r=I[g+V0],l=L[g+V0],X0=I[g+V0+E],m=L[g+V0+E],i=p*X0-n*m;if(m=p*m+n*X0,X0=i,I[g+V0]=r+X0,L[g+V0]=l+m,I[g+V0+E]=r-X0,L[g+V0+E]=l-m,V0!==T)i=S*p-v*n,n=S*n+v*p,p=i}}}},d.prototype.guessLen13b=function(Z,Y){var I=Math.max(Y,Z)|1,L=I&1,G=0;for(I=I/2|0;I;I=I>>>1)G++;return 1<<G+1+L},d.prototype.conjugate=function(Z,Y,I){if(I<=1)return;for(var L=0;L<I/2;L++){var G=Z[L];Z[L]=Z[I-L-1],Z[I-L-1]=G,G=Y[L],Y[L]=-Y[I-L-1],Y[I-L-1]=-G}},d.prototype.normalize13b=function(Z,Y){var I=0;for(var L=0;L<Y/2;L++){var G=Math.round(Z[2*L+1]/Y)*8192+Math.round(Z[2*L]/Y)+I;if(Z[L]=G&67108863,G<67108864)I=0;else I=G/67108864|0}return Z},d.prototype.convert13b=function(Z,Y,I,L){var G=0;for(var O=0;O<Y;O++)G=G+(Z[O]|0),I[2*O]=G&8191,G=G>>>13,I[2*O+1]=G&8191,G=G>>>13;for(O=2*Y;O<L;++O)I[O]=0;C(G===0),C((G&-8192)===0)},d.prototype.stub=function(Z){var Y=Array(Z);for(var I=0;I<Z;I++)Y[I]=0;return Y},d.prototype.mulp=function(Z,Y,I){var L=2*this.guessLen13b(Z.length,Y.length),G=this.makeRBT(L),O=this.stub(L),E=Array(L),T=Array(L),S=Array(L),v=Array(L),g=Array(L),p=Array(L),n=I.words;n.length=L,this.convert13b(Z.words,Z.length,E,L),this.convert13b(Y.words,Y.length,v,L),this.transform(E,O,T,S,L,G),this.transform(v,O,g,p,L,G);for(var V0=0;V0<L;V0++){var r=T[V0]*g[V0]-S[V0]*p[V0];S[V0]=T[V0]*p[V0]+S[V0]*g[V0],T[V0]=r}return this.conjugate(T,S,L),this.transform(T,S,n,O,L,G),this.conjugate(n,O,L),this.normalize13b(n,L),I.negative=Z.negative^Y.negative,I.length=Z.length+Y.length,I._strip()},A.prototype.mul=function(Z){var Y=new A(null);return Y.words=Array(this.length+Z.length),this.mulTo(Z,Y)},A.prototype.mulf=function(Z){var Y=new A(null);return Y.words=Array(this.length+Z.length),w(this,Z,Y)},A.prototype.imul=function(Z){return this.clone().mulTo(Z,this)},A.prototype.imuln=function(Z){var Y=Z<0;if(Y)Z=-Z;C(typeof Z==="number"),C(Z<67108864);var I=0;for(var L=0;L<this.length;L++){var G=(this.words[L]|0)*Z,O=(G&67108863)+(I&67108863);I>>=26,I+=G/67108864|0,I+=O>>>26,this.words[L]=O&67108863}if(I!==0)this.words[L]=I,this.length++;return this.length=Z===0?1:this.length,Y?this.ineg():this},A.prototype.muln=function(Z){return this.clone().imuln(Z)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(Z){var Y=B(Z);if(Y.length===0)return new A(1);var I=this;for(var L=0;L<Y.length;L++,I=I.sqr())if(Y[L]!==0)break;if(++L<Y.length)for(var G=I.sqr();L<Y.length;L++,G=G.sqr()){if(Y[L]===0)continue;I=I.mul(G)}return I},A.prototype.iushln=function(Z){C(typeof Z==="number"&&Z>=0);var Y=Z%26,I=(Z-Y)/26,L=67108863>>>26-Y<<26-Y,G;if(Y!==0){var O=0;for(G=0;G<this.length;G++){var E=this.words[G]&L,T=(this.words[G]|0)-E<<Y;this.words[G]=T|O,O=E>>>26-Y}if(O)this.words[G]=O,this.length++}if(I!==0){for(G=this.length-1;G>=0;G--)this.words[G+I]=this.words[G];for(G=0;G<I;G++)this.words[G]=0;this.length+=I}return this._strip()},A.prototype.ishln=function(Z){return C(this.negative===0),this.iushln(Z)},A.prototype.iushrn=function(Z,Y,I){C(typeof Z==="number"&&Z>=0);var L;if(Y)L=(Y-Y%26)/26;else L=0;var G=Z%26,O=Math.min((Z-G)/26,this.length),E=67108863^67108863>>>G<<G,T=I;if(L-=O,L=Math.max(0,L),T){for(var S=0;S<O;S++)T.words[S]=this.words[S];T.length=O}if(O===0);else if(this.length>O){this.length-=O;for(S=0;S<this.length;S++)this.words[S]=this.words[S+O]}else this.words[0]=0,this.length=1;var v=0;for(S=this.length-1;S>=0&&(v!==0||S>=L);S--){var g=this.words[S]|0;this.words[S]=v<<26-G|g>>>G,v=g&E}if(T&&v!==0)T.words[T.length++]=v;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},A.prototype.ishrn=function(Z,Y,I){return C(this.negative===0),this.iushrn(Z,Y,I)},A.prototype.shln=function(Z){return this.clone().ishln(Z)},A.prototype.ushln=function(Z){return this.clone().iushln(Z)},A.prototype.shrn=function(Z){return this.clone().ishrn(Z)},A.prototype.ushrn=function(Z){return this.clone().iushrn(Z)},A.prototype.testn=function(Z){C(typeof Z==="number"&&Z>=0);var Y=Z%26,I=(Z-Y)/26,L=1<<Y;if(this.length<=I)return!1;var G=this.words[I];return!!(G&L)},A.prototype.imaskn=function(Z){C(typeof Z==="number"&&Z>=0);var Y=Z%26,I=(Z-Y)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=I)return this;if(Y!==0)I++;if(this.length=Math.min(I,this.length),Y!==0){var L=67108863^67108863>>>Y<<Y;this.words[this.length-1]&=L}return this._strip()},A.prototype.maskn=function(Z){return this.clone().imaskn(Z)},A.prototype.iaddn=function(Z){if(C(typeof Z==="number"),C(Z<67108864),Z<0)return this.isubn(-Z);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=Z)return this.words[0]=Z-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Z),this.negative=1,this}return this._iaddn(Z)},A.prototype._iaddn=function(Z){this.words[0]+=Z;for(var Y=0;Y<this.length&&this.words[Y]>=67108864;Y++)if(this.words[Y]-=67108864,Y===this.length-1)this.words[Y+1]=1;else this.words[Y+1]++;return this.length=Math.max(this.length,Y+1),this},A.prototype.isubn=function(Z){if(C(typeof Z==="number"),C(Z<67108864),Z<0)return this.iaddn(-Z);if(this.negative!==0)return this.negative=0,this.iaddn(Z),this.negative=1,this;if(this.words[0]-=Z,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Y=0;Y<this.length&&this.words[Y]<0;Y++)this.words[Y]+=67108864,this.words[Y+1]-=1;return this._strip()},A.prototype.addn=function(Z){return this.clone().iaddn(Z)},A.prototype.subn=function(Z){return this.clone().isubn(Z)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(Z,Y,I){var L=Z.length+I,G;this._expand(L);var O,E=0;for(G=0;G<Z.length;G++){O=(this.words[G+I]|0)+E;var T=(Z.words[G]|0)*Y;O-=T&67108863,E=(O>>26)-(T/67108864|0),this.words[G+I]=O&67108863}for(;G<this.length-I;G++)O=(this.words[G+I]|0)+E,E=O>>26,this.words[G+I]=O&67108863;if(E===0)return this._strip();C(E===-1),E=0;for(G=0;G<this.length;G++)O=-(this.words[G]|0)+E,E=O>>26,this.words[G]=O&67108863;return this.negative=1,this._strip()},A.prototype._wordDiv=function(Z,Y){var I=this.length-Z.length,L=this.clone(),G=Z,O=G.words[G.length-1]|0,E=this._countBits(O);if(I=26-E,I!==0)G=G.ushln(I),L.iushln(I),O=G.words[G.length-1]|0;var T=L.length-G.length,S;if(Y!=="mod"){S=new A(null),S.length=T+1,S.words=Array(S.length);for(var v=0;v<S.length;v++)S.words[v]=0}var g=L.clone()._ishlnsubmul(G,1,T);if(g.negative===0){if(L=g,S)S.words[T]=1}for(var p=T-1;p>=0;p--){var n=(L.words[G.length+p]|0)*67108864+(L.words[G.length+p-1]|0);n=Math.min(n/O|0,67108863),L._ishlnsubmul(G,n,p);while(L.negative!==0)if(n--,L.negative=0,L._ishlnsubmul(G,1,p),!L.isZero())L.negative^=1;if(S)S.words[p]=n}if(S)S._strip();if(L._strip(),Y!=="div"&&I!==0)L.iushrn(I);return{div:S||null,mod:L}},A.prototype.divmod=function(Z,Y,I){if(C(!Z.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var L,G,O;if(this.negative!==0&&Z.negative===0){if(O=this.neg().divmod(Z,Y),Y!=="mod")L=O.div.neg();if(Y!=="div"){if(G=O.mod.neg(),I&&G.negative!==0)G.iadd(Z)}return{div:L,mod:G}}if(this.negative===0&&Z.negative!==0){if(O=this.divmod(Z.neg(),Y),Y!=="mod")L=O.div.neg();return{div:L,mod:O.mod}}if((this.negative&Z.negative)!==0){if(O=this.neg().divmod(Z.neg(),Y),Y!=="div"){if(G=O.mod.neg(),I&&G.negative!==0)G.isub(Z)}return{div:O.div,mod:G}}if(Z.length>this.length||this.cmp(Z)<0)return{div:new A(0),mod:this};if(Z.length===1){if(Y==="div")return{div:this.divn(Z.words[0]),mod:null};if(Y==="mod")return{div:null,mod:new A(this.modrn(Z.words[0]))};return{div:this.divn(Z.words[0]),mod:new A(this.modrn(Z.words[0]))}}return this._wordDiv(Z,Y)},A.prototype.div=function(Z){return this.divmod(Z,"div",!1).div},A.prototype.mod=function(Z){return this.divmod(Z,"mod",!1).mod},A.prototype.umod=function(Z){return this.divmod(Z,"mod",!0).mod},A.prototype.divRound=function(Z){var Y=this.divmod(Z);if(Y.mod.isZero())return Y.div;var I=Y.div.negative!==0?Y.mod.isub(Z):Y.mod,L=Z.ushrn(1),G=Z.andln(1),O=I.cmp(L);if(O<0||G===1&&O===0)return Y.div;return Y.div.negative!==0?Y.div.isubn(1):Y.div.iaddn(1)},A.prototype.modrn=function(Z){var Y=Z<0;if(Y)Z=-Z;C(Z<=67108863);var I=67108864%Z,L=0;for(var G=this.length-1;G>=0;G--)L=(I*L+(this.words[G]|0))%Z;return Y?-L:L},A.prototype.modn=function(Z){return this.modrn(Z)},A.prototype.idivn=function(Z){var Y=Z<0;if(Y)Z=-Z;C(Z<=67108863);var I=0;for(var L=this.length-1;L>=0;L--){var G=(this.words[L]|0)+I*67108864;this.words[L]=G/Z|0,I=G%Z}return this._strip(),Y?this.ineg():this},A.prototype.divn=function(Z){return this.clone().idivn(Z)},A.prototype.egcd=function(Z){C(Z.negative===0),C(!Z.isZero());var Y=this,I=Z.clone();if(Y.negative!==0)Y=Y.umod(Z);else Y=Y.clone();var L=new A(1),G=new A(0),O=new A(0),E=new A(1),T=0;while(Y.isEven()&&I.isEven())Y.iushrn(1),I.iushrn(1),++T;var S=I.clone(),v=Y.clone();while(!Y.isZero()){for(var g=0,p=1;(Y.words[0]&p)===0&&g<26;++g,p<<=1);if(g>0){Y.iushrn(g);while(g-- >0){if(L.isOdd()||G.isOdd())L.iadd(S),G.isub(v);L.iushrn(1),G.iushrn(1)}}for(var n=0,V0=1;(I.words[0]&V0)===0&&n<26;++n,V0<<=1);if(n>0){I.iushrn(n);while(n-- >0){if(O.isOdd()||E.isOdd())O.iadd(S),E.isub(v);O.iushrn(1),E.iushrn(1)}}if(Y.cmp(I)>=0)Y.isub(I),L.isub(O),G.isub(E);else I.isub(Y),O.isub(L),E.isub(G)}return{a:O,b:E,gcd:I.iushln(T)}},A.prototype._invmp=function(Z){C(Z.negative===0),C(!Z.isZero());var Y=this,I=Z.clone();if(Y.negative!==0)Y=Y.umod(Z);else Y=Y.clone();var L=new A(1),G=new A(0),O=I.clone();while(Y.cmpn(1)>0&&I.cmpn(1)>0){for(var E=0,T=1;(Y.words[0]&T)===0&&E<26;++E,T<<=1);if(E>0){Y.iushrn(E);while(E-- >0){if(L.isOdd())L.iadd(O);L.iushrn(1)}}for(var S=0,v=1;(I.words[0]&v)===0&&S<26;++S,v<<=1);if(S>0){I.iushrn(S);while(S-- >0){if(G.isOdd())G.iadd(O);G.iushrn(1)}}if(Y.cmp(I)>=0)Y.isub(I),L.isub(G);else I.isub(Y),G.isub(L)}var g;if(Y.cmpn(1)===0)g=L;else g=G;if(g.cmpn(0)<0)g.iadd(Z);return g},A.prototype.gcd=function(Z){if(this.isZero())return Z.abs();if(Z.isZero())return this.abs();var Y=this.clone(),I=Z.clone();Y.negative=0,I.negative=0;for(var L=0;Y.isEven()&&I.isEven();L++)Y.iushrn(1),I.iushrn(1);do{while(Y.isEven())Y.iushrn(1);while(I.isEven())I.iushrn(1);var G=Y.cmp(I);if(G<0){var O=Y;Y=I,I=O}else if(G===0||I.cmpn(1)===0)break;Y.isub(I)}while(!0);return I.iushln(L)},A.prototype.invm=function(Z){return this.egcd(Z).a.umod(Z)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(Z){return this.words[0]&Z},A.prototype.bincn=function(Z){C(typeof Z==="number");var Y=Z%26,I=(Z-Y)/26,L=1<<Y;if(this.length<=I)return this._expand(I+1),this.words[I]|=L,this;var G=L;for(var O=I;G!==0&&O<this.length;O++){var E=this.words[O]|0;E+=G,G=E>>>26,E&=67108863,this.words[O]=E}if(G!==0)this.words[O]=G,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(Z){var Y=Z<0;if(this.negative!==0&&!Y)return-1;if(this.negative===0&&Y)return 1;this._strip();var I;if(this.length>1)I=1;else{if(Y)Z=-Z;C(Z<=67108863,"Number is too big");var L=this.words[0]|0;I=L===Z?0:L<Z?-1:1}if(this.negative!==0)return-I|0;return I},A.prototype.cmp=function(Z){if(this.negative!==0&&Z.negative===0)return-1;if(this.negative===0&&Z.negative!==0)return 1;var Y=this.ucmp(Z);if(this.negative!==0)return-Y|0;return Y},A.prototype.ucmp=function(Z){if(this.length>Z.length)return 1;if(this.length<Z.length)return-1;var Y=0;for(var I=this.length-1;I>=0;I--){var L=this.words[I]|0,G=Z.words[I]|0;if(L===G)continue;if(L<G)Y=-1;else if(L>G)Y=1;break}return Y},A.prototype.gtn=function(Z){return this.cmpn(Z)===1},A.prototype.gt=function(Z){return this.cmp(Z)===1},A.prototype.gten=function(Z){return this.cmpn(Z)>=0},A.prototype.gte=function(Z){return this.cmp(Z)>=0},A.prototype.ltn=function(Z){return this.cmpn(Z)===-1},A.prototype.lt=function(Z){return this.cmp(Z)===-1},A.prototype.lten=function(Z){return this.cmpn(Z)<=0},A.prototype.lte=function(Z){return this.cmp(Z)<=0},A.prototype.eqn=function(Z){return this.cmpn(Z)===0},A.prototype.eq=function(Z){return this.cmp(Z)===0},A.red=function(Z){return new X(Z)},A.prototype.toRed=function(Z){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),Z.convertTo(this)._forceRed(Z)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(Z){return this.red=Z,this},A.prototype.forceRed=function(Z){return C(!this.red,"Already a number in reduction context"),this._forceRed(Z)},A.prototype.redAdd=function(Z){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,Z)},A.prototype.redIAdd=function(Z){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Z)},A.prototype.redSub=function(Z){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,Z)},A.prototype.redISub=function(Z){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,Z)},A.prototype.redShl=function(Z){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,Z)},A.prototype.redMul=function(Z){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.mul(this,Z)},A.prototype.redIMul=function(Z){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.imul(this,Z)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(Z){return C(this.red&&!Z.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Z)};var Y0={k256:null,p224:null,p192:null,p25519:null};function J0(Z,Y){this.name=Z,this.p=new A(Y,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}J0.prototype._tmp=function(){var Z=new A(null);return Z.words=Array(Math.ceil(this.n/13)),Z},J0.prototype.ireduce=function(Z){var Y=Z,I;do this.split(Y,this.tmp),Y=this.imulK(Y),Y=Y.iadd(this.tmp),I=Y.bitLength();while(I>this.n);var L=I<this.n?-1:Y.ucmp(this.p);if(L===0)Y.words[0]=0,Y.length=1;else if(L>0)Y.isub(this.p);else if(Y.strip!==void 0)Y.strip();else Y._strip();return Y},J0.prototype.split=function(Z,Y){Z.iushrn(this.n,0,Y)},J0.prototype.imulK=function(Z){return Z.imul(this.k)};function $0(){J0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D($0,J0),$0.prototype.split=function(Z,Y){var I=4194303,L=Math.min(Z.length,9);for(var G=0;G<L;G++)Y.words[G]=Z.words[G];if(Y.length=L,Z.length<=9){Z.words[0]=0,Z.length=1;return}var O=Z.words[9];Y.words[Y.length++]=O&I;for(G=10;G<Z.length;G++){var E=Z.words[G]|0;Z.words[G-10]=(E&I)<<4|O>>>22,O=E}if(O>>>=22,Z.words[G-10]=O,O===0&&Z.length>10)Z.length-=10;else Z.length-=9},$0.prototype.imulK=function(Z){Z.words[Z.length]=0,Z.words[Z.length+1]=0,Z.length+=2;var Y=0;for(var I=0;I<Z.length;I++){var L=Z.words[I]|0;Y+=L*977,Z.words[I]=Y&67108863,Y=L*64+(Y/67108864|0)}if(Z.words[Z.length-1]===0){if(Z.length--,Z.words[Z.length-1]===0)Z.length--}return Z};function u(){J0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(u,J0);function O0(){J0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(O0,J0);function U(){J0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D(U,J0),U.prototype.imulK=function(Z){var Y=0;for(var I=0;I<Z.length;I++){var L=(Z.words[I]|0)*19+Y,G=L&67108863;L>>>=26,Z.words[I]=G,Y=L}if(Y!==0)Z.words[Z.length++]=Y;return Z},A._prime=function(Z){if(Y0[Z])return Y0[Z];var Y;if(Z==="k256")Y=new $0;else if(Z==="p224")Y=new u;else if(Z==="p192")Y=new O0;else if(Z==="p25519")Y=new U;else throw Error("Unknown prime "+Z);return Y0[Z]=Y,Y};function X(Z){if(typeof Z==="string"){var Y=A._prime(Z);this.m=Y.p,this.prime=Y}else C(Z.gtn(1),"modulus must be greater than 1"),this.m=Z,this.prime=null}X.prototype._verify1=function(Z){C(Z.negative===0,"red works only with positives"),C(Z.red,"red works only with red numbers")},X.prototype._verify2=function(Z,Y){C((Z.negative|Y.negative)===0,"red works only with positives"),C(Z.red&&Z.red===Y.red,"red works only with red numbers")},X.prototype.imod=function(Z){if(this.prime)return this.prime.ireduce(Z)._forceRed(this);return K(Z,Z.umod(this.m)._forceRed(this)),Z},X.prototype.neg=function(Z){if(Z.isZero())return Z.clone();return this.m.sub(Z)._forceRed(this)},X.prototype.add=function(Z,Y){this._verify2(Z,Y);var I=Z.add(Y);if(I.cmp(this.m)>=0)I.isub(this.m);return I._forceRed(this)},X.prototype.iadd=function(Z,Y){this._verify2(Z,Y);var I=Z.iadd(Y);if(I.cmp(this.m)>=0)I.isub(this.m);return I},X.prototype.sub=function(Z,Y){this._verify2(Z,Y);var I=Z.sub(Y);if(I.cmpn(0)<0)I.iadd(this.m);return I._forceRed(this)},X.prototype.isub=function(Z,Y){this._verify2(Z,Y);var I=Z.isub(Y);if(I.cmpn(0)<0)I.iadd(this.m);return I},X.prototype.shl=function(Z,Y){return this._verify1(Z),this.imod(Z.ushln(Y))},X.prototype.imul=function(Z,Y){return this._verify2(Z,Y),this.imod(Z.imul(Y))},X.prototype.mul=function(Z,Y){return this._verify2(Z,Y),this.imod(Z.mul(Y))},X.prototype.isqr=function(Z){return this.imul(Z,Z.clone())},X.prototype.sqr=function(Z){return this.mul(Z,Z)},X.prototype.sqrt=function(Z){if(Z.isZero())return Z.clone();var Y=this.m.andln(3);if(C(Y%2===1),Y===3){var I=this.m.add(new A(1)).iushrn(2);return this.pow(Z,I)}var L=this.m.subn(1),G=0;while(!L.isZero()&&L.andln(1)===0)G++,L.iushrn(1);C(!L.isZero());var O=new A(1).toRed(this),E=O.redNeg(),T=this.m.subn(1).iushrn(1),S=this.m.bitLength();S=new A(2*S*S).toRed(this);while(this.pow(S,T).cmp(E)!==0)S.redIAdd(E);var v=this.pow(S,L),g=this.pow(Z,L.addn(1).iushrn(1)),p=this.pow(Z,L),n=G;while(p.cmp(O)!==0){var V0=p;for(var r=0;V0.cmp(O)!==0;r++)V0=V0.redSqr();C(r<n);var l=this.pow(v,new A(1).iushln(n-r-1));g=g.redMul(l),v=l.redSqr(),p=p.redMul(v),n=r}return g},X.prototype.invm=function(Z){var Y=Z._invmp(this.m);if(Y.negative!==0)return Y.negative=0,this.imod(Y).redNeg();else return this.imod(Y)},X.prototype.pow=function(Z,Y){if(Y.isZero())return new A(1).toRed(this);if(Y.cmpn(1)===0)return Z.clone();var I=4,L=Array(1<<I);L[0]=new A(1).toRed(this),L[1]=Z;for(var G=2;G<L.length;G++)L[G]=this.mul(L[G-1],Z);var O=L[0],E=0,T=0,S=Y.bitLength()%26;if(S===0)S=26;for(G=Y.length-1;G>=0;G--){var v=Y.words[G];for(var g=S-1;g>=0;g--){var p=v>>g&1;if(O!==L[0])O=this.sqr(O);if(p===0&&E===0){T=0;continue}if(E<<=1,E|=p,T++,T!==I&&(G!==0||g!==0))continue;O=this.mul(O,L[E]),T=0,E=0}S=26}return O},X.prototype.convertTo=function(Z){var Y=Z.umod(this.m);return Y===Z?Y.clone():Y},X.prototype.convertFrom=function(Z){var Y=Z.clone();return Y.red=null,Y},A.mont=function(Z){return new J(Z)};function J(Z){if(X.call(this,Z),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(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)}D(J,X),J.prototype.convertTo=function(Z){return this.imod(Z.ushln(this.shift))},J.prototype.convertFrom=function(Z){var Y=this.imod(Z.mul(this.rinv));return Y.red=null,Y},J.prototype.imul=function(Z,Y){if(Z.isZero()||Y.isZero())return Z.words[0]=0,Z.length=1,Z;var I=Z.imul(Y),L=I.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=I.isub(L).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},J.prototype.mul=function(Z,Y){if(Z.isZero()||Y.isZero())return new A(0)._forceRed(this);var I=Z.mul(Y),L=I.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=I.isub(L).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},J.prototype.invm=function(Z){var Y=this.imod(Z._invmp(this.m).mul(this.r2));return Y._forceRed(this)}})(typeof $>"u"||$,Q)}),RY=A0((Q,$)=>{var V=HG(),W=UZ(),C=MU().Buffer;function D(M){var F=M.modulus.byteLength(),R;do R=new V(W(F));while(R.cmp(M.modulus)>=0||!R.umod(M.prime1)||!R.umod(M.prime2));return R}function A(M){var F=D(M),R=F.toRed(V.mont(M.modulus)).redPow(new V(M.publicExponent)).fromRed();return{blinder:R,unblinder:F.invm(M.modulus)}}function z(M,F){var R=A(F),K=F.modulus.byteLength(),H=new V(M).mul(R.blinder).umod(F.modulus),q=H.toRed(V.mont(F.prime1)),P=H.toRed(V.mont(F.prime2)),_=F.coefficient,k=F.prime1,B=F.prime2,j=q.redPow(F.exponent1).fromRed(),x=P.redPow(F.exponent2).fromRed(),f=j.isub(x).imul(_).umod(k).imul(B);return x.iadd(f).imul(R.unblinder).umod(F.modulus).toArrayLike(C,"be",K)}z.getr=D,$.exports=z}),SG=A0((Q,$)=>{var V=HY(),W=UZ(),C=OZ(),D=SY(),A=DY(),z=GX(),M=FY(),F=RY(),R=MU().Buffer;$.exports=function(P,_,k){var B;if(P.padding)B=P.padding;else if(k)B=1;else B=4;var j=V(P),x;if(B===4)x=K(j,_);else if(B===1)x=H(j,_,k);else if(B===3){if(x=new z(_),x.cmp(j.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(k)return F(x,j);else return M(x,j)};function K(P,_){var k=P.modulus.byteLength(),B=_.length,j=C("sha1").update(R.alloc(0)).digest(),x=j.length,f=2*x;if(B>k-f-2)throw Error("message too long");var w=R.alloc(k-B-f-2),d=k-x-1,Y0=W(x),J0=A(R.concat([j,w,R.alloc(1,1),_],d),D(Y0,d)),$0=A(Y0,D(J0,x));return new z(R.concat([R.alloc(1),$0,J0],k))}function H(P,_,k){var B=_.length,j=P.modulus.byteLength();if(B>j-11)throw Error("message too long");var x;if(k)x=R.alloc(j-B-3,255);else x=q(j-B-3);return new z(R.concat([R.from([0,k?1:2]),x,R.alloc(1),_],j))}function q(P){var _=R.allocUnsafe(P),k=0,B=W(P*2),j=0,x;while(k<P){if(j===B.length)B=W(P*2),j=0;if(x=B[j++],x)_[k++]=x}return _}}),DG=A0((Q,$)=>{var V=HY(),W=SY(),C=DY(),D=GX(),A=RY(),z=OZ(),M=FY(),F=MU().Buffer;$.exports=function(q,P,_){var k;if(q.padding)k=q.padding;else if(_)k=1;else k=4;var B=V(q),j=B.modulus.byteLength();if(P.length>j||new D(P).cmp(B.modulus)>=0)throw Error("decryption error");var x;if(_)x=M(new D(P),B);else x=A(P,B);var f=F.alloc(j-x.length);if(x=F.concat([f,x],j),k===4)return R(B,x);else if(k===1)return K(B,x,_);else if(k===3)return x;else throw Error("unknown padding")};function R(q,P){var _=q.modulus.byteLength(),k=z("sha1").update(F.alloc(0)).digest(),B=k.length;if(P[0]!==0)throw Error("decryption error");var j=P.slice(1,B+1),x=P.slice(B+1),f=C(j,W(x,B)),w=C(x,W(f,_-B-1));if(H(k,w.slice(0,B)))throw Error("decryption error");var d=B;while(w[d]===0)d++;if(w[d++]!==1)throw Error("decryption error");return w.slice(d)}function K(q,P,_){var k=P.slice(0,2),B=2,j=0;while(P[B++]!==0)if(B>=P.length){j++;break}var x=P.slice(2,B-1);if(k.toString("hex")!=="0002"&&!_||k.toString("hex")!=="0001"&&_)j++;if(x.length<8)j++;if(j)throw Error("decryption error");return P.slice(B)}function H(q,P){q=F.from(q),P=F.from(P);var _=0,k=q.length;if(q.length!==P.length)_++,k=Math.min(q.length,P.length);var B=-1;while(++B<k)_+=q[B]^P[B];return _}}),UX=A0((Q)=>{Q.publicEncrypt=SG(),Q.privateDecrypt=DG(),Q.privateEncrypt=function($,V){return Q.publicEncrypt($,V,!0)},Q.publicDecrypt=function($,V){return Q.privateDecrypt($,V,!0)}}),FG=A0((Q)=>{var $=(jU(),h0(vU));if(typeof $.publicEncrypt!=="function")$=UX();if(Q.publicEncrypt=$.publicEncrypt,Q.privateDecrypt=$.privateDecrypt,typeof $.privateEncrypt!=="function")Q.privateEncrypt=UX().privateEncrypt;else Q.privateEncrypt=$.privateEncrypt;if(typeof $.publicDecrypt!=="function")Q.publicDecrypt=UX().publicDecrypt;else Q.publicDecrypt=$.publicDecrypt}),RG=A0((Q)=>{var $=MU(),V=UZ(),W=$.Buffer,C=$.kMaxLength,D=globalThis.crypto||globalThis.msCrypto,A=Math.pow(2,32)-1;function z(H,q){if(typeof H!=="number"||H!==H)throw TypeError("offset must be a number");if(H>A||H<0)throw TypeError("offset must be a uint32");if(H>C||H>q)throw RangeError("offset out of range")}function M(H,q,P){if(typeof H!=="number"||H!==H)throw TypeError("size must be a number");if(H>A||H<0)throw TypeError("size must be a uint32");if(H+q>P||H>C)throw RangeError("buffer too small")}D&&D.getRandomValues,Q.randomFill=F,Q.randomFillSync=K;function F(H,q,P,_){if(!W.isBuffer(H)&&!(H instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof q==="function")_=q,q=0,P=H.length;else if(typeof P==="function")_=P,P=H.length-q;else if(typeof _!=="function")throw TypeError('"cb" argument must be a function');return z(q,H.length),M(P,q,H.length),R(H,q,P,_)}function R(H,q,P,_){if(!1)var k,B;if(_){V(P,function(x,f){if(x)return _(x);f.copy(H,q),_(null,H)});return}var j=V(P);return j.copy(H,q),H}function K(H,q,P){if(typeof q>"u")q=0;if(!W.isBuffer(H)&&!(H instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(z(q,H.length),P===void 0)P=H.length-q;return M(P,q,H.length),R(H,q,P)}}),TG=A0((Q,$)=>{var V=(jU(),h0(vU));if(typeof V.randomFill==="function"&&typeof V.randomFillSync==="function")Q.randomFill=V.randomFill,Q.randomFillSync=V.randomFillSync;else $.exports=RG()}),zG=A0((Q)=>{Q.randomBytes=Q.rng=Q.pseudoRandomBytes=Q.prng=UZ(),Q.createHash=Q.Hash=OZ(),Q.createHmac=Q.Hmac=sQ();var $=mA(),V=Object.keys($),W=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(V);Q.getHashes=function(){return W};var C=$Y();Q.pbkdf2=C.pbkdf2,Q.pbkdf2Sync=C.pbkdf2Sync;var D=vJ();Q.Cipher=D.Cipher,Q.createCipher=D.createCipher,Q.Cipheriv=D.Cipheriv,Q.createCipheriv=D.createCipheriv,Q.Decipher=D.Decipher,Q.createDecipher=D.createDecipher,Q.Decipheriv=D.Decipheriv,Q.createDecipheriv=D.createDecipheriv,Q.getCiphers=D.getCiphers,Q.listCiphers=D.listCiphers;var A=jJ();Q.DiffieHellmanGroup=A.DiffieHellmanGroup,Q.createDiffieHellmanGroup=A.createDiffieHellmanGroup,Q.getDiffieHellman=A.getDiffieHellman,Q.createDiffieHellman=A.createDiffieHellman,Q.DiffieHellman=A.DiffieHellman;var z=BJ();Q.createSign=z.createSign,Q.Sign=z.Sign,Q.createVerify=z.createVerify,Q.Verify=z.Verify,Q.createECDH=UG();var M=FG();Q.publicEncrypt=M.publicEncrypt,Q.privateEncrypt=M.privateEncrypt,Q.publicDecrypt=M.publicDecrypt,Q.privateDecrypt=M.privateDecrypt;var F=TG();Q.randomFill=F.randomFill,Q.randomFillSync=F.randomFillSync,Q.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
14
+ })`)}catch(T){J=function(M){this._initNamed(M)}}return V(J,D),J.prototype._initNamed=function(T){D.call(this,T)},new J(this)},C.prototype._getDecoder=function(D){if(D=D||"der",!this.decoders.hasOwnProperty(D))this.decoders[D]=this._createNamed(Y.decoders[D]);return this.decoders[D]},C.prototype.decode=function(D,J,T){return this._getDecoder(J).decode(D,T)},C.prototype._getEncoder=function(D){if(D=D||"der",!this.encoders.hasOwnProperty(D))this.encoders[D]=this._createNamed(Y.encoders[D]);return this.encoders[D]},C.prototype.encode=function(D,J,T){return this._getEncoder(J).encode(D,T)}}),VG=J0((Q)=>{var Y=xU();function V(C){this._reporterState={obj:null,path:[],options:C||{},errors:[]}}Q.Reporter=V,V.prototype.isError=function(C){return C instanceof H},V.prototype.save=function(){var C=this._reporterState;return{obj:C.obj,pathLen:C.path.length}},V.prototype.restore=function(C){var D=this._reporterState;D.obj=C.obj,D.path=D.path.slice(0,C.pathLen)},V.prototype.enterKey=function(C){return this._reporterState.path.push(C)},V.prototype.exitKey=function(C){var D=this._reporterState;D.path=D.path.slice(0,C-1)},V.prototype.leaveKey=function(C,D,J){var T=this._reporterState;if(this.exitKey(C),T.obj!==null)T.obj[D]=J},V.prototype.path=function(){return this._reporterState.path.join("/")},V.prototype.enterObject=function(){var C=this._reporterState,D=C.obj;return C.obj={},D},V.prototype.leaveObject=function(C){var D=this._reporterState,J=D.obj;return D.obj=C,J},V.prototype.error=function(C){var D,J=this._reporterState,T=C instanceof H;if(T)D=C;else D=new H(J.path.map(function(M){return"["+JSON.stringify(M)+"]"}).join(""),C.message||C,C.stack);if(!J.options.partial)throw D;if(!T)J.errors.push(D);return D},V.prototype.wrapResult=function(C){var D=this._reporterState;if(!D.options.partial)return C;return{result:this.isError(C)?null:C,errors:D.errors}};function H(C,D){this.path=C,this.rethrow(D)}Y(H,Error),H.prototype.rethrow=function(C){if(this.message=C+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,H);if(!this.stack)try{throw Error(this.message)}catch(D){this.stack=D.stack}return this}}),tQ=J0((Q)=>{var Y=xU(),V=_O().Reporter,H=(WU(),h0(HU)).Buffer;function C(J,T){if(V.call(this,T),!H.isBuffer(J)){this.error("Input not Buffer");return}this.base=J,this.offset=0,this.length=J.length}Y(C,V),Q.DecoderBuffer=C,C.prototype.save=function(){return{offset:this.offset,reporter:V.prototype.save.call(this)}},C.prototype.restore=function(J){var T=new C(this.base);return T.offset=J.offset,T.length=this.offset,this.offset=J.offset,V.prototype.restore.call(this,J.reporter),T},C.prototype.isEmpty=function(){return this.offset===this.length},C.prototype.readUInt8=function(J){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(J||"DecoderBuffer overrun")},C.prototype.skip=function(J,T){if(!(this.offset+J<=this.length))return this.error(T||"DecoderBuffer overrun");var M=new C(this.base);return M._reporterState=this._reporterState,M.offset=this.offset,M.length=this.offset+J,this.offset+=J,M},C.prototype.raw=function(J){return this.base.slice(J?J.offset:this.offset,this.length)};function D(J,T){if(Array.isArray(J))this.length=0,this.value=J.map(function(M){if(!(M instanceof D))M=new D(M,T);return this.length+=M.length,M},this);else if(typeof J==="number"){if(!(0<=J&&J<=255))return T.error("non-byte EncoderBuffer value");this.value=J,this.length=1}else if(typeof J==="string")this.value=J,this.length=H.byteLength(J);else if(H.isBuffer(J))this.value=J,this.length=J.length;else return T.error("Unsupported type: "+typeof J)}Q.EncoderBuffer=D,D.prototype.join=function(J,T){if(!J)J=new H(this.length);if(!T)T=0;if(this.length===0)return J;if(Array.isArray(this.value))this.value.forEach(function(M){M.join(J,T),T+=M.length});else{if(typeof this.value==="number")J[T]=this.value;else if(typeof this.value==="string")J.write(this.value,T);else if(H.isBuffer(this.value))this.value.copy(J,T);T+=this.length}return J}}),EG=J0((Q,Y)=>{var V=_O().Reporter,H=_O().EncoderBuffer,C=_O().DecoderBuffer,D=OO(),J=["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"],T=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(J),M=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function F(K,W){var q={};if(this._baseState=q,q.enc=K,q.parent=W||null,q.children=null,q.tag=null,q.args=null,q.reverseArgs=null,q.choice=null,q.optional=!1,q.any=!1,q.obj=!1,q.use=null,q.useDecoder=null,q.key=null,q.default=null,q.explicit=null,q.implicit=null,q.contains=null,!q.parent)q.children=[],this._wrap()}Y.exports=F;var R=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];F.prototype.clone=function(){var K=this._baseState,W={};R.forEach(function(P){W[P]=K[P]});var q=new this.constructor(W.parent);return q._baseState=W,q},F.prototype._wrap=function(){var K=this._baseState;T.forEach(function(W){this[W]=function(){var q=new this.constructor(this);return K.children.push(q),q[W].apply(q,arguments)}},this)},F.prototype._init=function(K){var W=this._baseState;D(W.parent===null),K.call(this),W.children=W.children.filter(function(q){return q._baseState.parent===this},this),D.equal(W.children.length,1,"Root node can have only one child")},F.prototype._useArgs=function(K){var W=this._baseState,q=K.filter(function(P){return P instanceof this.constructor},this);if(K=K.filter(function(P){return!(P instanceof this.constructor)},this),q.length!==0)D(W.children===null),W.children=q,q.forEach(function(P){P._baseState.parent=this},this);if(K.length!==0)D(W.args===null),W.args=K,W.reverseArgs=K.map(function(P){if(typeof P!=="object"||P.constructor!==Object)return P;var _={};return Object.keys(P).forEach(function(k){if(k==(k|0))k|=0;var B=P[k];_[B]=k}),_})},M.forEach(function(K){F.prototype[K]=function(){var W=this._baseState;throw Error(K+" not implemented for encoding: "+W.enc)}}),J.forEach(function(K){F.prototype[K]=function(){var W=this._baseState,q=Array.prototype.slice.call(arguments);return D(W.tag===null),W.tag=K,this._useArgs(q),this}}),F.prototype.use=function(K){D(K);var W=this._baseState;return D(W.use===null),W.use=K,this},F.prototype.optional=function(){var K=this._baseState;return K.optional=!0,this},F.prototype.def=function(K){var W=this._baseState;return D(W.default===null),W.default=K,W.optional=!0,this},F.prototype.explicit=function(K){var W=this._baseState;return D(W.explicit===null&&W.implicit===null),W.explicit=K,this},F.prototype.implicit=function(K){var W=this._baseState;return D(W.explicit===null&&W.implicit===null),W.implicit=K,this},F.prototype.obj=function(){var K=this._baseState,W=Array.prototype.slice.call(arguments);if(K.obj=!0,W.length!==0)this._useArgs(W);return this},F.prototype.key=function(K){var W=this._baseState;return D(W.key===null),W.key=K,this},F.prototype.any=function(){var K=this._baseState;return K.any=!0,this},F.prototype.choice=function(K){var W=this._baseState;return D(W.choice===null),W.choice=K,this._useArgs(Object.keys(K).map(function(q){return K[q]})),this},F.prototype.contains=function(K){var W=this._baseState;return D(W.use===null),W.contains=K,this},F.prototype._decode=function(K,W){var q=this._baseState;if(q.parent===null)return K.wrapResult(q.children[0]._decode(K,W));var P=q.default,_=!0,k=null;if(q.key!==null)k=K.enterKey(q.key);if(q.optional){var B=null;if(q.explicit!==null)B=q.explicit;else if(q.implicit!==null)B=q.implicit;else if(q.tag!==null)B=q.tag;if(B===null&&!q.any){var j=K.save();try{if(q.choice===null)this._decodeGeneric(q.tag,K,W);else this._decodeChoice(K,W);_=!0}catch(A0){_=!1}K.restore(j)}else if(_=this._peekTag(K,B,q.any),K.isError(_))return _}var x;if(q.obj&&_)x=K.enterObject();if(_){if(q.explicit!==null){var f=this._decodeTag(K,q.explicit);if(K.isError(f))return f;K=f}var w=K.offset;if(q.use===null&&q.choice===null){if(q.any)var j=K.save();var d=this._decodeTag(K,q.implicit!==null?q.implicit:q.tag,q.any);if(K.isError(d))return d;if(q.any)P=K.raw(j);else K=d}if(W&&W.track&&q.tag!==null)W.track(K.path(),w,K.length,"tagged");if(W&&W.track&&q.tag!==null)W.track(K.path(),K.offset,K.length,"content");if(q.any)P=P;else if(q.choice===null)P=this._decodeGeneric(q.tag,K,W);else P=this._decodeChoice(K,W);if(K.isError(P))return P;if(!q.any&&q.choice===null&&q.children!==null)q.children.forEach(function(A0){A0._decode(K,W)});if(q.contains&&(q.tag==="octstr"||q.tag==="bitstr")){var Y0=new C(P);P=this._getUse(q.contains,K._reporterState.obj)._decode(Y0,W)}}if(q.obj&&_)P=K.leaveObject(x);if(q.key!==null&&(P!==null||_===!0))K.leaveKey(k,q.key,P);else if(k!==null)K.exitKey(k);return P},F.prototype._decodeGeneric=function(K,W,q){var P=this._baseState;if(K==="seq"||K==="set")return null;if(K==="seqof"||K==="setof")return this._decodeList(W,K,P.args[0],q);else if(/str$/.test(K))return this._decodeStr(W,K,q);else if(K==="objid"&&P.args)return this._decodeObjid(W,P.args[0],P.args[1],q);else if(K==="objid")return this._decodeObjid(W,null,null,q);else if(K==="gentime"||K==="utctime")return this._decodeTime(W,K,q);else if(K==="null_")return this._decodeNull(W,q);else if(K==="bool")return this._decodeBool(W,q);else if(K==="objDesc")return this._decodeStr(W,K,q);else if(K==="int"||K==="enum")return this._decodeInt(W,P.args&&P.args[0],q);if(P.use!==null)return this._getUse(P.use,W._reporterState.obj)._decode(W,q);else return W.error("unknown tag: "+K)},F.prototype._getUse=function(K,W){var q=this._baseState;if(q.useDecoder=this._use(K,W),D(q.useDecoder._baseState.parent===null),q.useDecoder=q.useDecoder._baseState.children[0],q.implicit!==q.useDecoder._baseState.implicit)q.useDecoder=q.useDecoder.clone(),q.useDecoder._baseState.implicit=q.implicit;return q.useDecoder},F.prototype._decodeChoice=function(K,W){var q=this._baseState,P=null,_=!1;if(Object.keys(q.choice).some(function(k){var B=K.save(),j=q.choice[k];try{var x=j._decode(K,W);if(K.isError(x))return!1;P={type:k,value:x},_=!0}catch(f){return K.restore(B),!1}return!0},this),!_)return K.error("Choice not matched");return P},F.prototype._createEncoderBuffer=function(K){return new H(K,this.reporter)},F.prototype._encode=function(K,W,q){var P=this._baseState;if(P.default!==null&&P.default===K)return;var _=this._encodeValue(K,W,q);if(_===void 0)return;if(this._skipDefault(_,W,q))return;return _},F.prototype._encodeValue=function(K,W,q){var P=this._baseState;if(P.parent===null)return P.children[0]._encode(K,W||new V);var j=null;if(this.reporter=W,P.optional&&K===void 0)if(P.default!==null)K=P.default;else return;var _=null,k=!1;if(P.any)j=this._createEncoderBuffer(K);else if(P.choice)j=this._encodeChoice(K,W);else if(P.contains)_=this._getUse(P.contains,q)._encode(K,W),k=!0;else if(P.children)_=P.children.map(function(w){if(w._baseState.tag==="null_")return w._encode(null,W,K);if(w._baseState.key===null)return W.error("Child should have a key");var d=W.enterKey(w._baseState.key);if(typeof K!=="object")return W.error("Child expected, but input is not object");var Y0=w._encode(K[w._baseState.key],W,K);return W.leaveKey(d),Y0},this).filter(function(w){return w}),_=this._createEncoderBuffer(_);else if(P.tag==="seqof"||P.tag==="setof"){if(!(P.args&&P.args.length===1))return W.error("Too many args for : "+P.tag);if(!Array.isArray(K))return W.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,_=this._createEncoderBuffer(K.map(function(w){var d=this._baseState;return this._getUse(d.args[0],K)._encode(w,W)},B))}else if(P.use!==null)j=this._getUse(P.use,q)._encode(K,W);else _=this._encodePrimitive(P.tag,K),k=!0;var j;if(!P.any&&P.choice===null){var x=P.implicit!==null?P.implicit:P.tag,f=P.implicit===null?"universal":"context";if(x===null){if(P.use===null)W.error("Tag could be omitted only for .use()")}else if(P.use===null)j=this._encodeComposite(x,k,f,_)}if(P.explicit!==null)j=this._encodeComposite(P.explicit,!1,"context",j);return j},F.prototype._encodeChoice=function(K,W){var q=this._baseState,P=q.choice[K.type];if(!P)D(!1,K.type+" not found in "+JSON.stringify(Object.keys(q.choice)));return P._encode(K.value,W)},F.prototype._encodePrimitive=function(K,W){var q=this._baseState;if(/str$/.test(K))return this._encodeStr(W,K);else if(K==="objid"&&q.args)return this._encodeObjid(W,q.reverseArgs[0],q.args[1]);else if(K==="objid")return this._encodeObjid(W,null,null);else if(K==="gentime"||K==="utctime")return this._encodeTime(W,K);else if(K==="null_")return this._encodeNull();else if(K==="int"||K==="enum")return this._encodeInt(W,q.args&&q.reverseArgs[0]);else if(K==="bool")return this._encodeBool(W);else if(K==="objDesc")return this._encodeStr(W,K);else throw Error("Unsupported tag: "+K)},F.prototype._isNumstr=function(K){return/^[0-9 ]*$/.test(K)},F.prototype._isPrintstr=function(K){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(K)}}),_O=J0((Q)=>{var Y=Q;Y.Reporter=VG().Reporter,Y.DecoderBuffer=tQ().DecoderBuffer,Y.EncoderBuffer=tQ().EncoderBuffer,Y.Node=EG()}),IG=J0((Q)=>{var Y=LY();Q.tagClass={0:"universal",1:"application",2:"context",3:"private"},Q.tagClassByName=Y._reverse(Q.tagClass),Q.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"},Q.tagByName=Y._reverse(Q.tag)}),LY=J0((Q)=>{var Y=Q;Y._reverse=function(V){var H={};return Object.keys(V).forEach(function(C){if((C|0)==C)C=C|0;var D=V[C];H[D]=C}),H},Y.der=IG()}),KY=J0((Q,Y)=>{var V=xU(),H=NO(),C=H.base,D=H.bignum,J=H.constants.der;function T(K){this.enc="der",this.name=K.name,this.entity=K,this.tree=new M,this.tree._init(K.body)}Y.exports=T,T.prototype.decode=function(K,W){if(!(K instanceof C.DecoderBuffer))K=new C.DecoderBuffer(K,W);return this.tree._decode(K,W)};function M(K){C.Node.call(this,"der",K)}V(M,C.Node),M.prototype._peekTag=function(K,W,q){if(K.isEmpty())return!1;var P=K.save(),_=F(K,'Failed to peek tag: "'+W+'"');if(K.isError(_))return _;return K.restore(P),_.tag===W||_.tagStr===W||_.tagStr+"of"===W||q},M.prototype._decodeTag=function(K,W,q){var P=F(K,'Failed to decode tag of "'+W+'"');if(K.isError(P))return P;var _=R(K,P.primitive,'Failed to get length of "'+W+'"');if(K.isError(_))return _;if(!q&&P.tag!==W&&P.tagStr!==W&&P.tagStr+"of"!==W)return K.error('Failed to match tag: "'+W+'"');if(P.primitive||_!==null)return K.skip(_,'Failed to match body of: "'+W+'"');var k=K.save(),B=this._skipUntilEnd(K,'Failed to skip indefinite length body: "'+this.tag+'"');if(K.isError(B))return B;return _=K.offset-k.offset,K.restore(k),K.skip(_,'Failed to match body of: "'+W+'"')},M.prototype._skipUntilEnd=function(K,W){while(!0){var q=F(K,W);if(K.isError(q))return q;var P=R(K,q.primitive,W);if(K.isError(P))return P;var _;if(q.primitive||P!==null)_=K.skip(P);else _=this._skipUntilEnd(K,W);if(K.isError(_))return _;if(q.tagStr==="end")break}},M.prototype._decodeList=function(K,W,q,P){var _=[];while(!K.isEmpty()){var k=this._peekTag(K,"end");if(K.isError(k))return k;var B=q.decode(K,"der",P);if(K.isError(B)&&k)break;_.push(B)}return _},M.prototype._decodeStr=function(K,W){if(W==="bitstr"){var q=K.readUInt8();if(K.isError(q))return q;return{unused:q,data:K.raw()}}else if(W==="bmpstr"){var P=K.raw();if(P.length%2===1)return K.error("Decoding of string type: bmpstr length mismatch");var _="";for(var k=0;k<P.length/2;k++)_+=String.fromCharCode(P.readUInt16BE(k*2));return _}else if(W==="numstr"){var B=K.raw().toString("ascii");if(!this._isNumstr(B))return K.error("Decoding of string type: numstr unsupported characters");return B}else if(W==="octstr")return K.raw();else if(W==="objDesc")return K.raw();else if(W==="printstr"){var j=K.raw().toString("ascii");if(!this._isPrintstr(j))return K.error("Decoding of string type: printstr unsupported characters");return j}else if(/str$/.test(W))return K.raw().toString();else return K.error("Decoding of string type: "+W+" unsupported")},M.prototype._decodeObjid=function(K,W,q){var P,_=[],k=0;while(!K.isEmpty()){var B=K.readUInt8();if(k<<=7,k|=B&127,(B&128)===0)_.push(k),k=0}if(B&128)_.push(k);var j=_[0]/40|0,x=_[0]%40;if(q)P=_;else P=[j,x].concat(_.slice(1));if(W){var f=W[P.join(" ")];if(f===void 0)f=W[P.join(".")];if(f!==void 0)P=f}return P},M.prototype._decodeTime=function(K,W){var q=K.raw().toString();if(W==="gentime")var P=q.slice(0,4)|0,_=q.slice(4,6)|0,k=q.slice(6,8)|0,B=q.slice(8,10)|0,j=q.slice(10,12)|0,x=q.slice(12,14)|0;else if(W==="utctime"){var P=q.slice(0,2)|0,_=q.slice(2,4)|0,k=q.slice(4,6)|0,B=q.slice(6,8)|0,j=q.slice(8,10)|0,x=q.slice(10,12)|0;if(P<70)P=2000+P;else P=1900+P}else return K.error("Decoding "+W+" time is not supported yet");return Date.UTC(P,_-1,k,B,j,x,0)},M.prototype._decodeNull=function(K){return null},M.prototype._decodeBool=function(K){var W=K.readUInt8();if(K.isError(W))return W;else return W!==0},M.prototype._decodeInt=function(K,W){var q=K.raw(),P=new D(q);if(W)P=W[P.toString(10)]||P;return P},M.prototype._use=function(K,W){if(typeof K==="function")K=K(W);return K._getDecoder("der").tree};function F(K,W){var q=K.readUInt8(W);if(K.isError(q))return q;var P=J.tagClass[q>>6],_=(q&32)===0;if((q&31)===31){var k=q;q=0;while((k&128)===128){if(k=K.readUInt8(W),K.isError(k))return k;q<<=7,q|=k&127}}else q&=31;var B=J.tag[q];return{cls:P,primitive:_,tag:q,tagStr:B}}function R(K,W,q){var P=K.readUInt8(q);if(K.isError(P))return P;if(!W&&P===128)return null;if((P&128)===0)return P;var _=P&127;if(_>4)return K.error("length octect is too long");P=0;for(var k=0;k<_;k++){P<<=8;var B=K.readUInt8(q);if(K.isError(B))return B;P|=B}return P}}),CG=J0((Q,Y)=>{var V=xU(),H=(WU(),h0(HU)).Buffer,C=KY();function D(J){C.call(this,J),this.enc="pem"}V(D,C),Y.exports=D,D.prototype.decode=function(J,T){var M=J.toString().split(/[\r\n]+/g),F=T.label.toUpperCase(),R=/^-----(BEGIN|END) ([^-]+)-----$/,K=-1,W=-1;for(var q=0;q<M.length;q++){var P=M[q].match(R);if(P===null)continue;if(P[2]!==F)continue;if(K===-1){if(P[1]!=="BEGIN")break;K=q}else{if(P[1]!=="END")break;W=q;break}}if(K===-1||W===-1)throw Error("PEM section not found for: "+F);var _=M.slice(K+1,W).join("");_.replace(/[^a-z0-9\+\/=]+/gi,"");var k=new H(_,"base64");return C.prototype.decode.call(this,k,T)}}),LG=J0((Q)=>{var Y=Q;Y.der=KY(),Y.pem=CG()}),HY=J0((Q,Y)=>{var V=xU(),H=(WU(),h0(HU)).Buffer,C=NO(),D=C.base,J=C.constants.der;function T(K){this.enc="der",this.name=K.name,this.entity=K,this.tree=new M,this.tree._init(K.body)}Y.exports=T,T.prototype.encode=function(K,W){return this.tree._encode(K,W).join()};function M(K){D.Node.call(this,"der",K)}V(M,D.Node),M.prototype._encodeComposite=function(K,W,q,P){var _=R(K,W,q,this.reporter);if(P.length<128){var j=new H(2);return j[0]=_,j[1]=P.length,this._createEncoderBuffer([j,P])}var k=1;for(var B=P.length;B>=256;B>>=8)k++;var j=new H(2+k);j[0]=_,j[1]=128|k;for(var B=1+k,x=P.length;x>0;B--,x>>=8)j[B]=x&255;return this._createEncoderBuffer([j,P])},M.prototype._encodeStr=function(K,W){if(W==="bitstr")return this._createEncoderBuffer([K.unused|0,K.data]);else if(W==="bmpstr"){var q=new H(K.length*2);for(var P=0;P<K.length;P++)q.writeUInt16BE(K.charCodeAt(P),P*2);return this._createEncoderBuffer(q)}else if(W==="numstr"){if(!this._isNumstr(K))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(K)}else if(W==="printstr"){if(!this._isPrintstr(K))return 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");return this._createEncoderBuffer(K)}else if(/str$/.test(W))return this._createEncoderBuffer(K);else if(W==="objDesc")return this._createEncoderBuffer(K);else return this.reporter.error("Encoding of string type: "+W+" unsupported")},M.prototype._encodeObjid=function(K,W,q){if(typeof K==="string"){if(!W)return this.reporter.error("string objid given, but no values map found");if(!W.hasOwnProperty(K))return this.reporter.error("objid not found in values map");K=W[K].split(/[\s\.]+/g);for(var P=0;P<K.length;P++)K[P]|=0}else if(Array.isArray(K)){K=K.slice();for(var P=0;P<K.length;P++)K[P]|=0}if(!Array.isArray(K))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(K));if(!q){if(K[1]>=40)return this.reporter.error("Second objid identifier OOB");K.splice(0,2,K[0]*40+K[1])}var _=0;for(var P=0;P<K.length;P++){var k=K[P];for(_++;k>=128;k>>=7)_++}var B=new H(_),j=B.length-1;for(var P=K.length-1;P>=0;P--){var k=K[P];B[j--]=k&127;while((k>>=7)>0)B[j--]=128|k&127}return this._createEncoderBuffer(B)};function F(K){if(K<10)return"0"+K;else return K}M.prototype._encodeTime=function(K,W){var q,P=new Date(K);if(W==="gentime")q=[F(P.getFullYear()),F(P.getUTCMonth()+1),F(P.getUTCDate()),F(P.getUTCHours()),F(P.getUTCMinutes()),F(P.getUTCSeconds()),"Z"].join("");else if(W==="utctime")q=[F(P.getFullYear()%100),F(P.getUTCMonth()+1),F(P.getUTCDate()),F(P.getUTCHours()),F(P.getUTCMinutes()),F(P.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+W+" time is not supported yet");return this._encodeStr(q,"octstr")},M.prototype._encodeNull=function(){return this._createEncoderBuffer("")},M.prototype._encodeInt=function(K,W){if(typeof K==="string"){if(!W)return this.reporter.error("String int or enum given, but no values map");if(!W.hasOwnProperty(K))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(K));K=W[K]}if(typeof K!=="number"&&!H.isBuffer(K)){var q=K.toArray();if(!K.sign&&q[0]&128)q.unshift(0);K=new H(q)}if(H.isBuffer(K)){var P=K.length;if(K.length===0)P++;var k=new H(P);if(K.copy(k),K.length===0)k[0]=0;return this._createEncoderBuffer(k)}if(K<128)return this._createEncoderBuffer(K);if(K<256)return this._createEncoderBuffer([0,K]);var P=1;for(var _=K;_>=256;_>>=8)P++;var k=Array(P);for(var _=k.length-1;_>=0;_--)k[_]=K&255,K>>=8;if(k[0]&128)k.unshift(0);return this._createEncoderBuffer(new H(k))},M.prototype._encodeBool=function(K){return this._createEncoderBuffer(K?255:0)},M.prototype._use=function(K,W){if(typeof K==="function")K=K(W);return K._getEncoder("der").tree},M.prototype._skipDefault=function(K,W,q){var P=this._baseState,_;if(P.default===null)return!1;var k=K.join();if(P.defaultBuffer===void 0)P.defaultBuffer=this._encodeValue(P.default,W,q).join();if(k.length!==P.defaultBuffer.length)return!1;for(_=0;_<k.length;_++)if(k[_]!==P.defaultBuffer[_])return!1;return!0};function R(K,W,q,P){var _;if(K==="seqof")K="seq";else if(K==="setof")K="set";if(J.tagByName.hasOwnProperty(K))_=J.tagByName[K];else if(typeof K==="number"&&(K|0)===K)_=K;else return P.error("Unknown tag: "+K);if(_>=31)return P.error("Multi-octet tag encoding unsupported");if(!W)_|=32;return _|=J.tagClassByName[q||"universal"]<<6,_}}),KG=J0((Q,Y)=>{var V=xU(),H=HY();function C(D){H.call(this,D),this.enc="pem"}V(C,H),Y.exports=C,C.prototype.encode=function(D,J){var T=H.prototype.encode.call(this,D),M=T.toString("base64"),F=["-----BEGIN "+J.label+"-----"];for(var R=0;R<M.length;R+=64)F.push(M.slice(R,R+64));return F.push("-----END "+J.label+"-----"),F.join(`
15
+ `)}}),HG=J0((Q)=>{var Y=Q;Y.der=HY(),Y.pem=KG()}),NO=J0((Q)=>{var Y=Q;Y.bignum=AG(),Y.define=GG().define,Y.base=_O(),Y.constants=LY(),Y.decoders=LG(),Y.encoders=HG()}),WG=J0((Q,Y)=>{var V=NO(),H=V.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),C=V.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),D=V.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),J=V.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(D),this.key("subjectPublicKey").bitstr())}),T=V.define("RelativeDistinguishedName",function(){this.setof(C)}),M=V.define("RDNSequence",function(){this.seqof(T)}),F=V.define("Name",function(){this.choice({rdnSequence:this.use(M)})}),R=V.define("Validity",function(){this.seq().obj(this.key("notBefore").use(H),this.key("notAfter").use(H))}),K=V.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),W=V.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(D),this.key("issuer").use(F),this.key("validity").use(R),this.key("subject").use(F),this.key("subjectPublicKeyInfo").use(J),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(K).optional())}),q=V.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(W),this.key("signatureAlgorithm").use(D),this.key("signatureValue").bitstr())});Y.exports=q}),SG=J0((Q)=>{var Y=NO();Q.certificate=WG();var V=Y.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())});Q.RSAPrivateKey=V;var H=Y.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});Q.RSAPublicKey=H;var C=Y.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())}),D=Y.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(C),this.key("subjectPublicKey").bitstr())});Q.PublicKey=D;var J=Y.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(C),this.key("subjectPrivateKey").octstr())});Q.PrivateKey=J;var T=Y.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())});Q.EncryptedPrivateKey=T;var M=Y.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())});Q.DSAPrivateKey=M,Q.DSAparam=Y.define("DSAparam",function(){this.int()});var F=Y.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),R=Y.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(F),this.key("publicKey").optional().explicit(1).bitstr())});Q.ECPrivateKey=R,Q.signature=Y.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),DG=J0((Q,Y)=>{Y.exports={"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"}}),FG=J0((Q,Y)=>{var V=MU().Buffer,H=dO().Transform,C=xU();function D(F){H.call(this),this._block=V.allocUnsafe(F),this._blockSize=F,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}C(D,H),D.prototype._transform=function(F,R,K){var W=null;try{this.update(F,R)}catch(q){W=q}K(W)},D.prototype._flush=function(F){var R=null;try{this.push(this.digest())}catch(K){R=K}F(R)};var J=typeof Uint8Array<"u",T=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(V.prototype instanceof Uint8Array||V.TYPED_ARRAY_SUPPORT);function M(F,R){if(F instanceof V)return F;if(typeof F==="string")return V.from(F,R);if(T&&ArrayBuffer.isView(F)){if(F.byteLength===0)return V.alloc(0);var K=V.from(F.buffer,F.byteOffset,F.byteLength);if(K.byteLength===F.byteLength)return K}if(J&&F instanceof Uint8Array)return V.from(F);if(V.isBuffer(F)&&F.constructor&&typeof F.constructor.isBuffer==="function"&&F.constructor.isBuffer(F))return V.from(F);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}D.prototype.update=function(F,R){if(this._finalized)throw Error("Digest already called");F=M(F,R);var K=this._block,W=0;while(this._blockOffset+F.length-W>=this._blockSize){for(var q=this._blockOffset;q<this._blockSize;)K[q++]=F[W++];this._update(),this._blockOffset=0}while(W<F.length)K[this._blockOffset++]=F[W++];for(var P=0,_=F.length*8;_>0;++P)if(this._length[P]+=_,_=this._length[P]/4294967296|0,_>0)this._length[P]-=4294967296*_;return this},D.prototype._update=function(){throw Error("_update is not implemented")},D.prototype.digest=function(F){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var R=this._digest();if(F!==void 0)R=R.toString(F);this._block.fill(0),this._blockOffset=0;for(var K=0;K<4;++K)this._length[K]=0;return R},D.prototype._digest=function(){throw Error("_digest is not implemented")},Y.exports=D}),RG=J0((Q,Y)=>{var V=xU(),H=FG(),C=MU().Buffer,D=Array(16);function J(){H.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}V(J,H),J.prototype._update=function(){var W=D;for(var q=0;q<16;++q)W[q]=this._block.readInt32LE(q*4);var P=this._a,_=this._b,k=this._c,B=this._d;P=M(P,_,k,B,W[0],3614090360,7),B=M(B,P,_,k,W[1],3905402710,12),k=M(k,B,P,_,W[2],606105819,17),_=M(_,k,B,P,W[3],3250441966,22),P=M(P,_,k,B,W[4],4118548399,7),B=M(B,P,_,k,W[5],1200080426,12),k=M(k,B,P,_,W[6],2821735955,17),_=M(_,k,B,P,W[7],4249261313,22),P=M(P,_,k,B,W[8],1770035416,7),B=M(B,P,_,k,W[9],2336552879,12),k=M(k,B,P,_,W[10],4294925233,17),_=M(_,k,B,P,W[11],2304563134,22),P=M(P,_,k,B,W[12],1804603682,7),B=M(B,P,_,k,W[13],4254626195,12),k=M(k,B,P,_,W[14],2792965006,17),_=M(_,k,B,P,W[15],1236535329,22),P=F(P,_,k,B,W[1],4129170786,5),B=F(B,P,_,k,W[6],3225465664,9),k=F(k,B,P,_,W[11],643717713,14),_=F(_,k,B,P,W[0],3921069994,20),P=F(P,_,k,B,W[5],3593408605,5),B=F(B,P,_,k,W[10],38016083,9),k=F(k,B,P,_,W[15],3634488961,14),_=F(_,k,B,P,W[4],3889429448,20),P=F(P,_,k,B,W[9],568446438,5),B=F(B,P,_,k,W[14],3275163606,9),k=F(k,B,P,_,W[3],4107603335,14),_=F(_,k,B,P,W[8],1163531501,20),P=F(P,_,k,B,W[13],2850285829,5),B=F(B,P,_,k,W[2],4243563512,9),k=F(k,B,P,_,W[7],1735328473,14),_=F(_,k,B,P,W[12],2368359562,20),P=R(P,_,k,B,W[5],4294588738,4),B=R(B,P,_,k,W[8],2272392833,11),k=R(k,B,P,_,W[11],1839030562,16),_=R(_,k,B,P,W[14],4259657740,23),P=R(P,_,k,B,W[1],2763975236,4),B=R(B,P,_,k,W[4],1272893353,11),k=R(k,B,P,_,W[7],4139469664,16),_=R(_,k,B,P,W[10],3200236656,23),P=R(P,_,k,B,W[13],681279174,4),B=R(B,P,_,k,W[0],3936430074,11),k=R(k,B,P,_,W[3],3572445317,16),_=R(_,k,B,P,W[6],76029189,23),P=R(P,_,k,B,W[9],3654602809,4),B=R(B,P,_,k,W[12],3873151461,11),k=R(k,B,P,_,W[15],530742520,16),_=R(_,k,B,P,W[2],3299628645,23),P=K(P,_,k,B,W[0],4096336452,6),B=K(B,P,_,k,W[7],1126891415,10),k=K(k,B,P,_,W[14],2878612391,15),_=K(_,k,B,P,W[5],4237533241,21),P=K(P,_,k,B,W[12],1700485571,6),B=K(B,P,_,k,W[3],2399980690,10),k=K(k,B,P,_,W[10],4293915773,15),_=K(_,k,B,P,W[1],2240044497,21),P=K(P,_,k,B,W[8],1873313359,6),B=K(B,P,_,k,W[15],4264355552,10),k=K(k,B,P,_,W[6],2734768916,15),_=K(_,k,B,P,W[13],1309151649,21),P=K(P,_,k,B,W[4],4149444226,6),B=K(B,P,_,k,W[11],3174756917,10),k=K(k,B,P,_,W[2],718787259,15),_=K(_,k,B,P,W[9],3951481745,21),this._a=this._a+P|0,this._b=this._b+_|0,this._c=this._c+k|0,this._d=this._d+B|0},J.prototype._digest=function(){if(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 W=C.allocUnsafe(16);return W.writeInt32LE(this._a,0),W.writeInt32LE(this._b,4),W.writeInt32LE(this._c,8),W.writeInt32LE(this._d,12),W};function T(W,q){return W<<q|W>>>32-q}function M(W,q,P,_,k,B,j){return T(W+(q&P|~q&_)+k+B|0,j)+q|0}function F(W,q,P,_,k,B,j){return T(W+(q&_|P&~_)+k+B|0,j)+q|0}function R(W,q,P,_,k,B,j){return T(W+(q^P^_)+k+B|0,j)+q|0}function K(W,q,P,_,k,B,j){return T(W+(P^(q|~_))+k+B|0,j)+q|0}Y.exports=J}),TG=J0((Q,Y)=>{var V=MU().Buffer,H=RG();function C(D,J,T,M){if(!V.isBuffer(D))D=V.from(D,"binary");if(J){if(!V.isBuffer(J))J=V.from(J,"binary");if(J.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var F=T/8,R=V.alloc(F),K=V.alloc(M||0),W=V.alloc(0);while(F>0||M>0){var q=new H;if(q.update(W),q.update(D),J)q.update(J);W=q.digest();var P=0;if(F>0){var _=R.length-F;P=Math.min(F,W.length),W.copy(R,_,0,P),F-=P}if(P<W.length&&M>0){var k=K.length-M,B=Math.min(M,W.length-P);W.copy(K,k,P,P+B),M-=B}}return W.fill(0),{key:R,iv:K}}Y.exports=C}),WY=J0((Q)=>{var Y=(jU(),h0(vU));Q.createCipher=Q.Cipher=Y.createCipher,Q.createCipheriv=Q.Cipheriv=Y.createCipheriv,Q.createDecipher=Q.Decipher=Y.createDecipher,Q.createDecipheriv=Q.Decipheriv=Y.createDecipheriv,Q.listCiphers=Q.getCiphers=Y.getCiphers}),zG=J0((Q,Y)=>{var V=/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,H=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,C=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,D=TG(),J=WY(),T=MU().Buffer;Y.exports=function(M,F){var R=M.toString(),K=R.match(V),W;if(!K){var q=R.match(C);W=T.from(q[2].replace(/[\r\n]/g,""),"base64")}else{var P="aes"+K[1],_=T.from(K[2],"hex"),k=T.from(K[3].replace(/[\r\n]/g,""),"base64"),B=D(F,_.slice(0,8),parseInt(K[1],10)).key,j=[],x=J.createDecipheriv(P,B,_);j.push(x.update(k)),j.push(x.final()),W=T.concat(j)}var f=R.match(H)[1];return{tag:f,data:W}}}),SY=J0((Q,Y)=>{var V=SG(),H=DG(),C=zG(),D=WY(),J=JY().pbkdf2Sync,T=MU().Buffer;function M(R,K){var W=R.algorithm.decrypt.kde.kdeparams.salt,q=parseInt(R.algorithm.decrypt.kde.kdeparams.iters.toString(),10),P=H[R.algorithm.decrypt.cipher.algo.join(".")],_=R.algorithm.decrypt.cipher.iv,k=R.subjectPrivateKey,B=parseInt(P.split("-")[1],10)/8,j=J(K,W,q,B,"sha1"),x=D.createDecipheriv(P,j,_),f=[];return f.push(x.update(k)),f.push(x.final()),T.concat(f)}function F(R){var K;if(typeof R==="object"&&!T.isBuffer(R))K=R.passphrase,R=R.key;if(typeof R==="string")R=T.from(R);var W=C(R,K),q=W.tag,P=W.data,_,k;switch(q){case"CERTIFICATE":k=V.certificate.decode(P,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!k)k=V.PublicKey.decode(P,"der");switch(_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return V.RSAPublicKey.decode(k.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return k.subjectPrivateKey=k.subjectPublicKey,{type:"ec",data:k};case"1.2.840.10040.4.1":return k.algorithm.params.pub_key=V.DSAparam.decode(k.subjectPublicKey.data,"der"),{type:"dsa",data:k.algorithm.params};default:throw Error("unknown key id "+_)}case"ENCRYPTED PRIVATE KEY":P=V.EncryptedPrivateKey.decode(P,"der"),P=M(P,K);case"PRIVATE KEY":switch(k=V.PrivateKey.decode(P,"der"),_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return V.RSAPrivateKey.decode(k.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:k.algorithm.curve,privateKey:V.ECPrivateKey.decode(k.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return k.algorithm.params.priv_key=V.DSAparam.decode(k.subjectPrivateKey,"der"),{type:"dsa",params:k.algorithm.params};default:throw Error("unknown key id "+_)}case"RSA PUBLIC KEY":return V.RSAPublicKey.decode(P,"der");case"RSA PRIVATE KEY":return V.RSAPrivateKey.decode(P,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:V.DSAPrivateKey.decode(P,"der")};case"EC PRIVATE KEY":return P=V.ECPrivateKey.decode(P,"der"),{curve:P.parameters.value,privateKey:P.privateKey};default:throw Error("unknown key type "+q)}}F.signature=V.signature,Y.exports=F}),DY=J0((Q,Y)=>{var V=OZ(),H=MU().Buffer;Y.exports=function(D,J){var T=H.alloc(0),M=0,F;while(T.length<J)F=C(M++),T=H.concat([T,V("sha1").update(D).update(F).digest()]);return T.slice(0,J)};function C(D){var J=H.allocUnsafe(4);return J.writeUInt32BE(D,0),J}}),FY=J0((Q,Y)=>{Y.exports=function(V,H){var C=V.length,D=-1;while(++D<C)V[D]^=H[D];return V}}),GX=J0((Q,Y)=>{(function(V,H){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function D(U,X){U.super_=X;var A=function(){};A.prototype=X.prototype,U.prototype=new A,U.prototype.constructor=U}function J(U,X,A){if(J.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")A=X,X=10;this._init(U||0,X||10,A||"be")}}if(typeof V==="object")V.exports=J;else H.BN=J;J.BN=J,J.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(WU(),h0(HU)).Buffer}catch(U){}J.isBN=function(U){if(U instanceof J)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===J.wordSize&&Array.isArray(U.words)},J.max=function(U,X){if(U.cmp(X)>0)return U;return X},J.min=function(U,X){if(U.cmp(X)<0)return U;return X},J.prototype._init=function(U,X,A){if(typeof U==="number")return this._initNumber(U,X,A);if(typeof U==="object")return this._initArray(U,X,A);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,A);else if(this._parseBase(U,X,Z),A==="le")this._initArray(this.toArray(),X,A)}},J.prototype._initNumber=function(U,X,A){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(A!=="le")return;this._initArray(this.toArray(),X,A)},J.prototype._initArray=function(U,X,A){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var $,I,L=0;if(A==="be"){for(Z=U.length-1,$=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[$]|=I<<L&67108863,this.words[$+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,$++}else if(A==="le"){for(Z=0,$=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[$]|=I<<L&67108863,this.words[$+1]=I>>>26-L&67108863,L+=24,L>=26)L-=26,$++}return this.strip()};function M(U,X){var A=U.charCodeAt(X);if(A>=65&&A<=70)return A-55;else if(A>=97&&A<=102)return A-87;else return A-48&15}function F(U,X,A){var Z=M(U,A);if(A-1>=X)Z|=M(U,A-1)<<4;return Z}J.prototype._parseHex=function(U,X,A){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var $=0,I=0,L;if(A==="be")for(Z=U.length-1;Z>=X;Z-=2)if(L=F(U,X,Z)<<$,this.words[I]|=L&67108863,$>=18)$-=18,I+=1,this.words[I]|=L>>>26;else $+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(L=F(U,X,Z)<<$,this.words[I]|=L&67108863,$>=18)$-=18,I+=1,this.words[I]|=L>>>26;else $+=8}this.strip()};function R(U,X,A,Z){var $=0,I=Math.min(U.length,A);for(var L=X;L<I;L++){var G=U.charCodeAt(L)-48;if($*=Z,G>=49)$+=G-49+10;else if(G>=17)$+=G-17+10;else $+=G}return $}J.prototype._parseBase=function(U,X,A){this.words=[0],this.length=1;for(var Z=0,$=1;$<=67108863;$*=X)Z++;Z--,$=$/X|0;var I=U.length-A,L=I%Z,G=Math.min(I,I-L)+A,O=0;for(var E=A;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln($),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(L!==0){var z=1;O=R(U,E,U.length,X);for(E=0;E<L;E++)z*=X;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},J.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},J.prototype.clone=function(){var U=new J(null);return this.copy(U),U},J.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},J.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},J.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var K=["","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"],W=[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],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(U,X){U=U||10,X=X|0||1;var A;if(U===16||U==="hex"){A="";var Z=0,$=0;for(var I=0;I<this.length;I++){var L=this.words[I],G=((L<<Z|$)&16777215).toString(16);if($=L>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if($!==0||I!==this.length-1)A=K[6-G.length]+G+A;else A=G+A}if($!==0)A=$.toString(16)+A;while(A.length%X!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}if(U===(U|0)&&U>=2&&U<=36){var O=W[U],E=q[U];A="";var z=this.clone();z.negative=0;while(!z.isZero()){var S=z.modn(E).toString(U);if(z=z.idivn(E),!z.isZero())A=K[O-S.length]+S+A;else A=S+A}if(this.isZero())A="0"+A;while(A.length%X!==0)A="0"+A;if(this.negative!==0)A="-"+A;return A}C(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},J.prototype.toJSON=function(){return this.toString(16)},J.prototype.toBuffer=function(U,X){return C(typeof T<"u"),this.toArrayLike(T,U,X)},J.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},J.prototype.toArrayLike=function(U,X,A){var Z=this.byteLength(),$=A||Math.max(1,Z);C(Z<=$,"byte array longer than desired length"),C($>0,"Requested array length <= 0"),this.strip();var I=X==="le",L=new U($),G,O,E=this.clone();if(!I){for(O=0;O<$-Z;O++)L[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[$-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),L[O]=G;for(;O<$;O++)L[O]=0}return L},Math.clz32)J.prototype._countBits=function(U){return 32-Math.clz32(U)};else J.prototype._countBits=function(U){var X=U,A=0;if(X>=4096)A+=13,X>>>=13;if(X>=64)A+=7,X>>>=7;if(X>=8)A+=4,X>>>=4;if(X>=2)A+=2,X>>>=2;return A+X};J.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,A=0;if((X&8191)===0)A+=13,X>>>=13;if((X&127)===0)A+=7,X>>>=7;if((X&15)===0)A+=4,X>>>=4;if((X&3)===0)A+=2,X>>>=2;if((X&1)===0)A++;return A},J.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var A=0;A<X.length;A++){var Z=A/26|0,$=A%26;X[A]=(U.words[Z]&1<<$)>>>$}return X}J.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var A=this._zeroBits(this.words[X]);if(U+=A,A!==26)break}return U},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},J.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},J.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},J.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},J.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},J.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var A=0;A<X.length;A++)this.words[A]=this.words[A]&U.words[A];return this.length=X.length,this.strip()},J.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},J.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},J.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},J.prototype.iuxor=function(U){var X,A;if(this.length>U.length)X=this,A=U;else X=U,A=this;for(var Z=0;Z<A.length;Z++)this.words[Z]=X.words[Z]^A.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},J.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},J.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},J.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},J.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,A=U%26;if(this._expand(X),A>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(A>0)this.words[Z]=~this.words[Z]&67108863>>26-A;return this.strip()},J.prototype.notn=function(U){return this.clone().inotn(U)},J.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var A=U/26|0,Z=U%26;if(this._expand(A+1),X)this.words[A]=this.words[A]|1<<Z;else this.words[A]=this.words[A]&~(1<<Z);return this.strip()},J.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var A,Z;if(this.length>U.length)A=this,Z=U;else A=U,Z=this;var $=0;for(var I=0;I<Z.length;I++)X=(A.words[I]|0)+(Z.words[I]|0)+$,this.words[I]=X&67108863,$=X>>>26;for(;$!==0&&I<A.length;I++)X=(A.words[I]|0)+$,this.words[I]=X&67108863,$=X>>>26;if(this.length=A.length,$!==0)this.words[this.length]=$,this.length++;else if(A!==this)for(;I<A.length;I++)this.words[I]=A.words[I];return this},J.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},J.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var A=this.cmp(U);if(A===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,$;if(A>0)Z=this,$=U;else Z=U,$=this;var I=0;for(var L=0;L<$.length;L++)X=(Z.words[L]|0)-($.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;for(;I!==0&&L<Z.length;L++)X=(Z.words[L]|0)+I,I=X>>26,this.words[L]=X&67108863;if(I===0&&L<Z.length&&Z!==this)for(;L<Z.length;L++)this.words[L]=Z.words[L];if(this.length=Math.max(this.length,L),Z!==this)this.negative=1;return this.strip()},J.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,A){A.negative=X.negative^U.negative;var Z=U.length+X.length|0;A.length=Z,Z=Z-1|0;var $=U.words[0]|0,I=X.words[0]|0,L=$*I,G=L&67108863,O=L/67108864|0;A.words[0]=G;for(var E=1;E<Z;E++){var z=O>>>26,S=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;$=U.words[p]|0,I=X.words[g]|0,L=$*I+S,z+=L/67108864|0,S=L&67108863}A.words[E]=S|0,O=z|0}if(O!==0)A.words[E]=O|0;else A.length--;return A.strip()}var k=function(U,X,A){var Z=U.words,$=X.words,I=A.words,L=0,G,O,E,z=Z[0]|0,S=z&8191,v=z>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,t=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,s=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,L0=w0>>>13,s0=Z[9]|0,E0=s0&8191,K0=s0>>>13,e0=$[0]|0,S0=e0&8191,W0=e0>>>13,FU=$[1]|0,R0=FU&8191,k0=FU>>>13,RU=$[2]|0,_0=RU&8191,T0=RU>>>13,SU=$[3]|0,v0=SU&8191,z0=SU>>>13,CU=$[4]|0,j0=CU&8191,B0=CU>>>13,LU=$[5]|0,M0=LU&8191,N=LU>>>13,b=$[6]|0,a=b&8191,U0=b>>>13,f0=$[7]|0,I0=f0&8191,H0=f0>>>13,t0=$[8]|0,q0=t0&8191,x0=t0>>>13,DU=$[9]|0,P0=DU&8191,D0=DU>>>13;A.negative=U.negative^X.negative,A.length=19,G=Math.imul(S,S0),O=Math.imul(S,W0),O=O+Math.imul(v,S0)|0,E=Math.imul(v,W0);var r0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,S0),O=Math.imul(p,W0),O=O+Math.imul(n,S0)|0,E=Math.imul(n,W0),G=G+Math.imul(S,R0)|0,O=O+Math.imul(S,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,S0),O=Math.imul(r,W0),O=O+Math.imul(l,S0)|0,E=Math.imul(l,W0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(S,_0)|0,O=O+Math.imul(S,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,S0),O=Math.imul(m,W0),O=O+Math.imul(i,S0)|0,E=Math.imul(i,W0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(S,v0)|0,O=O+Math.imul(S,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,S0),O=Math.imul(y,W0),O=O+Math.imul(h,S0)|0,E=Math.imul(h,W0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(S,j0)|0,O=O+Math.imul(S,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(t,S0),O=Math.imul(t,W0),O=O+Math.imul(e,S0)|0,E=Math.imul(e,W0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(S,M0)|0,O=O+Math.imul(S,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,S0),O=Math.imul(c,W0),O=O+Math.imul(o,S0)|0,E=Math.imul(o,W0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(S,a)|0,O=O+Math.imul(S,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,S0),O=Math.imul(s,W0),O=O+Math.imul(Z0,S0)|0,E=Math.imul(Z0,W0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(S,I0)|0,O=O+Math.imul(S,H0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,H0)|0;var OU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,S0),O=Math.imul(C0,W0),O=O+Math.imul(L0,S0)|0,E=Math.imul(L0,W0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,H0)|0,G=G+Math.imul(S,q0)|0,O=O+Math.imul(S,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,S0),O=Math.imul(E0,W0),O=O+Math.imul(K0,S0)|0,E=Math.imul(K0,W0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(L0,R0)|0,E=E+Math.imul(L0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,H0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(S,P0)|0,O=O+Math.imul(S,D0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,D0)|0;var XU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(K0,R0)|0,E=Math.imul(K0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(L0,_0)|0,E=E+Math.imul(L0,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,H0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,D0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,D0)|0;var QU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(K0,_0)|0,E=Math.imul(K0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(L0,v0)|0,E=E+Math.imul(L0,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,H0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,D0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,D0)|0;var YU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(K0,v0)|0,E=Math.imul(K0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(L0,j0)|0,E=E+Math.imul(L0,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,H0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,D0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,D0)|0;var $U=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(K0,j0)|0,E=Math.imul(K0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(L0,M0)|0,E=E+Math.imul(L0,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,H0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,D0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,D0)|0;var JU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(K0,M0)|0,E=Math.imul(K0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(L0,a)|0,E=E+Math.imul(L0,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,H0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,D0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,D0)|0;var AU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(K0,a)|0,E=Math.imul(K0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,H0)|0,O=O+Math.imul(L0,I0)|0,E=E+Math.imul(L0,H0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,D0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,D0)|0;var GU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,H0),O=O+Math.imul(K0,I0)|0,E=Math.imul(K0,H0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(L0,q0)|0,E=E+Math.imul(L0,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,D0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,D0)|0;var VU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(K0,q0)|0,E=Math.imul(K0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,D0)|0,O=O+Math.imul(L0,P0)|0,E=E+Math.imul(L0,D0)|0;var EU=(L+G|0)+((O&8191)<<13)|0;L=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,D0),O=O+Math.imul(K0,P0)|0,E=Math.imul(K0,D0);var IU=(L+G|0)+((O&8191)<<13)|0;if(L=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=$U,I[13]=JU,I[14]=AU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,L!==0)I[19]=L,A.length++;return A};if(!Math.imul)k=_;function B(U,X,A){A.negative=X.negative^U.negative,A.length=U.length+X.length;var Z=0,$=0;for(var I=0;I<A.length-1;I++){var L=$;$=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var z=I-E,S=U.words[z]|0,v=X.words[E]|0,g=S*v,p=g&67108863;L=L+(g/67108864|0)|0,p=p+G|0,G=p&67108863,L=L+(p>>>26)|0,$+=L>>>26,L&=67108863}A.words[I]=G,Z=L,L=$}if(Z!==0)A.words[I]=Z;else A.length--;return A.strip()}function j(U,X,A){var Z=new x;return Z.mulp(U,X,A)}J.prototype.mulTo=function(U,X){var A,Z=this.length+U.length;if(this.length===10&&U.length===10)A=k(this,U,X);else if(Z<63)A=_(this,U,X);else if(Z<1024)A=B(this,U,X);else A=j(this,U,X);return A};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),A=J.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,A,U);return X},x.prototype.revBin=function(U,X,A){if(U===0||U===A-1)return U;var Z=0;for(var $=0;$<X;$++)Z|=(U&1)<<X-$-1,U>>=1;return Z},x.prototype.permute=function(U,X,A,Z,$,I){for(var L=0;L<I;L++)Z[L]=X[U[L]],$[L]=A[U[L]]},x.prototype.transform=function(U,X,A,Z,$,I){this.permute(I,U,X,A,Z,$);for(var L=1;L<$;L<<=1){var G=L<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var z=0;z<$;z+=G){var S=O,v=E;for(var g=0;g<L;g++){var p=A[z+g],n=Z[z+g],V0=A[z+g+L],r=Z[z+g+L],l=S*V0-v*r;if(r=S*r+v*V0,V0=l,A[z+g]=p+V0,Z[z+g]=n+r,A[z+g+L]=p-V0,Z[z+g+L]=n-r,g!==G)l=O*S-E*v,v=O*v+E*S,S=l}}}},x.prototype.guessLen13b=function(U,X){var A=Math.max(X,U)|1,Z=A&1,$=0;for(A=A/2|0;A;A=A>>>1)$++;return 1<<$+1+Z},x.prototype.conjugate=function(U,X,A){if(A<=1)return;for(var Z=0;Z<A/2;Z++){var $=U[Z];U[Z]=U[A-Z-1],U[A-Z-1]=$,$=X[Z],X[Z]=-X[A-Z-1],X[A-Z-1]=-$}},x.prototype.normalize13b=function(U,X){var A=0;for(var Z=0;Z<X/2;Z++){var $=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+A;if(U[Z]=$&67108863,$<67108864)A=0;else A=$/67108864|0}return U},x.prototype.convert13b=function(U,X,A,Z){var $=0;for(var I=0;I<X;I++)$=$+(U[I]|0),A[2*I]=$&8191,$=$>>>13,A[2*I+1]=$&8191,$=$>>>13;for(I=2*X;I<Z;++I)A[I]=0;C($===0),C(($&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var A=0;A<U;A++)X[A]=0;return X},x.prototype.mulp=function(U,X,A){var Z=2*this.guessLen13b(U.length,X.length),$=this.makeRBT(Z),I=this.stub(Z),L=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),z=Array(Z),S=Array(Z),v=A.words;v.length=Z,this.convert13b(U.words,U.length,L,Z),this.convert13b(X.words,X.length,E,Z),this.transform(L,I,G,O,Z,$),this.transform(E,I,z,S,Z,$);for(var g=0;g<Z;g++){var p=G[g]*z[g]-O[g]*S[g];O[g]=G[g]*S[g]+O[g]*z[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,$),this.conjugate(v,I,Z),this.normalize13b(v,Z),A.negative=U.negative^X.negative,A.length=U.length+X.length,A.strip()},J.prototype.mul=function(U){var X=new J(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},J.prototype.mulf=function(U){var X=new J(null);return X.words=Array(this.length+U.length),j(this,U,X)},J.prototype.imul=function(U){return this.clone().mulTo(U,this)},J.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var A=0;A<this.length;A++){var Z=(this.words[A]|0)*U,$=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=$>>>26,this.words[A]=$&67108863}if(X!==0)this.words[A]=X,this.length++;return this.length=U===0?1:this.length,this},J.prototype.muln=function(U){return this.clone().imuln(U)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(U){var X=P(U);if(X.length===0)return new J(1);var A=this;for(var Z=0;Z<X.length;Z++,A=A.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var $=A.sqr();Z<X.length;Z++,$=$.sqr()){if(X[Z]===0)continue;A=A.mul($)}return A},J.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26,Z=67108863>>>26-X<<26-X,$;if(X!==0){var I=0;for($=0;$<this.length;$++){var L=this.words[$]&Z,G=(this.words[$]|0)-L<<X;this.words[$]=G|I,I=L>>>26-X}if(I)this.words[$]=I,this.length++}if(A!==0){for($=this.length-1;$>=0;$--)this.words[$+A]=this.words[$];for($=0;$<A;$++)this.words[$]=0;this.length+=A}return this.strip()},J.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},J.prototype.iushrn=function(U,X,A){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var $=U%26,I=Math.min((U-$)/26,this.length),L=67108863^67108863>>>$<<$,G=A;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=E<<26-$|z>>>$,E=z&L}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},J.prototype.ishrn=function(U,X,A){return C(this.negative===0),this.iushrn(U,X,A)},J.prototype.shln=function(U){return this.clone().ishln(U)},J.prototype.ushln=function(U){return this.clone().iushln(U)},J.prototype.shrn=function(U){return this.clone().ishrn(U)},J.prototype.ushrn=function(U){return this.clone().iushrn(U)},J.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26,Z=1<<X;if(this.length<=A)return!1;var $=this.words[A];return!!($&Z)},J.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,A=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=A)return this;if(X!==0)A++;if(this.length=Math.min(A,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},J.prototype.maskn=function(U){return this.clone().imaskn(U)},J.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},J.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},J.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},J.prototype.addn=function(U){return this.clone().iaddn(U)},J.prototype.subn=function(U){return this.clone().isubn(U)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(U,X,A){var Z=U.length+A,$;this._expand(Z);var I,L=0;for($=0;$<U.length;$++){I=(this.words[$+A]|0)+L;var G=(U.words[$]|0)*X;I-=G&67108863,L=(I>>26)-(G/67108864|0),this.words[$+A]=I&67108863}for(;$<this.length-A;$++)I=(this.words[$+A]|0)+L,L=I>>26,this.words[$+A]=I&67108863;if(L===0)return this.strip();C(L===-1),L=0;for($=0;$<this.length;$++)I=-(this.words[$]|0)+L,L=I>>26,this.words[$]=I&67108863;return this.negative=1,this.strip()},J.prototype._wordDiv=function(U,X){var A=this.length-U.length,Z=this.clone(),$=U,I=$.words[$.length-1]|0,L=this._countBits(I);if(A=26-L,A!==0)$=$.ushln(A),Z.iushln(A),I=$.words[$.length-1]|0;var G=Z.length-$.length,O;if(X!=="mod"){O=new J(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var z=Z.clone()._ishlnsubmul($,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var S=G-1;S>=0;S--){var v=(Z.words[$.length+S]|0)*67108864+(Z.words[$.length+S-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul($,v,S);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul($,1,S),!Z.isZero())Z.negative^=1;if(O)O.words[S]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&A!==0)Z.iushrn(A);return{div:O||null,mod:Z}},J.prototype.divmod=function(U,X,A){if(C(!U.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var Z,$,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if($=I.mod.neg(),A&&$.negative!==0)$.iadd(U)}return{div:Z,mod:$}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if($=I.mod.neg(),A&&$.negative!==0)$.isub(U)}return{div:I.div,mod:$}}if(U.length>this.length||this.cmp(U)<0)return{div:new J(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new J(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new J(this.modn(U.words[0]))}}return this._wordDiv(U,X)},J.prototype.div=function(U){return this.divmod(U,"div",!1).div},J.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},J.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},J.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var A=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),$=U.andln(1),I=A.cmp(Z);if(I<0||$===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},J.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,A=0;for(var Z=this.length-1;Z>=0;Z--)A=(X*A+(this.words[Z]|0))%U;return A},J.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var A=this.length-1;A>=0;A--){var Z=(this.words[A]|0)+X*67108864;this.words[A]=Z/U|0,X=Z%U}return this.strip()},J.prototype.divn=function(U){return this.clone().idivn(U)},J.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,A=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),$=new J(0),I=new J(0),L=new J(1),G=0;while(X.isEven()&&A.isEven())X.iushrn(1),A.iushrn(1),++G;var O=A.clone(),E=X.clone();while(!X.isZero()){for(var z=0,S=1;(X.words[0]&S)===0&&z<26;++z,S<<=1);if(z>0){X.iushrn(z);while(z-- >0){if(Z.isOdd()||$.isOdd())Z.iadd(O),$.isub(E);Z.iushrn(1),$.iushrn(1)}}for(var v=0,g=1;(A.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){A.iushrn(v);while(v-- >0){if(I.isOdd()||L.isOdd())I.iadd(O),L.isub(E);I.iushrn(1),L.iushrn(1)}}if(X.cmp(A)>=0)X.isub(A),Z.isub(I),$.isub(L);else A.isub(X),I.isub(Z),L.isub($)}return{a:I,b:L,gcd:A.iushln(G)}},J.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,A=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new J(1),$=new J(0),I=A.clone();while(X.cmpn(1)>0&&A.cmpn(1)>0){for(var L=0,G=1;(X.words[0]&G)===0&&L<26;++L,G<<=1);if(L>0){X.iushrn(L);while(L-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(A.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){A.iushrn(O);while(O-- >0){if($.isOdd())$.iadd(I);$.iushrn(1)}}if(X.cmp(A)>=0)X.isub(A),Z.isub($);else A.isub(X),$.isub(Z)}var z;if(X.cmpn(1)===0)z=Z;else z=$;if(z.cmpn(0)<0)z.iadd(U);return z},J.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),A=U.clone();X.negative=0,A.negative=0;for(var Z=0;X.isEven()&&A.isEven();Z++)X.iushrn(1),A.iushrn(1);do{while(X.isEven())X.iushrn(1);while(A.isEven())A.iushrn(1);var $=X.cmp(A);if($<0){var I=X;X=A,A=I}else if($===0||A.cmpn(1)===0)break;X.isub(A)}while(!0);return A.iushln(Z)},J.prototype.invm=function(U){return this.egcd(U).a.umod(U)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(U){return this.words[0]&U},J.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,A=(U-X)/26,Z=1<<X;if(this.length<=A)return this._expand(A+1),this.words[A]|=Z,this;var $=Z;for(var I=A;$!==0&&I<this.length;I++){var L=this.words[I]|0;L+=$,$=L>>>26,L&=67108863,this.words[I]=L}if($!==0)this.words[I]=$,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var A;if(this.length>1)A=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;A=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-A|0;return A},J.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},J.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var A=this.length-1;A>=0;A--){var Z=this.words[A]|0,$=U.words[A]|0;if(Z===$)continue;if(Z<$)X=-1;else if(Z>$)X=1;break}return X},J.prototype.gtn=function(U){return this.cmpn(U)===1},J.prototype.gt=function(U){return this.cmp(U)===1},J.prototype.gten=function(U){return this.cmpn(U)>=0},J.prototype.gte=function(U){return this.cmp(U)>=0},J.prototype.ltn=function(U){return this.cmpn(U)===-1},J.prototype.lt=function(U){return this.cmp(U)===-1},J.prototype.lten=function(U){return this.cmpn(U)<=0},J.prototype.lte=function(U){return this.cmp(U)<=0},J.prototype.eqn=function(U){return this.cmpn(U)===0},J.prototype.eq=function(U){return this.cmp(U)===0},J.red=function(U){return new u(U)},J.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},J.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(U){return this.red=U,this},J.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},J.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},J.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},J.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},J.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},J.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},J.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},J.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},J.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new J(X,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new J(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,A;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),A=X.bitLength();while(A>this.n);var Z=A<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D(d,w),d.prototype.split=function(U,X){var A=4194303,Z=Math.min(U.length,9);for(var $=0;$<Z;$++)X.words[$]=U.words[$];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&A;for($=10;$<U.length;$++){var L=U.words[$]|0;U.words[$-10]=(L&A)<<4|I>>>22,I=L}if(I>>>=22,U.words[$-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var A=0;A<U.length;A++){var Z=U.words[A]|0;X+=Z*977,U.words[A]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(Y0,w);function A0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(A0,w);function $0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D($0,w),$0.prototype.imulK=function(U){var X=0;for(var A=0;A<U.length;A++){var Z=(U.words[A]|0)*19+X,$=Z&67108863;Z>>>=26,U.words[A]=$,X=Z}if(X!==0)U.words[U.length++]=X;return U},J._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new A0;else if(U==="p25519")X=new $0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=J._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var A=U.add(X);if(A.cmp(this.m)>=0)A.isub(this.m);return A._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var A=U.iadd(X);if(A.cmp(this.m)>=0)A.isub(this.m);return A},u.prototype.sub=function(U,X){this._verify2(U,X);var A=U.sub(X);if(A.cmpn(0)<0)A.iadd(this.m);return A._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var A=U.isub(X);if(A.cmpn(0)<0)A.iadd(this.m);return A},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var A=this.m.add(new J(1)).iushrn(2);return this.pow(U,A)}var Z=this.m.subn(1),$=0;while(!Z.isZero()&&Z.andln(1)===0)$++,Z.iushrn(1);C(!Z.isZero());var I=new J(1).toRed(this),L=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new J(2*O*O).toRed(this);while(this.pow(O,G).cmp(L)!==0)O.redIAdd(L);var E=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),S=this.pow(U,Z),v=$;while(S.cmp(I)!==0){var g=S;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new J(1).iushln(v-p-1));z=z.redMul(n),E=n.redSqr(),S=S.redMul(E),v=p}return z},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new J(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var A=4,Z=Array(1<<A);Z[0]=new J(1).toRed(this),Z[1]=U;for(var $=2;$<Z.length;$++)Z[$]=this.mul(Z[$-1],U);var I=Z[0],L=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for($=X.length-1;$>=0;$--){var E=X.words[$];for(var z=O-1;z>=0;z--){var S=E>>z&1;if(I!==Z[0])I=this.sqr(I);if(S===0&&L===0){G=0;continue}if(L<<=1,L|=S,G++,G!==A&&($!==0||z!==0))continue;I=this.mul(I,Z[L]),G=0,L=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},J.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}D(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var A=U.imul(X),Z=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=A.isub(Z).iushrn(this.shift),I=$;if($.cmp(this.m)>=0)I=$.isub(this.m);else if($.cmpn(0)<0)I=$.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new J(0)._forceRed(this);var A=U.mul(X),Z=A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),$=A.isub(Z).iushrn(this.shift),I=$;if($.cmp(this.m)>=0)I=$.isub(this.m);else if($.cmpn(0)<0)I=$.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof Y>"u"||Y,Q)}),RY=J0((Q,Y)=>{var V=GX(),H=MU().Buffer;function C(D,J){return H.from(D.toRed(V.mont(J.modulus)).redPow(new V(J.publicExponent)).fromRed().toArray())}Y.exports=C}),MG=J0((Q,Y)=>{(function(V,H){function C(Z,$){if(!Z)throw Error($||"Assertion failed")}function D(Z,$){Z.super_=$;var I=function(){};I.prototype=$.prototype,Z.prototype=new I,Z.prototype.constructor=Z}function J(Z,$,I){if(J.isBN(Z))return Z;if(this.negative=0,this.words=null,this.length=0,this.red=null,Z!==null){if($==="le"||$==="be")I=$,$=10;this._init(Z||0,$||10,I||"be")}}if(typeof V==="object")V.exports=J;else H.BN=J;J.BN=J,J.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(WU(),h0(HU)).Buffer}catch(Z){}J.isBN=function(Z){if(Z instanceof J)return!0;return Z!==null&&typeof Z==="object"&&Z.constructor.wordSize===J.wordSize&&Array.isArray(Z.words)},J.max=function(Z,$){if(Z.cmp($)>0)return Z;return $},J.min=function(Z,$){if(Z.cmp($)<0)return Z;return $},J.prototype._init=function(Z,$,I){if(typeof Z==="number")return this._initNumber(Z,$,I);if(typeof Z==="object")return this._initArray(Z,$,I);if($==="hex")$=16;C($===($|0)&&$>=2&&$<=36),Z=Z.toString().replace(/\s+/g,"");var L=0;if(Z[0]==="-")L++,this.negative=1;if(L<Z.length){if($===16)this._parseHex(Z,L,I);else if(this._parseBase(Z,$,L),I==="le")this._initArray(this.toArray(),$,I)}},J.prototype._initNumber=function(Z,$,I){if(Z<0)this.negative=1,Z=-Z;if(Z<67108864)this.words=[Z&67108863],this.length=1;else if(Z<4503599627370496)this.words=[Z&67108863,Z/67108864&67108863],this.length=2;else C(Z<9007199254740992),this.words=[Z&67108863,Z/67108864&67108863,1],this.length=3;if(I!=="le")return;this._initArray(this.toArray(),$,I)},J.prototype._initArray=function(Z,$,I){if(C(typeof Z.length==="number"),Z.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Z.length/3),this.words=Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var G,O,E=0;if(I==="be"){for(L=Z.length-1,G=0;L>=0;L-=3)if(O=Z[L]|Z[L-1]<<8|Z[L-2]<<16,this.words[G]|=O<<E&67108863,this.words[G+1]=O>>>26-E&67108863,E+=24,E>=26)E-=26,G++}else if(I==="le"){for(L=0,G=0;L<Z.length;L+=3)if(O=Z[L]|Z[L+1]<<8|Z[L+2]<<16,this.words[G]|=O<<E&67108863,this.words[G+1]=O>>>26-E&67108863,E+=24,E>=26)E-=26,G++}return this._strip()};function M(Z,$){var I=Z.charCodeAt($);if(I>=48&&I<=57)return I-48;else if(I>=65&&I<=70)return I-55;else if(I>=97&&I<=102)return I-87;else C(!1,"Invalid character in "+Z)}function F(Z,$,I){var L=M(Z,I);if(I-1>=$)L|=M(Z,I-1)<<4;return L}J.prototype._parseHex=function(Z,$,I){this.length=Math.ceil((Z.length-$)/6),this.words=Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var G=0,O=0,E;if(I==="be")for(L=Z.length-1;L>=$;L-=2)if(E=F(Z,$,L)<<G,this.words[O]|=E&67108863,G>=18)G-=18,O+=1,this.words[O]|=E>>>26;else G+=8;else{var z=Z.length-$;for(L=z%2===0?$+1:$;L<Z.length;L+=2)if(E=F(Z,$,L)<<G,this.words[O]|=E&67108863,G>=18)G-=18,O+=1,this.words[O]|=E>>>26;else G+=8}this._strip()};function R(Z,$,I,L){var G=0,O=0,E=Math.min(Z.length,I);for(var z=$;z<E;z++){var S=Z.charCodeAt(z)-48;if(G*=L,S>=49)O=S-49+10;else if(S>=17)O=S-17+10;else O=S;C(S>=0&&O<L,"Invalid character"),G+=O}return G}J.prototype._parseBase=function(Z,$,I){this.words=[0],this.length=1;for(var L=0,G=1;G<=67108863;G*=$)L++;L--,G=G/$|0;var O=Z.length-I,E=O%L,z=Math.min(O,O-E)+I,S=0;for(var v=I;v<z;v+=L)if(S=R(Z,v,v+L,$),this.imuln(G),this.words[0]+S<67108864)this.words[0]+=S;else this._iaddn(S);if(E!==0){var g=1;S=R(Z,v,Z.length,$);for(v=0;v<E;v++)g*=$;if(this.imuln(g),this.words[0]+S<67108864)this.words[0]+=S;else this._iaddn(S)}this._strip()},J.prototype.copy=function(Z){Z.words=Array(this.length);for(var $=0;$<this.length;$++)Z.words[$]=this.words[$];Z.length=this.length,Z.negative=this.negative,Z.red=this.red};function K(Z,$){Z.words=$.words,Z.length=$.length,Z.negative=$.negative,Z.red=$.red}if(J.prototype._move=function(Z){K(Z,this)},J.prototype.clone=function(){var Z=new J(null);return this.copy(Z),Z},J.prototype._expand=function(Z){while(this.length<Z)this.words[this.length++]=0;return this},J.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},J.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{J.prototype[Symbol.for("nodejs.util.inspect.custom")]=W}catch(Z){J.prototype.inspect=W}else J.prototype.inspect=W;function W(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var q=["","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"],P=[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],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(J.prototype.toString=function(Z,$){Z=Z||10,$=$|0||1;var I;if(Z===16||Z==="hex"){I="";var L=0,G=0;for(var O=0;O<this.length;O++){var E=this.words[O],z=((E<<L|G)&16777215).toString(16);if(G=E>>>24-L&16777215,L+=2,L>=26)L-=26,O--;if(G!==0||O!==this.length-1)I=q[6-z.length]+z+I;else I=z+I}if(G!==0)I=G.toString(16)+I;while(I.length%$!==0)I="0"+I;if(this.negative!==0)I="-"+I;return I}if(Z===(Z|0)&&Z>=2&&Z<=36){var S=P[Z],v=_[Z];I="";var g=this.clone();g.negative=0;while(!g.isZero()){var p=g.modrn(v).toString(Z);if(g=g.idivn(v),!g.isZero())I=q[S-p.length]+p+I;else I=p+I}if(this.isZero())I="0"+I;while(I.length%$!==0)I="0"+I;if(this.negative!==0)I="-"+I;return I}C(!1,"Base should be between 2 and 36")},J.prototype.toNumber=function(){var Z=this.words[0];if(this.length===2)Z+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Z+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Z:Z},J.prototype.toJSON=function(){return this.toString(16,2)},T)J.prototype.toBuffer=function(Z,$){return this.toArrayLike(T,Z,$)};J.prototype.toArray=function(Z,$){return this.toArrayLike(Array,Z,$)};var k=function(Z,$){if(Z.allocUnsafe)return Z.allocUnsafe($);return new Z($)};if(J.prototype.toArrayLike=function(Z,$,I){this._strip();var L=this.byteLength(),G=I||Math.max(1,L);C(L<=G,"byte array longer than desired length"),C(G>0,"Requested array length <= 0");var O=k(Z,G),E=$==="le"?"LE":"BE";return this["_toArrayLike"+E](O,L),O},J.prototype._toArrayLikeLE=function(Z,$){var I=0,L=0;for(var G=0,O=0;G<this.length;G++){var E=this.words[G]<<O|L;if(Z[I++]=E&255,I<Z.length)Z[I++]=E>>8&255;if(I<Z.length)Z[I++]=E>>16&255;if(O===6){if(I<Z.length)Z[I++]=E>>24&255;L=0,O=0}else L=E>>>24,O+=2}if(I<Z.length){Z[I++]=L;while(I<Z.length)Z[I++]=0}},J.prototype._toArrayLikeBE=function(Z,$){var I=Z.length-1,L=0;for(var G=0,O=0;G<this.length;G++){var E=this.words[G]<<O|L;if(Z[I--]=E&255,I>=0)Z[I--]=E>>8&255;if(I>=0)Z[I--]=E>>16&255;if(O===6){if(I>=0)Z[I--]=E>>24&255;L=0,O=0}else L=E>>>24,O+=2}if(I>=0){Z[I--]=L;while(I>=0)Z[I--]=0}},Math.clz32)J.prototype._countBits=function(Z){return 32-Math.clz32(Z)};else J.prototype._countBits=function(Z){var $=Z,I=0;if($>=4096)I+=13,$>>>=13;if($>=64)I+=7,$>>>=7;if($>=8)I+=4,$>>>=4;if($>=2)I+=2,$>>>=2;return I+$};J.prototype._zeroBits=function(Z){if(Z===0)return 26;var $=Z,I=0;if(($&8191)===0)I+=13,$>>>=13;if(($&127)===0)I+=7,$>>>=7;if(($&15)===0)I+=4,$>>>=4;if(($&3)===0)I+=2,$>>>=2;if(($&1)===0)I++;return I},J.prototype.bitLength=function(){var Z=this.words[this.length-1],$=this._countBits(Z);return(this.length-1)*26+$};function B(Z){var $=Array(Z.bitLength());for(var I=0;I<$.length;I++){var L=I/26|0,G=I%26;$[I]=Z.words[L]>>>G&1}return $}J.prototype.zeroBits=function(){if(this.isZero())return 0;var Z=0;for(var $=0;$<this.length;$++){var I=this._zeroBits(this.words[$]);if(Z+=I,I!==26)break}return Z},J.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},J.prototype.toTwos=function(Z){if(this.negative!==0)return this.abs().inotn(Z).iaddn(1);return this.clone()},J.prototype.fromTwos=function(Z){if(this.testn(Z-1))return this.notn(Z).iaddn(1).ineg();return this.clone()},J.prototype.isNeg=function(){return this.negative!==0},J.prototype.neg=function(){return this.clone().ineg()},J.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},J.prototype.iuor=function(Z){while(this.length<Z.length)this.words[this.length++]=0;for(var $=0;$<Z.length;$++)this.words[$]=this.words[$]|Z.words[$];return this._strip()},J.prototype.ior=function(Z){return C((this.negative|Z.negative)===0),this.iuor(Z)},J.prototype.or=function(Z){if(this.length>Z.length)return this.clone().ior(Z);return Z.clone().ior(this)},J.prototype.uor=function(Z){if(this.length>Z.length)return this.clone().iuor(Z);return Z.clone().iuor(this)},J.prototype.iuand=function(Z){var $;if(this.length>Z.length)$=Z;else $=this;for(var I=0;I<$.length;I++)this.words[I]=this.words[I]&Z.words[I];return this.length=$.length,this._strip()},J.prototype.iand=function(Z){return C((this.negative|Z.negative)===0),this.iuand(Z)},J.prototype.and=function(Z){if(this.length>Z.length)return this.clone().iand(Z);return Z.clone().iand(this)},J.prototype.uand=function(Z){if(this.length>Z.length)return this.clone().iuand(Z);return Z.clone().iuand(this)},J.prototype.iuxor=function(Z){var $,I;if(this.length>Z.length)$=this,I=Z;else $=Z,I=this;for(var L=0;L<I.length;L++)this.words[L]=$.words[L]^I.words[L];if(this!==$)for(;L<$.length;L++)this.words[L]=$.words[L];return this.length=$.length,this._strip()},J.prototype.ixor=function(Z){return C((this.negative|Z.negative)===0),this.iuxor(Z)},J.prototype.xor=function(Z){if(this.length>Z.length)return this.clone().ixor(Z);return Z.clone().ixor(this)},J.prototype.uxor=function(Z){if(this.length>Z.length)return this.clone().iuxor(Z);return Z.clone().iuxor(this)},J.prototype.inotn=function(Z){C(typeof Z==="number"&&Z>=0);var $=Math.ceil(Z/26)|0,I=Z%26;if(this._expand($),I>0)$--;for(var L=0;L<$;L++)this.words[L]=~this.words[L]&67108863;if(I>0)this.words[L]=~this.words[L]&67108863>>26-I;return this._strip()},J.prototype.notn=function(Z){return this.clone().inotn(Z)},J.prototype.setn=function(Z,$){C(typeof Z==="number"&&Z>=0);var I=Z/26|0,L=Z%26;if(this._expand(I+1),$)this.words[I]=this.words[I]|1<<L;else this.words[I]=this.words[I]&~(1<<L);return this._strip()},J.prototype.iadd=function(Z){var $;if(this.negative!==0&&Z.negative===0)return this.negative=0,$=this.isub(Z),this.negative^=1,this._normSign();else if(this.negative===0&&Z.negative!==0)return Z.negative=0,$=this.isub(Z),Z.negative=1,$._normSign();var I,L;if(this.length>Z.length)I=this,L=Z;else I=Z,L=this;var G=0;for(var O=0;O<L.length;O++)$=(I.words[O]|0)+(L.words[O]|0)+G,this.words[O]=$&67108863,G=$>>>26;for(;G!==0&&O<I.length;O++)$=(I.words[O]|0)+G,this.words[O]=$&67108863,G=$>>>26;if(this.length=I.length,G!==0)this.words[this.length]=G,this.length++;else if(I!==this)for(;O<I.length;O++)this.words[O]=I.words[O];return this},J.prototype.add=function(Z){var $;if(Z.negative!==0&&this.negative===0)return Z.negative=0,$=this.sub(Z),Z.negative^=1,$;else if(Z.negative===0&&this.negative!==0)return this.negative=0,$=Z.sub(this),this.negative=1,$;if(this.length>Z.length)return this.clone().iadd(Z);return Z.clone().iadd(this)},J.prototype.isub=function(Z){if(Z.negative!==0){Z.negative=0;var $=this.iadd(Z);return Z.negative=1,$._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Z),this.negative=1,this._normSign();var I=this.cmp(Z);if(I===0)return this.negative=0,this.length=1,this.words[0]=0,this;var L,G;if(I>0)L=this,G=Z;else L=Z,G=this;var O=0;for(var E=0;E<G.length;E++)$=(L.words[E]|0)-(G.words[E]|0)+O,O=$>>26,this.words[E]=$&67108863;for(;O!==0&&E<L.length;E++)$=(L.words[E]|0)+O,O=$>>26,this.words[E]=$&67108863;if(O===0&&E<L.length&&L!==this)for(;E<L.length;E++)this.words[E]=L.words[E];if(this.length=Math.max(this.length,E),L!==this)this.negative=1;return this._strip()},J.prototype.sub=function(Z){return this.clone().isub(Z)};function j(Z,$,I){I.negative=$.negative^Z.negative;var L=Z.length+$.length|0;I.length=L,L=L-1|0;var G=Z.words[0]|0,O=$.words[0]|0,E=G*O,z=E&67108863,S=E/67108864|0;I.words[0]=z;for(var v=1;v<L;v++){var g=S>>>26,p=S&67108863,n=Math.min(v,$.length-1);for(var V0=Math.max(0,v-Z.length+1);V0<=n;V0++){var r=v-V0|0;G=Z.words[r]|0,O=$.words[V0]|0,E=G*O+p,g+=E/67108864|0,p=E&67108863}I.words[v]=p|0,S=g|0}if(S!==0)I.words[v]=S|0;else I.length--;return I._strip()}var x=function(Z,$,I){var L=Z.words,G=$.words,O=I.words,E=0,z,S,v,g=L[0]|0,p=g&8191,n=g>>>13,V0=L[1]|0,r=V0&8191,l=V0>>>13,X0=L[2]|0,m=X0&8191,i=X0>>>13,g0=L[3]|0,y=g0&8191,h=g0>>>13,Q0=L[4]|0,t=Q0&8191,e=Q0>>>13,F0=L[5]|0,c=F0&8191,o=F0>>>13,N0=L[6]|0,s=N0&8191,Z0=N0>>>13,w0=L[7]|0,C0=w0&8191,L0=w0>>>13,s0=L[8]|0,E0=s0&8191,K0=s0>>>13,e0=L[9]|0,S0=e0&8191,W0=e0>>>13,FU=G[0]|0,R0=FU&8191,k0=FU>>>13,RU=G[1]|0,_0=RU&8191,T0=RU>>>13,SU=G[2]|0,v0=SU&8191,z0=SU>>>13,CU=G[3]|0,j0=CU&8191,B0=CU>>>13,LU=G[4]|0,M0=LU&8191,N=LU>>>13,b=G[5]|0,a=b&8191,U0=b>>>13,f0=G[6]|0,I0=f0&8191,H0=f0>>>13,t0=G[7]|0,q0=t0&8191,x0=t0>>>13,DU=G[8]|0,P0=DU&8191,D0=DU>>>13,r0=G[9]|0,c0=r0&8191,y0=r0>>>13;I.negative=Z.negative^$.negative,I.length=19,z=Math.imul(p,R0),S=Math.imul(p,k0),S=S+Math.imul(n,R0)|0,v=Math.imul(n,k0);var d0=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(d0>>>26)|0,d0&=67108863,z=Math.imul(r,R0),S=Math.imul(r,k0),S=S+Math.imul(l,R0)|0,v=Math.imul(l,k0),z=z+Math.imul(p,_0)|0,S=S+Math.imul(p,T0)|0,S=S+Math.imul(n,_0)|0,v=v+Math.imul(n,T0)|0;var l0=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(l0>>>26)|0,l0&=67108863,z=Math.imul(m,R0),S=Math.imul(m,k0),S=S+Math.imul(i,R0)|0,v=Math.imul(i,k0),z=z+Math.imul(r,_0)|0,S=S+Math.imul(r,T0)|0,S=S+Math.imul(l,_0)|0,v=v+Math.imul(l,T0)|0,z=z+Math.imul(p,v0)|0,S=S+Math.imul(p,z0)|0,S=S+Math.imul(n,v0)|0,v=v+Math.imul(n,z0)|0;var i0=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(i0>>>26)|0,i0&=67108863,z=Math.imul(y,R0),S=Math.imul(y,k0),S=S+Math.imul(h,R0)|0,v=Math.imul(h,k0),z=z+Math.imul(m,_0)|0,S=S+Math.imul(m,T0)|0,S=S+Math.imul(i,_0)|0,v=v+Math.imul(i,T0)|0,z=z+Math.imul(r,v0)|0,S=S+Math.imul(r,z0)|0,S=S+Math.imul(l,v0)|0,v=v+Math.imul(l,z0)|0,z=z+Math.imul(p,j0)|0,S=S+Math.imul(p,B0)|0,S=S+Math.imul(n,j0)|0,v=v+Math.imul(n,B0)|0;var UU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(UU>>>26)|0,UU&=67108863,z=Math.imul(t,R0),S=Math.imul(t,k0),S=S+Math.imul(e,R0)|0,v=Math.imul(e,k0),z=z+Math.imul(y,_0)|0,S=S+Math.imul(y,T0)|0,S=S+Math.imul(h,_0)|0,v=v+Math.imul(h,T0)|0,z=z+Math.imul(m,v0)|0,S=S+Math.imul(m,z0)|0,S=S+Math.imul(i,v0)|0,v=v+Math.imul(i,z0)|0,z=z+Math.imul(r,j0)|0,S=S+Math.imul(r,B0)|0,S=S+Math.imul(l,j0)|0,v=v+Math.imul(l,B0)|0,z=z+Math.imul(p,M0)|0,S=S+Math.imul(p,N)|0,S=S+Math.imul(n,M0)|0,v=v+Math.imul(n,N)|0;var OU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(OU>>>26)|0,OU&=67108863,z=Math.imul(c,R0),S=Math.imul(c,k0),S=S+Math.imul(o,R0)|0,v=Math.imul(o,k0),z=z+Math.imul(t,_0)|0,S=S+Math.imul(t,T0)|0,S=S+Math.imul(e,_0)|0,v=v+Math.imul(e,T0)|0,z=z+Math.imul(y,v0)|0,S=S+Math.imul(y,z0)|0,S=S+Math.imul(h,v0)|0,v=v+Math.imul(h,z0)|0,z=z+Math.imul(m,j0)|0,S=S+Math.imul(m,B0)|0,S=S+Math.imul(i,j0)|0,v=v+Math.imul(i,B0)|0,z=z+Math.imul(r,M0)|0,S=S+Math.imul(r,N)|0,S=S+Math.imul(l,M0)|0,v=v+Math.imul(l,N)|0,z=z+Math.imul(p,a)|0,S=S+Math.imul(p,U0)|0,S=S+Math.imul(n,a)|0,v=v+Math.imul(n,U0)|0;var ZU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,z=Math.imul(s,R0),S=Math.imul(s,k0),S=S+Math.imul(Z0,R0)|0,v=Math.imul(Z0,k0),z=z+Math.imul(c,_0)|0,S=S+Math.imul(c,T0)|0,S=S+Math.imul(o,_0)|0,v=v+Math.imul(o,T0)|0,z=z+Math.imul(t,v0)|0,S=S+Math.imul(t,z0)|0,S=S+Math.imul(e,v0)|0,v=v+Math.imul(e,z0)|0,z=z+Math.imul(y,j0)|0,S=S+Math.imul(y,B0)|0,S=S+Math.imul(h,j0)|0,v=v+Math.imul(h,B0)|0,z=z+Math.imul(m,M0)|0,S=S+Math.imul(m,N)|0,S=S+Math.imul(i,M0)|0,v=v+Math.imul(i,N)|0,z=z+Math.imul(r,a)|0,S=S+Math.imul(r,U0)|0,S=S+Math.imul(l,a)|0,v=v+Math.imul(l,U0)|0,z=z+Math.imul(p,I0)|0,S=S+Math.imul(p,H0)|0,S=S+Math.imul(n,I0)|0,v=v+Math.imul(n,H0)|0;var XU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(XU>>>26)|0,XU&=67108863,z=Math.imul(C0,R0),S=Math.imul(C0,k0),S=S+Math.imul(L0,R0)|0,v=Math.imul(L0,k0),z=z+Math.imul(s,_0)|0,S=S+Math.imul(s,T0)|0,S=S+Math.imul(Z0,_0)|0,v=v+Math.imul(Z0,T0)|0,z=z+Math.imul(c,v0)|0,S=S+Math.imul(c,z0)|0,S=S+Math.imul(o,v0)|0,v=v+Math.imul(o,z0)|0,z=z+Math.imul(t,j0)|0,S=S+Math.imul(t,B0)|0,S=S+Math.imul(e,j0)|0,v=v+Math.imul(e,B0)|0,z=z+Math.imul(y,M0)|0,S=S+Math.imul(y,N)|0,S=S+Math.imul(h,M0)|0,v=v+Math.imul(h,N)|0,z=z+Math.imul(m,a)|0,S=S+Math.imul(m,U0)|0,S=S+Math.imul(i,a)|0,v=v+Math.imul(i,U0)|0,z=z+Math.imul(r,I0)|0,S=S+Math.imul(r,H0)|0,S=S+Math.imul(l,I0)|0,v=v+Math.imul(l,H0)|0,z=z+Math.imul(p,q0)|0,S=S+Math.imul(p,x0)|0,S=S+Math.imul(n,q0)|0,v=v+Math.imul(n,x0)|0;var QU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(QU>>>26)|0,QU&=67108863,z=Math.imul(E0,R0),S=Math.imul(E0,k0),S=S+Math.imul(K0,R0)|0,v=Math.imul(K0,k0),z=z+Math.imul(C0,_0)|0,S=S+Math.imul(C0,T0)|0,S=S+Math.imul(L0,_0)|0,v=v+Math.imul(L0,T0)|0,z=z+Math.imul(s,v0)|0,S=S+Math.imul(s,z0)|0,S=S+Math.imul(Z0,v0)|0,v=v+Math.imul(Z0,z0)|0,z=z+Math.imul(c,j0)|0,S=S+Math.imul(c,B0)|0,S=S+Math.imul(o,j0)|0,v=v+Math.imul(o,B0)|0,z=z+Math.imul(t,M0)|0,S=S+Math.imul(t,N)|0,S=S+Math.imul(e,M0)|0,v=v+Math.imul(e,N)|0,z=z+Math.imul(y,a)|0,S=S+Math.imul(y,U0)|0,S=S+Math.imul(h,a)|0,v=v+Math.imul(h,U0)|0,z=z+Math.imul(m,I0)|0,S=S+Math.imul(m,H0)|0,S=S+Math.imul(i,I0)|0,v=v+Math.imul(i,H0)|0,z=z+Math.imul(r,q0)|0,S=S+Math.imul(r,x0)|0,S=S+Math.imul(l,q0)|0,v=v+Math.imul(l,x0)|0,z=z+Math.imul(p,P0)|0,S=S+Math.imul(p,D0)|0,S=S+Math.imul(n,P0)|0,v=v+Math.imul(n,D0)|0;var YU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(YU>>>26)|0,YU&=67108863,z=Math.imul(S0,R0),S=Math.imul(S0,k0),S=S+Math.imul(W0,R0)|0,v=Math.imul(W0,k0),z=z+Math.imul(E0,_0)|0,S=S+Math.imul(E0,T0)|0,S=S+Math.imul(K0,_0)|0,v=v+Math.imul(K0,T0)|0,z=z+Math.imul(C0,v0)|0,S=S+Math.imul(C0,z0)|0,S=S+Math.imul(L0,v0)|0,v=v+Math.imul(L0,z0)|0,z=z+Math.imul(s,j0)|0,S=S+Math.imul(s,B0)|0,S=S+Math.imul(Z0,j0)|0,v=v+Math.imul(Z0,B0)|0,z=z+Math.imul(c,M0)|0,S=S+Math.imul(c,N)|0,S=S+Math.imul(o,M0)|0,v=v+Math.imul(o,N)|0,z=z+Math.imul(t,a)|0,S=S+Math.imul(t,U0)|0,S=S+Math.imul(e,a)|0,v=v+Math.imul(e,U0)|0,z=z+Math.imul(y,I0)|0,S=S+Math.imul(y,H0)|0,S=S+Math.imul(h,I0)|0,v=v+Math.imul(h,H0)|0,z=z+Math.imul(m,q0)|0,S=S+Math.imul(m,x0)|0,S=S+Math.imul(i,q0)|0,v=v+Math.imul(i,x0)|0,z=z+Math.imul(r,P0)|0,S=S+Math.imul(r,D0)|0,S=S+Math.imul(l,P0)|0,v=v+Math.imul(l,D0)|0,z=z+Math.imul(p,c0)|0,S=S+Math.imul(p,y0)|0,S=S+Math.imul(n,c0)|0,v=v+Math.imul(n,y0)|0;var $U=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+($U>>>26)|0,$U&=67108863,z=Math.imul(S0,_0),S=Math.imul(S0,T0),S=S+Math.imul(W0,_0)|0,v=Math.imul(W0,T0),z=z+Math.imul(E0,v0)|0,S=S+Math.imul(E0,z0)|0,S=S+Math.imul(K0,v0)|0,v=v+Math.imul(K0,z0)|0,z=z+Math.imul(C0,j0)|0,S=S+Math.imul(C0,B0)|0,S=S+Math.imul(L0,j0)|0,v=v+Math.imul(L0,B0)|0,z=z+Math.imul(s,M0)|0,S=S+Math.imul(s,N)|0,S=S+Math.imul(Z0,M0)|0,v=v+Math.imul(Z0,N)|0,z=z+Math.imul(c,a)|0,S=S+Math.imul(c,U0)|0,S=S+Math.imul(o,a)|0,v=v+Math.imul(o,U0)|0,z=z+Math.imul(t,I0)|0,S=S+Math.imul(t,H0)|0,S=S+Math.imul(e,I0)|0,v=v+Math.imul(e,H0)|0,z=z+Math.imul(y,q0)|0,S=S+Math.imul(y,x0)|0,S=S+Math.imul(h,q0)|0,v=v+Math.imul(h,x0)|0,z=z+Math.imul(m,P0)|0,S=S+Math.imul(m,D0)|0,S=S+Math.imul(i,P0)|0,v=v+Math.imul(i,D0)|0,z=z+Math.imul(r,c0)|0,S=S+Math.imul(r,y0)|0,S=S+Math.imul(l,c0)|0,v=v+Math.imul(l,y0)|0;var JU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(JU>>>26)|0,JU&=67108863,z=Math.imul(S0,v0),S=Math.imul(S0,z0),S=S+Math.imul(W0,v0)|0,v=Math.imul(W0,z0),z=z+Math.imul(E0,j0)|0,S=S+Math.imul(E0,B0)|0,S=S+Math.imul(K0,j0)|0,v=v+Math.imul(K0,B0)|0,z=z+Math.imul(C0,M0)|0,S=S+Math.imul(C0,N)|0,S=S+Math.imul(L0,M0)|0,v=v+Math.imul(L0,N)|0,z=z+Math.imul(s,a)|0,S=S+Math.imul(s,U0)|0,S=S+Math.imul(Z0,a)|0,v=v+Math.imul(Z0,U0)|0,z=z+Math.imul(c,I0)|0,S=S+Math.imul(c,H0)|0,S=S+Math.imul(o,I0)|0,v=v+Math.imul(o,H0)|0,z=z+Math.imul(t,q0)|0,S=S+Math.imul(t,x0)|0,S=S+Math.imul(e,q0)|0,v=v+Math.imul(e,x0)|0,z=z+Math.imul(y,P0)|0,S=S+Math.imul(y,D0)|0,S=S+Math.imul(h,P0)|0,v=v+Math.imul(h,D0)|0,z=z+Math.imul(m,c0)|0,S=S+Math.imul(m,y0)|0,S=S+Math.imul(i,c0)|0,v=v+Math.imul(i,y0)|0;var AU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(AU>>>26)|0,AU&=67108863,z=Math.imul(S0,j0),S=Math.imul(S0,B0),S=S+Math.imul(W0,j0)|0,v=Math.imul(W0,B0),z=z+Math.imul(E0,M0)|0,S=S+Math.imul(E0,N)|0,S=S+Math.imul(K0,M0)|0,v=v+Math.imul(K0,N)|0,z=z+Math.imul(C0,a)|0,S=S+Math.imul(C0,U0)|0,S=S+Math.imul(L0,a)|0,v=v+Math.imul(L0,U0)|0,z=z+Math.imul(s,I0)|0,S=S+Math.imul(s,H0)|0,S=S+Math.imul(Z0,I0)|0,v=v+Math.imul(Z0,H0)|0,z=z+Math.imul(c,q0)|0,S=S+Math.imul(c,x0)|0,S=S+Math.imul(o,q0)|0,v=v+Math.imul(o,x0)|0,z=z+Math.imul(t,P0)|0,S=S+Math.imul(t,D0)|0,S=S+Math.imul(e,P0)|0,v=v+Math.imul(e,D0)|0,z=z+Math.imul(y,c0)|0,S=S+Math.imul(y,y0)|0,S=S+Math.imul(h,c0)|0,v=v+Math.imul(h,y0)|0;var GU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(GU>>>26)|0,GU&=67108863,z=Math.imul(S0,M0),S=Math.imul(S0,N),S=S+Math.imul(W0,M0)|0,v=Math.imul(W0,N),z=z+Math.imul(E0,a)|0,S=S+Math.imul(E0,U0)|0,S=S+Math.imul(K0,a)|0,v=v+Math.imul(K0,U0)|0,z=z+Math.imul(C0,I0)|0,S=S+Math.imul(C0,H0)|0,S=S+Math.imul(L0,I0)|0,v=v+Math.imul(L0,H0)|0,z=z+Math.imul(s,q0)|0,S=S+Math.imul(s,x0)|0,S=S+Math.imul(Z0,q0)|0,v=v+Math.imul(Z0,x0)|0,z=z+Math.imul(c,P0)|0,S=S+Math.imul(c,D0)|0,S=S+Math.imul(o,P0)|0,v=v+Math.imul(o,D0)|0,z=z+Math.imul(t,c0)|0,S=S+Math.imul(t,y0)|0,S=S+Math.imul(e,c0)|0,v=v+Math.imul(e,y0)|0;var VU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(VU>>>26)|0,VU&=67108863,z=Math.imul(S0,a),S=Math.imul(S0,U0),S=S+Math.imul(W0,a)|0,v=Math.imul(W0,U0),z=z+Math.imul(E0,I0)|0,S=S+Math.imul(E0,H0)|0,S=S+Math.imul(K0,I0)|0,v=v+Math.imul(K0,H0)|0,z=z+Math.imul(C0,q0)|0,S=S+Math.imul(C0,x0)|0,S=S+Math.imul(L0,q0)|0,v=v+Math.imul(L0,x0)|0,z=z+Math.imul(s,P0)|0,S=S+Math.imul(s,D0)|0,S=S+Math.imul(Z0,P0)|0,v=v+Math.imul(Z0,D0)|0,z=z+Math.imul(c,c0)|0,S=S+Math.imul(c,y0)|0,S=S+Math.imul(o,c0)|0,v=v+Math.imul(o,y0)|0;var EU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(EU>>>26)|0,EU&=67108863,z=Math.imul(S0,I0),S=Math.imul(S0,H0),S=S+Math.imul(W0,I0)|0,v=Math.imul(W0,H0),z=z+Math.imul(E0,q0)|0,S=S+Math.imul(E0,x0)|0,S=S+Math.imul(K0,q0)|0,v=v+Math.imul(K0,x0)|0,z=z+Math.imul(C0,P0)|0,S=S+Math.imul(C0,D0)|0,S=S+Math.imul(L0,P0)|0,v=v+Math.imul(L0,D0)|0,z=z+Math.imul(s,c0)|0,S=S+Math.imul(s,y0)|0,S=S+Math.imul(Z0,c0)|0,v=v+Math.imul(Z0,y0)|0;var IU=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(IU>>>26)|0,IU&=67108863,z=Math.imul(S0,q0),S=Math.imul(S0,x0),S=S+Math.imul(W0,q0)|0,v=Math.imul(W0,x0),z=z+Math.imul(E0,P0)|0,S=S+Math.imul(E0,D0)|0,S=S+Math.imul(K0,P0)|0,v=v+Math.imul(K0,D0)|0,z=z+Math.imul(C0,c0)|0,S=S+Math.imul(C0,y0)|0,S=S+Math.imul(L0,c0)|0,v=v+Math.imul(L0,y0)|0;var GZ=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(GZ>>>26)|0,GZ&=67108863,z=Math.imul(S0,P0),S=Math.imul(S0,D0),S=S+Math.imul(W0,P0)|0,v=Math.imul(W0,D0),z=z+Math.imul(E0,c0)|0,S=S+Math.imul(E0,y0)|0,S=S+Math.imul(K0,c0)|0,v=v+Math.imul(K0,y0)|0;var VZ=(E+z|0)+((S&8191)<<13)|0;E=(v+(S>>>13)|0)+(VZ>>>26)|0,VZ&=67108863,z=Math.imul(S0,c0),S=Math.imul(S0,y0),S=S+Math.imul(W0,c0)|0,v=Math.imul(W0,y0);var EZ=(E+z|0)+((S&8191)<<13)|0;if(E=(v+(S>>>13)|0)+(EZ>>>26)|0,EZ&=67108863,O[0]=d0,O[1]=l0,O[2]=i0,O[3]=UU,O[4]=OU,O[5]=ZU,O[6]=XU,O[7]=QU,O[8]=YU,O[9]=$U,O[10]=JU,O[11]=AU,O[12]=GU,O[13]=VU,O[14]=EU,O[15]=IU,O[16]=GZ,O[17]=VZ,O[18]=EZ,E!==0)O[19]=E,I.length++;return I};if(!Math.imul)x=j;function f(Z,$,I){I.negative=$.negative^Z.negative,I.length=Z.length+$.length;var L=0,G=0;for(var O=0;O<I.length-1;O++){var E=G;G=0;var z=L&67108863,S=Math.min(O,$.length-1);for(var v=Math.max(0,O-Z.length+1);v<=S;v++){var g=O-v,p=Z.words[g]|0,n=$.words[v]|0,V0=p*n,r=V0&67108863;E=E+(V0/67108864|0)|0,r=r+z|0,z=r&67108863,E=E+(r>>>26)|0,G+=E>>>26,E&=67108863}I.words[O]=z,L=E,E=G}if(L!==0)I.words[O]=L;else I.length--;return I._strip()}function w(Z,$,I){return f(Z,$,I)}J.prototype.mulTo=function(Z,$){var I,L=this.length+Z.length;if(this.length===10&&Z.length===10)I=x(this,Z,$);else if(L<63)I=j(this,Z,$);else if(L<1024)I=f(this,Z,$);else I=w(this,Z,$);return I};function d(Z,$){this.x=Z,this.y=$}d.prototype.makeRBT=function(Z){var $=Array(Z),I=J.prototype._countBits(Z)-1;for(var L=0;L<Z;L++)$[L]=this.revBin(L,I,Z);return $},d.prototype.revBin=function(Z,$,I){if(Z===0||Z===I-1)return Z;var L=0;for(var G=0;G<$;G++)L|=(Z&1)<<$-G-1,Z>>=1;return L},d.prototype.permute=function(Z,$,I,L,G,O){for(var E=0;E<O;E++)L[E]=$[Z[E]],G[E]=I[Z[E]]},d.prototype.transform=function(Z,$,I,L,G,O){this.permute(O,Z,$,I,L,G);for(var E=1;E<G;E<<=1){var z=E<<1,S=Math.cos(2*Math.PI/z),v=Math.sin(2*Math.PI/z);for(var g=0;g<G;g+=z){var p=S,n=v;for(var V0=0;V0<E;V0++){var r=I[g+V0],l=L[g+V0],X0=I[g+V0+E],m=L[g+V0+E],i=p*X0-n*m;if(m=p*m+n*X0,X0=i,I[g+V0]=r+X0,L[g+V0]=l+m,I[g+V0+E]=r-X0,L[g+V0+E]=l-m,V0!==z)i=S*p-v*n,n=S*n+v*p,p=i}}}},d.prototype.guessLen13b=function(Z,$){var I=Math.max($,Z)|1,L=I&1,G=0;for(I=I/2|0;I;I=I>>>1)G++;return 1<<G+1+L},d.prototype.conjugate=function(Z,$,I){if(I<=1)return;for(var L=0;L<I/2;L++){var G=Z[L];Z[L]=Z[I-L-1],Z[I-L-1]=G,G=$[L],$[L]=-$[I-L-1],$[I-L-1]=-G}},d.prototype.normalize13b=function(Z,$){var I=0;for(var L=0;L<$/2;L++){var G=Math.round(Z[2*L+1]/$)*8192+Math.round(Z[2*L]/$)+I;if(Z[L]=G&67108863,G<67108864)I=0;else I=G/67108864|0}return Z},d.prototype.convert13b=function(Z,$,I,L){var G=0;for(var O=0;O<$;O++)G=G+(Z[O]|0),I[2*O]=G&8191,G=G>>>13,I[2*O+1]=G&8191,G=G>>>13;for(O=2*$;O<L;++O)I[O]=0;C(G===0),C((G&-8192)===0)},d.prototype.stub=function(Z){var $=Array(Z);for(var I=0;I<Z;I++)$[I]=0;return $},d.prototype.mulp=function(Z,$,I){var L=2*this.guessLen13b(Z.length,$.length),G=this.makeRBT(L),O=this.stub(L),E=Array(L),z=Array(L),S=Array(L),v=Array(L),g=Array(L),p=Array(L),n=I.words;n.length=L,this.convert13b(Z.words,Z.length,E,L),this.convert13b($.words,$.length,v,L),this.transform(E,O,z,S,L,G),this.transform(v,O,g,p,L,G);for(var V0=0;V0<L;V0++){var r=z[V0]*g[V0]-S[V0]*p[V0];S[V0]=z[V0]*p[V0]+S[V0]*g[V0],z[V0]=r}return this.conjugate(z,S,L),this.transform(z,S,n,O,L,G),this.conjugate(n,O,L),this.normalize13b(n,L),I.negative=Z.negative^$.negative,I.length=Z.length+$.length,I._strip()},J.prototype.mul=function(Z){var $=new J(null);return $.words=Array(this.length+Z.length),this.mulTo(Z,$)},J.prototype.mulf=function(Z){var $=new J(null);return $.words=Array(this.length+Z.length),w(this,Z,$)},J.prototype.imul=function(Z){return this.clone().mulTo(Z,this)},J.prototype.imuln=function(Z){var $=Z<0;if($)Z=-Z;C(typeof Z==="number"),C(Z<67108864);var I=0;for(var L=0;L<this.length;L++){var G=(this.words[L]|0)*Z,O=(G&67108863)+(I&67108863);I>>=26,I+=G/67108864|0,I+=O>>>26,this.words[L]=O&67108863}if(I!==0)this.words[L]=I,this.length++;return this.length=Z===0?1:this.length,$?this.ineg():this},J.prototype.muln=function(Z){return this.clone().imuln(Z)},J.prototype.sqr=function(){return this.mul(this)},J.prototype.isqr=function(){return this.imul(this.clone())},J.prototype.pow=function(Z){var $=B(Z);if($.length===0)return new J(1);var I=this;for(var L=0;L<$.length;L++,I=I.sqr())if($[L]!==0)break;if(++L<$.length)for(var G=I.sqr();L<$.length;L++,G=G.sqr()){if($[L]===0)continue;I=I.mul(G)}return I},J.prototype.iushln=function(Z){C(typeof Z==="number"&&Z>=0);var $=Z%26,I=(Z-$)/26,L=67108863>>>26-$<<26-$,G;if($!==0){var O=0;for(G=0;G<this.length;G++){var E=this.words[G]&L,z=(this.words[G]|0)-E<<$;this.words[G]=z|O,O=E>>>26-$}if(O)this.words[G]=O,this.length++}if(I!==0){for(G=this.length-1;G>=0;G--)this.words[G+I]=this.words[G];for(G=0;G<I;G++)this.words[G]=0;this.length+=I}return this._strip()},J.prototype.ishln=function(Z){return C(this.negative===0),this.iushln(Z)},J.prototype.iushrn=function(Z,$,I){C(typeof Z==="number"&&Z>=0);var L;if($)L=($-$%26)/26;else L=0;var G=Z%26,O=Math.min((Z-G)/26,this.length),E=67108863^67108863>>>G<<G,z=I;if(L-=O,L=Math.max(0,L),z){for(var S=0;S<O;S++)z.words[S]=this.words[S];z.length=O}if(O===0);else if(this.length>O){this.length-=O;for(S=0;S<this.length;S++)this.words[S]=this.words[S+O]}else this.words[0]=0,this.length=1;var v=0;for(S=this.length-1;S>=0&&(v!==0||S>=L);S--){var g=this.words[S]|0;this.words[S]=v<<26-G|g>>>G,v=g&E}if(z&&v!==0)z.words[z.length++]=v;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},J.prototype.ishrn=function(Z,$,I){return C(this.negative===0),this.iushrn(Z,$,I)},J.prototype.shln=function(Z){return this.clone().ishln(Z)},J.prototype.ushln=function(Z){return this.clone().iushln(Z)},J.prototype.shrn=function(Z){return this.clone().ishrn(Z)},J.prototype.ushrn=function(Z){return this.clone().iushrn(Z)},J.prototype.testn=function(Z){C(typeof Z==="number"&&Z>=0);var $=Z%26,I=(Z-$)/26,L=1<<$;if(this.length<=I)return!1;var G=this.words[I];return!!(G&L)},J.prototype.imaskn=function(Z){C(typeof Z==="number"&&Z>=0);var $=Z%26,I=(Z-$)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=I)return this;if($!==0)I++;if(this.length=Math.min(I,this.length),$!==0){var L=67108863^67108863>>>$<<$;this.words[this.length-1]&=L}return this._strip()},J.prototype.maskn=function(Z){return this.clone().imaskn(Z)},J.prototype.iaddn=function(Z){if(C(typeof Z==="number"),C(Z<67108864),Z<0)return this.isubn(-Z);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=Z)return this.words[0]=Z-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Z),this.negative=1,this}return this._iaddn(Z)},J.prototype._iaddn=function(Z){this.words[0]+=Z;for(var $=0;$<this.length&&this.words[$]>=67108864;$++)if(this.words[$]-=67108864,$===this.length-1)this.words[$+1]=1;else this.words[$+1]++;return this.length=Math.max(this.length,$+1),this},J.prototype.isubn=function(Z){if(C(typeof Z==="number"),C(Z<67108864),Z<0)return this.iaddn(-Z);if(this.negative!==0)return this.negative=0,this.iaddn(Z),this.negative=1,this;if(this.words[0]-=Z,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var $=0;$<this.length&&this.words[$]<0;$++)this.words[$]+=67108864,this.words[$+1]-=1;return this._strip()},J.prototype.addn=function(Z){return this.clone().iaddn(Z)},J.prototype.subn=function(Z){return this.clone().isubn(Z)},J.prototype.iabs=function(){return this.negative=0,this},J.prototype.abs=function(){return this.clone().iabs()},J.prototype._ishlnsubmul=function(Z,$,I){var L=Z.length+I,G;this._expand(L);var O,E=0;for(G=0;G<Z.length;G++){O=(this.words[G+I]|0)+E;var z=(Z.words[G]|0)*$;O-=z&67108863,E=(O>>26)-(z/67108864|0),this.words[G+I]=O&67108863}for(;G<this.length-I;G++)O=(this.words[G+I]|0)+E,E=O>>26,this.words[G+I]=O&67108863;if(E===0)return this._strip();C(E===-1),E=0;for(G=0;G<this.length;G++)O=-(this.words[G]|0)+E,E=O>>26,this.words[G]=O&67108863;return this.negative=1,this._strip()},J.prototype._wordDiv=function(Z,$){var I=this.length-Z.length,L=this.clone(),G=Z,O=G.words[G.length-1]|0,E=this._countBits(O);if(I=26-E,I!==0)G=G.ushln(I),L.iushln(I),O=G.words[G.length-1]|0;var z=L.length-G.length,S;if($!=="mod"){S=new J(null),S.length=z+1,S.words=Array(S.length);for(var v=0;v<S.length;v++)S.words[v]=0}var g=L.clone()._ishlnsubmul(G,1,z);if(g.negative===0){if(L=g,S)S.words[z]=1}for(var p=z-1;p>=0;p--){var n=(L.words[G.length+p]|0)*67108864+(L.words[G.length+p-1]|0);n=Math.min(n/O|0,67108863),L._ishlnsubmul(G,n,p);while(L.negative!==0)if(n--,L.negative=0,L._ishlnsubmul(G,1,p),!L.isZero())L.negative^=1;if(S)S.words[p]=n}if(S)S._strip();if(L._strip(),$!=="div"&&I!==0)L.iushrn(I);return{div:S||null,mod:L}},J.prototype.divmod=function(Z,$,I){if(C(!Z.isZero()),this.isZero())return{div:new J(0),mod:new J(0)};var L,G,O;if(this.negative!==0&&Z.negative===0){if(O=this.neg().divmod(Z,$),$!=="mod")L=O.div.neg();if($!=="div"){if(G=O.mod.neg(),I&&G.negative!==0)G.iadd(Z)}return{div:L,mod:G}}if(this.negative===0&&Z.negative!==0){if(O=this.divmod(Z.neg(),$),$!=="mod")L=O.div.neg();return{div:L,mod:O.mod}}if((this.negative&Z.negative)!==0){if(O=this.neg().divmod(Z.neg(),$),$!=="div"){if(G=O.mod.neg(),I&&G.negative!==0)G.isub(Z)}return{div:O.div,mod:G}}if(Z.length>this.length||this.cmp(Z)<0)return{div:new J(0),mod:this};if(Z.length===1){if($==="div")return{div:this.divn(Z.words[0]),mod:null};if($==="mod")return{div:null,mod:new J(this.modrn(Z.words[0]))};return{div:this.divn(Z.words[0]),mod:new J(this.modrn(Z.words[0]))}}return this._wordDiv(Z,$)},J.prototype.div=function(Z){return this.divmod(Z,"div",!1).div},J.prototype.mod=function(Z){return this.divmod(Z,"mod",!1).mod},J.prototype.umod=function(Z){return this.divmod(Z,"mod",!0).mod},J.prototype.divRound=function(Z){var $=this.divmod(Z);if($.mod.isZero())return $.div;var I=$.div.negative!==0?$.mod.isub(Z):$.mod,L=Z.ushrn(1),G=Z.andln(1),O=I.cmp(L);if(O<0||G===1&&O===0)return $.div;return $.div.negative!==0?$.div.isubn(1):$.div.iaddn(1)},J.prototype.modrn=function(Z){var $=Z<0;if($)Z=-Z;C(Z<=67108863);var I=67108864%Z,L=0;for(var G=this.length-1;G>=0;G--)L=(I*L+(this.words[G]|0))%Z;return $?-L:L},J.prototype.modn=function(Z){return this.modrn(Z)},J.prototype.idivn=function(Z){var $=Z<0;if($)Z=-Z;C(Z<=67108863);var I=0;for(var L=this.length-1;L>=0;L--){var G=(this.words[L]|0)+I*67108864;this.words[L]=G/Z|0,I=G%Z}return this._strip(),$?this.ineg():this},J.prototype.divn=function(Z){return this.clone().idivn(Z)},J.prototype.egcd=function(Z){C(Z.negative===0),C(!Z.isZero());var $=this,I=Z.clone();if($.negative!==0)$=$.umod(Z);else $=$.clone();var L=new J(1),G=new J(0),O=new J(0),E=new J(1),z=0;while($.isEven()&&I.isEven())$.iushrn(1),I.iushrn(1),++z;var S=I.clone(),v=$.clone();while(!$.isZero()){for(var g=0,p=1;($.words[0]&p)===0&&g<26;++g,p<<=1);if(g>0){$.iushrn(g);while(g-- >0){if(L.isOdd()||G.isOdd())L.iadd(S),G.isub(v);L.iushrn(1),G.iushrn(1)}}for(var n=0,V0=1;(I.words[0]&V0)===0&&n<26;++n,V0<<=1);if(n>0){I.iushrn(n);while(n-- >0){if(O.isOdd()||E.isOdd())O.iadd(S),E.isub(v);O.iushrn(1),E.iushrn(1)}}if($.cmp(I)>=0)$.isub(I),L.isub(O),G.isub(E);else I.isub($),O.isub(L),E.isub(G)}return{a:O,b:E,gcd:I.iushln(z)}},J.prototype._invmp=function(Z){C(Z.negative===0),C(!Z.isZero());var $=this,I=Z.clone();if($.negative!==0)$=$.umod(Z);else $=$.clone();var L=new J(1),G=new J(0),O=I.clone();while($.cmpn(1)>0&&I.cmpn(1)>0){for(var E=0,z=1;($.words[0]&z)===0&&E<26;++E,z<<=1);if(E>0){$.iushrn(E);while(E-- >0){if(L.isOdd())L.iadd(O);L.iushrn(1)}}for(var S=0,v=1;(I.words[0]&v)===0&&S<26;++S,v<<=1);if(S>0){I.iushrn(S);while(S-- >0){if(G.isOdd())G.iadd(O);G.iushrn(1)}}if($.cmp(I)>=0)$.isub(I),L.isub(G);else I.isub($),G.isub(L)}var g;if($.cmpn(1)===0)g=L;else g=G;if(g.cmpn(0)<0)g.iadd(Z);return g},J.prototype.gcd=function(Z){if(this.isZero())return Z.abs();if(Z.isZero())return this.abs();var $=this.clone(),I=Z.clone();$.negative=0,I.negative=0;for(var L=0;$.isEven()&&I.isEven();L++)$.iushrn(1),I.iushrn(1);do{while($.isEven())$.iushrn(1);while(I.isEven())I.iushrn(1);var G=$.cmp(I);if(G<0){var O=$;$=I,I=O}else if(G===0||I.cmpn(1)===0)break;$.isub(I)}while(!0);return I.iushln(L)},J.prototype.invm=function(Z){return this.egcd(Z).a.umod(Z)},J.prototype.isEven=function(){return(this.words[0]&1)===0},J.prototype.isOdd=function(){return(this.words[0]&1)===1},J.prototype.andln=function(Z){return this.words[0]&Z},J.prototype.bincn=function(Z){C(typeof Z==="number");var $=Z%26,I=(Z-$)/26,L=1<<$;if(this.length<=I)return this._expand(I+1),this.words[I]|=L,this;var G=L;for(var O=I;G!==0&&O<this.length;O++){var E=this.words[O]|0;E+=G,G=E>>>26,E&=67108863,this.words[O]=E}if(G!==0)this.words[O]=G,this.length++;return this},J.prototype.isZero=function(){return this.length===1&&this.words[0]===0},J.prototype.cmpn=function(Z){var $=Z<0;if(this.negative!==0&&!$)return-1;if(this.negative===0&&$)return 1;this._strip();var I;if(this.length>1)I=1;else{if($)Z=-Z;C(Z<=67108863,"Number is too big");var L=this.words[0]|0;I=L===Z?0:L<Z?-1:1}if(this.negative!==0)return-I|0;return I},J.prototype.cmp=function(Z){if(this.negative!==0&&Z.negative===0)return-1;if(this.negative===0&&Z.negative!==0)return 1;var $=this.ucmp(Z);if(this.negative!==0)return-$|0;return $},J.prototype.ucmp=function(Z){if(this.length>Z.length)return 1;if(this.length<Z.length)return-1;var $=0;for(var I=this.length-1;I>=0;I--){var L=this.words[I]|0,G=Z.words[I]|0;if(L===G)continue;if(L<G)$=-1;else if(L>G)$=1;break}return $},J.prototype.gtn=function(Z){return this.cmpn(Z)===1},J.prototype.gt=function(Z){return this.cmp(Z)===1},J.prototype.gten=function(Z){return this.cmpn(Z)>=0},J.prototype.gte=function(Z){return this.cmp(Z)>=0},J.prototype.ltn=function(Z){return this.cmpn(Z)===-1},J.prototype.lt=function(Z){return this.cmp(Z)===-1},J.prototype.lten=function(Z){return this.cmpn(Z)<=0},J.prototype.lte=function(Z){return this.cmp(Z)<=0},J.prototype.eqn=function(Z){return this.cmpn(Z)===0},J.prototype.eq=function(Z){return this.cmp(Z)===0},J.red=function(Z){return new X(Z)},J.prototype.toRed=function(Z){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),Z.convertTo(this)._forceRed(Z)},J.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},J.prototype._forceRed=function(Z){return this.red=Z,this},J.prototype.forceRed=function(Z){return C(!this.red,"Already a number in reduction context"),this._forceRed(Z)},J.prototype.redAdd=function(Z){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,Z)},J.prototype.redIAdd=function(Z){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Z)},J.prototype.redSub=function(Z){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,Z)},J.prototype.redISub=function(Z){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,Z)},J.prototype.redShl=function(Z){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,Z)},J.prototype.redMul=function(Z){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.mul(this,Z)},J.prototype.redIMul=function(Z){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.imul(this,Z)},J.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},J.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},J.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},J.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},J.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},J.prototype.redPow=function(Z){return C(this.red&&!Z.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Z)};var Y0={k256:null,p224:null,p192:null,p25519:null};function A0(Z,$){this.name=Z,this.p=new J($,16),this.n=this.p.bitLength(),this.k=new J(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}A0.prototype._tmp=function(){var Z=new J(null);return Z.words=Array(Math.ceil(this.n/13)),Z},A0.prototype.ireduce=function(Z){var $=Z,I;do this.split($,this.tmp),$=this.imulK($),$=$.iadd(this.tmp),I=$.bitLength();while(I>this.n);var L=I<this.n?-1:$.ucmp(this.p);if(L===0)$.words[0]=0,$.length=1;else if(L>0)$.isub(this.p);else if($.strip!==void 0)$.strip();else $._strip();return $},A0.prototype.split=function(Z,$){Z.iushrn(this.n,0,$)},A0.prototype.imulK=function(Z){return Z.imul(this.k)};function $0(){A0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}D($0,A0),$0.prototype.split=function(Z,$){var I=4194303,L=Math.min(Z.length,9);for(var G=0;G<L;G++)$.words[G]=Z.words[G];if($.length=L,Z.length<=9){Z.words[0]=0,Z.length=1;return}var O=Z.words[9];$.words[$.length++]=O&I;for(G=10;G<Z.length;G++){var E=Z.words[G]|0;Z.words[G-10]=(E&I)<<4|O>>>22,O=E}if(O>>>=22,Z.words[G-10]=O,O===0&&Z.length>10)Z.length-=10;else Z.length-=9},$0.prototype.imulK=function(Z){Z.words[Z.length]=0,Z.words[Z.length+1]=0,Z.length+=2;var $=0;for(var I=0;I<Z.length;I++){var L=Z.words[I]|0;$+=L*977,Z.words[I]=$&67108863,$=L*64+($/67108864|0)}if(Z.words[Z.length-1]===0){if(Z.length--,Z.words[Z.length-1]===0)Z.length--}return Z};function u(){A0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}D(u,A0);function O0(){A0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}D(O0,A0);function U(){A0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}D(U,A0),U.prototype.imulK=function(Z){var $=0;for(var I=0;I<Z.length;I++){var L=(Z.words[I]|0)*19+$,G=L&67108863;L>>>=26,Z.words[I]=G,$=L}if($!==0)Z.words[Z.length++]=$;return Z},J._prime=function(Z){if(Y0[Z])return Y0[Z];var $;if(Z==="k256")$=new $0;else if(Z==="p224")$=new u;else if(Z==="p192")$=new O0;else if(Z==="p25519")$=new U;else throw Error("Unknown prime "+Z);return Y0[Z]=$,$};function X(Z){if(typeof Z==="string"){var $=J._prime(Z);this.m=$.p,this.prime=$}else C(Z.gtn(1),"modulus must be greater than 1"),this.m=Z,this.prime=null}X.prototype._verify1=function(Z){C(Z.negative===0,"red works only with positives"),C(Z.red,"red works only with red numbers")},X.prototype._verify2=function(Z,$){C((Z.negative|$.negative)===0,"red works only with positives"),C(Z.red&&Z.red===$.red,"red works only with red numbers")},X.prototype.imod=function(Z){if(this.prime)return this.prime.ireduce(Z)._forceRed(this);return K(Z,Z.umod(this.m)._forceRed(this)),Z},X.prototype.neg=function(Z){if(Z.isZero())return Z.clone();return this.m.sub(Z)._forceRed(this)},X.prototype.add=function(Z,$){this._verify2(Z,$);var I=Z.add($);if(I.cmp(this.m)>=0)I.isub(this.m);return I._forceRed(this)},X.prototype.iadd=function(Z,$){this._verify2(Z,$);var I=Z.iadd($);if(I.cmp(this.m)>=0)I.isub(this.m);return I},X.prototype.sub=function(Z,$){this._verify2(Z,$);var I=Z.sub($);if(I.cmpn(0)<0)I.iadd(this.m);return I._forceRed(this)},X.prototype.isub=function(Z,$){this._verify2(Z,$);var I=Z.isub($);if(I.cmpn(0)<0)I.iadd(this.m);return I},X.prototype.shl=function(Z,$){return this._verify1(Z),this.imod(Z.ushln($))},X.prototype.imul=function(Z,$){return this._verify2(Z,$),this.imod(Z.imul($))},X.prototype.mul=function(Z,$){return this._verify2(Z,$),this.imod(Z.mul($))},X.prototype.isqr=function(Z){return this.imul(Z,Z.clone())},X.prototype.sqr=function(Z){return this.mul(Z,Z)},X.prototype.sqrt=function(Z){if(Z.isZero())return Z.clone();var $=this.m.andln(3);if(C($%2===1),$===3){var I=this.m.add(new J(1)).iushrn(2);return this.pow(Z,I)}var L=this.m.subn(1),G=0;while(!L.isZero()&&L.andln(1)===0)G++,L.iushrn(1);C(!L.isZero());var O=new J(1).toRed(this),E=O.redNeg(),z=this.m.subn(1).iushrn(1),S=this.m.bitLength();S=new J(2*S*S).toRed(this);while(this.pow(S,z).cmp(E)!==0)S.redIAdd(E);var v=this.pow(S,L),g=this.pow(Z,L.addn(1).iushrn(1)),p=this.pow(Z,L),n=G;while(p.cmp(O)!==0){var V0=p;for(var r=0;V0.cmp(O)!==0;r++)V0=V0.redSqr();C(r<n);var l=this.pow(v,new J(1).iushln(n-r-1));g=g.redMul(l),v=l.redSqr(),p=p.redMul(v),n=r}return g},X.prototype.invm=function(Z){var $=Z._invmp(this.m);if($.negative!==0)return $.negative=0,this.imod($).redNeg();else return this.imod($)},X.prototype.pow=function(Z,$){if($.isZero())return new J(1).toRed(this);if($.cmpn(1)===0)return Z.clone();var I=4,L=Array(1<<I);L[0]=new J(1).toRed(this),L[1]=Z;for(var G=2;G<L.length;G++)L[G]=this.mul(L[G-1],Z);var O=L[0],E=0,z=0,S=$.bitLength()%26;if(S===0)S=26;for(G=$.length-1;G>=0;G--){var v=$.words[G];for(var g=S-1;g>=0;g--){var p=v>>g&1;if(O!==L[0])O=this.sqr(O);if(p===0&&E===0){z=0;continue}if(E<<=1,E|=p,z++,z!==I&&(G!==0||g!==0))continue;O=this.mul(O,L[E]),z=0,E=0}S=26}return O},X.prototype.convertTo=function(Z){var $=Z.umod(this.m);return $===Z?$.clone():$},X.prototype.convertFrom=function(Z){var $=Z.clone();return $.red=null,$},J.mont=function(Z){return new A(Z)};function A(Z){if(X.call(this,Z),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new J(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)}D(A,X),A.prototype.convertTo=function(Z){return this.imod(Z.ushln(this.shift))},A.prototype.convertFrom=function(Z){var $=this.imod(Z.mul(this.rinv));return $.red=null,$},A.prototype.imul=function(Z,$){if(Z.isZero()||$.isZero())return Z.words[0]=0,Z.length=1,Z;var I=Z.imul($),L=I.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=I.isub(L).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},A.prototype.mul=function(Z,$){if(Z.isZero()||$.isZero())return new J(0)._forceRed(this);var I=Z.mul($),L=I.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=I.isub(L).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},A.prototype.invm=function(Z){var $=this.imod(Z._invmp(this.m).mul(this.r2));return $._forceRed(this)}})(typeof Y>"u"||Y,Q)}),TY=J0((Q,Y)=>{var V=MG(),H=UZ(),C=MU().Buffer;function D(M){var F=M.modulus.byteLength(),R;do R=new V(H(F));while(R.cmp(M.modulus)>=0||!R.umod(M.prime1)||!R.umod(M.prime2));return R}function J(M){var F=D(M),R=F.toRed(V.mont(M.modulus)).redPow(new V(M.publicExponent)).fromRed();return{blinder:R,unblinder:F.invm(M.modulus)}}function T(M,F){var R=J(F),K=F.modulus.byteLength(),W=new V(M).mul(R.blinder).umod(F.modulus),q=W.toRed(V.mont(F.prime1)),P=W.toRed(V.mont(F.prime2)),_=F.coefficient,k=F.prime1,B=F.prime2,j=q.redPow(F.exponent1).fromRed(),x=P.redPow(F.exponent2).fromRed(),f=j.isub(x).imul(_).umod(k).imul(B);return x.iadd(f).imul(R.unblinder).umod(F.modulus).toArrayLike(C,"be",K)}T.getr=D,Y.exports=T}),qG=J0((Q,Y)=>{var V=SY(),H=UZ(),C=OZ(),D=DY(),J=FY(),T=GX(),M=RY(),F=TY(),R=MU().Buffer;Y.exports=function(P,_,k){var B;if(P.padding)B=P.padding;else if(k)B=1;else B=4;var j=V(P),x;if(B===4)x=K(j,_);else if(B===1)x=W(j,_,k);else if(B===3){if(x=new T(_),x.cmp(j.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(k)return F(x,j);else return M(x,j)};function K(P,_){var k=P.modulus.byteLength(),B=_.length,j=C("sha1").update(R.alloc(0)).digest(),x=j.length,f=2*x;if(B>k-f-2)throw Error("message too long");var w=R.alloc(k-B-f-2),d=k-x-1,Y0=H(x),A0=J(R.concat([j,w,R.alloc(1,1),_],d),D(Y0,d)),$0=J(Y0,D(A0,x));return new T(R.concat([R.alloc(1),$0,A0],k))}function W(P,_,k){var B=_.length,j=P.modulus.byteLength();if(B>j-11)throw Error("message too long");var x;if(k)x=R.alloc(j-B-3,255);else x=q(j-B-3);return new T(R.concat([R.from([0,k?1:2]),x,R.alloc(1),_],j))}function q(P){var _=R.allocUnsafe(P),k=0,B=H(P*2),j=0,x;while(k<P){if(j===B.length)B=H(P*2),j=0;if(x=B[j++],x)_[k++]=x}return _}}),PG=J0((Q,Y)=>{var V=SY(),H=DY(),C=FY(),D=GX(),J=TY(),T=OZ(),M=RY(),F=MU().Buffer;Y.exports=function(q,P,_){var k;if(q.padding)k=q.padding;else if(_)k=1;else k=4;var B=V(q),j=B.modulus.byteLength();if(P.length>j||new D(P).cmp(B.modulus)>=0)throw Error("decryption error");var x;if(_)x=M(new D(P),B);else x=J(P,B);var f=F.alloc(j-x.length);if(x=F.concat([f,x],j),k===4)return R(B,x);else if(k===1)return K(B,x,_);else if(k===3)return x;else throw Error("unknown padding")};function R(q,P){var _=q.modulus.byteLength(),k=T("sha1").update(F.alloc(0)).digest(),B=k.length;if(P[0]!==0)throw Error("decryption error");var j=P.slice(1,B+1),x=P.slice(B+1),f=C(j,H(x,B)),w=C(x,H(f,_-B-1));if(W(k,w.slice(0,B)))throw Error("decryption error");var d=B;while(w[d]===0)d++;if(w[d++]!==1)throw Error("decryption error");return w.slice(d)}function K(q,P,_){var k=P.slice(0,2),B=2,j=0;while(P[B++]!==0)if(B>=P.length){j++;break}var x=P.slice(2,B-1);if(k.toString("hex")!=="0002"&&!_||k.toString("hex")!=="0001"&&_)j++;if(x.length<8)j++;if(j)throw Error("decryption error");return P.slice(B)}function W(q,P){q=F.from(q),P=F.from(P);var _=0,k=q.length;if(q.length!==P.length)_++,k=Math.min(q.length,P.length);var B=-1;while(++B<k)_+=q[B]^P[B];return _}}),UX=J0((Q)=>{Q.publicEncrypt=qG(),Q.privateDecrypt=PG(),Q.privateEncrypt=function(Y,V){return Q.publicEncrypt(Y,V,!0)},Q.publicDecrypt=function(Y,V){return Q.privateDecrypt(Y,V,!0)}}),kG=J0((Q)=>{var Y=(jU(),h0(vU));if(typeof Y.publicEncrypt!=="function")Y=UX();if(Q.publicEncrypt=Y.publicEncrypt,Q.privateDecrypt=Y.privateDecrypt,typeof Y.privateEncrypt!=="function")Q.privateEncrypt=UX().privateEncrypt;else Q.privateEncrypt=Y.privateEncrypt;if(typeof Y.publicDecrypt!=="function")Q.publicDecrypt=UX().publicDecrypt;else Q.publicDecrypt=Y.publicDecrypt}),_G=J0((Q)=>{var Y=MU(),V=UZ(),H=Y.Buffer,C=Y.kMaxLength,D=globalThis.crypto||globalThis.msCrypto,J=Math.pow(2,32)-1;function T(W,q){if(typeof W!=="number"||W!==W)throw TypeError("offset must be a number");if(W>J||W<0)throw TypeError("offset must be a uint32");if(W>C||W>q)throw RangeError("offset out of range")}function M(W,q,P){if(typeof W!=="number"||W!==W)throw TypeError("size must be a number");if(W>J||W<0)throw TypeError("size must be a uint32");if(W+q>P||W>C)throw RangeError("buffer too small")}D&&D.getRandomValues,Q.randomFill=F,Q.randomFillSync=K;function F(W,q,P,_){if(!H.isBuffer(W)&&!(W instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof q==="function")_=q,q=0,P=W.length;else if(typeof P==="function")_=P,P=W.length-q;else if(typeof _!=="function")throw TypeError('"cb" argument must be a function');return T(q,W.length),M(P,q,W.length),R(W,q,P,_)}function R(W,q,P,_){if(!1)var k,B;if(_){V(P,function(x,f){if(x)return _(x);f.copy(W,q),_(null,W)});return}var j=V(P);return j.copy(W,q),W}function K(W,q,P){if(typeof q>"u")q=0;if(!H.isBuffer(W)&&!(W instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(T(q,W.length),P===void 0)P=W.length-q;return M(P,q,W.length),R(W,q,P)}}),vG=J0((Q,Y)=>{var V=(jU(),h0(vU));if(typeof V.randomFill==="function"&&typeof V.randomFillSync==="function")Q.randomFill=V.randomFill,Q.randomFillSync=V.randomFillSync;else Y.exports=_G()}),jG=J0((Q)=>{Q.randomBytes=Q.rng=Q.pseudoRandomBytes=Q.prng=UZ(),Q.createHash=Q.Hash=OZ(),Q.createHmac=Q.Hmac=rQ();var Y=UA(),V=Object.keys(Y),H=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(V);Q.getHashes=function(){return H};var C=JY();Q.pbkdf2=C.pbkdf2,Q.pbkdf2Sync=C.pbkdf2Sync;var D=wA();Q.Cipher=D.Cipher,Q.createCipher=D.createCipher,Q.Cipheriv=D.Cipheriv,Q.createCipheriv=D.createCipheriv,Q.Decipher=D.Decipher,Q.createDecipher=D.createDecipher,Q.Decipheriv=D.Decipheriv,Q.createDecipheriv=D.createDecipheriv,Q.getCiphers=D.getCiphers,Q.listCiphers=D.listCiphers;var J=yA();Q.DiffieHellmanGroup=J.DiffieHellmanGroup,Q.createDiffieHellmanGroup=J.createDiffieHellmanGroup,Q.getDiffieHellman=J.getDiffieHellman,Q.createDiffieHellman=J.createDiffieHellman,Q.DiffieHellman=J.DiffieHellman;var T=cA();Q.createSign=T.createSign,Q.Sign=T.Sign,Q.createVerify=T.createVerify,Q.Verify=T.Verify,Q.createECDH=JG();var M=kG();Q.publicEncrypt=M.publicEncrypt,Q.privateEncrypt=M.privateEncrypt,Q.publicDecrypt=M.publicDecrypt,Q.privateDecrypt=M.privateDecrypt;var F=vG();Q.randomFill=F.randomFill,Q.randomFillSync=F.randomFillSync,Q.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
16
16
  we accept pull requests
17
- https://github.com/browserify/crypto-browserify`)},Q.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}}),p0=nA(zG(),1),MG=p0.prng,qG=p0.pseudoRandomBytes,PG=p0.rng,kG=p0.randomBytes,_G=p0.Hash,vG=p0.createHash,jG=p0.Hmac,BG=p0.createHmac,xG=p0.getHashes,NG=p0.pbkdf2,gG=p0.pbkdf2Sync,fG=p0.Cipher,wG=p0.createCipher,yG=p0.Cipheriv,cG=p0.createCipheriv,pG=p0.Decipher,hG=p0.createDecipher,uG=p0.Decipheriv,bG=p0.createDecipheriv,lG=p0.getCiphers,dG=p0.listCiphers,oG=p0.DiffieHellmanGroup,nG=p0.createDiffieHellmanGroup,mG=p0.getDiffieHellman,tG=p0.createDiffieHellman,sG=p0.DiffieHellman,rG=p0.createSign,aG=p0.Sign,eG=p0.createVerify,iG=p0.Verify,UV=p0.createECDH,OV=p0.publicEncrypt,ZV=p0.privateEncrypt,XV=p0.publicDecrypt,QV=p0.privateDecrypt,YV=p0.randomFill,$V=p0.randomFillSync,AV=p0.createCredentials,JV=p0.constants,IV=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];LV=crypto,KV=crypto});import{logger as BU,ModelType as a0}from"@elizaos/core";var KX={name:"CHECK_CLOUD_CREDITS",description:"Check ElizaCloud credit balance, container costs, and estimated remaining runtime.",similes:["check credits","check balance","how much credit","cloud billing"],tags:["cloud","billing"],parameters:[{name:"detailed",description:"Include transaction history",required:!1,schema:{type:"boolean"}}],validate:async(Q,$,V,W)=>{let D=(typeof $?.content?.text==="string"?$.content.text:"").toLowerCase(),A=["check","cloud","credits"],z=A.length>0&&A.some((k)=>k.length>0&&D.includes(k)),M=/\b(?:check|cloud|credits)\b/i,F=Boolean(D.match(M)),R=String($?.content?.source??$?.source??""),K="",H=Boolean(R||V||Q?.agentId||Q?.getService),q=W&&typeof W==="object"?W:{},P=D.trim().length>0||Object.keys(q).length>0||Boolean($?.content&&typeof $.content==="object");if(!(z&&F&&H&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _(Q,$,V,W))}catch{return!1}},async handler(Q,$,V,W,C){let D=Q.getService("CLOUD_AUTH"),A=Q.getService("CLOUD_CONTAINER"),z=D.getClient(),M=W?.detailed===!0||$.metadata?.detailed===!0,{data:{balance:F}}=await z.get("/credits/balance"),R=A?.getTrackedContainers().filter((_)=>_.status==="running").length??0,K=R*0.67,H=K>0?F/K:null,q=[`ElizaCloud credits: $${F.toFixed(2)}`,R>0?`Active containers: ${R} ($${K.toFixed(2)}/day) — ~${H?.toFixed(1)} days remaining`:"No active containers."];if(M){let{data:_}=await z.get("/credits/summary");q.push(`Total spent: $${_.totalSpent.toFixed(2)} | Total added: $${_.totalAdded.toFixed(2)}`);for(let k of _.recentTransactions.slice(0,10)){let B=k.amount>=0?"+":"";q.push(` ${B}$${k.amount.toFixed(2)} — ${k.description} (${new Date(k.created_at).toLocaleDateString()})`)}}let P=q.join(`
18
- `);if(C)await C({text:P,actions:["CHECK_CLOUD_CREDITS"]});return{success:!0,text:P,data:{balance:F,runningContainers:R,dailyCost:K,estimatedDaysRemaining:H}}}};function vY(Q,$){if($?.containerId)return String($.containerId);let V=Q.metadata?.actionParams;return V?.containerId?String(V.containerId):null}var WX={name:"FREEZE_CLOUD_AGENT",description:"Freeze a cloud agent: snapshot state, disconnect bridge, stop container.",similes:["freeze agent","hibernate agent","pause agent","stop cloud agent"],tags:["cloud","container","backup"],parameters:[{name:"containerId",description:"ID of the container to freeze",required:!0,schema:{type:"string"}}],validate:async(Q,$,V,W)=>{let D=(typeof $?.content?.text==="string"?$.content.text:"").toLowerCase(),A=["freeze","cloud"],z=A.length>0&&A.some((k)=>k.length>0&&D.includes(k)),M=/\b(?:freeze|cloud)\b/i,F=Boolean(D.match(M)),R=String($?.content?.source??$?.source??""),K="",H=Boolean(R||V||Q?.agentId||Q?.getService),q=W&&typeof W==="object"?W:{},P=D.trim().length>0||Object.keys(q).length>0||Boolean($?.content&&typeof $.content==="object");if(!(z&&F&&H&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _(Q,$,V,W))}catch{return!1}},async handler(Q,$,V,W,C){let D=Q.getService("CLOUD_CONTAINER"),A=Q.getService("CLOUD_BRIDGE"),z=Q.getService("CLOUD_BACKUP"),M=vY($,W);if(!M)return{success:!1,error:"Missing containerId"};let F=await D.getContainer(M);if(F.status!=="running")return{success:!1,error:`Container not running (status: ${F.status})`};let R=async(H)=>{if(C)await C({text:H,actions:["FREEZE_CLOUD_AGENT"]})};await R(`Freezing "${F.name}"... Creating snapshot.`);let K=null;if(z)K=(await z.createSnapshot(M,"manual",{trigger:"user-freeze",containerName:F.name})).id,z.cancelAutoBackup(M);if(A)await A.disconnect(M);return await D.deleteContainer(M),await R(`"${F.name}" frozen.${K?` Snapshot: ${K}`:""}`),{success:!0,text:`Agent "${F.name}" frozen`,data:{containerId:M,containerName:F.name,snapshotId:K}}}};import{logger as BY}from"@elizaos/core";var qU={enabled:!1,baseUrl:"https://www.elizacloud.ai/api/v1",inferenceMode:"cloud",autoProvision:!1,bridge:{reconnectIntervalMs:3000,maxReconnectAttempts:20,heartbeatIntervalMs:30000},backup:{autoBackupIntervalMs:3600000,maxSnapshots:10},container:{defaultImage:"elizaos/agent:latest",defaultArchitecture:"arm64",defaultCpu:1792,defaultMemory:1792,defaultPort:3000}};class SO extends Error{statusCode;errorBody;constructor(Q,$){super($.error);this.name="CloudApiError",this.statusCode=Q,this.errorBody=$}}class IZ extends SO{requiredCredits;constructor(Q){super(402,Q);this.name="InsufficientCreditsError",this.requiredCredits=Q.requiredCredits??0}}var jY=["OPENAI_API_KEY","ANTHROPIC_API_KEY","GROQ_API_KEY","ELIZAOS_CLOUD_API_KEY","SMALL_MODEL","LARGE_MODEL","ELIZAOS_CLOUD_SMALL_MODEL","ELIZAOS_CLOUD_LARGE_MODEL"];function gO(Q){let $={};for(let V of jY){let W=Q.getSetting(V);if(W)$[V]=String(W)}return $}function xY(Q,$){if($&&Object.keys($).length>0)return $;let V=Q.metadata;if(V?.actionParams)return V.actionParams;let W=Q.content?.text??"",C=W.match(/name[:\s]+["']?([^"',]+)["']?/i)?.[1]?.trim(),D=W.match(/project[:\s]+["']?([^"',\s]+)["']?/i)?.[1]?.trim();return{name:C,project_name:D}}var HX={name:"PROVISION_CLOUD_AGENT",description:"Deploy an ElizaOS agent to ElizaCloud. Provisions a container, waits for deployment, connects the bridge, and starts auto-backup.",similes:["deploy agent to cloud","launch cloud agent","start remote agent","provision container"],tags:["cloud","container","deployment"],parameters:[{name:"name",description:"Human-readable name for the cloud agent",required:!0,schema:{type:"string"}},{name:"project_name",description:"Unique project identifier (lowercase, no spaces)",required:!0,schema:{type:"string"}},{name:"description",description:"Optional description",required:!1,schema:{type:"string"}},{name:"environment_vars",description:"Additional environment variables",required:!1,schema:{type:"object"}},{name:"auto_backup",description:"Enable periodic auto-backup (default: true)",required:!1,schema:{type:"boolean"}}],validate:async(Q,$,V,W)=>{let D=(typeof $?.content?.text==="string"?$.content.text:"").toLowerCase(),A=["provision","cloud"],z=A.length>0&&A.some((k)=>k.length>0&&D.includes(k)),M=/\b(?:provision|cloud)\b/i,F=Boolean(D.match(M)),R=String($?.content?.source??$?.source??""),K="",H=Boolean(R||V||Q?.agentId||Q?.getService),q=W&&typeof W==="object"?W:{},P=D.trim().length>0||Object.keys(q).length>0||Boolean($?.content&&typeof $.content==="object");if(!(z&&F&&H&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _(Q,$,V,W))}catch{return!1}},async handler(Q,$,V,W,C){let D=Q.getService("CLOUD_AUTH"),A=Q.getService("CLOUD_CONTAINER"),z=Q.getService("CLOUD_BRIDGE"),M=Q.getService("CLOUD_BACKUP");if(!D?.isAuthenticated()||!A)return{success:!1,error:"ElizaCloud not authenticated or container service unavailable"};let F=xY($,W);if(!F.name||!F.project_name)return{success:!1,error:"Missing required parameters: name and project_name"};let R=async(B)=>{if(C)await C({text:B,actions:["PROVISION_CLOUD_AGENT"]})};await R(`Provisioning cloud agent "${F.name}"... This typically takes 8-12 minutes.`);let K=qU.container,H={name:F.name,project_name:F.project_name,description:F.description,port:K.defaultPort,cpu:K.defaultCpu,memory:K.defaultMemory,architecture:K.defaultArchitecture,ecr_image_uri:K.defaultImage,environment_vars:{...gO(Q),...F.environment_vars},health_check_path:"/health"},q=await A.createContainer(H),P=q.data.id;await R(`Container created (id: ${P}). Credits: -$${q.creditsDeducted.toFixed(2)} ($${q.creditsRemaining.toFixed(2)} remaining).`);let _=await A.waitForDeployment(P);if(await R(`Container running at ${_.load_balancer_url}`),z)await z.connect(P),BY.info(`[PROVISION] Bridge connected to ${P}`);let k=F.auto_backup!==!1;if(k&&M)M.scheduleAutoBackup(P);return await R(`Agent "${F.name}" deployed.${k?" Auto-backup enabled.":""}`),{success:!0,text:`Cloud agent "${F.name}" deployed`,data:{containerId:P,containerUrl:_.load_balancer_url,status:_.status,creditsDeducted:q.creditsDeducted,creditsRemaining:q.creditsRemaining,bridgeConnected:z?.getConnectionState(P)==="connected",autoBackupEnabled:k}}}};function NY(Q,$){if($&&Object.keys($).length>0)return $;return Q.metadata?.actionParams??{}}async function gY(Q,$,V){let C=(await $.listContainers()).filter((A)=>A.project_name===V).map((A)=>A.id),D=[];for(let A of C)D.push(...await Q.listSnapshots(A));return D.sort((A,z)=>new Date(z.created_at).getTime()-new Date(A.created_at).getTime()),D[0]??null}var SX={name:"RESUME_CLOUD_AGENT",description:"Resume a frozen cloud agent from snapshot. Re-provisions, restores state, reconnects bridge.",similes:["resume agent","unfreeze agent","restart cloud agent","restore agent"],tags:["cloud","container","restore"],parameters:[{name:"name",description:"Name for the restored agent",required:!0,schema:{type:"string"}},{name:"project_name",description:"Project identifier (must match original)",required:!0,schema:{type:"string"}},{name:"snapshotId",description:"Specific snapshot ID (defaults to latest)",required:!1,schema:{type:"string"}},{name:"environment_vars",description:"Additional environment variables",required:!1,schema:{type:"object"}}],validate:async(Q,$,V,W)=>{let D=(typeof $?.content?.text==="string"?$.content.text:"").toLowerCase(),A=["resume","cloud"],z=A.length>0&&A.some((k)=>k.length>0&&D.includes(k)),M=/\b(?:resume|cloud)\b/i,F=Boolean(D.match(M)),R=String($?.content?.source??$?.source??""),K="",H=Boolean(R||V||Q?.agentId||Q?.getService),q=W&&typeof W==="object"?W:{},P=D.trim().length>0||Object.keys(q).length>0||Boolean($?.content&&typeof $.content==="object");if(!(z&&F&&H&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _(Q,$,V,W))}catch{return!1}},async handler(Q,$,V,W,C){let D=Q.getService("CLOUD_CONTAINER"),A=Q.getService("CLOUD_BRIDGE"),z=Q.getService("CLOUD_BACKUP"),M=NY($,W);if(!M.name||!M.project_name)return{success:!1,error:"Missing required parameters: name and project_name"};let F=async(k)=>{if(C)await C({text:k,actions:["RESUME_CLOUD_AGENT"]})};await F(`Resuming cloud agent "${M.name}"...`);let R=qU.container,K={name:M.name,project_name:M.project_name,port:R.defaultPort,cpu:R.defaultCpu,memory:R.defaultMemory,architecture:R.defaultArchitecture,ecr_image_uri:R.defaultImage,environment_vars:{...gO(Q),...M.environment_vars},health_check_path:"/health"},H=await D.createContainer(K),q=H.data.id;await F(`Container re-provisioned (${q}). Waiting for infrastructure...`);let P=await D.waitForDeployment(q),_=null;if(z){let k=M.snapshotId;if(k)await z.restoreSnapshot(q,k),_=k;else{let B=await gY(z,D,M.project_name);if(B)await z.restoreSnapshot(q,B.id),_=B.id}z.scheduleAutoBackup(q)}if(A)await A.connect(q);return await F(`Agent "${M.name}" resumed at ${P.load_balancer_url}.`+(_?` Restored snapshot ${_}.`:" No snapshot to restore.")),{success:!0,text:`Cloud agent "${M.name}" resumed`,data:{containerId:q,containerUrl:P.load_balancer_url,restoredSnapshotId:_,creditsDeducted:H.creditsDeducted,creditsRemaining:H.creditsRemaining}}}};var DX={name:"elizacloud_status",description:"ElizaCloud container and connection status",dynamic:!0,position:90,async get(Q,$,V){if(!Q.getService("CLOUD_AUTH")?.isAuthenticated())return{text:"ElizaCloud: Not authenticated",values:{cloudAuthenticated:!1}};let C=Q.getService("CLOUD_CONTAINER"),D=Q.getService("CLOUD_BRIDGE"),A=C?.getTrackedContainers()??[],z=D?.getConnectedContainerIds()??[],M=A.filter((H)=>H.status==="running").length,F=A.filter((H)=>H.status==="pending"||H.status==="building"||H.status==="deploying").length,R=A.map((H)=>({id:H.id,name:H.name,status:H.status,url:H.load_balancer_url,billing:H.billing_status,bridged:z.includes(H.id)}));return{text:[`ElizaCloud: ${A.length} container(s), ${M} running, ${z.length} bridged`,...R.map((H)=>` - ${H.name} [${H.status}]${H.url?` @ ${H.url}`:""}${H.bridged?" (bridged)":""}`)].join(`
19
- `),values:{cloudAuthenticated:!0,totalContainers:A.length,runningContainers:M,deployingContainers:F},data:{containers:R}}}};var FX={name:"elizacloud_health",description:"ElizaCloud container health",dynamic:!0,position:92,private:!0,async get(Q,$,V){if(!Q.getService("CLOUD_AUTH")?.isAuthenticated())return{text:""};let D=Q.getService("CLOUD_CONTAINER")?.getTrackedContainers().filter((F)=>F.status==="running")??[];if(D.length===0)return{text:"No running containers.",values:{healthyContainers:0}};let A=D.map((F)=>({id:F.id,name:F.name,healthy:F.status==="running"&&F.billing_status==="active"&&!F.error_message,status:F.status,billing:F.billing_status})),z=A.filter((F)=>F.healthy).length;return{text:[`Health: ${z}/${A.length} healthy`,...A.map((F)=>` - ${F.name}: ${F.healthy?"OK":"UNHEALTHY"} (status=${F.status}, billing=${F.billing})`)].join(`
20
- `),values:{healthyContainers:z,unhealthyContainers:A.length-z},data:{reports:A}}}};import{logger as RX}from"@elizaos/core";var CZ="https://www.elizacloud.ai/dashboard/settings?tab=billing",TX=new WeakMap,fY=60000,zX={name:"elizacloud_credits",description:"ElizaCloud credit balance",dynamic:!0,position:91,async get(Q,$,V){let W=Q.getService("CLOUD_AUTH");if(!W?.isAuthenticated())return{text:""};let C=TX.get(Q);if(C&&Date.now()-C.at<fY)return LZ(C.value);let D;try{let{data:A}=await W.getClient().get("/credits/balance");D=A.balance}catch(A){if(RX.warn(`[CloudCredits] Failed to fetch balance: ${A instanceof Error?A.message:A}`),C)return LZ(C.value);return{text:""}}if(TX.set(Q,{value:D,at:Date.now()}),D<1)RX.warn(`[CloudCredits] Low balance: $${D.toFixed(2)}`);return LZ(D)}};function LZ(Q){let $=Q<2,V=Q<0.5,W=`ElizaCloud credits: $${Q.toFixed(2)}`;if(V)W+=` (CRITICAL — top up at ${CZ})`;else if($)W+=` (LOW — top up at ${CZ})`;return{text:W,values:{cloudCredits:Q,cloudCreditsLow:$,cloudCreditsCritical:V,cloudTopUpUrl:CZ}}}var MX=new WeakMap,PX={name:"elizacloud_models",description:"Available AI models from ElizaCloud grouped by provider",dynamic:!0,position:92,async get(Q,$,V){let W=Q.getService("CLOUD_MODEL_REGISTRY");if(!W)return{text:""};let C=MX.get(Q);if(C&&Date.now()-C.at<300000)return qX(C.value);let D=await W.getModelsByProvider();if(Object.keys(D).length===0)return{text:""};return MX.set(Q,{value:D,at:Date.now()}),qX(D)}};function qX(Q){let $=Object.keys(Q).sort(),V=Object.values(Q).reduce((W,C)=>W+C.length,0);return{text:`ElizaCloud: ${V} models (${$.join(", ")})`,values:{cloudModelProviders:$.join(","),cloudModelCount:V}}}import{logger as uU}from"@elizaos/core";import{logger as fO}from"@elizaos/core";function wY(Q){if(typeof process>"u")return;let $=process.env[Q];return $===void 0?void 0:String($)}function u0(Q,$,V){let W=Q.getSetting($);if(W!==void 0&&W!==null)return String(W);return wY($)??V}function sU(){return typeof globalThis<"u"&&typeof globalThis.document<"u"}function kX(Q){return sU()&&!!u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL")}function gU(Q,$=!1){if(sU())return{};let V=$?yY(Q):rU(Q);return V?{Authorization:`Bearer ${V}`}:{}}function PU(Q){let $=u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL");return sU()&&$?$:u0(Q,"ELIZAOS_CLOUD_BASE_URL","https://www.elizacloud.ai/api/v1")}function _X(Q){let $=sU()?u0(Q,"ELIZAOS_CLOUD_BROWSER_EMBEDDING_URL")||u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL"):u0(Q,"ELIZAOS_CLOUD_EMBEDDING_URL");if($)return fO.debug(`[ELIZAOS_CLOUD] Using specific embedding base URL: ${$}`),$;return fO.debug("[ELIZAOS_CLOUD] Falling back to general base URL for embeddings."),PU(Q)}function rU(Q){return u0(Q,"ELIZAOS_CLOUD_API_KEY")}function yY(Q){let $=u0(Q,"ELIZAOS_CLOUD_EMBEDDING_API_KEY");if($)return fO.debug("[ELIZAOS_CLOUD] Using specific embedding API key (present)"),$;return fO.debug("[ELIZAOS_CLOUD] Falling back to general API key for embeddings."),rU(Q)}function wO(Q){return u0(Q,"ELIZAOS_CLOUD_SMALL_MODEL")??u0(Q,"SMALL_MODEL","openai/gpt-5-mini")}function DO(Q){return u0(Q,"ELIZAOS_CLOUD_LARGE_MODEL")??u0(Q,"LARGE_MODEL","anthropic/claude-sonnet-4.5")}function vX(Q){return u0(Q,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL","gpt-5-mini")}function jX(Q){return u0(Q,"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL","google/gemini-2.5-flash-image")??"google/gemini-2.5-flash-image"}function BX(Q){return u0(Q,"ELIZAOS_CLOUD_REASONING_SMALL_MODEL")??u0(Q,"REASONING_SMALL_MODEL","deepseek/deepseek-r1")}function xX(Q){return u0(Q,"ELIZAOS_CLOUD_REASONING_LARGE_MODEL")??u0(Q,"REASONING_LARGE_MODEL","anthropic/claude-opus-4.5")}function NX(Q){return u0(Q,"ELIZAOS_CLOUD_RESEARCH_MODEL")??u0(Q,"RESEARCH_MODEL","o3-deep-research")}function gX(Q){let $=u0(Q,"ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY","false");return String($).toLowerCase()==="true"}function fX(Q,$){(async()=>{try{if(!rU($)&&!sU()){uU.warn("ELIZAOS_CLOUD_API_KEY is not set in environment - ElizaOS Cloud functionality will be limited"),uU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");return}try{let V=PU($),W=await fetch(`${V}/models`,{headers:{...gU($)}});if(!W.ok)uU.warn(`ElizaOS Cloud API key validation failed: ${W.statusText}`),uU.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided"),uU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");else uU.log("ElizaOS Cloud API key validated successfully")}catch(V){let W=V instanceof Error?V.message:String(V);uU.warn(`Error validating ElizaOS Cloud API key: ${W}`),uU.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided")}}catch(V){let W=V?.errors?.map((C)=>C.message).join(", ")||(V instanceof Error?V.message:String(V));uU.warn(`ElizaOS Cloud plugin configuration issue: ${W} - You need to configure the ELIZAOS_CLOUD_API_KEY in your environment variables`),uU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys")}})()}import{logger as TU,ModelType as pY,VECTOR_DIMS as wX}from"@elizaos/core";import{EventType as cY}from"@elizaos/core";function cU(Q,$,V,W){let C=Number(W.inputTokens||0),D=Number(W.outputTokens||0),A=Number(W.totalTokens!=null?W.totalTokens:C+D);Q.emitEvent(cY.MODEL_USED,{runtime:Q,source:"elizacloud",type:$,tokens:{prompt:C,completion:D,total:A}})}var yO=100;function hY(Q){return{remainingRequests:parseInt(Q.headers.get("x-ratelimit-remaining-requests")||"",10)||void 0,remainingTokens:parseInt(Q.headers.get("x-ratelimit-remaining-tokens")||"",10)||void 0,limitRequests:parseInt(Q.headers.get("x-ratelimit-limit-requests")||"",10)||void 0,limitTokens:parseInt(Q.headers.get("x-ratelimit-limit-tokens")||"",10)||void 0,resetRequests:Q.headers.get("x-ratelimit-reset-requests")||void 0,resetTokens:Q.headers.get("x-ratelimit-reset-tokens")||void 0,retryAfter:parseInt(Q.headers.get("retry-after")||"",10)||void 0}}function yX(Q){let $=u0(Q,"ELIZAOS_CLOUD_EMBEDDING_MODEL","text-embedding-3-small"),V=Number.parseInt(u0(Q,"ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS","1536")||"1536",10);if(!Object.values(wX).includes(V)){let W=`Invalid embedding dimension: ${V}. Must be one of: ${Object.values(wX).join(", ")}`;throw TU.error(W),Error(W)}return{embeddingModelName:$,embeddingDimension:V}}function aU(Q,$){let V=Array(Q).fill(0);return V[0]=$,V}async function KZ(Q,$){let{embeddingDimension:V}=yX(Q);if($===null)return TU.debug("Creating test embedding for initialization"),aU(V,0.1);let W;if(typeof $==="string")W=$;else if(typeof $==="object"&&$.text)W=$.text;else return TU.warn("Invalid input format for embedding"),aU(V,0.2);if(!W.trim())return TU.warn("Empty text for embedding"),aU(V,0.3);return(await cX(Q,[W]))[0]}async function cX(Q,$){let{embeddingModelName:V,embeddingDimension:W}=yX(Q),C=_X(Q);if(!$||$.length===0)return TU.warn("[BatchEmbeddings] Empty texts array"),[];let D=[],A=Array($.length);for(let z=0;z<$.length;z++){let M=$[z]?.trim();if(M)D.push({text:M,originalIndex:z});else A[z]=aU(W,0.3)}if(D.length===0)return TU.warn("[BatchEmbeddings] All texts were empty"),A;for(let z=0;z<D.length;z+=yO){let M=Math.min(z+yO,D.length),F=D.slice(z,M),R=F.map((K)=>K.text);TU.info(`[BatchEmbeddings] Processing batch ${Math.floor(z/yO)+1}/${Math.ceil(D.length/yO)}: ${F.length} texts`);try{let K=await fetch(`${C}/embeddings`,{method:"POST",headers:{...gU(Q,!0),"Content-Type":"application/json"},body:JSON.stringify({model:V,input:R})}),H=hY(K);if(H.remainingRequests!==void 0&&H.remainingRequests<50)TU.warn(`[BatchEmbeddings] Rate limit: ${H.remainingRequests}/${H.limitRequests} requests remaining`);if(K.status===429){let P=H.retryAfter||30;TU.warn(`[BatchEmbeddings] Rate limited, waiting ${P}s...`),await new Promise((B)=>setTimeout(B,P*1000));let _=await fetch(`${C}/embeddings`,{method:"POST",headers:{...gU(Q,!0),"Content-Type":"application/json"},body:JSON.stringify({model:V,input:R})});if(!_.ok){TU.error(`[BatchEmbeddings] Retry failed: ${_.status}`);for(let B of F)A[B.originalIndex]=aU(W,0.4);continue}let k=await _.json();if(k?.data){for(let B of k.data){let j=F[B.index].originalIndex;A[j]=B.embedding}TU.info(`[BatchEmbeddings] Retry successful for ${F.length} embeddings`)}continue}if(!K.ok){TU.error(`[BatchEmbeddings] API error: ${K.status} - ${K.statusText}`);for(let P of F)A[P.originalIndex]=aU(W,0.4);continue}let q=await K.json();if(!q?.data||!Array.isArray(q.data)){TU.error("[BatchEmbeddings] API returned invalid structure");for(let P of F)A[P.originalIndex]=aU(W,0.5);continue}for(let P of q.data){let _=F[P.index].originalIndex;A[_]=P.embedding}if(q.usage){let P={inputTokens:q.usage.prompt_tokens,outputTokens:0,totalTokens:q.usage.total_tokens};cU(Q,pY.TEXT_EMBEDDING,`batch:${F.length}`,P)}TU.debug(`[BatchEmbeddings] Got ${F.length} embeddings (${W}d), remaining: ${H.remainingRequests??"unknown"}`)}catch(K){let H=K instanceof Error?K.message:String(K);TU.error(`[BatchEmbeddings] Error: ${H}`);for(let q of F)A[q.originalIndex]=aU(W,0.6)}}return A}import{logger as kO,ModelType as d$}from"@elizaos/core";import{logger as vQ}from"@elizaos/core";import{JSONParseError as l$}from"ai";function BZ(){return async({text:Q,error:$})=>{try{if($ instanceof l$){let V=Q.replace(/```json\n|\n```|```/g,"");return JSON.parse(V),V}return null}catch(V){let W=V instanceof Error?V.message:String(V);return vQ.warn(`Failed to repair JSON text: ${W}`),null}}}async function jQ(Q){try{let{Readable:$}=await Promise.resolve().then(() => PY(dO(),1)),V=Q.getReader();return new $({async read(){try{let{done:W,value:C}=await V.read();if(W)this.push(null);else this.push(C)}catch(W){this.destroy(W)}},destroy(W,C){V.cancel().finally(()=>C(W))}})}catch($){let V=$ instanceof Error?$.message:String($);throw vQ.error(`Failed to load node:stream module: ${V}`),Error("Cannot convert stream: node:stream module unavailable. This feature requires a Node.js environment.")}}function BQ(Q){let V=Q.match(/title[:\s]+(.+?)(?:\n|$)/i)?.[1]?.trim()||"Image Analysis",W=Q.replace(/title[:\s]+(.+?)(?:\n|$)/i,"").trim();return{title:V,description:W}}async function xZ(Q,$){let V=$.count||1,W=$.size||"1024x1024",C=$.prompt,D=jX(Q);kO.log(`[ELIZAOS_CLOUD] Using IMAGE model: ${D}`);let A=PU(Q),M={"1024x1024":"1:1","1792x1024":"16:9","1024x1792":"9:16"}[W]||"1:1";try{let F=`${A}/generate-image`,R={prompt:C,numImages:V,aspectRatio:M,model:D},K=await fetch(F,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json"},body:JSON.stringify(R)});if(!K.ok){let _=await K.text();throw Error(`Failed to generate image: ${K.status} ${_}`)}return(await K.json()).images.map((_)=>({url:_.url||_.image}))}catch(F){let R=F instanceof Error?F.message:String(F);throw kO.error(`[ELIZAOS_CLOUD] Image generation error: ${R}`),F}}async function NZ(Q,$){let V,W,C=vX(Q);kO.log(`[ELIZAOS_CLOUD] Using IMAGE_DESCRIPTION model: ${C}`);let D=Number.parseInt(u0(Q,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS","8192")||"8192",10);if(typeof $==="string")V=$,W="Please analyze this image and provide a title and detailed description.";else V=$.imageUrl,W=$.prompt||"Please analyze this image and provide a title and detailed description.";let A=[{role:"user",content:[{type:"text",text:W},{type:"image_url",image_url:{url:V}}]}],z=PU(Q);try{let M={model:C,messages:A,max_tokens:D},F=null;for(let H=0;H<3;H++){if(F=await fetch(`${z}/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",...gU(Q)},body:JSON.stringify(M)}),F.status===429&&H<2){let q=(H+1)*2000;kO.warn(`[ELIZAOS_CLOUD] Image analysis rate-limited (429), retrying in ${q/1000}s...`),await new Promise((P)=>setTimeout(P,q));continue}break}if(!F||!F.ok){let H=F?.status??0;if(H===402)throw Error("Eliza Cloud credits exhausted — top up at https://www.elizacloud.ai/dashboard/settings?tab=billing");throw Error(`ElizaOS Cloud API error: ${H}`)}let R=await F.json(),K=R.choices?.[0]?.message?.content;if(R.usage)cU(Q,d$.IMAGE_DESCRIPTION,typeof $==="string"?$:$.prompt||"",{inputTokens:R.usage.prompt_tokens,outputTokens:R.usage.completion_tokens,totalTokens:R.usage.total_tokens});if(!K)return{title:"Failed to analyze image",description:"No response from API"};return BQ(K)}catch(M){let F=M instanceof Error?M.message:String(M);return kO.error(`Error analyzing image: ${F}`),{title:"Failed to analyze image",description:`Error: ${F}`}}}import{logger as IO,ModelType as xQ}from"@elizaos/core";import{generateObject as n$,JSONParseError as m$}from"ai";import{createOpenAI as o$}from"@ai-sdk/openai";function oO(Q){let $=PU(Q),V=rU(Q)??(kX(Q)?"eliza-proxy":void 0);return o$({apiKey:V??"",baseURL:$})}var t$=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.5","claude-opus-4","gpt-5-mini","gpt-5"];function s$(Q){let $=Q.toLowerCase();return t$.some((V)=>$.includes(V))}async function NQ(Q,$,V,W){let C=oO(Q),D=W(Q);IO.log(`[ELIZAOS_CLOUD] Using ${V} model: ${D}`);let A=s$(D);try{let z=C.chat(D),{object:M,usage:F}=await n$({model:z,output:"no-schema",prompt:$.prompt,...A?{}:{temperature:$.temperature??0},experimental_repairText:BZ()});if(F)cU(Q,V,$.prompt,F);return M}catch(z){if(z instanceof m$){IO.error(`[generateObject] Failed to parse JSON: ${z.message}`);let F=await BZ()({text:z.text,error:z});if(F)try{let R=JSON.parse(F);return IO.info("[generateObject] Successfully repaired JSON."),R}catch(R){let K=R instanceof Error?R.message:String(R);throw IO.error(`[generateObject] Failed to parse repaired JSON: ${K}`),R}else throw IO.error("[generateObject] JSON repair failed."),z}else{let M=z instanceof Error?z.message:String(z);throw IO.error(`[generateObject] Error: ${M}`),z}}}async function gZ(Q,$){return NQ(Q,$,xQ.OBJECT_SMALL,wO)}async function fZ(Q,$){return NQ(Q,$,xQ.OBJECT_LARGE,DO)}import{logger as r$,ModelType as a$}from"@elizaos/core";function e$(Q){return Q.filter(($)=>$.url!==void 0).map(($)=>({url:$.url,title:$.title??"",startIndex:$.start_index??0,endIndex:$.end_index??0}))}function i$(Q){let $=[];for(let V of Q)switch(V.type){case"web_search_call":$.push({id:V.id??"",type:"web_search_call",status:V.status??"completed",action:{type:V.action?.type??"search",query:V.action?.query,url:V.action?.url}});break;case"file_search_call":$.push({id:V.id??"",type:"file_search_call",status:V.status??"completed",query:V.query??"",results:V.results?.map((W)=>({fileId:W.file_id,fileName:W.file_name,score:W.score}))});break;case"code_interpreter_call":$.push({id:V.id??"",type:"code_interpreter_call",status:V.status??"completed",code:V.code??"",output:V.output});break;case"mcp_tool_call":$.push({id:V.id??"",type:"mcp_tool_call",status:V.status??"completed",serverLabel:V.server_label??"",toolName:V.tool_name??"",arguments:V.arguments??{},result:V.result});break;case"message":{let W=V.content??[];$.push({type:"message",content:W.filter((C)=>C.type==="output_text").map((C)=>({type:"output_text",text:C.text??"",annotations:e$(C.annotations??[])}))});break}}return $}async function wZ(Q,$){let V=$.model??NX(Q);r$.log(`[ELIZAOS_CLOUD] Using RESEARCH model: ${V}`);let W=PU(Q),C=$.tools??[{type:"web_search_preview"}],D={model:V,input:$.input,tools:C};if($.instructions)D.instructions=$.instructions;if($.background!==void 0)D.background=$.background;if($.maxToolCalls!==void 0)D.max_tool_calls=$.maxToolCalls;if($.reasoningSummary)D.reasoning={summary:$.reasoningSummary};let A=await fetch(`${W}/responses`,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json"},body:JSON.stringify(D)});if(!A.ok){let K=await A.text();throw Error(`Research API error: ${A.status} ${K}`)}let z=await A.json();if(z.usage)cU(Q,a$.RESEARCH,$.input,{inputTokens:z.usage.input_tokens,outputTokens:z.usage.output_tokens,totalTokens:z.usage.total_tokens});let M=i$(z.output),F="",R=[];for(let K of M)if(K.type==="message"){for(let H of K.content)if(H.type==="output_text")F+=H.text,R.push(...H.annotations)}return{id:z.id,text:F,annotations:R,outputItems:M,status:z.status}}import{logger as jE}from"@elizaos/core";async function yZ(Q,$){let V=u0(Q,"ELIZAOS_CLOUD_TTS_MODEL","gpt-5-mini-tts"),W=u0(Q,"ELIZAOS_CLOUD_TTS_VOICE","nova"),C=u0(Q,"ELIZAOS_CLOUD_TTS_INSTRUCTIONS",""),D=PU(Q),A=$.model||V,z=$.voice||W,M=$.instructions??C,F=$.format||"mp3";try{let R=await fetch(`${D}/audio/speech`,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json",...F==="mp3"?{Accept:"audio/mpeg"}:{}},body:JSON.stringify({model:A,voice:z,input:$.text,format:F,...M&&{instructions:M}})});if(!R.ok){let K=await R.text();throw Error(`ElizaOS Cloud TTS error ${R.status}: ${K}`)}if(!R.body)throw Error("ElizaOS Cloud TTS response body is null");if(!sU())return await jQ(R.body);return R.body}catch(R){let K=R instanceof Error?R.message:String(R);throw Error(`Failed to fetch speech from ElizaOS Cloud TTS: ${K}`)}}import{logger as nO,ModelType as wU}from"@elizaos/core";import{generateText as UA,streamText as OA}from"ai";var ZA=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.5","claude-opus-4","gpt-5-mini","gpt-5"],XA=["openai/","anthropic/"];function QA(Q){let $=Q.toLowerCase();return ZA.some((V)=>$.includes(V))}function YA(Q){let $=Q.toLowerCase();return!XA.some((V)=>$.startsWith(V))}function $A(Q,$){switch($){case wU.TEXT_SMALL:return wO(Q);case wU.TEXT_LARGE:return DO(Q);case wU.TEXT_REASONING_SMALL:return BX(Q);case wU.TEXT_REASONING_LARGE:return xX(Q);default:return DO(Q)}}function AA(Q,$,V){let{prompt:W}=V,C=V.maxTokens??8192,D=oO(Q),A=$A(Q,$),z=gX(Q),M=D.chat(A),R=!(QA(A)||$===wU.TEXT_REASONING_SMALL||$===wU.TEXT_REASONING_LARGE)&&YA(A)&&Array.isArray(V.stopSequences)&&V.stopSequences.length>0?V.stopSequences:void 0;return{generateParams:{model:M,prompt:W,system:Q.character.system??void 0,...R?{stopSequences:R}:{},maxOutputTokens:C,experimental_telemetry:{isEnabled:z}},modelName:A,modelType:$,prompt:W}}function JA(Q,$,V,W){nO.debug(`[ELIZAOS_CLOUD] Streaming text with ${$} model`);let C=OA(V);return{textStream:C.textStream,text:Promise.resolve(C.text),usage:Promise.resolve(C.usage).then((D)=>{if(D){cU(Q,$,W,D);let A=D.inputTokens??0,z=D.outputTokens??0;return{promptTokens:A,completionTokens:z,totalTokens:A+z}}return}),finishReason:Promise.resolve(C.finishReason)}}async function mO(Q,$,V){let{generateParams:W,modelName:C,prompt:D}=AA(Q,$,V);if(nO.debug(`[ELIZAOS_CLOUD] Generating text with ${$} model: ${C}`),V.stream)return JA(Q,$,W,D);nO.log(`[ELIZAOS_CLOUD] Using ${$} model: ${C}`),nO.log(D);let A=await UA(W);if(A.usage)cU(Q,$,D,A.usage);return A.text}async function cZ(Q,$){return mO(Q,wU.TEXT_SMALL,$)}async function pZ(Q,$){return mO(Q,wU.TEXT_LARGE,$)}async function hZ(Q,$){return mO(Q,wU.TEXT_REASONING_SMALL,$)}async function uZ(Q,$){return mO(Q,wU.TEXT_REASONING_LARGE,$)}import{logger as ZO,Service as WV}from"@elizaos/core";import{logger as GA}from"@elizaos/core";class bZ{baseUrl;apiKey;constructor(Q,$){this.baseUrl=Q.replace(/\/+$/,""),this.apiKey=$}setApiKey(Q){this.apiKey=Q}setBaseUrl(Q){this.baseUrl=Q.replace(/\/+$/,"")}getBaseUrl(){return this.baseUrl}getApiKey(){return this.apiKey}buildWsUrl(Q){return`${this.baseUrl.replace(/^http/,"ws")}${Q}`}async get(Q){return this.request("GET",Q)}async post(Q,$){return this.request("POST",Q,$)}async delete(Q){return this.request("DELETE",Q)}async postUnauthenticated(Q,$){return this.request("POST",Q,$,!0)}async request(Q,$,V,W=!1){let C=`${this.baseUrl}${$}`;GA.debug(`[CloudAPI] ${Q} ${C}`);let D={"Content-Type":"application/json",Accept:"application/json"};if(!W&&this.apiKey)D.Authorization=`Bearer ${this.apiKey}`;let A=await fetch(C,{method:Q,headers:D,...V?{body:JSON.stringify(V)}:{}});return this.handleResponse(A)}async handleResponse(Q){if(!(Q.headers.get("content-type")??"").includes("application/json")){if(!Q.ok)throw new SO(Q.status,{success:!1,error:`HTTP ${Q.status}: ${Q.statusText}`});return{success:!0}}let V=await Q.json();if(!Q.ok){let W=V;throw Q.status===402?new IZ(W):new SO(Q.status,W)}return V}}async function HV(){let Q=await Promise.resolve().then(() => (dZ(),lZ)),$=await Promise.resolve().then(() => (jU(),vU)),V=Q.cpus(),W=[Q.hostname(),Q.platform(),Q.arch(),V[0]?.model??"?",V.length,Q.totalmem()].join(":");return $.createHash("sha256").update(W).digest("hex")}function SV(){if(typeof process>"u")return"web";return{darwin:"macos",win32:"windows",linux:"linux"}[process.platform]??"linux"}class QZ extends WV{static serviceType="CLOUD_AUTH";capabilityDescription="ElizaCloud device authentication and session management";client;credentials=null;constructor(Q){super(Q);this.client=new bZ(qU.baseUrl)}static async start(Q){let $=new QZ(Q);return await $.initialize(),$}async stop(){this.credentials=null}async initialize(){let Q=String(this.runtime.getSetting("ELIZAOS_CLOUD_BASE_URL")??qU.baseUrl);this.client.setBaseUrl(Q);let $=this.runtime.getSetting("ELIZAOS_CLOUD_API_KEY");if($){let W=String($);this.client.setApiKey(W),this.credentials={apiKey:W,userId:String(this.runtime.getSetting("ELIZAOS_CLOUD_USER_ID")??""),organizationId:String(this.runtime.getSetting("ELIZAOS_CLOUD_ORG_ID")??""),authenticatedAt:Date.now()},ZO.info("[CloudAuth] Authenticated with saved API key"),this.validateApiKey(W).then((C)=>{if(!C)ZO.warn("[CloudAuth] Saved API key could not be validated (cloud may be unreachable or key revoked) — model calls will use the key anyway")}).catch(()=>{});return}let V=this.runtime.getSetting("ELIZAOS_CLOUD_ENABLED");if(V==="true"||V==="1")try{await this.authenticateWithDevice()}catch(W){let C=W instanceof Error?W.message:String(W);ZO.warn(`[CloudAuth] Device auth failed (cloud may be unreachable): ${C}`),ZO.info("[CloudAuth] Service will start unauthenticated — cloud features disabled until connectivity is restored")}else ZO.info("[CloudAuth] Cloud not enabled (set ELIZAOS_CLOUD_ENABLED=true)")}async validateApiKey(Q){try{return(await fetch(`${this.client.getBaseUrl()}/models`,{headers:{Authorization:`Bearer ${Q}`},signal:AbortSignal.timeout(1e4)})).ok}catch($){let V=$ instanceof Error?$.message:String($);return ZO.warn(`[CloudAuth] Could not reach cloud API to validate key: ${V}`),!1}}async authenticateWithDevice(){let Q=await HV(),$=SV(),V=process.env.ELIZAOS_CLOUD_APP_VERSION??"2.0.0-alpha",W=await Promise.resolve().then(() => (dZ(),lZ));ZO.info(`[CloudAuth] Authenticating device (platform=${$})`);let C=await this.client.postUnauthenticated("/device-auth",{deviceId:Q,platform:$,appVersion:V,deviceName:W.hostname()});this.credentials={apiKey:C.data.apiKey,userId:C.data.userId,organizationId:C.data.organizationId,authenticatedAt:Date.now()},this.client.setApiKey(C.data.apiKey);let D=C.data.isNew?"New account created":"Authenticated";return ZO.info(`[CloudAuth] ${D} (credits: $${C.data.credits.toFixed(2)})`),this.credentials}isAuthenticated(){return this.credentials!==null}getCredentials(){return this.credentials}getApiKey(){return this.credentials?.apiKey??this.client.getApiKey()}getClient(){return this.client}getUserId(){return this.credentials?.userId}getOrganizationId(){return this.credentials?.organizationId}}import{logger as NU,Service as DV}from"@elizaos/core";class YZ extends DV{static serviceType="CLOUD_BACKUP";capabilityDescription="ElizaCloud agent state backup and restore";authService;autoBackups=new Map;maxSnapshots=qU.backup.maxSnapshots;backupIntervalMs=qU.backup.autoBackupIntervalMs;static async start(Q){let $=new YZ(Q);return await $.initialize(),$}async stop(){for(let[,Q]of this.autoBackups)clearInterval(Q.timer);this.autoBackups.clear(),NU.info("[CloudBackup] Service stopped")}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){NU.debug("[CloudBackup] CloudAuthService not available");return}this.authService=Q,NU.info("[CloudBackup] Service initialized")}async createSnapshot(Q,$="manual",V){let C=await this.authService.getClient().post(`/agent-state/${Q}/snapshot`,{snapshotType:$,metadata:V});NU.info(`[CloudBackup] Created ${$} snapshot for container ${Q} (id=${C.data.id}, size=${FV(C.data.sizeBytes)})`);let D=this.autoBackups.get(Q);if(D)D.lastBackupAt=Date.now();return C.data}async listSnapshots(Q){return(await this.authService.getClient().get(`/agent-state/${Q}/snapshots`)).data}async restoreSnapshot(Q,$){await this.authService.getClient().post(`/agent-state/${Q}/restore`,{snapshotId:$}),NU.info(`[CloudBackup] Restored snapshot ${$} for container ${Q}`)}async getLatestSnapshot(Q){let $=await this.listSnapshots(Q);if($.length===0)return null;return $.sort((V,W)=>new Date(W.created_at).getTime()-new Date(V.created_at).getTime()),$[0]}scheduleAutoBackup(Q,$){if(this.autoBackups.has(Q)){NU.debug(`[CloudBackup] Auto-backup already scheduled for ${Q}`);return}let V=$??this.backupIntervalMs,W=setInterval(()=>{NU.debug(`[CloudBackup] Running auto-backup for container ${Q}`),this.createSnapshot(Q,"auto",{trigger:"scheduled",scheduledIntervalMs:V}).then(()=>this.pruneSnapshots(Q)).catch((C)=>{NU.error(`[CloudBackup] Auto-backup failed for ${Q}: ${C.message}`)})},V);this.autoBackups.set(Q,{containerId:Q,timer:W,lastBackupAt:null}),NU.info(`[CloudBackup] Scheduled auto-backup for ${Q} every ${Math.round(V/60000)} minutes`)}cancelAutoBackup(Q){let $=this.autoBackups.get(Q);if(!$)return;clearInterval($.timer),this.autoBackups.delete(Q),NU.info(`[CloudBackup] Cancelled auto-backup for ${Q}`)}async createPreEvictionSnapshot(Q){return NU.info(`[CloudBackup] Creating pre-eviction snapshot for ${Q}`),this.createSnapshot(Q,"pre-eviction",{trigger:"billing-eviction",createdAt:new Date().toISOString()})}async pruneSnapshots(Q){let W=(await this.listSnapshots(Q)).filter((D)=>D.snapshotType==="auto").sort((D,A)=>new Date(A.created_at).getTime()-new Date(D.created_at).getTime()).slice(this.maxSnapshots);if(W.length===0)return;let C=this.authService.getClient();for(let D of W)await C.delete(`/agent-state/${Q}/snapshots/${D.id}`),NU.debug(`[CloudBackup] Pruned old auto snapshot ${D.id} for ${Q}`);NU.info(`[CloudBackup] Pruned ${W.length} old auto snapshot(s) for ${Q}`)}isAutoBackupScheduled(Q){return this.autoBackups.has(Q)}getLastBackupTime(Q){return this.autoBackups.get(Q)?.lastBackupAt??null}}function FV(Q){if(Q<1024)return`${Q} B`;if(Q<1048576)return`${(Q/1024).toFixed(1)} KB`;if(Q<1073741824)return`${(Q/1048576).toFixed(1)} MB`;return`${(Q/1073741824).toFixed(1)} GB`}import{logger as pU,Service as RV}from"@elizaos/core";import{WebSocket as VX}from"undici";class $Z extends RV{static serviceType="CLOUD_BRIDGE";capabilityDescription="WebSocket bridge to cloud-hosted ElizaOS agents";authService;bridgeConfig=qU.bridge;connections=new Map;static async start(Q){let $=new $Z(Q);return await $.initialize(),$}async stop(){for(let[Q]of this.connections)await this.disconnect(Q);pU.info("[CloudBridge] Service stopped")}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){pU.debug("[CloudBridge] CloudAuthService not available");return}this.authService=Q,pU.info("[CloudBridge] Service initialized")}async connect(Q){if(this.connections.has(Q)){let $=this.connections.get(Q);if($.state==="connected"||$.state==="connecting"){pU.debug(`[CloudBridge] Already connected/connecting to ${Q}`);return}}await this.establishConnection(Q,0)}async disconnect(Q){let $=this.connections.get(Q);if(!$)return;if($.heartbeatTimer)clearInterval($.heartbeatTimer);if($.reconnectTimer)clearTimeout($.reconnectTimer);for(let[,V]of $.pendingRequests)clearTimeout(V.timeout),V.reject(Error("Bridge disconnected"));if($.pendingRequests.clear(),$.ws.readyState===VX.OPEN||$.ws.readyState===VX.CONNECTING)$.ws.close(1000,"Client disconnect");this.connections.delete(Q),pU.info(`[CloudBridge] Disconnected from ${Q}`)}async establishConnection(Q,$){let V=this.authService.getClient(),W=this.authService.getApiKey(),C=V.buildWsUrl(`/agent-bridge/${Q}`),D=W?`${C}?token=${encodeURIComponent(W)}`:C,A={ws:new VX(D),state:"connecting",connectedAt:null,lastHeartbeat:null,reconnectAttempts:$,heartbeatTimer:null,reconnectTimer:null,handlers:this.connections.get(Q)?.handlers??new Set,pendingRequests:new Map,nextRequestId:1};this.connections.set(Q,A),A.ws.addEventListener("open",()=>{A.state="connected",A.connectedAt=Date.now(),A.reconnectAttempts=0,pU.info(`[CloudBridge] Connected to agent ${Q}`),A.heartbeatTimer=setInterval(()=>{this.sendHeartbeat(Q)},this.bridgeConfig.heartbeatIntervalMs)}),A.ws.addEventListener("message",(z)=>{let M=z.data,F=typeof M==="string"?M:M instanceof Buffer?M.toString("utf-8"):String(M),R=JSON.parse(F);if(R.method==="heartbeat.ack"){A.lastHeartbeat=Date.now();return}if(R.id!==void 0&&!R.method){let K=A.pendingRequests.get(R.id);if(K){if(clearTimeout(K.timeout),A.pendingRequests.delete(R.id),R.error)K.reject(Error(R.error.message));else K.resolve(R.result);return}}for(let K of A.handlers)K(R)}),A.ws.addEventListener("close",(z)=>{if(A.state="disconnected",A.heartbeatTimer)clearInterval(A.heartbeatTimer);if(z.code===1000){pU.info(`[CloudBridge] Clean disconnect from ${Q}`);return}pU.warn(`[CloudBridge] Connection lost to ${Q} (code=${z.code}, reason=${z.reason})`),this.scheduleReconnect(Q,A.reconnectAttempts+1)}),A.ws.addEventListener("error",()=>{pU.error(`[CloudBridge] WebSocket error for ${Q}`)})}scheduleReconnect(Q,$){if($>this.bridgeConfig.maxReconnectAttempts){pU.error(`[CloudBridge] Max reconnect attempts (${this.bridgeConfig.maxReconnectAttempts}) reached for ${Q}`),this.connections.delete(Q);return}let V=this.bridgeConfig.reconnectIntervalMs,W=Math.min(V*2**Math.min($,5),120000),C=Math.floor(Math.random()*1000);pU.info(`[CloudBridge] Reconnecting to ${Q} in ${Math.round((W+C)/1000)}s (attempt ${$})`);let D=this.connections.get(Q);if(D)D.state="reconnecting",D.reconnectTimer=setTimeout(()=>{this.establishConnection(Q,$)},W+C)}sendHeartbeat(Q){let $=this.connections.get(Q);if(!$||$.state!=="connected")return;let V={jsonrpc:"2.0",method:"heartbeat",params:{timestamp:Date.now()}};$.ws.send(JSON.stringify(V))}async sendRequest(Q,$,V,W=60000){let C=this.connections.get(Q);if(!C||C.state!=="connected")throw Error(`Not connected to container ${Q}`);let D=C.nextRequestId++,A={jsonrpc:"2.0",id:D,method:$,params:V};return new Promise((z,M)=>{let F=setTimeout(()=>{C.pendingRequests.delete(D),M(Error(`Request ${$} timed out after ${W}ms`))},W);C.pendingRequests.set(D,{resolve:z,reject:M,timeout:F}),C.ws.send(JSON.stringify(A))})}sendNotification(Q,$,V){let W=this.connections.get(Q);if(!W||W.state!=="connected")throw Error(`Not connected to container ${Q}`);let C={jsonrpc:"2.0",method:$,params:V};W.ws.send(JSON.stringify(C))}async sendChatMessage(Q,$,V,W){return await this.sendRequest(Q,"message.send",{text:$,roomId:V,metadata:W})}async getAgentStatus(Q){return await this.sendRequest(Q,"status.get",{})}async updateAgentConfig(Q,$){await this.sendRequest(Q,"config.update",$)}onMessage(Q,$){let V=this.connections.get(Q);if(!V)V={ws:null,state:"disconnected",connectedAt:null,lastHeartbeat:null,reconnectAttempts:0,heartbeatTimer:null,reconnectTimer:null,handlers:new Set,pendingRequests:new Map,nextRequestId:1},this.connections.set(Q,V);return V.handlers.add($),()=>{V.handlers.delete($)}}getConnectionState(Q){return this.connections.get(Q)?.state??"disconnected"}getConnectionInfo(Q){let $=this.connections.get(Q);if(!$)return null;return{containerId:Q,state:$.state,connectedAt:$.connectedAt,lastHeartbeat:$.lastHeartbeat,reconnectAttempts:$.reconnectAttempts}}getConnectedContainerIds(){let Q=[];for(let[$,V]of this.connections)if(V.state==="connected")Q.push($);return Q}}import{logger as hU,Service as TV}from"@elizaos/core";class AZ extends TV{static serviceType="CLOUD_CONTAINER";capabilityDescription="ElizaCloud container provisioning and lifecycle management";authService;containerDefaults=qU.container;tracked=new Map;static async start(Q){let $=new AZ(Q);return await $.initialize(),$}async stop(){for(let[,Q]of this.tracked){if(Q.pollingTimer)clearTimeout(Q.pollingTimer);if(Q.healthTimer)clearInterval(Q.healthTimer)}this.tracked.clear()}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){hU.debug("[CloudContainer] CloudAuthService not available, container operations will fail");return}if(this.authService=Q,this.authService.isAuthenticated()){let $=await this.listContainers();for(let V of $){if(this.tracked.set(V.id,{container:V,pollingTimer:null,healthTimer:null}),V.status==="pending"||V.status==="building"||V.status==="deploying")this.startPolling(V.id);if(V.status==="running")this.startHealthMonitoring(V.id)}hU.info(`[CloudContainer] Loaded ${$.length} existing container(s)`)}}getClient(){return this.authService.getClient()}async createContainer(Q){let $=this.getClient(),V=this.containerDefaults,W={name:Q.name,project_name:Q.project_name,description:Q.description,port:Q.port??V.defaultPort,desired_count:Q.desired_count??1,cpu:Q.cpu??V.defaultCpu,memory:Q.memory??V.defaultMemory,environment_vars:Q.environment_vars??{},health_check_path:Q.health_check_path??"/health",ecr_image_uri:Q.ecr_image_uri,ecr_repository_uri:Q.ecr_repository_uri,image_tag:Q.image_tag,architecture:Q.architecture??V.defaultArchitecture},C=await $.post("/containers",W);return this.tracked.set(C.data.id,{container:C.data,pollingTimer:null,healthTimer:null}),this.startPolling(C.data.id),hU.info(`[CloudContainer] Created container "${Q.name}" (id=${C.data.id}, stack=${C.stackName})`),C}async listContainers(){return(await this.getClient().get("/containers")).data}async getContainer(Q){let V=await this.getClient().get(`/containers/${Q}`),W=this.tracked.get(Q);if(W)W.container=V.data;return V.data}async deleteContainer(Q){await this.getClient().delete(`/containers/${Q}`);let V=this.tracked.get(Q);if(V){if(V.pollingTimer)clearTimeout(V.pollingTimer);if(V.healthTimer)clearInterval(V.healthTimer);this.tracked.delete(Q)}hU.info(`[CloudContainer] Deleted container ${Q}`)}startPolling(Q){let $=this.tracked.get(Q);if(!$)return;let V=0,W=120,C=5000,D=30000,A=async()=>{if(V++,V>W){hU.error(`[CloudContainer] Polling timed out for container ${Q} after ${W} attempts`);return}let z=await this.getContainer(Q),M=z.status;if(hU.debug(`[CloudContainer] Poll #${V} for ${Q}: status=${M}`),M==="running"){hU.info(`[CloudContainer] Container ${Q} is now running at ${z.load_balancer_url}`),this.startHealthMonitoring(Q);return}if(M==="failed"||M==="stopped"||M==="suspended"){if(hU.warn(`[CloudContainer] Container ${Q} reached terminal state: ${M}`),z.error_message)hU.error(`[CloudContainer] Error: ${z.error_message}`);return}let F=Math.min(C*2**Math.min(V-1,3),D);$.pollingTimer=setTimeout(A,F)};$.pollingTimer=setTimeout(A,C)}async waitForDeployment(Q,$=900000){let V=Date.now()+$,W=5000,C=30000;while(Date.now()<V){let D=await this.getContainer(Q);if(D.status==="running")return D;if(D.status==="failed")throw Error(`Container deployment failed: ${D.error_message??"unknown error"}`);if(D.status==="stopped"||D.status==="suspended")throw Error(`Container reached terminal state: ${D.status}`);await new Promise((A)=>setTimeout(A,W)),W=Math.min(W*1.5,C)}throw Error(`Container deployment timed out after ${Math.round($/1000)}s`)}startHealthMonitoring(Q){let $=this.tracked.get(Q);if(!$||$.healthTimer)return;let V=60000;$.healthTimer=setInterval(()=>{this.getContainerHealth(Q).then((W)=>{if(!W.data.healthy)hU.warn(`[CloudContainer] Container ${Q} unhealthy: ${W.data.status}`)}).catch((W)=>{hU.error(`[CloudContainer] Health check failed for ${Q}: ${W.message}`)})},V)}async getContainerHealth(Q){return this.getClient().get(`/containers/${Q}/health`)}getTrackedContainers(){return Array.from(this.tracked.values()).map((Q)=>Q.container)}getTrackedContainer(Q){return this.tracked.get(Q)?.container}isContainerRunning(Q){return this.tracked.get(Q)?.container.status==="running"}getContainerUrl(Q){return this.tracked.get(Q)?.container.load_balancer_url??null}}import{logger as EX,Service as zV}from"@elizaos/core";var TY=1800000,MV=[["gpt-","openai"],["o1","openai"],["o3","openai"],["o4","openai"],["dall-e","openai"],["whisper","openai"],["tts","openai"],["claude-","anthropic"],["gemini-","google"],["llama","meta"],["deepseek","deepseek"],["grok","xai"],["kimi","moonshot"]];function qV(Q){if(Q.includes("/"))return Q.split("/")[0];let $=Q.toLowerCase();for(let[V,W]of MV)if($.startsWith(V))return W;return"unknown"}function PV(Q){if(Q.includes("/"))return Q.split("/").slice(1).join("/");return Q}class JZ extends zV{static serviceType="CLOUD_MODEL_REGISTRY";capabilityDescription="Discovers and caches available AI models from ElizaCloud";models=[];byProvider={};lastFetchedAt=0;fetchPromise=null;static async start(Q){let $=new JZ(Q);return await $.initialize(),$}async stop(){this.models=[],this.byProvider={},this.lastFetchedAt=0}async initialize(){if(!this.runtime.getService("CLOUD_AUTH")?.isAuthenticated()){EX.info("[CloudModelRegistry] Auth not available, will fetch models on first access");return}await this.fetchModels(),this.validateConfiguredModels()}async fetchModels(){if(this.fetchPromise){await this.fetchPromise;return}this.fetchPromise=this.doFetchModels(),await this.fetchPromise,this.fetchPromise=null}async doFetchModels(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q?.isAuthenticated())return;let W=(await Q.getClient().get("/models")).data??[];this.models=W.map((C)=>({id:C.id,provider:qV(C.id),name:PV(C.id),createdAt:C.created})),this.byProvider={};for(let C of this.models){if(!this.byProvider[C.provider])this.byProvider[C.provider]=[];this.byProvider[C.provider].push(C)}this.lastFetchedAt=Date.now(),EX.info(`[CloudModelRegistry] Loaded ${this.models.length} models from ${Object.keys(this.byProvider).length} providers`)}validateConfiguredModels(){if(this.models.length===0)return;let Q=new Set(this.models.map((W)=>W.id)),$=new Set(this.models.map((W)=>W.name)),V=[{key:"ELIZAOS_CLOUD_SMALL_MODEL",label:"small model"},{key:"ELIZAOS_CLOUD_LARGE_MODEL",label:"large model"},{key:"ELIZAOS_CLOUD_REASONING_SMALL_MODEL",label:"reasoning small model"},{key:"ELIZAOS_CLOUD_REASONING_LARGE_MODEL",label:"reasoning large model"},{key:"ELIZAOS_CLOUD_RESEARCH_MODEL",label:"research model"},{key:"ELIZAOS_CLOUD_EMBEDDING_MODEL",label:"embedding model"},{key:"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL",label:"image description model"},{key:"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL",label:"image generation model"},{key:"ELIZAOS_CLOUD_TTS_MODEL",label:"TTS model"},{key:"ELIZAOS_CLOUD_TRANSCRIPTION_MODEL",label:"transcription model"}];for(let{key:W,label:C}of V){let D=this.runtime.getSetting(W);if(D&&typeof D==="string"){if(!(Q.has(D)||$.has(D)))EX.warn(`[CloudModelRegistry] Configured ${C} "${D}" not found in available models. It may still work if the gateway supports it, but check your configuration.`)}}}async getAvailableModels(){if(Date.now()-this.lastFetchedAt>TY)await this.fetchModels();return this.models}async getModelsByProvider(){if(Date.now()-this.lastFetchedAt>TY)await this.fetchModels();return this.byProvider}}function kV(){if(typeof process>"u")return{};return process.env}var m0=kV(),_V={name:"elizaOSCloud",description:"ElizaOS Cloud plugin — Multi-model AI generation, container provisioning, agent bridge, and billing management",config:{ELIZAOS_CLOUD_API_KEY:m0.ELIZAOS_CLOUD_API_KEY??null,ELIZAOS_CLOUD_BASE_URL:m0.ELIZAOS_CLOUD_BASE_URL??null,ELIZAOS_CLOUD_ENABLED:m0.ELIZAOS_CLOUD_ENABLED??null,ELIZAOS_CLOUD_SMALL_MODEL:m0.ELIZAOS_CLOUD_SMALL_MODEL??null,ELIZAOS_CLOUD_LARGE_MODEL:m0.ELIZAOS_CLOUD_LARGE_MODEL??null,SMALL_MODEL:m0.SMALL_MODEL??null,LARGE_MODEL:m0.LARGE_MODEL??null,ELIZAOS_CLOUD_REASONING_SMALL_MODEL:m0.ELIZAOS_CLOUD_REASONING_SMALL_MODEL??null,ELIZAOS_CLOUD_REASONING_LARGE_MODEL:m0.ELIZAOS_CLOUD_REASONING_LARGE_MODEL??null,REASONING_SMALL_MODEL:m0.REASONING_SMALL_MODEL??null,REASONING_LARGE_MODEL:m0.REASONING_LARGE_MODEL??null,ELIZAOS_CLOUD_RESEARCH_MODEL:m0.ELIZAOS_CLOUD_RESEARCH_MODEL??null,RESEARCH_MODEL:m0.RESEARCH_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_MODEL:m0.ELIZAOS_CLOUD_EMBEDDING_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_API_KEY:m0.ELIZAOS_CLOUD_EMBEDDING_API_KEY??null,ELIZAOS_CLOUD_EMBEDDING_URL:m0.ELIZAOS_CLOUD_EMBEDDING_URL??null,ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS:m0.ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL:m0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS:m0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS??null,ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL:m0.ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL??null,ELIZAOS_CLOUD_TTS_MODEL:m0.ELIZAOS_CLOUD_TTS_MODEL??null,ELIZAOS_CLOUD_TRANSCRIPTION_MODEL:m0.ELIZAOS_CLOUD_TRANSCRIPTION_MODEL??null,ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY:m0.ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY??null},async init(Q,$){fX(Q,$)},services:[QZ,JZ,AZ,$Z,YZ],actions:[HX,WX,SX,KX],providers:[DX,zX,FX,PX],models:{[a0.TEXT_EMBEDDING]:KZ,[a0.TEXT_SMALL]:cZ,[a0.TEXT_LARGE]:pZ,[a0.TEXT_REASONING_SMALL]:hZ,[a0.TEXT_REASONING_LARGE]:uZ,[a0.RESEARCH]:wZ,[a0.IMAGE]:xZ,[a0.IMAGE_DESCRIPTION]:NZ,[a0.OBJECT_SMALL]:gZ,[a0.OBJECT_LARGE]:fZ},tests:[{name:"ELIZAOS_CLOUD_plugin_tests",tests:[{name:"ELIZAOS_CLOUD_test_url_and_api_key_validation",fn:async(Q)=>{let $=PU(Q),V=await fetch(`${$}/models`,{headers:{Authorization:`Bearer ${rU(Q)}`}}),W=await V.json();if(BU.log({data:W?.data?.length??"N/A"},"Models Available"),!V.ok)throw Error(`Failed to validate OpenAI API key: ${V.statusText}`)}},{name:"ELIZAOS_CLOUD_test_text_embedding",fn:async(Q)=>{let $=await Q.useModel(a0.TEXT_EMBEDDING,{text:"Hello, world!"});BU.log({embedding:$},"embedding")}},{name:"ELIZAOS_CLOUD_test_text_large",fn:async(Q)=>{let $=await Q.useModel(a0.TEXT_LARGE,{prompt:"What is the nature of reality in 10 words?"});if($.length===0)throw Error("Failed to generate text");BU.log({text:$},"generated with test_text_large")}},{name:"ELIZAOS_CLOUD_test_text_small",fn:async(Q)=>{let $=await Q.useModel(a0.TEXT_SMALL,{prompt:"What is the nature of reality in 10 words?"});if($.length===0)throw Error("Failed to generate text");BU.log({text:$},"generated with test_text_small")}},{name:"ELIZAOS_CLOUD_test_image_generation",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_image_generation");let $=await Q.useModel(a0.IMAGE,{prompt:"A beautiful sunset over a calm ocean",count:1,size:"1024x1024"});BU.log({image:$},"generated with test_image_generation")}},{name:"image-description",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_image_description");let $=await Q.useModel(a0.IMAGE_DESCRIPTION,"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg/537px-Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg");if($&&typeof $==="object"&&"title"in $&&"description"in $)BU.log({result:$},"Image description");else BU.error(`Invalid image description result format: ${JSON.stringify($)}`)}},{name:"ELIZAOS_CLOUD_test_transcription",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_transcription");let V=await(await fetch("https://upload.wikimedia.org/wikipedia/en/4/40/Chris_Benoit_Voice_Message.ogg")).arrayBuffer(),W=await Q.useModel(a0.TRANSCRIPTION,Buffer.from(new Uint8Array(V)));BU.log({transcription:W},"generated with test_transcription")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_encode",fn:async(Q)=>{let V=await Q.useModel(a0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer encode!",modelType:a0.TEXT_SMALL});if(!Array.isArray(V)||V.length===0)throw Error("Failed to tokenize text: expected non-empty array of tokens");BU.log({tokens:V},"Tokenized output")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_decode",fn:async(Q)=>{let V=await Q.useModel(a0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer decode!",modelType:a0.TEXT_SMALL}),W=await Q.useModel(a0.TEXT_TOKENIZER_DECODE,{tokens:V,modelType:a0.TEXT_SMALL});if(W!=="Hello tokenizer decode!")throw Error(`Decoded text does not match original. Expected "Hello tokenizer decode!", got "${W}"`);BU.log({decodedText:W},"Decoded text")}},{name:"ELIZAOS_CLOUD_test_text_to_speech",fn:async(Q)=>{if(!await yZ(Q,{text:"Hello, this is a test for text-to-speech."}))throw Error("Failed to generate speech");BU.log("Generated speech successfully")}}]}]},vV=_V;export{_V as elizaOSCloudPlugin,vV as default};
17
+ https://github.com/browserify/crypto-browserify`)},Q.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}}),p0=iJ(jG(),1),BG=p0.prng,xG=p0.pseudoRandomBytes,NG=p0.rng,gG=p0.randomBytes,fG=p0.Hash,wG=p0.createHash,yG=p0.Hmac,cG=p0.createHmac,pG=p0.getHashes,hG=p0.pbkdf2,uG=p0.pbkdf2Sync,bG=p0.Cipher,lG=p0.createCipher,dG=p0.Cipheriv,oG=p0.createCipheriv,nG=p0.Decipher,mG=p0.createDecipher,sG=p0.Decipheriv,tG=p0.createDecipheriv,rG=p0.getCiphers,aG=p0.listCiphers,eG=p0.DiffieHellmanGroup,iG=p0.createDiffieHellmanGroup,UV=p0.getDiffieHellman,OV=p0.createDiffieHellman,ZV=p0.DiffieHellman,XV=p0.createSign,QV=p0.Sign,YV=p0.createVerify,$V=p0.Verify,JV=p0.createECDH,AV=p0.publicEncrypt,GV=p0.privateEncrypt,VV=p0.publicDecrypt,EV=p0.privateDecrypt,IV=p0.randomFill,CV=p0.randomFillSync,LV=p0.createCredentials,KV=p0.constants,DV=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];RV=crypto,TV=crypto});import{logger as BU,ModelType as a0}from"@elizaos/core";var HX={name:"CHECK_CLOUD_CREDITS",description:"Check ElizaCloud credit balance, container costs, and estimated remaining runtime.",similes:["check credits","check balance","how much credit","cloud billing"],tags:["cloud","billing"],parameters:[{name:"detailed",description:"Include transaction history",required:!1,schema:{type:"boolean"}}],validate:async(Q,Y,V,H)=>{let D=(typeof Y?.content?.text==="string"?Y.content.text:"").toLowerCase(),J=["check","cloud","credits"],T=J.length>0&&J.some((k)=>k.length>0&&D.includes(k)),M=/\b(?:check|cloud|credits)\b/i,F=Boolean(D.match(M)),R=String(Y?.content?.source??Y?.source??""),K="",W=Boolean(R||V||Q?.agentId||Q?.getService),q=H&&typeof H==="object"?H:{},P=D.trim().length>0||Object.keys(q).length>0||Boolean(Y?.content&&typeof Y.content==="object");if(!(T&&F&&W&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _(Q,Y,V,H))}catch{return!1}},async handler(Q,Y,V,H,C){let D=Q.getService("CLOUD_AUTH"),J=Q.getService("CLOUD_CONTAINER"),T=D.getClient(),M=H?.detailed===!0||Y.metadata?.detailed===!0,{data:{balance:F}}=await T.get("/credits/balance"),R=J?.getTrackedContainers().filter((_)=>_.status==="running").length??0,K=R*0.67,W=K>0?F/K:null,q=[`ElizaCloud credits: $${F.toFixed(2)}`,R>0?`Active containers: ${R} ($${K.toFixed(2)}/day) — ~${W?.toFixed(1)} days remaining`:"No active containers."];if(M){let{data:_}=await T.get("/credits/summary");q.push(`Total spent: $${_.totalSpent.toFixed(2)} | Total added: $${_.totalAdded.toFixed(2)}`);for(let k of _.recentTransactions.slice(0,10)){let B=k.amount>=0?"+":"";q.push(` ${B}$${k.amount.toFixed(2)} — ${k.description} (${new Date(k.created_at).toLocaleDateString()})`)}}let P=q.join(`
18
+ `);if(C)await C({text:P,actions:["CHECK_CLOUD_CREDITS"]});return{success:!0,text:P,data:{balance:F,runningContainers:R,dailyCost:K,estimatedDaysRemaining:W}}}};function fY(Q,Y){if(Y?.containerId)return String(Y.containerId);let V=Q.metadata?.actionParams;return V?.containerId?String(V.containerId):null}var WX={name:"FREEZE_CLOUD_AGENT",description:"Freeze a cloud agent: snapshot state, disconnect bridge, stop container.",similes:["freeze agent","hibernate agent","pause agent","stop cloud agent"],tags:["cloud","container","backup"],parameters:[{name:"containerId",description:"ID of the container to freeze",required:!0,schema:{type:"string"}}],validate:async(Q,Y,V,H)=>{let D=(typeof Y?.content?.text==="string"?Y.content.text:"").toLowerCase(),J=["freeze","cloud"],T=J.length>0&&J.some((k)=>k.length>0&&D.includes(k)),M=/\b(?:freeze|cloud)\b/i,F=Boolean(D.match(M)),R=String(Y?.content?.source??Y?.source??""),K="",W=Boolean(R||V||Q?.agentId||Q?.getService),q=H&&typeof H==="object"?H:{},P=D.trim().length>0||Object.keys(q).length>0||Boolean(Y?.content&&typeof Y.content==="object");if(!(T&&F&&W&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _(Q,Y,V,H))}catch{return!1}},async handler(Q,Y,V,H,C){let D=Q.getService("CLOUD_CONTAINER"),J=Q.getService("CLOUD_BRIDGE"),T=Q.getService("CLOUD_BACKUP"),M=fY(Y,H);if(!M)return{success:!1,error:"Missing containerId"};let F=await D.getContainer(M);if(F.status!=="running")return{success:!1,error:`Container not running (status: ${F.status})`};let R=async(W)=>{if(C)await C({text:W,actions:["FREEZE_CLOUD_AGENT"]})};await R(`Freezing "${F.name}"... Creating snapshot.`);let K=null;if(T)K=(await T.createSnapshot(M,"manual",{trigger:"user-freeze",containerName:F.name})).id,T.cancelAutoBackup(M);if(J)await J.disconnect(M);return await D.deleteContainer(M),await R(`"${F.name}" frozen.${K?` Snapshot: ${K}`:""}`),{success:!0,text:`Agent "${F.name}" frozen`,data:{containerId:M,containerName:F.name,snapshotId:K}}}};import{logger as yY}from"@elizaos/core";var qU={enabled:!1,baseUrl:"https://www.elizacloud.ai/api/v1",inferenceMode:"cloud",autoProvision:!1,bridge:{reconnectIntervalMs:3000,maxReconnectAttempts:20,heartbeatIntervalMs:30000},backup:{autoBackupIntervalMs:3600000,maxSnapshots:10},container:{defaultImage:"elizaos/agent:latest",defaultArchitecture:"arm64",defaultCpu:1792,defaultMemory:1792,defaultPort:3000}};class SO extends Error{statusCode;errorBody;constructor(Q,Y){super(Y.error);this.name="CloudApiError",this.statusCode=Q,this.errorBody=Y}}class IZ extends SO{requiredCredits;constructor(Q){super(402,Q);this.name="InsufficientCreditsError",this.requiredCredits=Q.requiredCredits??0}}var wY=["OPENAI_API_KEY","ANTHROPIC_API_KEY","GROQ_API_KEY","ELIZAOS_CLOUD_API_KEY","SMALL_MODEL","LARGE_MODEL","ELIZAOS_CLOUD_SMALL_MODEL","ELIZAOS_CLOUD_LARGE_MODEL"];function gO(Q){let Y={};for(let V of wY){let H=Q.getSetting(V);if(H)Y[V]=String(H)}return Y}function cY(Q,Y){if(Y&&Object.keys(Y).length>0)return Y;let V=Q.metadata;if(V?.actionParams)return V.actionParams;let H=Q.content?.text??"",C=H.match(/name[:\s]+["']?([^"',]+)["']?/i)?.[1]?.trim(),D=H.match(/project[:\s]+["']?([^"',\s]+)["']?/i)?.[1]?.trim();return{name:C,project_name:D}}var SX={name:"PROVISION_CLOUD_AGENT",description:"Deploy an ElizaOS agent to ElizaCloud. Provisions a container, waits for deployment, connects the bridge, and starts auto-backup.",similes:["deploy agent to cloud","launch cloud agent","start remote agent","provision container"],tags:["cloud","container","deployment"],parameters:[{name:"name",description:"Human-readable name for the cloud agent",required:!0,schema:{type:"string"}},{name:"project_name",description:"Unique project identifier (lowercase, no spaces)",required:!0,schema:{type:"string"}},{name:"description",description:"Optional description",required:!1,schema:{type:"string"}},{name:"environment_vars",description:"Additional environment variables",required:!1,schema:{type:"object"}},{name:"auto_backup",description:"Enable periodic auto-backup (default: true)",required:!1,schema:{type:"boolean"}}],validate:async(Q,Y,V,H)=>{let D=(typeof Y?.content?.text==="string"?Y.content.text:"").toLowerCase(),J=["provision","cloud"],T=J.length>0&&J.some((k)=>k.length>0&&D.includes(k)),M=/\b(?:provision|cloud)\b/i,F=Boolean(D.match(M)),R=String(Y?.content?.source??Y?.source??""),K="",W=Boolean(R||V||Q?.agentId||Q?.getService),q=H&&typeof H==="object"?H:{},P=D.trim().length>0||Object.keys(q).length>0||Boolean(Y?.content&&typeof Y.content==="object");if(!(T&&F&&W&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _(Q,Y,V,H))}catch{return!1}},async handler(Q,Y,V,H,C){let D=Q.getService("CLOUD_AUTH"),J=Q.getService("CLOUD_CONTAINER"),T=Q.getService("CLOUD_BRIDGE"),M=Q.getService("CLOUD_BACKUP");if(!D?.isAuthenticated()||!J)return{success:!1,error:"ElizaCloud not authenticated or container service unavailable"};let F=cY(Y,H);if(!F.name||!F.project_name)return{success:!1,error:"Missing required parameters: name and project_name"};let R=async(B)=>{if(C)await C({text:B,actions:["PROVISION_CLOUD_AGENT"]})};await R(`Provisioning cloud agent "${F.name}"... This typically takes 8-12 minutes.`);let K=qU.container,W={name:F.name,project_name:F.project_name,description:F.description,port:K.defaultPort,cpu:K.defaultCpu,memory:K.defaultMemory,architecture:K.defaultArchitecture,ecr_image_uri:K.defaultImage,environment_vars:{...gO(Q),...F.environment_vars},health_check_path:"/health"},q=await J.createContainer(W),P=q.data.id;await R(`Container created (id: ${P}). Credits: -$${q.creditsDeducted.toFixed(2)} ($${q.creditsRemaining.toFixed(2)} remaining).`);let _=await J.waitForDeployment(P);if(await R(`Container running at ${_.load_balancer_url}`),T)await T.connect(P),yY.info(`[PROVISION] Bridge connected to ${P}`);let k=F.auto_backup!==!1;if(k&&M)M.scheduleAutoBackup(P);return await R(`Agent "${F.name}" deployed.${k?" Auto-backup enabled.":""}`),{success:!0,text:`Cloud agent "${F.name}" deployed`,data:{containerId:P,containerUrl:_.load_balancer_url,status:_.status,creditsDeducted:q.creditsDeducted,creditsRemaining:q.creditsRemaining,bridgeConnected:T?.getConnectionState(P)==="connected",autoBackupEnabled:k}}}};function pY(Q,Y){if(Y&&Object.keys(Y).length>0)return Y;return Q.metadata?.actionParams??{}}async function hY(Q,Y,V){let C=(await Y.listContainers()).filter((J)=>J.project_name===V).map((J)=>J.id),D=[];for(let J of C)D.push(...await Q.listSnapshots(J));return D.sort((J,T)=>new Date(T.created_at).getTime()-new Date(J.created_at).getTime()),D[0]??null}var DX={name:"RESUME_CLOUD_AGENT",description:"Resume a frozen cloud agent from snapshot. Re-provisions, restores state, reconnects bridge.",similes:["resume agent","unfreeze agent","restart cloud agent","restore agent"],tags:["cloud","container","restore"],parameters:[{name:"name",description:"Name for the restored agent",required:!0,schema:{type:"string"}},{name:"project_name",description:"Project identifier (must match original)",required:!0,schema:{type:"string"}},{name:"snapshotId",description:"Specific snapshot ID (defaults to latest)",required:!1,schema:{type:"string"}},{name:"environment_vars",description:"Additional environment variables",required:!1,schema:{type:"object"}}],validate:async(Q,Y,V,H)=>{let D=(typeof Y?.content?.text==="string"?Y.content.text:"").toLowerCase(),J=["resume","cloud"],T=J.length>0&&J.some((k)=>k.length>0&&D.includes(k)),M=/\b(?:resume|cloud)\b/i,F=Boolean(D.match(M)),R=String(Y?.content?.source??Y?.source??""),K="",W=Boolean(R||V||Q?.agentId||Q?.getService),q=H&&typeof H==="object"?H:{},P=D.trim().length>0||Object.keys(q).length>0||Boolean(Y?.content&&typeof Y.content==="object");if(!(T&&F&&W&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _(Q,Y,V,H))}catch{return!1}},async handler(Q,Y,V,H,C){let D=Q.getService("CLOUD_CONTAINER"),J=Q.getService("CLOUD_BRIDGE"),T=Q.getService("CLOUD_BACKUP"),M=pY(Y,H);if(!M.name||!M.project_name)return{success:!1,error:"Missing required parameters: name and project_name"};let F=async(k)=>{if(C)await C({text:k,actions:["RESUME_CLOUD_AGENT"]})};await F(`Resuming cloud agent "${M.name}"...`);let R=qU.container,K={name:M.name,project_name:M.project_name,port:R.defaultPort,cpu:R.defaultCpu,memory:R.defaultMemory,architecture:R.defaultArchitecture,ecr_image_uri:R.defaultImage,environment_vars:{...gO(Q),...M.environment_vars},health_check_path:"/health"},W=await D.createContainer(K),q=W.data.id;await F(`Container re-provisioned (${q}). Waiting for infrastructure...`);let P=await D.waitForDeployment(q),_=null;if(T){let k=M.snapshotId;if(k)await T.restoreSnapshot(q,k),_=k;else{let B=await hY(T,D,M.project_name);if(B)await T.restoreSnapshot(q,B.id),_=B.id}T.scheduleAutoBackup(q)}if(J)await J.connect(q);return await F(`Agent "${M.name}" resumed at ${P.load_balancer_url}.`+(_?` Restored snapshot ${_}.`:" No snapshot to restore.")),{success:!0,text:`Cloud agent "${M.name}" resumed`,data:{containerId:q,containerUrl:P.load_balancer_url,restoredSnapshotId:_,creditsDeducted:W.creditsDeducted,creditsRemaining:W.creditsRemaining}}}};var FX={name:"elizacloud_status",description:"ElizaCloud container and connection status",dynamic:!0,position:90,async get(Q,Y,V){if(!Q.getService("CLOUD_AUTH")?.isAuthenticated())return{text:"ElizaCloud: Not authenticated",values:{cloudAuthenticated:!1}};let C=Q.getService("CLOUD_CONTAINER"),D=Q.getService("CLOUD_BRIDGE"),J=C?.getTrackedContainers()??[],T=D?.getConnectedContainerIds()??[],M=J.filter((W)=>W.status==="running").length,F=J.filter((W)=>W.status==="pending"||W.status==="building"||W.status==="deploying").length,R=J.map((W)=>({id:W.id,name:W.name,status:W.status,url:W.load_balancer_url,billing:W.billing_status,bridged:T.includes(W.id)}));return{text:[`ElizaCloud: ${J.length} container(s), ${M} running, ${T.length} bridged`,...R.map((W)=>` - ${W.name} [${W.status}]${W.url?` @ ${W.url}`:""}${W.bridged?" (bridged)":""}`)].join(`
19
+ `),values:{cloudAuthenticated:!0,totalContainers:J.length,runningContainers:M,deployingContainers:F},data:{containers:R}}}};var RX={name:"elizacloud_health",description:"ElizaCloud container health",dynamic:!0,position:92,private:!0,async get(Q,Y,V){if(!Q.getService("CLOUD_AUTH")?.isAuthenticated())return{text:""};let D=Q.getService("CLOUD_CONTAINER")?.getTrackedContainers().filter((F)=>F.status==="running")??[];if(D.length===0)return{text:"No running containers.",values:{healthyContainers:0}};let J=D.map((F)=>({id:F.id,name:F.name,healthy:F.status==="running"&&F.billing_status==="active"&&!F.error_message,status:F.status,billing:F.billing_status})),T=J.filter((F)=>F.healthy).length;return{text:[`Health: ${T}/${J.length} healthy`,...J.map((F)=>` - ${F.name}: ${F.healthy?"OK":"UNHEALTHY"} (status=${F.status}, billing=${F.billing})`)].join(`
20
+ `),values:{healthyContainers:T,unhealthyContainers:J.length-T},data:{reports:J}}}};import{logger as TX}from"@elizaos/core";var CZ="https://www.elizacloud.ai/dashboard/settings?tab=billing",zX=new WeakMap,uY=60000,MX={name:"elizacloud_credits",description:"ElizaCloud credit balance",dynamic:!0,position:91,async get(Q,Y,V){let H=Q.getService("CLOUD_AUTH");if(!H?.isAuthenticated())return{text:""};let C=zX.get(Q);if(C&&Date.now()-C.at<uY)return LZ(C.value);let D;try{let{data:J}=await H.getClient().get("/credits/balance");D=J.balance}catch(J){if(TX.warn(`[CloudCredits] Failed to fetch balance: ${J instanceof Error?J.message:J}`),C)return LZ(C.value);return{text:""}}if(zX.set(Q,{value:D,at:Date.now()}),D<1)TX.warn(`[CloudCredits] Low balance: $${D.toFixed(2)}`);return LZ(D)}};function LZ(Q){let Y=Q<2,V=Q<0.5,H=`ElizaCloud credits: $${Q.toFixed(2)}`;if(V)H+=` (CRITICAL — top up at ${CZ})`;else if(Y)H+=` (LOW — top up at ${CZ})`;return{text:H,values:{cloudCredits:Q,cloudCreditsLow:Y,cloudCreditsCritical:V,cloudTopUpUrl:CZ}}}var qX=new WeakMap,kX={name:"elizacloud_models",description:"Available AI models from ElizaCloud grouped by provider",dynamic:!0,position:92,async get(Q,Y,V){let H=Q.getService("CLOUD_MODEL_REGISTRY");if(!H)return{text:""};let C=qX.get(Q);if(C&&Date.now()-C.at<300000)return PX(C.value);let D=await H.getModelsByProvider();if(Object.keys(D).length===0)return{text:""};return qX.set(Q,{value:D,at:Date.now()}),PX(D)}};function PX(Q){let Y=Object.keys(Q).sort(),V=Object.values(Q).reduce((H,C)=>H+C.length,0);return{text:`ElizaCloud: ${V} models (${Y.join(", ")})`,values:{cloudModelProviders:Y.join(","),cloudModelCount:V}}}import{logger as uU}from"@elizaos/core";import{logger as fO}from"@elizaos/core";function bY(Q){if(typeof process>"u")return;let Y=process.env[Q];return Y===void 0?void 0:String(Y)}function u0(Q,Y,V){let H=Q.getSetting(Y);if(H!==void 0&&H!==null)return String(H);return bY(Y)??V}function tU(){return typeof globalThis<"u"&&typeof globalThis.document<"u"}function _X(Q){return tU()&&!!u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL")}function gU(Q,Y=!1){if(tU())return{};let V=Y?lY(Q):rU(Q);return V?{Authorization:`Bearer ${V}`}:{}}function PU(Q){let Y=u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL");return tU()&&Y?Y:u0(Q,"ELIZAOS_CLOUD_BASE_URL","https://www.elizacloud.ai/api/v1")}function vX(Q){let Y=tU()?u0(Q,"ELIZAOS_CLOUD_BROWSER_EMBEDDING_URL")||u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL"):u0(Q,"ELIZAOS_CLOUD_EMBEDDING_URL");if(Y)return fO.debug(`[ELIZAOS_CLOUD] Using specific embedding base URL: ${Y}`),Y;return fO.debug("[ELIZAOS_CLOUD] Falling back to general base URL for embeddings."),PU(Q)}function rU(Q){return u0(Q,"ELIZAOS_CLOUD_API_KEY")}function lY(Q){let Y=u0(Q,"ELIZAOS_CLOUD_EMBEDDING_API_KEY");if(Y)return fO.debug("[ELIZAOS_CLOUD] Using specific embedding API key (present)"),Y;return fO.debug("[ELIZAOS_CLOUD] Falling back to general API key for embeddings."),rU(Q)}function wO(Q){return u0(Q,"ELIZAOS_CLOUD_SMALL_MODEL")??u0(Q,"SMALL_MODEL","openai/gpt-5-mini")}function DO(Q){return u0(Q,"ELIZAOS_CLOUD_LARGE_MODEL")??u0(Q,"LARGE_MODEL","anthropic/claude-sonnet-4.5")}function jX(Q){return u0(Q,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL","gpt-5-mini")}function BX(Q){return u0(Q,"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL","google/gemini-2.5-flash-image")??"google/gemini-2.5-flash-image"}function xX(Q){return u0(Q,"ELIZAOS_CLOUD_REASONING_SMALL_MODEL")??u0(Q,"REASONING_SMALL_MODEL","deepseek/deepseek-r1")}function NX(Q){return u0(Q,"ELIZAOS_CLOUD_REASONING_LARGE_MODEL")??u0(Q,"REASONING_LARGE_MODEL","anthropic/claude-opus-4.5")}function gX(Q){return u0(Q,"ELIZAOS_CLOUD_RESEARCH_MODEL")??u0(Q,"RESEARCH_MODEL","o3-deep-research")}function fX(Q){let Y=u0(Q,"ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY","false");return String(Y).toLowerCase()==="true"}function wX(Q,Y){(async()=>{try{if(!rU(Y)&&!tU()){uU.warn("ELIZAOS_CLOUD_API_KEY is not set in environment - ElizaOS Cloud functionality will be limited"),uU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");return}try{let V=PU(Y),H=await fetch(`${V}/models`,{headers:{...gU(Y)}});if(!H.ok)uU.warn(`ElizaOS Cloud API key validation failed: ${H.statusText}`),uU.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided"),uU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");else uU.log("ElizaOS Cloud API key validated successfully")}catch(V){let H=V instanceof Error?V.message:String(V);uU.warn(`Error validating ElizaOS Cloud API key: ${H}`),uU.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided")}}catch(V){let H=V?.errors?.map((C)=>C.message).join(", ")||(V instanceof Error?V.message:String(V));uU.warn(`ElizaOS Cloud plugin configuration issue: ${H} - You need to configure the ELIZAOS_CLOUD_API_KEY in your environment variables`),uU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys")}})()}import{logger as TU,ModelType as oY,VECTOR_DIMS as yX}from"@elizaos/core";import{EventType as dY}from"@elizaos/core";function cU(Q,Y,V,H){let C=Number(H.inputTokens||0),D=Number(H.outputTokens||0),J=Number(H.totalTokens!=null?H.totalTokens:C+D);Q.emitEvent(dY.MODEL_USED,{runtime:Q,source:"elizacloud",type:Y,tokens:{prompt:C,completion:D,total:J}})}var yO=100;function nY(Q){return{remainingRequests:parseInt(Q.headers.get("x-ratelimit-remaining-requests")||"",10)||void 0,remainingTokens:parseInt(Q.headers.get("x-ratelimit-remaining-tokens")||"",10)||void 0,limitRequests:parseInt(Q.headers.get("x-ratelimit-limit-requests")||"",10)||void 0,limitTokens:parseInt(Q.headers.get("x-ratelimit-limit-tokens")||"",10)||void 0,resetRequests:Q.headers.get("x-ratelimit-reset-requests")||void 0,resetTokens:Q.headers.get("x-ratelimit-reset-tokens")||void 0,retryAfter:parseInt(Q.headers.get("retry-after")||"",10)||void 0}}function cX(Q){let Y=u0(Q,"ELIZAOS_CLOUD_EMBEDDING_MODEL","text-embedding-3-small"),V=Number.parseInt(u0(Q,"ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS","1536")||"1536",10);if(!Object.values(yX).includes(V)){let H=`Invalid embedding dimension: ${V}. Must be one of: ${Object.values(yX).join(", ")}`;throw TU.error(H),Error(H)}return{embeddingModelName:Y,embeddingDimension:V}}function aU(Q,Y){let V=Array(Q).fill(0);return V[0]=Y,V}async function KZ(Q,Y){let{embeddingDimension:V}=cX(Q);if(Y===null)return TU.debug("Creating test embedding for initialization"),aU(V,0.1);let H;if(typeof Y==="string")H=Y;else if(typeof Y==="object"&&Y.text)H=Y.text;else return TU.warn("Invalid input format for embedding"),aU(V,0.2);if(!H.trim())return TU.warn("Empty text for embedding"),aU(V,0.3);return(await pX(Q,[H]))[0]}async function pX(Q,Y){let{embeddingModelName:V,embeddingDimension:H}=cX(Q),C=vX(Q);if(!Y||Y.length===0)return TU.warn("[BatchEmbeddings] Empty texts array"),[];let D=[],J=Array(Y.length);for(let T=0;T<Y.length;T++){let M=Y[T]?.trim();if(M)D.push({text:M,originalIndex:T});else J[T]=aU(H,0.3)}if(D.length===0)return TU.warn("[BatchEmbeddings] All texts were empty"),J;for(let T=0;T<D.length;T+=yO){let M=Math.min(T+yO,D.length),F=D.slice(T,M),R=F.map((K)=>K.text);TU.info(`[BatchEmbeddings] Processing batch ${Math.floor(T/yO)+1}/${Math.ceil(D.length/yO)}: ${F.length} texts`);try{let K=await fetch(`${C}/embeddings`,{method:"POST",headers:{...gU(Q,!0),"Content-Type":"application/json"},body:JSON.stringify({model:V,input:R})}),W=nY(K);if(W.remainingRequests!==void 0&&W.remainingRequests<50)TU.warn(`[BatchEmbeddings] Rate limit: ${W.remainingRequests}/${W.limitRequests} requests remaining`);if(K.status===429){let P=W.retryAfter||30;TU.warn(`[BatchEmbeddings] Rate limited, waiting ${P}s...`),await new Promise((B)=>setTimeout(B,P*1000));let _=await fetch(`${C}/embeddings`,{method:"POST",headers:{...gU(Q,!0),"Content-Type":"application/json"},body:JSON.stringify({model:V,input:R})});if(!_.ok){TU.error(`[BatchEmbeddings] Retry failed: ${_.status}`);for(let B of F)J[B.originalIndex]=aU(H,0.4);continue}let k=await _.json();if(k?.data){for(let B of k.data){let j=F[B.index].originalIndex;J[j]=B.embedding}TU.info(`[BatchEmbeddings] Retry successful for ${F.length} embeddings`)}continue}if(!K.ok){TU.error(`[BatchEmbeddings] API error: ${K.status} - ${K.statusText}`);for(let P of F)J[P.originalIndex]=aU(H,0.4);continue}let q=await K.json();if(!q?.data||!Array.isArray(q.data)){TU.error("[BatchEmbeddings] API returned invalid structure");for(let P of F)J[P.originalIndex]=aU(H,0.5);continue}for(let P of q.data){let _=F[P.index].originalIndex;J[_]=P.embedding}if(q.usage){let P={inputTokens:q.usage.prompt_tokens,outputTokens:0,totalTokens:q.usage.total_tokens};cU(Q,oY.TEXT_EMBEDDING,`batch:${F.length}`,P)}TU.debug(`[BatchEmbeddings] Got ${F.length} embeddings (${H}d), remaining: ${W.remainingRequests??"unknown"}`)}catch(K){let W=K instanceof Error?K.message:String(K);TU.error(`[BatchEmbeddings] Error: ${W}`);for(let q of F)J[q.originalIndex]=aU(H,0.6)}}return J}import{logger as kO,ModelType as r$}from"@elizaos/core";import{logger as jQ}from"@elizaos/core";import{JSONParseError as t$}from"ai";function BZ(){return async({text:Q,error:Y})=>{try{if(Y instanceof t$){let V=Q.replace(/```json\n|\n```|```/g,"");return JSON.parse(V),V}return null}catch(V){let H=V instanceof Error?V.message:String(V);return jQ.warn(`Failed to repair JSON text: ${H}`),null}}}async function BQ(Q){try{let{Readable:Y}=await Promise.resolve().then(() => jY(dO(),1)),V=Q.getReader();return new Y({async read(){try{let{done:H,value:C}=await V.read();if(H)this.push(null);else this.push(C)}catch(H){this.destroy(H)}},destroy(H,C){V.cancel().finally(()=>C(H))}})}catch(Y){let V=Y instanceof Error?Y.message:String(Y);throw jQ.error(`Failed to load node:stream module: ${V}`),Error("Cannot convert stream: node:stream module unavailable. This feature requires a Node.js environment.")}}function xQ(Q){let V=Q.match(/title[:\s]+(.+?)(?:\n|$)/i)?.[1]?.trim()||"Image Analysis",H=Q.replace(/title[:\s]+(.+?)(?:\n|$)/i,"").trim();return{title:V,description:H}}async function xZ(Q,Y){let V=Y.count||1,H=Y.size||"1024x1024",C=Y.prompt,D=BX(Q);kO.log(`[ELIZAOS_CLOUD] Using IMAGE model: ${D}`);let J=PU(Q),M={"1024x1024":"1:1","1792x1024":"16:9","1024x1792":"9:16"}[H]||"1:1";try{let F=`${J}/generate-image`,R={prompt:C,numImages:V,aspectRatio:M,model:D},K=await fetch(F,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json"},body:JSON.stringify(R)});if(!K.ok){let _=await K.text();throw Error(`Failed to generate image: ${K.status} ${_}`)}return(await K.json()).images.map((_)=>({url:_.url||_.image}))}catch(F){let R=F instanceof Error?F.message:String(F);throw kO.error(`[ELIZAOS_CLOUD] Image generation error: ${R}`),F}}async function NZ(Q,Y){let V,H,C=jX(Q);kO.log(`[ELIZAOS_CLOUD] Using IMAGE_DESCRIPTION model: ${C}`);let D=Number.parseInt(u0(Q,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS","8192")||"8192",10);if(typeof Y==="string")V=Y,H="Please analyze this image and provide a title and detailed description.";else V=Y.imageUrl,H=Y.prompt||"Please analyze this image and provide a title and detailed description.";let J=[{role:"user",content:[{type:"text",text:H},{type:"image_url",image_url:{url:V}}]}],T=PU(Q);try{let M={model:C,messages:J,max_tokens:D},F=null;for(let W=0;W<3;W++){if(F=await fetch(`${T}/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",...gU(Q)},body:JSON.stringify(M)}),F.status===429&&W<2){let q=(W+1)*2000;kO.warn(`[ELIZAOS_CLOUD] Image analysis rate-limited (429), retrying in ${q/1000}s...`),await new Promise((P)=>setTimeout(P,q));continue}break}if(!F?.ok){let W=F?.status??0;if(W===402)throw Error("Eliza Cloud credits exhausted — top up at https://www.elizacloud.ai/dashboard/settings?tab=billing");throw Error(`ElizaOS Cloud API error: ${W}`)}let R=await F.json(),K=R.choices?.[0]?.message?.content;if(R.usage)cU(Q,r$.IMAGE_DESCRIPTION,typeof Y==="string"?Y:Y.prompt||"",{inputTokens:R.usage.prompt_tokens,outputTokens:R.usage.completion_tokens,totalTokens:R.usage.total_tokens});if(!K)return{title:"Failed to analyze image",description:"No response from API"};return xQ(K)}catch(M){let F=M instanceof Error?M.message:String(M);return kO.error(`Error analyzing image: ${F}`),{title:"Failed to analyze image",description:`Error: ${F}`}}}import{logger as IO,ModelType as NQ}from"@elizaos/core";import{generateObject as e$,JSONParseError as i$}from"ai";import{createOpenAI as a$}from"@ai-sdk/openai";function oO(Q){let Y=PU(Q),V=rU(Q)??(_X(Q)?"eliza-proxy":void 0);return a$({apiKey:V??"",baseURL:Y})}var UJ=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.5","claude-opus-4","gpt-5-mini","gpt-5"];function OJ(Q){let Y=Q.toLowerCase();return UJ.some((V)=>Y.includes(V))}async function gQ(Q,Y,V,H){let C=oO(Q),D=H(Q);IO.log(`[ELIZAOS_CLOUD] Using ${V} model: ${D}`);let J=OJ(D);try{let T=C.chat(D),{object:M,usage:F}=await e$({model:T,output:"no-schema",prompt:Y.prompt,...J?{}:{temperature:Y.temperature??0},experimental_repairText:BZ()});if(F)cU(Q,V,Y.prompt,F);return M}catch(T){if(T instanceof i$){IO.error(`[generateObject] Failed to parse JSON: ${T.message}`);let F=await BZ()({text:T.text,error:T});if(F)try{let R=JSON.parse(F);return IO.info("[generateObject] Successfully repaired JSON."),R}catch(R){let K=R instanceof Error?R.message:String(R);throw IO.error(`[generateObject] Failed to parse repaired JSON: ${K}`),R}else throw IO.error("[generateObject] JSON repair failed."),T}else{let M=T instanceof Error?T.message:String(T);throw IO.error(`[generateObject] Error: ${M}`),T}}}async function gZ(Q,Y){return gQ(Q,Y,NQ.OBJECT_SMALL,wO)}async function fZ(Q,Y){return gQ(Q,Y,NQ.OBJECT_LARGE,DO)}import{logger as ZJ,ModelType as XJ}from"@elizaos/core";function QJ(Q){return Q.filter((Y)=>Y.url!==void 0).map((Y)=>({url:Y.url,title:Y.title??"",startIndex:Y.start_index??0,endIndex:Y.end_index??0}))}function YJ(Q){let Y=[];for(let V of Q)switch(V.type){case"web_search_call":Y.push({id:V.id??"",type:"web_search_call",status:V.status??"completed",action:{type:V.action?.type??"search",query:V.action?.query,url:V.action?.url}});break;case"file_search_call":Y.push({id:V.id??"",type:"file_search_call",status:V.status??"completed",query:V.query??"",results:V.results?.map((H)=>({fileId:H.file_id,fileName:H.file_name,score:H.score}))});break;case"code_interpreter_call":Y.push({id:V.id??"",type:"code_interpreter_call",status:V.status??"completed",code:V.code??"",output:V.output});break;case"mcp_tool_call":Y.push({id:V.id??"",type:"mcp_tool_call",status:V.status??"completed",serverLabel:V.server_label??"",toolName:V.tool_name??"",arguments:V.arguments??{},result:V.result});break;case"message":{let H=V.content??[];Y.push({type:"message",content:H.filter((C)=>C.type==="output_text").map((C)=>({type:"output_text",text:C.text??"",annotations:QJ(C.annotations??[])}))});break}}return Y}async function wZ(Q,Y){let V=Y.model??gX(Q);ZJ.log(`[ELIZAOS_CLOUD] Using RESEARCH model: ${V}`);let H=PU(Q),C=Y.tools??[{type:"web_search_preview"}],D={model:V,input:Y.input,tools:C};if(Y.instructions)D.instructions=Y.instructions;if(Y.background!==void 0)D.background=Y.background;if(Y.maxToolCalls!==void 0)D.max_tool_calls=Y.maxToolCalls;if(Y.reasoningSummary)D.reasoning={summary:Y.reasoningSummary};let J=await fetch(`${H}/responses`,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json"},body:JSON.stringify(D)});if(!J.ok){let K=await J.text();throw Error(`Research API error: ${J.status} ${K}`)}let T=await J.json();if(T.usage)cU(Q,XJ.RESEARCH,Y.input,{inputTokens:T.usage.input_tokens,outputTokens:T.usage.output_tokens,totalTokens:T.usage.total_tokens});let M=YJ(T.output),F="",R=[];for(let K of M)if(K.type==="message"){for(let W of K.content)if(W.type==="output_text")F+=W.text,R.push(...W.annotations)}return{id:T.id,text:F,annotations:R,outputItems:M,status:T.status}}import{logger as wE}from"@elizaos/core";async function yZ(Q,Y){let V=u0(Q,"ELIZAOS_CLOUD_TTS_MODEL","gpt-5-mini-tts"),H=u0(Q,"ELIZAOS_CLOUD_TTS_VOICE","nova"),C=u0(Q,"ELIZAOS_CLOUD_TTS_INSTRUCTIONS",""),D=PU(Q),J=Y.model||V,T=Y.voice||H,M=Y.instructions??C,F=Y.format||"mp3";try{let R=await fetch(`${D}/audio/speech`,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json",...F==="mp3"?{Accept:"audio/mpeg"}:{}},body:JSON.stringify({model:J,voice:T,input:Y.text,format:F,...M&&{instructions:M}})});if(!R.ok){let K=await R.text();throw Error(`ElizaOS Cloud TTS error ${R.status}: ${K}`)}if(!R.body)throw Error("ElizaOS Cloud TTS response body is null");if(!tU())return await BQ(R.body);return R.body}catch(R){let K=R instanceof Error?R.message:String(R);throw Error(`Failed to fetch speech from ElizaOS Cloud TTS: ${K}`)}}import{logger as nO,ModelType as wU}from"@elizaos/core";import{generateText as $J,streamText as JJ}from"ai";var AJ=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.5","claude-opus-4","gpt-5-mini","gpt-5"],GJ=["openai/","anthropic/"];function VJ(Q){let Y=[{type:"text",text:Q.prompt}];for(let V of Q.attachments??[])Y.push({type:"file",data:V.data,mediaType:V.mediaType,...V.filename?{filename:V.filename}:{}});return Y}function EJ(Q){let Y=Q.toLowerCase();return AJ.some((V)=>Y.includes(V))}function IJ(Q){let Y=Q.toLowerCase();return!GJ.some((V)=>Y.startsWith(V))}function CJ(Q,Y){switch(Y){case wU.TEXT_SMALL:return wO(Q);case wU.TEXT_LARGE:return DO(Q);case wU.TEXT_REASONING_SMALL:return xX(Q);case wU.TEXT_REASONING_LARGE:return NX(Q);default:return DO(Q)}}function LJ(Q,Y,V){let H=V,{prompt:C}=V,D=V.maxTokens??8192,J=oO(Q),T=CJ(Q,Y),M=fX(Q),F=(H.attachments?.length??0)>0?VJ(H):void 0,R=J.chat(T),W=!(EJ(T)||Y===wU.TEXT_REASONING_SMALL||Y===wU.TEXT_REASONING_LARGE)&&IJ(T)&&Array.isArray(V.stopSequences)&&V.stopSequences.length>0?V.stopSequences:void 0;return{generateParams:{model:R,...F?{messages:[{role:"user",content:F}]}:{prompt:C},system:Q.character.system??void 0,...W?{stopSequences:W}:{},maxOutputTokens:D,experimental_telemetry:{isEnabled:M}},modelName:T,modelType:Y,prompt:C}}function KJ(Q,Y,V,H){nO.debug(`[ELIZAOS_CLOUD] Streaming text with ${Y} model`);let C=JJ(V);return{textStream:C.textStream,text:Promise.resolve(C.text),usage:Promise.resolve(C.usage).then((D)=>{if(D){cU(Q,Y,H,D);let J=D.inputTokens??0,T=D.outputTokens??0;return{promptTokens:J,completionTokens:T,totalTokens:J+T}}return}),finishReason:Promise.resolve(C.finishReason)}}async function mO(Q,Y,V){let{generateParams:H,modelName:C,prompt:D}=LJ(Q,Y,V);if(nO.debug(`[ELIZAOS_CLOUD] Generating text with ${Y} model: ${C}`),V.stream)return KJ(Q,Y,H,D);nO.log(`[ELIZAOS_CLOUD] Using ${Y} model: ${C}`),nO.log(D);let J=await $J(H);if(J.usage)cU(Q,Y,D,J.usage);return J.text}async function cZ(Q,Y){return mO(Q,wU.TEXT_SMALL,Y)}async function pZ(Q,Y){return mO(Q,wU.TEXT_LARGE,Y)}async function hZ(Q,Y){return mO(Q,wU.TEXT_REASONING_SMALL,Y)}async function uZ(Q,Y){return mO(Q,wU.TEXT_REASONING_LARGE,Y)}import{logger as ZO,Service as zV}from"@elizaos/core";import{logger as HJ}from"@elizaos/core";class bZ{baseUrl;apiKey;constructor(Q,Y){this.baseUrl=Q.replace(/\/+$/,""),this.apiKey=Y}setApiKey(Q){this.apiKey=Q}setBaseUrl(Q){this.baseUrl=Q.replace(/\/+$/,"")}getBaseUrl(){return this.baseUrl}getApiKey(){return this.apiKey}buildWsUrl(Q){return`${this.baseUrl.replace(/^http/,"ws")}${Q}`}async get(Q){return this.request("GET",Q)}async post(Q,Y){return this.request("POST",Q,Y)}async delete(Q){return this.request("DELETE",Q)}async postUnauthenticated(Q,Y){return this.request("POST",Q,Y,!0)}async request(Q,Y,V,H=!1){let C=`${this.baseUrl}${Y}`;HJ.debug(`[CloudAPI] ${Q} ${C}`);let D={"Content-Type":"application/json",Accept:"application/json"};if(!H&&this.apiKey)D.Authorization=`Bearer ${this.apiKey}`;let J=await fetch(C,{method:Q,headers:D,...V?{body:JSON.stringify(V)}:{}});return this.handleResponse(J)}async handleResponse(Q){if(!(Q.headers.get("content-type")??"").includes("application/json")){if(!Q.ok)throw new SO(Q.status,{success:!1,error:`HTTP ${Q.status}: ${Q.statusText}`});return{success:!0}}let V=await Q.json();if(!Q.ok){let H=V;throw Q.status===402?new IZ(H):new SO(Q.status,H)}return V}}async function MV(){let Q=await Promise.resolve().then(() => (dZ(),lZ)),Y=await Promise.resolve().then(() => (jU(),vU)),V=Q.cpus(),H=[Q.hostname(),Q.platform(),Q.arch(),V[0]?.model??"?",V.length,Q.totalmem()].join(":");return Y.createHash("sha256").update(H).digest("hex")}function qV(){if(typeof process>"u")return"web";return{darwin:"macos",win32:"windows",linux:"linux"}[process.platform]??"linux"}class QZ extends zV{static serviceType="CLOUD_AUTH";capabilityDescription="ElizaCloud device authentication and session management";client;credentials=null;constructor(Q){super(Q);this.client=new bZ(qU.baseUrl)}static async start(Q){let Y=new QZ(Q);return await Y.initialize(),Y}async stop(){this.credentials=null}async initialize(){let Q=String(this.runtime.getSetting("ELIZAOS_CLOUD_BASE_URL")??qU.baseUrl);this.client.setBaseUrl(Q);let Y=this.runtime.getSetting("ELIZAOS_CLOUD_API_KEY");if(Y){let H=String(Y);this.client.setApiKey(H),this.credentials={apiKey:H,userId:String(this.runtime.getSetting("ELIZAOS_CLOUD_USER_ID")??""),organizationId:String(this.runtime.getSetting("ELIZAOS_CLOUD_ORG_ID")??""),authenticatedAt:Date.now()},ZO.info("[CloudAuth] Authenticated with saved API key"),this.validateApiKey(H).then((C)=>{if(!C)ZO.warn("[CloudAuth] Saved API key could not be validated (cloud may be unreachable or key revoked) — model calls will use the key anyway")}).catch(()=>{});return}let V=this.runtime.getSetting("ELIZAOS_CLOUD_ENABLED");if(V==="true"||V==="1")try{await this.authenticateWithDevice()}catch(H){let C=H instanceof Error?H.message:String(H);ZO.warn(`[CloudAuth] Device auth failed (cloud may be unreachable): ${C}`),ZO.info("[CloudAuth] Service will start unauthenticated — cloud features disabled until connectivity is restored")}else ZO.info("[CloudAuth] Cloud not enabled (set ELIZAOS_CLOUD_ENABLED=true)")}async validateApiKey(Q){try{return(await fetch(`${this.client.getBaseUrl()}/models`,{headers:{Authorization:`Bearer ${Q}`},signal:AbortSignal.timeout(1e4)})).ok}catch(Y){let V=Y instanceof Error?Y.message:String(Y);return ZO.warn(`[CloudAuth] Could not reach cloud API to validate key: ${V}`),!1}}async authenticateWithDevice(){let Q=await MV(),Y=qV(),V=process.env.ELIZAOS_CLOUD_APP_VERSION??"2.0.0-alpha",H=await Promise.resolve().then(() => (dZ(),lZ));ZO.info(`[CloudAuth] Authenticating device (platform=${Y})`);let C=await this.client.postUnauthenticated("/device-auth",{deviceId:Q,platform:Y,appVersion:V,deviceName:H.hostname()});this.credentials={apiKey:C.data.apiKey,userId:C.data.userId,organizationId:C.data.organizationId,authenticatedAt:Date.now()},this.client.setApiKey(C.data.apiKey);let D=C.data.isNew?"New account created":"Authenticated";return ZO.info(`[CloudAuth] ${D} (credits: $${C.data.credits.toFixed(2)})`),this.credentials}isAuthenticated(){return this.credentials!==null}getCredentials(){return this.credentials}getApiKey(){return this.credentials?.apiKey??this.client.getApiKey()}getClient(){return this.client}getUserId(){return this.credentials?.userId}getOrganizationId(){return this.credentials?.organizationId}}import{logger as NU,Service as PV}from"@elizaos/core";class YZ extends PV{static serviceType="CLOUD_BACKUP";capabilityDescription="ElizaCloud agent state backup and restore";authService;autoBackups=new Map;maxSnapshots=qU.backup.maxSnapshots;backupIntervalMs=qU.backup.autoBackupIntervalMs;static async start(Q){let Y=new YZ(Q);return await Y.initialize(),Y}async stop(){for(let[,Q]of this.autoBackups)clearInterval(Q.timer);this.autoBackups.clear(),NU.info("[CloudBackup] Service stopped")}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){NU.debug("[CloudBackup] CloudAuthService not available");return}this.authService=Q,NU.info("[CloudBackup] Service initialized")}async createSnapshot(Q,Y="manual",V){let C=await this.authService.getClient().post(`/agent-state/${Q}/snapshot`,{snapshotType:Y,metadata:V});NU.info(`[CloudBackup] Created ${Y} snapshot for container ${Q} (id=${C.data.id}, size=${kV(C.data.sizeBytes)})`);let D=this.autoBackups.get(Q);if(D)D.lastBackupAt=Date.now();return C.data}async listSnapshots(Q){return(await this.authService.getClient().get(`/agent-state/${Q}/snapshots`)).data}async restoreSnapshot(Q,Y){await this.authService.getClient().post(`/agent-state/${Q}/restore`,{snapshotId:Y}),NU.info(`[CloudBackup] Restored snapshot ${Y} for container ${Q}`)}async getLatestSnapshot(Q){let Y=await this.listSnapshots(Q);if(Y.length===0)return null;return Y.sort((V,H)=>new Date(H.created_at).getTime()-new Date(V.created_at).getTime()),Y[0]}scheduleAutoBackup(Q,Y){if(this.autoBackups.has(Q)){NU.debug(`[CloudBackup] Auto-backup already scheduled for ${Q}`);return}let V=Y??this.backupIntervalMs,H=setInterval(()=>{NU.debug(`[CloudBackup] Running auto-backup for container ${Q}`),this.createSnapshot(Q,"auto",{trigger:"scheduled",scheduledIntervalMs:V}).then(()=>this.pruneSnapshots(Q)).catch((C)=>{NU.error(`[CloudBackup] Auto-backup failed for ${Q}: ${C.message}`)})},V);this.autoBackups.set(Q,{containerId:Q,timer:H,lastBackupAt:null}),NU.info(`[CloudBackup] Scheduled auto-backup for ${Q} every ${Math.round(V/60000)} minutes`)}cancelAutoBackup(Q){let Y=this.autoBackups.get(Q);if(!Y)return;clearInterval(Y.timer),this.autoBackups.delete(Q),NU.info(`[CloudBackup] Cancelled auto-backup for ${Q}`)}async createPreEvictionSnapshot(Q){return NU.info(`[CloudBackup] Creating pre-eviction snapshot for ${Q}`),this.createSnapshot(Q,"pre-eviction",{trigger:"billing-eviction",createdAt:new Date().toISOString()})}async pruneSnapshots(Q){let H=(await this.listSnapshots(Q)).filter((D)=>D.snapshotType==="auto").sort((D,J)=>new Date(J.created_at).getTime()-new Date(D.created_at).getTime()).slice(this.maxSnapshots);if(H.length===0)return;let C=this.authService.getClient();for(let D of H)await C.delete(`/agent-state/${Q}/snapshots/${D.id}`),NU.debug(`[CloudBackup] Pruned old auto snapshot ${D.id} for ${Q}`);NU.info(`[CloudBackup] Pruned ${H.length} old auto snapshot(s) for ${Q}`)}isAutoBackupScheduled(Q){return this.autoBackups.has(Q)}getLastBackupTime(Q){return this.autoBackups.get(Q)?.lastBackupAt??null}}function kV(Q){if(Q<1024)return`${Q} B`;if(Q<1048576)return`${(Q/1024).toFixed(1)} KB`;if(Q<1073741824)return`${(Q/1048576).toFixed(1)} MB`;return`${(Q/1073741824).toFixed(1)} GB`}import{logger as pU,Service as _V}from"@elizaos/core";import{WebSocket as VX}from"undici";class $Z extends _V{static serviceType="CLOUD_BRIDGE";capabilityDescription="WebSocket bridge to cloud-hosted ElizaOS agents";authService;bridgeConfig=qU.bridge;connections=new Map;static async start(Q){let Y=new $Z(Q);return await Y.initialize(),Y}async stop(){for(let[Q]of this.connections)await this.disconnect(Q);pU.info("[CloudBridge] Service stopped")}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){pU.debug("[CloudBridge] CloudAuthService not available");return}this.authService=Q,pU.info("[CloudBridge] Service initialized")}async connect(Q){if(this.connections.has(Q)){let Y=this.connections.get(Q);if(Y.state==="connected"||Y.state==="connecting"){pU.debug(`[CloudBridge] Already connected/connecting to ${Q}`);return}}await this.establishConnection(Q,0)}async disconnect(Q){let Y=this.connections.get(Q);if(!Y)return;if(Y.heartbeatTimer)clearInterval(Y.heartbeatTimer);if(Y.reconnectTimer)clearTimeout(Y.reconnectTimer);for(let[,V]of Y.pendingRequests)clearTimeout(V.timeout),V.reject(Error("Bridge disconnected"));if(Y.pendingRequests.clear(),Y.ws.readyState===VX.OPEN||Y.ws.readyState===VX.CONNECTING)Y.ws.close(1000,"Client disconnect");this.connections.delete(Q),pU.info(`[CloudBridge] Disconnected from ${Q}`)}async establishConnection(Q,Y){let V=this.authService.getClient(),H=this.authService.getApiKey(),C=V.buildWsUrl(`/agent-bridge/${Q}`),D=H?`${C}?token=${encodeURIComponent(H)}`:C,J={ws:new VX(D),state:"connecting",connectedAt:null,lastHeartbeat:null,reconnectAttempts:Y,heartbeatTimer:null,reconnectTimer:null,handlers:this.connections.get(Q)?.handlers??new Set,pendingRequests:new Map,nextRequestId:1};this.connections.set(Q,J),J.ws.addEventListener("open",()=>{J.state="connected",J.connectedAt=Date.now(),J.reconnectAttempts=0,pU.info(`[CloudBridge] Connected to agent ${Q}`),J.heartbeatTimer=setInterval(()=>{this.sendHeartbeat(Q)},this.bridgeConfig.heartbeatIntervalMs)}),J.ws.addEventListener("message",(T)=>{let M=T.data,F=typeof M==="string"?M:M instanceof Buffer?M.toString("utf-8"):String(M),R=JSON.parse(F);if(R.method==="heartbeat.ack"){J.lastHeartbeat=Date.now();return}if(R.id!==void 0&&!R.method){let K=J.pendingRequests.get(R.id);if(K){if(clearTimeout(K.timeout),J.pendingRequests.delete(R.id),R.error)K.reject(Error(R.error.message));else K.resolve(R.result);return}}for(let K of J.handlers)K(R)}),J.ws.addEventListener("close",(T)=>{if(J.state="disconnected",J.heartbeatTimer)clearInterval(J.heartbeatTimer);if(T.code===1000){pU.info(`[CloudBridge] Clean disconnect from ${Q}`);return}pU.warn(`[CloudBridge] Connection lost to ${Q} (code=${T.code}, reason=${T.reason})`),this.scheduleReconnect(Q,J.reconnectAttempts+1)}),J.ws.addEventListener("error",()=>{pU.error(`[CloudBridge] WebSocket error for ${Q}`)})}scheduleReconnect(Q,Y){if(Y>this.bridgeConfig.maxReconnectAttempts){pU.error(`[CloudBridge] Max reconnect attempts (${this.bridgeConfig.maxReconnectAttempts}) reached for ${Q}`),this.connections.delete(Q);return}let V=this.bridgeConfig.reconnectIntervalMs,H=Math.min(V*2**Math.min(Y,5),120000),C=Math.floor(Math.random()*1000);pU.info(`[CloudBridge] Reconnecting to ${Q} in ${Math.round((H+C)/1000)}s (attempt ${Y})`);let D=this.connections.get(Q);if(D)D.state="reconnecting",D.reconnectTimer=setTimeout(()=>{this.establishConnection(Q,Y)},H+C)}sendHeartbeat(Q){let Y=this.connections.get(Q);if(!Y||Y.state!=="connected")return;let V={jsonrpc:"2.0",method:"heartbeat",params:{timestamp:Date.now()}};Y.ws.send(JSON.stringify(V))}async sendRequest(Q,Y,V,H=60000){let C=this.connections.get(Q);if(!C||C.state!=="connected")throw Error(`Not connected to container ${Q}`);let D=C.nextRequestId++,J={jsonrpc:"2.0",id:D,method:Y,params:V};return new Promise((T,M)=>{let F=setTimeout(()=>{C.pendingRequests.delete(D),M(Error(`Request ${Y} timed out after ${H}ms`))},H);C.pendingRequests.set(D,{resolve:T,reject:M,timeout:F}),C.ws.send(JSON.stringify(J))})}sendNotification(Q,Y,V){let H=this.connections.get(Q);if(!H||H.state!=="connected")throw Error(`Not connected to container ${Q}`);let C={jsonrpc:"2.0",method:Y,params:V};H.ws.send(JSON.stringify(C))}async sendChatMessage(Q,Y,V,H){return await this.sendRequest(Q,"message.send",{text:Y,roomId:V,metadata:H})}async getAgentStatus(Q){return await this.sendRequest(Q,"status.get",{})}async updateAgentConfig(Q,Y){await this.sendRequest(Q,"config.update",Y)}onMessage(Q,Y){let V=this.connections.get(Q);if(!V)V={ws:null,state:"disconnected",connectedAt:null,lastHeartbeat:null,reconnectAttempts:0,heartbeatTimer:null,reconnectTimer:null,handlers:new Set,pendingRequests:new Map,nextRequestId:1},this.connections.set(Q,V);return V.handlers.add(Y),()=>{V.handlers.delete(Y)}}getConnectionState(Q){return this.connections.get(Q)?.state??"disconnected"}getConnectionInfo(Q){let Y=this.connections.get(Q);if(!Y)return null;return{containerId:Q,state:Y.state,connectedAt:Y.connectedAt,lastHeartbeat:Y.lastHeartbeat,reconnectAttempts:Y.reconnectAttempts}}getConnectedContainerIds(){let Q=[];for(let[Y,V]of this.connections)if(V.state==="connected")Q.push(Y);return Q}}import{logger as hU,Service as vV}from"@elizaos/core";class JZ extends vV{static serviceType="CLOUD_CONTAINER";capabilityDescription="ElizaCloud container provisioning and lifecycle management";authService;containerDefaults=qU.container;tracked=new Map;static async start(Q){let Y=new JZ(Q);return await Y.initialize(),Y}async stop(){for(let[,Q]of this.tracked){if(Q.pollingTimer)clearTimeout(Q.pollingTimer);if(Q.healthTimer)clearInterval(Q.healthTimer)}this.tracked.clear()}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){hU.debug("[CloudContainer] CloudAuthService not available, container operations will fail");return}if(this.authService=Q,this.authService.isAuthenticated()){let Y=await this.listContainers();for(let V of Y){if(this.tracked.set(V.id,{container:V,pollingTimer:null,healthTimer:null}),V.status==="pending"||V.status==="building"||V.status==="deploying")this.startPolling(V.id);if(V.status==="running")this.startHealthMonitoring(V.id)}hU.info(`[CloudContainer] Loaded ${Y.length} existing container(s)`)}}getClient(){return this.authService.getClient()}async createContainer(Q){let Y=this.getClient(),V=this.containerDefaults,H={name:Q.name,project_name:Q.project_name,description:Q.description,port:Q.port??V.defaultPort,desired_count:Q.desired_count??1,cpu:Q.cpu??V.defaultCpu,memory:Q.memory??V.defaultMemory,environment_vars:Q.environment_vars??{},health_check_path:Q.health_check_path??"/health",ecr_image_uri:Q.ecr_image_uri,ecr_repository_uri:Q.ecr_repository_uri,image_tag:Q.image_tag,architecture:Q.architecture??V.defaultArchitecture},C=await Y.post("/containers",H);return this.tracked.set(C.data.id,{container:C.data,pollingTimer:null,healthTimer:null}),this.startPolling(C.data.id),hU.info(`[CloudContainer] Created container "${Q.name}" (id=${C.data.id}, stack=${C.stackName})`),C}async listContainers(){return(await this.getClient().get("/containers")).data}async getContainer(Q){let V=await this.getClient().get(`/containers/${Q}`),H=this.tracked.get(Q);if(H)H.container=V.data;return V.data}async deleteContainer(Q){await this.getClient().delete(`/containers/${Q}`);let V=this.tracked.get(Q);if(V){if(V.pollingTimer)clearTimeout(V.pollingTimer);if(V.healthTimer)clearInterval(V.healthTimer);this.tracked.delete(Q)}hU.info(`[CloudContainer] Deleted container ${Q}`)}startPolling(Q){let Y=this.tracked.get(Q);if(!Y)return;let V=0,H=120,C=5000,D=30000,J=async()=>{if(V++,V>H){hU.error(`[CloudContainer] Polling timed out for container ${Q} after ${H} attempts`);return}let T=await this.getContainer(Q),M=T.status;if(hU.debug(`[CloudContainer] Poll #${V} for ${Q}: status=${M}`),M==="running"){hU.info(`[CloudContainer] Container ${Q} is now running at ${T.load_balancer_url}`),this.startHealthMonitoring(Q);return}if(M==="failed"||M==="stopped"||M==="suspended"){if(hU.warn(`[CloudContainer] Container ${Q} reached terminal state: ${M}`),T.error_message)hU.error(`[CloudContainer] Error: ${T.error_message}`);return}let F=Math.min(C*2**Math.min(V-1,3),D);Y.pollingTimer=setTimeout(J,F)};Y.pollingTimer=setTimeout(J,C)}async waitForDeployment(Q,Y=900000){let V=Date.now()+Y,H=5000,C=30000;while(Date.now()<V){let D=await this.getContainer(Q);if(D.status==="running")return D;if(D.status==="failed")throw Error(`Container deployment failed: ${D.error_message??"unknown error"}`);if(D.status==="stopped"||D.status==="suspended")throw Error(`Container reached terminal state: ${D.status}`);await new Promise((J)=>setTimeout(J,H)),H=Math.min(H*1.5,C)}throw Error(`Container deployment timed out after ${Math.round(Y/1000)}s`)}startHealthMonitoring(Q){let Y=this.tracked.get(Q);if(!Y||Y.healthTimer)return;let V=60000;Y.healthTimer=setInterval(()=>{this.getContainerHealth(Q).then((H)=>{if(!H.data.healthy)hU.warn(`[CloudContainer] Container ${Q} unhealthy: ${H.data.status}`)}).catch((H)=>{hU.error(`[CloudContainer] Health check failed for ${Q}: ${H.message}`)})},V)}async getContainerHealth(Q){return this.getClient().get(`/containers/${Q}/health`)}getTrackedContainers(){return Array.from(this.tracked.values()).map((Q)=>Q.container)}getTrackedContainer(Q){return this.tracked.get(Q)?.container}isContainerRunning(Q){return this.tracked.get(Q)?.container.status==="running"}getContainerUrl(Q){return this.tracked.get(Q)?.container.load_balancer_url??null}}import{logger as EX,Service as jV}from"@elizaos/core";var zY=1800000,BV=[["gpt-","openai"],["o1","openai"],["o3","openai"],["o4","openai"],["dall-e","openai"],["whisper","openai"],["tts","openai"],["claude-","anthropic"],["gemini-","google"],["llama","meta"],["deepseek","deepseek"],["grok","xai"],["kimi","moonshot"]];function xV(Q){if(Q.includes("/"))return Q.split("/")[0];let Y=Q.toLowerCase();for(let[V,H]of BV)if(Y.startsWith(V))return H;return"unknown"}function NV(Q){if(Q.includes("/"))return Q.split("/").slice(1).join("/");return Q}class AZ extends jV{static serviceType="CLOUD_MODEL_REGISTRY";capabilityDescription="Discovers and caches available AI models from ElizaCloud";models=[];byProvider={};lastFetchedAt=0;fetchPromise=null;static async start(Q){let Y=new AZ(Q);return await Y.initialize(),Y}async stop(){this.models=[],this.byProvider={},this.lastFetchedAt=0}async initialize(){if(!this.runtime.getService("CLOUD_AUTH")?.isAuthenticated()){EX.info("[CloudModelRegistry] Auth not available, will fetch models on first access");return}await this.fetchModels(),this.validateConfiguredModels()}async fetchModels(){if(this.fetchPromise){await this.fetchPromise;return}this.fetchPromise=this.doFetchModels(),await this.fetchPromise,this.fetchPromise=null}async doFetchModels(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q?.isAuthenticated())return;let H=(await Q.getClient().get("/models")).data??[];this.models=H.map((C)=>({id:C.id,provider:xV(C.id),name:NV(C.id),createdAt:C.created})),this.byProvider={};for(let C of this.models){if(!this.byProvider[C.provider])this.byProvider[C.provider]=[];this.byProvider[C.provider].push(C)}this.lastFetchedAt=Date.now(),EX.info(`[CloudModelRegistry] Loaded ${this.models.length} models from ${Object.keys(this.byProvider).length} providers`)}validateConfiguredModels(){if(this.models.length===0)return;let Q=new Set(this.models.map((H)=>H.id)),Y=new Set(this.models.map((H)=>H.name)),V=[{key:"ELIZAOS_CLOUD_SMALL_MODEL",label:"small model"},{key:"ELIZAOS_CLOUD_LARGE_MODEL",label:"large model"},{key:"ELIZAOS_CLOUD_REASONING_SMALL_MODEL",label:"reasoning small model"},{key:"ELIZAOS_CLOUD_REASONING_LARGE_MODEL",label:"reasoning large model"},{key:"ELIZAOS_CLOUD_RESEARCH_MODEL",label:"research model"},{key:"ELIZAOS_CLOUD_EMBEDDING_MODEL",label:"embedding model"},{key:"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL",label:"image description model"},{key:"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL",label:"image generation model"},{key:"ELIZAOS_CLOUD_TTS_MODEL",label:"TTS model"},{key:"ELIZAOS_CLOUD_TRANSCRIPTION_MODEL",label:"transcription model"}];for(let{key:H,label:C}of V){let D=this.runtime.getSetting(H);if(D&&typeof D==="string"){if(!(Q.has(D)||Y.has(D)))EX.warn(`[CloudModelRegistry] Configured ${C} "${D}" not found in available models. It may still work if the gateway supports it, but check your configuration.`)}}}async getAvailableModels(){if(Date.now()-this.lastFetchedAt>zY)await this.fetchModels();return this.models}async getModelsByProvider(){if(Date.now()-this.lastFetchedAt>zY)await this.fetchModels();return this.byProvider}}function gV(){if(typeof process>"u")return{};return process.env}var m0=gV(),fV={name:"elizaOSCloud",description:"ElizaOS Cloud plugin — Multi-model AI generation, container provisioning, agent bridge, and billing management",config:{ELIZAOS_CLOUD_API_KEY:m0.ELIZAOS_CLOUD_API_KEY??null,ELIZAOS_CLOUD_BASE_URL:m0.ELIZAOS_CLOUD_BASE_URL??null,ELIZAOS_CLOUD_ENABLED:m0.ELIZAOS_CLOUD_ENABLED??null,ELIZAOS_CLOUD_SMALL_MODEL:m0.ELIZAOS_CLOUD_SMALL_MODEL??null,ELIZAOS_CLOUD_LARGE_MODEL:m0.ELIZAOS_CLOUD_LARGE_MODEL??null,SMALL_MODEL:m0.SMALL_MODEL??null,LARGE_MODEL:m0.LARGE_MODEL??null,ELIZAOS_CLOUD_REASONING_SMALL_MODEL:m0.ELIZAOS_CLOUD_REASONING_SMALL_MODEL??null,ELIZAOS_CLOUD_REASONING_LARGE_MODEL:m0.ELIZAOS_CLOUD_REASONING_LARGE_MODEL??null,REASONING_SMALL_MODEL:m0.REASONING_SMALL_MODEL??null,REASONING_LARGE_MODEL:m0.REASONING_LARGE_MODEL??null,ELIZAOS_CLOUD_RESEARCH_MODEL:m0.ELIZAOS_CLOUD_RESEARCH_MODEL??null,RESEARCH_MODEL:m0.RESEARCH_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_MODEL:m0.ELIZAOS_CLOUD_EMBEDDING_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_API_KEY:m0.ELIZAOS_CLOUD_EMBEDDING_API_KEY??null,ELIZAOS_CLOUD_EMBEDDING_URL:m0.ELIZAOS_CLOUD_EMBEDDING_URL??null,ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS:m0.ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL:m0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS:m0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS??null,ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL:m0.ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL??null,ELIZAOS_CLOUD_TTS_MODEL:m0.ELIZAOS_CLOUD_TTS_MODEL??null,ELIZAOS_CLOUD_TRANSCRIPTION_MODEL:m0.ELIZAOS_CLOUD_TRANSCRIPTION_MODEL??null,ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY:m0.ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY??null},async init(Q,Y){wX(Q,Y)},services:[QZ,AZ,JZ,$Z,YZ],actions:[SX,WX,DX,HX],providers:[FX,MX,RX,kX],models:{[a0.TEXT_EMBEDDING]:KZ,[a0.TEXT_SMALL]:cZ,[a0.TEXT_LARGE]:pZ,[a0.TEXT_REASONING_SMALL]:hZ,[a0.TEXT_REASONING_LARGE]:uZ,[a0.RESEARCH]:wZ,[a0.IMAGE]:xZ,[a0.IMAGE_DESCRIPTION]:NZ,[a0.OBJECT_SMALL]:gZ,[a0.OBJECT_LARGE]:fZ},tests:[{name:"ELIZAOS_CLOUD_plugin_tests",tests:[{name:"ELIZAOS_CLOUD_test_url_and_api_key_validation",fn:async(Q)=>{let Y=PU(Q),V=await fetch(`${Y}/models`,{headers:{Authorization:`Bearer ${rU(Q)}`}}),H=await V.json();if(BU.log({data:H?.data?.length??"N/A"},"Models Available"),!V.ok)throw Error(`Failed to validate OpenAI API key: ${V.statusText}`)}},{name:"ELIZAOS_CLOUD_test_text_embedding",fn:async(Q)=>{let Y=await Q.useModel(a0.TEXT_EMBEDDING,{text:"Hello, world!"});BU.log({embedding:Y},"embedding")}},{name:"ELIZAOS_CLOUD_test_text_large",fn:async(Q)=>{let Y=await Q.useModel(a0.TEXT_LARGE,{prompt:"What is the nature of reality in 10 words?"});if(Y.length===0)throw Error("Failed to generate text");BU.log({text:Y},"generated with test_text_large")}},{name:"ELIZAOS_CLOUD_test_text_small",fn:async(Q)=>{let Y=await Q.useModel(a0.TEXT_SMALL,{prompt:"What is the nature of reality in 10 words?"});if(Y.length===0)throw Error("Failed to generate text");BU.log({text:Y},"generated with test_text_small")}},{name:"ELIZAOS_CLOUD_test_image_generation",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_image_generation");let Y=await Q.useModel(a0.IMAGE,{prompt:"A beautiful sunset over a calm ocean",count:1,size:"1024x1024"});BU.log({image:Y},"generated with test_image_generation")}},{name:"image-description",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_image_description");let Y=await Q.useModel(a0.IMAGE_DESCRIPTION,"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg/537px-Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg");if(Y&&typeof Y==="object"&&"title"in Y&&"description"in Y)BU.log({result:Y},"Image description");else BU.error(`Invalid image description result format: ${JSON.stringify(Y)}`)}},{name:"ELIZAOS_CLOUD_test_transcription",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_transcription");let V=await(await fetch("https://upload.wikimedia.org/wikipedia/en/4/40/Chris_Benoit_Voice_Message.ogg")).arrayBuffer(),H=await Q.useModel(a0.TRANSCRIPTION,Buffer.from(new Uint8Array(V)));BU.log({transcription:H},"generated with test_transcription")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_encode",fn:async(Q)=>{let V=await Q.useModel(a0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer encode!",modelType:a0.TEXT_SMALL});if(!Array.isArray(V)||V.length===0)throw Error("Failed to tokenize text: expected non-empty array of tokens");BU.log({tokens:V},"Tokenized output")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_decode",fn:async(Q)=>{let V=await Q.useModel(a0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer decode!",modelType:a0.TEXT_SMALL}),H=await Q.useModel(a0.TEXT_TOKENIZER_DECODE,{tokens:V,modelType:a0.TEXT_SMALL});if(H!=="Hello tokenizer decode!")throw Error(`Decoded text does not match original. Expected "Hello tokenizer decode!", got "${H}"`);BU.log({decodedText:H},"Decoded text")}},{name:"ELIZAOS_CLOUD_test_text_to_speech",fn:async(Q)=>{if(!await yZ(Q,{text:"Hello, this is a test for text-to-speech."}))throw Error("Failed to generate speech");BU.log("Generated speech successfully")}}]}]},MY=fV;var oI=MY;export{fV as elizaOSCloudPlugin,oI as default};
21
21
 
22
- //# debugId=A4F814107758CCF064756E2164756E21
22
+ //# debugId=1A349189ABC3D56C64756E2164756E21